diff --git a/.gitignore b/.gitignore index abf913b6..fb83c2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ Thumbs.db # Other & Environments /projects/main-site/secret.json /projects/main-site/secret.prod.json +/projects/main-site/src/assets/raw diff --git a/dist/main-site/browser/109.8584ea77f5e66aec.js b/dist/main-site/browser/109.4a02bcbb491d3d55.js similarity index 89% rename from dist/main-site/browser/109.8584ea77f5e66aec.js rename to dist/main-site/browser/109.4a02bcbb491d3d55.js index 144ee360..6c82f33f 100644 --- a/dist/main-site/browser/109.8584ea77f5e66aec.js +++ b/dist/main-site/browser/109.4a02bcbb491d3d55.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[109],{9109:(M,E,o)=>{o.r(E),o.d(E,{UserModule:()=>ee});var p=o(6895),r=o(1390),u=o(4006),U=o(7375),x=o(5128),h=o(3659),d=o(1741),k=o(5816),O=o(3811),w=o(2314),_=o(9560),C=o(9736),m=o(8866),f=o(6319),v=o(5208),b=o(4674),t=o(4650),B=o(2972),y=o(9816),K=o(3322),F=o(5312),G=o(5141),P=o(1140),q=o(7396),Q=o(1428),Z=o(9818),H=o(3238),L=o(7392),T=o(9982),N=o(7462),j=o(801),V=o(1338),$=o(3710);function z(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",31),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.userData.role))}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("matTooltip",e.userData.role)}}function W(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.userData.role))}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("matTooltip",e.userData.role)}}function X(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",33),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.userData.role))}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("matTooltip",e.userData.role)}}function tt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",34),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Terverifikasi"))}),t.qZA()}}function et(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",35),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Banned :: "+n.userBanned.reason))}),t.qZA()}if(2&i){const e=t.oxw(2);t.MGl("matTooltip","Banned :: ",e.userBanned.reason,"")}}function it(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",36),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.accountAge+" Years of Service"))}),t.qZA()}if(2&i){const e=t.oxw(2);t.MGl("matTooltip","",e.accountAge," Years of Service")}}function st(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",37),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Sharing is Caring"))}),t.qZA()}}function nt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",38),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Akun Private"))}),t.qZA()}}function ot(i,l){if(1&i&&(t.TgZ(0,"mat-list-option",47),t._UZ(1,"img",48),t.TgZ(2,"a",49)(3,"span",50),t._uU(4),t.qZA(),t.TgZ(5,"span",51),t._uU(6),t.qZA()()()),2&i){const e=l.$implicit;t.MGl("routerLink","/fansub/",e.fansub_.slug,""),t.xp6(1),t.s9C("src",e.fansub_.image_url,t.LSH),t.xp6(3),t.hij(" ",e.keterangan," "),t.xp6(2),t.Oqu(e.fansub_.slug)}}function at(i,l){if(1&i&&(t.TgZ(0,"div",6)(1,"div",39)(2,"div",40)(3,"h2",41)(4,"b",42),t._uU(5,"Group Fansub"),t.qZA()()(),t.TgZ(6,"div",43)(7,"div",44)(8,"mat-selection-list",45),t.YNc(9,ot,7,4,"mat-list-option",46),t.qZA()()()()()),2&i){const e=t.oxw(2);t.xp6(8),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.groupFansub)}}function rt(i,l){if(1&i&&(t.TgZ(0,"button",52),t._UZ(1,"mat-icon",53),t._uU(2),t.qZA()),2&i){const e=t.oxw(2);t.xp6(2),t.hij(" ",e.userData.id," ")}}function lt(i,l){if(1&i&&(t.TgZ(0,"button",54),t._UZ(1,"mat-icon",55),t._uU(2),t.ALo(3,"date"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(2),t.hij(" ",t.xi3(3,1,e.userData.created_at,"d/M/yyyy, hh:mm:ss a z")," ")}}function ut(i,l){if(1&i&&(t.TgZ(0,"div",39),t._UZ(1,"app-material-expansion-panel",56),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("panelData",e.panelData)}}function ct(i,l){1&i&&(t.TgZ(0,"div",39)(1,"div",6),t._UZ(2,"app-report"),t.qZA()())}function pt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),t._UZ(6,"img",7),t.qZA(),t.TgZ(7,"div",8),t.YNc(8,z,1,1,"mat-icon",9),t.YNc(9,W,1,1,"mat-icon",10),t.YNc(10,X,1,1,"mat-icon",11),t.YNc(11,tt,1,0,"mat-icon",12),t.YNc(12,et,1,1,"mat-icon",13),t.YNc(13,it,1,1,"mat-icon",14),t.YNc(14,st,1,0,"mat-icon",15),t.YNc(15,nt,1,0,"mat-icon",16),t.qZA(),t.YNc(16,at,10,2,"div",17),t.qZA()(),t.TgZ(17,"div",18)(18,"div",19)(19,"h1",20)(20,"b"),t._uU(21),t.qZA()()(),t.TgZ(22,"div",21),t.YNc(23,rt,3,1,"button",22),t.YNc(24,lt,4,4,"button",23),t.TgZ(25,"button",24),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.createMailbox())}),t._UZ(26,"mat-icon",25),t._uU(27),t.qZA()(),t.YNc(28,ut,2,1,"div",26),t.YNc(29,ct,3,0,"div",26),t.qZA()(),t.TgZ(30,"div",27)(31,"div",6)(32,"app-material-tab",28),t.NdJ("tableRowClicked",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.openBerkas(n))})("paginatorClicked",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onPaginatorClicked(n))})("serverSideFilter",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onServerSideFilter(n))})("serverSideOrder",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onServerSideOrder(n))}),t.qZA()()()(),t._UZ(33,"div",29)(34,"div",30),t.qZA()}if(2&i){const e=t.oxw();t.xp6(6),t.s9C("src",e.userData.image_url,t.LSH),t.xp6(2),t.Q6J("ngIf",e.userData.role===e.ADMIN),t.xp6(1),t.Q6J("ngIf",e.userData.role===e.MODERATOR),t.xp6(1),t.Q6J("ngIf",e.userData.role===e.FANSUBBER),t.xp6(1),t.Q6J("ngIf",e.userData.verified),t.xp6(1),t.Q6J("ngIf",e.userBanned),t.xp6(1),t.Q6J("ngIf",e.accountAge>0),t.xp6(1),t.Q6J("ngIf",e.count>0),t.xp6(1),t.Q6J("ngIf",e.userData.private),t.xp6(1),t.Q6J("ngIf",e.groupFansub.length>0),t.xp6(5),t.Oqu(e.userData.kartu_tanda_penduduk_.nama),t.xp6(2),t.Q6J("ngIf",e.userData.id),t.xp6(1),t.Q6J("ngIf",e.userData.created_at),t.xp6(3),t.AsE(" ",e.userData.username,"@",e.ENV.domain," "),t.xp6(1),t.Q6J("ngIf",e.panelData.length>0),t.xp6(1),t.Q6J("ngIf",null==e.SS.mySocket?null:e.SS.mySocket.id),t.xp6(3),t.Q6J("tabData",e.tabData)("count",e.count)("serverSide",!0),t.xp6(1),t.Udp("background-image","url("+e.userData.profile_.cover_url+")")}}let mt=(()=>{class i{constructor(e,s,n,a,c,g,A,S,I,D){this.snackBar=e,this.router=s,this.activatedRoute=n,this.gs=a,this.bs=c,this.fs=g,this.pi=A,this.us=S,this.ss=I,this.berkas=D,this.username="",this.userData=null,this.userBanned=null,this.groupFansub=[],this.berkasUser=[],this.allBerkasUserId=[],this.panelData=[],this.tabData=[{name:"Berkas",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Kunjungan","Pemilik"],row:[]}}],this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.subsUser=null,this.subsBerkas=null,this.subsBanned=null,this.subsParam=null,this.subsGroupGet=null,this.subsTrusted=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get SS(){return this.ss}ngOnDestroy(){this.subsUser?.unsubscribe(),this.subsBerkas?.unsubscribe(),this.subsBanned?.unsubscribe(),this.subsParam?.unsubscribe(),this.subsGroupGet?.unsubscribe(),this.subsTrusted?.unsubscribe()}get ADMIN(){return d.yS.ADMIN}get MODERATOR(){return d.yS.MODERATOR}get FANSUBBER(){return d.yS.FANSUBBER}get accountAge(){return Math.abs(new Date(Date.now()-new Date(this.userData.created_at).getTime()).getUTCFullYear()-1970)}get ENV(){return b.N}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:e=>{this.username=e.username,this.bs.busy(),this.subsUser=this.us.getUserData(this.username).subscribe({next:s=>{this.gs.log("[USER_DETAIL_SUCCESS]",s),this.userData=s.result,this.pi.updatePageMetaData(this.userData.kartu_tanda_penduduk_.nama,this.userData.profile_.description,this.userData.username,this.userData.image_url,this.userData.username),this.bs.idle(),this.gs.isBrowser&&(this.panelData=[],this.panelData.push({title:"Tentang Saya",icon:"info",text:this.userData.profile_.description}),this.fs.initializeFab("edit",null,"Ubah Profil",`/user/${this.username}/edit`,!1),this.checkBanned(),this.getUserGroup(),this.getUserBerkas())},error:s=>{this.gs.log("[USER_DETAIL_ERROR]",s,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/"}})}})}})}checkBanned(){this.bs.busy(),this.subsBanned=this.us.checkBanned(this.userData.username).subscribe({next:e=>{this.gs.log("[USER_CHECK_BANNED_SUCCESS]",e),Object.keys(e.results[this.userData.username]).length>0&&(this.userBanned=e.results[this.userData.username]),this.bs.idle()},error:e=>{this.gs.log("[USER_CHECK_BANNED_ERROR]",e,"error"),this.bs.idle()}})}getUserBerkas(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.us.getUserBerkas(this.username,this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[USER_BERKAS_LIST_SUCCESS]",e),this.count=e.count,this.berkasUser=[];for(const s of e.results)this.allBerkasUserId.push(s.id),this.berkasUser.push({id:s.id,private:s.private,foto:s.user_.image_url,Proyek:s.project_type_.name,Tanggal:s.created_at,Kunjungan:s.view_count,Pemilik:s.user_.username,"Nama Berkas":s.name});this.tabData[0].data.row=this.berkasUser,this.allBerkasUserId.length>0&&this.checkTrusted(),this.bs.idle()},error:e=>{this.gs.log("[USER_BERKAS_LIST_ERROR]",e,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted&&(this.subsTrusted.unsubscribe(),this.bs.idle()),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasUserId).subscribe({next:e=>{this.gs.log("[USER_BERKAS_TRUSTED_SUCCESS]",e);for(const s of this.berkasUser)s.trusted=e.results[s.id];this.bs.idle()},error:e=>{this.gs.log("[USER_BERKAS_TRUSTED_ERROR]",e,"error"),this.bs.idle()}})}openBerkas(e){this.gs.log("[USER_BERKAS_LIST_CLICK_BERKAS]",e),this.router.navigateByUrl(`/berkas/${e.id}`)}onPaginatorClicked(e){this.gs.log("[USER_BERKAS_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getUserBerkas()}onServerSideFilter(e){this.gs.log("[USER_BERKAS_LIST_ENTER_FILTER]",e),this.q=e,this.getUserBerkas()}onServerSideOrder(e){this.gs.log("[USER_BERKAS_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getUserBerkas()}getUserGroup(){this.bs.busy(),this.subsGroupGet=this.us.getUserGroup(this.username).subscribe({next:e=>{this.gs.log("[USER_DETAIL_GROUP_LIST_SUCCESS]",e),this.groupFansub=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_DETAIL_GROUP_LIST_ERROR]",e,"error"),this.bs.idle()}})}createMailbox(){this.router.navigate(["/create/mailbox"],{queryParams:{to:`${this.userData.username}@${b.N.domain}`}})}badgeClicked(e){this.snackBar.open(e,"Ok")}static#t=this.\u0275fac=function(s){return new(s||i)(t.Y36(B.pl),t.Y36(r.F0),t.Y36(r.gz),t.Y36(y.U),t.Y36(K.z),t.Y36(F.r),t.Y36(G.Z),t.Y36(P.K),t.Y36(q.R),t.Y36(Q.A))};static#e=this.\u0275cmp=t.Xpm({type:i,selectors:[["app-user-detail"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"profile-info","align-items-center",2,"top","64px","position","relative"],[1,"row","py-3","px-2"],[1,"col-md-4","col-xl-3","px-3"],[1,"row","sticky-top","pt-3"],[1,"col-12"],[1,"profile-image",3,"src"],[1,"col-12","my-3"],["fontIcon","handyman","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","security","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","rate_review","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","verified","class","mx-1","matTooltip","Terverifikasi","style","cursor: pointer;",3,"click",4,"ngIf"],["fontIcon","lock","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","military_tech","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","volunteer_activism","class","mx-1","matTooltip","Sharing is Caring","style","cursor: pointer;",3,"click",4,"ngIf"],["fontIcon","sensor_occupied","class","mx-1","matTooltip","Akun Private","style","cursor: pointer;",3,"click",4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-md-8","col-xl-9","pt-3"],[1,"row","py-3","px-0","profile-height-large"],[1,"m-0","mt-auto"],[1,"row","p-3"],["type","button","mat-stroked-button","","matLine","","class","col-12 col-md-4 text-truncate","matTooltip","Nomor ID Pengguna","color","accent","style","overflow: hidden;",4,"ngIf"],["type","button","mat-stroked-button","","matLine","","class","col-12 col-md-8 text-truncate","matTooltip","Tanggal Bergabung","color","accent","style","overflow: hidden;",4,"ngIf"],["type","button","mat-stroked-button","","matLine","","matTooltip","Alamat Surel","color","accent",1,"col","text-truncate",2,"overflow","hidden",3,"click"],["fontIcon","email",1,"me-1"],["class","row py-3",4,"ngIf"],[1,"row"],[3,"tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"profile-banner","profile-banner-1","align-items-center"],[1,"profile-banner","profile-banner-2","align-items-center"],["fontIcon","handyman",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","security",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","rate_review",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","verified","matTooltip","Terverifikasi",1,"mx-1",2,"cursor","pointer",3,"click"],["fontIcon","lock",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","military_tech",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","volunteer_activism","matTooltip","Sharing is Caring",1,"mx-1",2,"cursor","pointer",3,"click"],["fontIcon","sensor_occupied","matTooltip","Akun Private",1,"mx-1",2,"cursor","pointer",3,"click"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12",2,"max-height","288px"],[1,"h-100",2,"overflow-y","auto"],[3,"multiple"],["class","h-100",3,"routerLink",4,"ngFor","ngForOf"],[1,"h-100",3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],[1,"text-truncate","text-decoration-none"],[1,"bg-bifeldy","px-2","me-1","text-warning",2,"position","absolute","right","0"],[1,"text-success"],["type","button","mat-stroked-button","","matLine","","matTooltip","Nomor ID Pengguna","color","accent",1,"col-12","col-md-4","text-truncate",2,"overflow","hidden"],["fontIcon","accessibility_new",1,"me-1"],["type","button","mat-stroked-button","","matLine","","matTooltip","Tanggal Bergabung","color","accent",1,"col-12","col-md-8","text-truncate",2,"overflow","hidden"],["fontIcon","access_time",1,"me-1"],[3,"panelData"]],template:function(s,n){1&s&&t.YNc(0,pt,35,22,"div",0),2&s&&t.Q6J("ngIf",n.userData)},dependencies:[p.sg,p.O5,r.rH,Z.eB,H.X2,L.Hw,T.Wx,T.kh,T.O$,N.Kd,j.Q,V.H,$.Y,p.uU],styles:[".profile-banner[_ngcontent-%COMP%]{height:192px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:.75}.profile-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.profile-banner-2[_ngcontent-%COMP%]{position:absolute;top:192px;left:0}.profile-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}.profile-image[_ngcontent-%COMP%]{width:50%}@media only screen and (min-width: 769px){.profile-height-large[_ngcontent-%COMP%]{height:100px}.profile-image[_ngcontent-%COMP%]{width:100%}}@media only screen and (max-width: 768px){.profile-image[_ngcontent-%COMP%]{padding-top:3rem}}"]})}return i})();var J=o(5861),_t=o(4425),Y=o(80),gt=o(2970),dt=o(3842),ht=o(9222);let ft=(()=>{class i{constructor(e,s){this.api=e,this.gs=s}getUserApiKey(e){return this.api.getData(`/api-key?username=${e}`)}createApiKey(e){return this.api.postData("/api-key",e)}editApiKey(e,s){return this.api.putData(`/api-key/${e}`,s)}revokeApiKey(e){return this.api.deleteData(`/api-key/${e}`)}static#t=this.\u0275fac=function(s){return new(s||i)(t.LFG(ht.s),t.LFG(y.U))};static#e=this.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var bt=o(8151),xt=o(4758),vt=o(7397),Ut=o(1105);function Tt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-list-option",27),t._UZ(1,"mat-icon",28),t.TgZ(2,"a",29),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.openComment(a))}),t.TgZ(3,"span",30),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t.TgZ(6,"span",31),t._uU(7),t.qZA()()()}if(2&i){const e=l.$implicit;t.xp6(4),t.Oqu(t.lcZ(5,2,e.created_at)),t.xp6(3),t.Oqu(e.comment)}}function Et(i,l){if(1&i&&(t.TgZ(0,"div",11)(1,"mat-selection-list",25),t.YNc(2,Tt,8,4,"mat-list-option",26),t.ALo(3,"slice"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",t.Dn7(3,2,e.feedKomentarData,0,5))}}function kt(i,l){if(1&i&&(t.TgZ(0,"mat-list-option",27),t._UZ(1,"mat-icon",32),t.TgZ(2,"a",33)(3,"span",30),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t.TgZ(6,"span",34),t._uU(7),t.qZA(),t.TgZ(8,"span",35),t._uU(9),t.qZA(),t.TgZ(10,"span",31),t._uU(11),t.qZA()()()),2&i){const e=l.$implicit;t.xp6(2),t.Q6J("routerLink",e.berkas_?"/berkas/"+(null==e.berkas_?null:e.berkas_.id):e.fansub_?"/fansub/"+(null==e.fansub_?null:e.fansub_.slug):e.user_?"/user/"+(null==e.user_?null:e.user_.username):e.news_?"/news/"+(null==e.news_?null:e.news_.id):""),t.xp6(2),t.Oqu(t.lcZ(5,5,e.created_at)),t.xp6(3),t.Oqu(e.type),t.xp6(2),t.Oqu(e.berkas_?"Berkas":e.fansub_?"Fansub":e.user_?"User":e.news_?"News":""),t.xp6(2),t.Oqu((null==e.berkas_?null:e.berkas_.name)||(null==e.fansub_?null:e.fansub_.name)||(null==e.user_||null==e.user_.kartu_tanda_penduduk_?null:e.user_.kartu_tanda_penduduk_.nama)||(null==e.news_?null:e.news_.title))}}function Ct(i,l){if(1&i&&(t.TgZ(0,"div",11)(1,"mat-selection-list",25),t.YNc(2,kt,12,7,"mat-list-option",26),t.ALo(3,"slice"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",t.Dn7(3,2,e.feedLikeDislikeData,0,5))}}function At(i,l){if(1&i&&(t.TgZ(0,"mat-list-option",27),t._UZ(1,"mat-icon",36),t.TgZ(2,"a",33)(3,"span",30),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t.TgZ(6,"span",35),t._uU(7),t.qZA(),t.TgZ(8,"span",31),t._uU(9),t.qZA()()()),2&i){const e=l.$implicit;t.xp6(2),t.Q6J("routerLink",e.berkas_?"/berkas/"+(null==e.berkas_?null:e.berkas_.id):e.fansub_?"/fansub/"+(null==e.fansub_?null:e.fansub_.slug):e.user_?"/user/"+(null==e.user_?null:e.user_.username):e.news_?"/news/"+(null==e.news_?null:e.news_.id):""),t.xp6(2),t.Oqu(t.lcZ(5,4,e.created_at)),t.xp6(3),t.Oqu(e.berkas_?"Berkas":e.fansub_?"Fansub":e.user_?"User":e.news_?"News":""),t.xp6(2),t.Oqu((null==e.berkas_?null:e.berkas_.name)||(null==e.fansub_?null:e.fansub_.name)||(null==e.user_||null==e.user_.kartu_tanda_penduduk_?null:e.user_.kartu_tanda_penduduk_.nama)||(null==e.news_?null:e.news_.title))}}function St(i,l){if(1&i&&(t.TgZ(0,"div",11)(1,"mat-selection-list",25),t.YNc(2,At,10,6,"mat-list-option",26),t.ALo(3,"slice"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",t.Dn7(3,2,e.feedVisitData,0,5))}}function It(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",37),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw();return c.copyApiKey(a),t.KtG(c.editApiKey(a))}),t.TgZ(1,"p",38),t._uU(2," Nama :: "),t.TgZ(3,"span",39),t._uU(4),t.qZA()(),t.TgZ(5,"p",40),t._uU(6," Origin :: "),t.TgZ(7,"span",39),t._uU(8),t.qZA()(),t.TgZ(9,"p",41),t._uU(10," Key :: "),t.TgZ(11,"span",39),t._uU(12),t.qZA()(),t.TgZ(13,"a",17),t.NdJ("click",function(n){const c=t.CHM(e).$implicit,g=t.oxw();return n.stopPropagation(),t.KtG(g.revokeApiKey(c))}),t._UZ(14,"mat-icon",42),t._uU(15," Hapus Akses "),t.qZA()()}if(2&i){const e=l.$implicit;t.xp6(4),t.hij(" ",e.name," "),t.xp6(4),t.hij(" ",e.ip_domain," "),t.xp6(4),t.hij(" ",e.api_key," ")}}function Dt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-list-option",46),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.editSubDomain(a.fansub_))}),t._UZ(1,"img",47),t.TgZ(2,"a",48),t.NdJ("click",function(n){const c=t.CHM(e).$implicit,g=t.oxw(2);return n.stopPropagation(),t.KtG(g.revokeDns(c.fansub_))}),t._UZ(3,"mat-icon",42),t.qZA(),t.TgZ(4,"a",49)(5,"span",50),t._uU(6),t.ALo(7,"date"),t.qZA(),t.TgZ(8,"span",39),t._uU(9),t.qZA()()()}if(2&i){const e=l.$implicit;t.xp6(1),t.s9C("src",e.fansub_.image_url,t.LSH),t.xp6(5),t.hij(" ",t.xi3(7,3,e.updated_at,"d-MM-y")," "),t.xp6(3),t.Oqu(e.fansub_.slug)}}function yt(i,l){if(1&i&&(t.TgZ(0,"div",43)(1,"div",44)(2,"mat-selection-list",25),t.YNc(3,Dt,10,6,"mat-list-option",45),t.qZA()()()),2&i){const e=t.oxw();t.xp6(2),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.groupFansub)}}function Zt(i,l){1&i&&t._UZ(0,"app-no-data",51)}let Rt=(()=>{class i{constructor(e,s,n,a,c,g,A,S,I,D,ie,se){this.clipboard=e,this.router=s,this.snackBar=n,this.as=a,this.ds=c,this.gs=g,this.fs=A,this.bs=S,this.us=I,this.fansub=D,this.aks=ie,this.wb=se,this.feedKomentarData=[],this.feedLikeDislikeData=[],this.feedVisitData=[],this.subsFeedKomentar=null,this.subsFeedLikeDislike=null,this.subsFeedVisit=null,this.subsGetApiKey=null,this.subsDialog=null,this.subsCreateApiKey=null,this.subsEditApiKey=null,this.subsRevokeApiKey=null,this.subsGroupGet=null,this.subsUpdateSubDomain=null,this.subsGetSubDomain=null,this.apiKey=[],this.groupFansub=[],this.totalKomentar=0,this.totalLikeDislike=0,this.totalKunjungan=0,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get ENV(){return b.N}ngOnInit(){this.gs.isBrowser&&(this.getUserFeedComment(),this.getUserFeedLikeDislike(),this.getUserFeedVisit(),this.getUserApiKey(),this.getUserGroup(),this.fs.initializeFab("arrow_forward",null,"Menuju Halaman Profile",`/user/${this.as.currentUserSubject?.value?.username}`,!1))}ngOnDestroy(){this.subsFeedKomentar?.unsubscribe(),this.subsFeedLikeDislike?.unsubscribe(),this.subsFeedVisit?.unsubscribe(),this.subsGetApiKey?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsCreateApiKey?.unsubscribe(),this.subsEditApiKey?.unsubscribe(),this.subsRevokeApiKey?.unsubscribe(),this.subsGroupGet?.unsubscribe(),this.subsUpdateSubDomain?.unsubscribe(),this.subsGetSubDomain?.unsubscribe()}getUserFeedComment(){this.bs.busy(),this.subsFeedKomentar=this.us.getUserFeedComment(this.as.currentUserSubject?.value?.username,"",1,5).subscribe({next:e=>{this.gs.log("[USER_FEED_COMMENT_SUCCESS]",e),this.totalKomentar=e.count,this.feedKomentarData=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_COMMENT_ERROR]",e,"error"),this.bs.idle()}})}getUserFeedLikeDislike(){this.bs.busy(),this.subsFeedLikeDislike=this.us.getUserFeedLikeDislike(this.as.currentUserSubject?.value?.username,"",1,5).subscribe({next:e=>{this.gs.log("[USER_FEED_LIKEDISLIKE_SUCCESS]",e),this.totalLikeDislike=e.count,this.feedLikeDislikeData=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_LIKEDISLIKE_ERROR]",e,"error"),this.bs.idle()}})}getUserFeedVisit(){this.bs.busy(),this.subsFeedVisit=this.us.getUserFeedVisit(this.as.currentUserSubject?.value?.username,"",1,5).subscribe({next:e=>{this.gs.log("[USER_FEED_VISIT_SUCCESS]",e),this.totalKunjungan=e.count,this.feedVisitData=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_VISIT_ERROR]",e,"error"),this.bs.idle()}})}getUserApiKey(){this.bs.busy(),this.subsGetApiKey=this.aks.getUserApiKey(this.as.currentUserSubject?.value?.username).subscribe({next:e=>{this.gs.log("[USER_FEED_VISIT_SUCCESS]",e),this.apiKey=e.results[this.as.currentUserSubject?.value?.username],this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_VISIT_ERROR]",e,"error"),this.bs.idle()}})}copyApiKey(e){this.clipboard.copy(e.api_key)&&this.snackBar.open("API Key :: Telah Di Salin Pada Clipboard","Ok")}generateNewApiKey(){this.subsDialog=this.ds.openInputDialog({data:{title:"Tambah API Key Baru",input:{name:{inputLabel:"Nama / Deskripsi",inputPlaceholder:`${this.as.currentUserSubject?.value?.username}_${Date.now()}`,inputValue:null,inputRequired:!0},ip_domain:{inputLabel:"Origin Tanpa http://",inputPlaceholder:"example.com; 1.1.1.1; *",inputValue:null,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Gunakan * Saja Untuk Perbolehkan Semua Dan Titik Koma ; Untuk Lebih Dari Satu"}}).afterClosed().subscribe({next:e=>{this.gs.log("[INPUT_DIALOG_CLOSED]",e),e&&(this.bs.busy(),this.subsCreateApiKey=this.aks.createApiKey({name:e.name,ip_domain:e.ip_domain}).subscribe({next:s=>{this.gs.log("[USER_CREATE_APIKEY_SUCCESS]",s),this.bs.idle(),this.getUserApiKey()},error:s=>{this.gs.log("[USER_CREATE_APIKEY_ERROR]",s,"error"),this.bs.idle(),this.getUserApiKey()}})),this.subsDialog.unsubscribe()}})}editApiKey(e){this.subsDialog=this.ds.openInputDialog({data:{title:"Ubah API Key",input:{name:{inputLabel:"Nama / Deskripsi",inputPlaceholder:e.name,inputValue:e.name,inputRequired:!0},ip_domain:{inputLabel:"Origin Tanpa http://",inputPlaceholder:e.ip_domain,inputValue:e.ip_domain,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Gunakan * Saja Untuk Perbolehkan Semua Dan Titik Koma ; Untuk Lebih Dari Satu"}}).afterClosed().subscribe({next:s=>{this.gs.log("[INPUT_DIALOG_CLOSED]",s),s&&(this.bs.busy(),this.subsEditApiKey=this.aks.editApiKey(e.id,{name:s.name,ip_domain:s.ip_domain}).subscribe({next:n=>{this.gs.log("[USER_EDIT_APIKEY_SUCCESS]",n),this.bs.idle(),this.getUserApiKey()},error:n=>{this.gs.log("[USER_EDIT_APIKEY_ERROR]",n,"error"),this.bs.idle(),this.getUserApiKey()}})),this.subsDialog.unsubscribe()}})}revokeApiKey(e){var s=this;return(0,J.Z)(function*(){s.subsDialog=(yield s.ds.openKonfirmasiDialog(`Hapus API Key -- '${e.api_key}'`,`Apakah Yakin Akan Menghapus ${e.ip_domain} ?`,!1)).afterClosed().subscribe({next:n=>{s.gs.log("[INFO_DIALOG_CLOSED]",n),!0===n&&(s.bs.busy(),s.subsRevokeApiKey=s.aks.revokeApiKey(e.id).subscribe({next:a=>{s.gs.log("[USER_REVOKE_APIKEY_SUCCESS]",a),s.bs.idle(),s.getUserApiKey()},error:a=>{s.gs.log("[USER_REVOKE_APIKEY_ERROR]",a,"error"),s.bs.idle(),s.getUserApiKey()}})),s.subsDialog.unsubscribe()}})})()}getUserGroup(){this.bs.busy(),this.subsGroupGet=this.us.getUserGroup(this.as.currentUserSubject?.value?.username).subscribe({next:e=>{this.gs.log("[USER_GROUP_LIST_SUCCESS]",e),this.groupFansub=e.results.filter(s=>s.fansub_.dns_id),this.bs.idle()},error:e=>{this.gs.log("[USER_GROUP_LIST_ERROR]",e,"error"),this.bs.idle()}})}editSubDomain(e){this.bs.busy(),this.subsGetSubDomain=this.fansub.getSubDomain(e.slug).subscribe({next:s=>{this.gs.log("[USER_FANSUB_SUBDOMAIN_SUCCESS]",s),this.bs.idle();const n=s.result;this.subsDialog=this.ds.openInputDialog({data:{title:`Ubah CNAME / A Record IP v4 v6 :: '${e.slug}'`,input:{server_target:{inputLabel:"Server Target Domain IP Publik",inputPlaceholder:"127.0.0.1 | ghs.google.com | blablabla.id.repl.co",inputValue:n.dns_id.content,inputRequired:!0},verification_name:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-name | slug-fs",inputValue:n.dns_id_alt?.name,inputRequired:!1},verification_target:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-target.dv.googlehosted.com | replit-verify=blablabla",inputValue:n.dns_id_alt?.content,inputRequired:!1}},confirmText:"OK",cancelText:"Batal",infoText:"Abaikan 2 Input Terakhir Jika Bukan Blogger / Replit"}}).afterClosed().subscribe({next:a=>{this.gs.log("[INPUT_DIALOG_CLOSED]",a),a&&(this.bs.busy(),this.subsUpdateSubDomain=this.fansub.updateSubDomain(e.slug,{server_target:a.server_target,verification_name:a.verification_name,verification_target:a.verification_target}).subscribe({next:c=>{this.gs.log("[FANSUB_UPDATE_SUBDOMAIN_SUCCESS]",c),this.bs.idle(),this.getUserGroup()},error:c=>{this.gs.log("[FANSUB_UPDATE_SUBDOMAIN_ERROR]",c,"error"),this.bs.idle(),this.getUserGroup()}})),this.subsDialog.unsubscribe()}})},error:s=>{this.gs.log("[USER_FANSUB_SUBDOMAIN_ERROR]",s,"error"),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:`Sepertinya Sub-Domain '${e.slug}' Belum Di Klaim`,htmlMessage:"Silahkan ambil sub-domain pada halaman fansub, ingin ke sana sekarang?",confirmText:"Ya",cancelText:"Tidak"},disableClose:!1}).afterClosed().subscribe({next:n=>{this.gs.log("[INFO_DIALOG_CLOSED]",n),!0===n?this.router.navigateByUrl(`/fansub/${e.slug}`):this.getUserGroup(),this.subsDialog.unsubscribe()}})}})}openComment(e){this.router.navigate([e.path],{queryParams:{comment:e.id}})}openApiDocs(){this.wb.winboxOpenUri(`${b.N.baseUrl}/api`,"_self",!0)}revokeDns(e){var s=this;return(0,J.Z)(function*(){s.subsDialog=(yield s.ds.openKonfirmasiDialog(`Hapus Sub-Domain -- '${e.slug}'`,"Apakah Yakin Ingin Menghapus / Nonaktifkan Sub-Domain ?",!1)).afterClosed().subscribe({next:n=>{s.gs.log("[INFO_DIALOG_CLOSED]",n),!0===n&&(s.bs.busy(),s.subsRevokeApiKey=s.fansub.revokeDomain(e.slug).subscribe({next:a=>{s.gs.log("[USER_REVOKE_DNS_SUCCESS]",a),s.bs.idle()},error:a=>{s.gs.log("[USER_REVOKE_DNS_ERROR]",a,"error"),s.bs.idle()}})),s.subsDialog.unsubscribe()}})})()}static#t=this.\u0275fac=function(s){return new(s||i)(t.Y36(_t.TU),t.Y36(r.F0),t.Y36(B.pl),t.Y36(Y.e),t.Y36(gt.x),t.Y36(y.U),t.Y36(F.r),t.Y36(K.z),t.Y36(P.K),t.Y36(dt.T),t.Y36(ft),t.Y36(bt.N))};static#e=this.\u0275cmp=t.Xpm({type:i,selectors:[["app-user-list"]],decls:65,vars:15,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-lg-8","col-xl-9"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"float-end","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[1,"text-bifeldy"],["class","col-12",4,"ngIf","ngIfElse"],[1,"col-lg-4","col-xl-3"],[1,"row","sticky-top"],[1,"col-12"],["matTooltip","Khusus Pengguna Terverifikasi",1,"text-bifeldy"],[1,"col-12","mb-2"],["mat-button","","color","accent","matTooltip","Buka Kotak Pesan","routerLink","/mailbox",1,"w-100"],["fontIcon","email",1,"me-1"],[1,"text-bifeldy",3,"matTooltip"],["mat-button","","color","accent",1,"w-100",3,"click"],["fontIcon","api",1,"me-1"],["fontIcon","webhook",1,"me-1"],["class","my-2 gradient-border",3,"click",4,"ngFor","ngForOf"],[1,"row","mt-4"],[1,"border-bottom-dotted"],["class","col-12 mb-2","style","max-height: 288px;",4,"ngIf","ngIfElse"],["noData",""],[3,"multiple"],["class","h-100",4,"ngFor","ngForOf"],[1,"h-100"],["fontIcon","add_comment","mat-list-icon","",1,"ps-3"],[1,"text-truncate","text-decoration-none",3,"click"],[1,"bg-bifeldy","px-2","me-1","text-danger",2,"position","absolute","right","0"],[1,"text-warning"],["fontIcon","volunteer_activism","mat-list-icon","",1,"ps-3"],[1,"text-truncate","text-decoration-none",3,"routerLink"],[1,"me-3","text-success"],[1,"me-3","text-info"],["fontIcon","directions_run","mat-list-icon","",1,"ps-3"],[1,"my-2","gradient-border",3,"click"],[1,"ps-2","pe-2","pt-2","text-truncate","my-0"],[1,"text-success"],[1,"ps-2","pe-2","pt-0","text-truncate","my-0"],[1,"ps-2","pe-2","pb-2","text-truncate","my-0"],["fontIcon","delete_sweep",1,"me-1"],[1,"col-12","mb-2",2,"max-height","288px"],[1,"h-100",2,"overflow-y","auto"],["class","h-100",3,"click",4,"ngFor","ngForOf"],[1,"h-100",3,"click"],["matListAvatar","",2,"border-radius","0",3,"src"],["mat-button","","matListAvatar","","color","accent",2,"border-radius","0",3,"click"],[1,"text-truncate","text-decoration-none"],[1,"bg-bifeldy","px-2","me-1","text-warning",2,"position","absolute","right","0"],[1,"col-12","p-3"]],template:function(s,n){if(1&s&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"span",6),t.NdJ("click",function(){return n.getUserFeedComment()}),t._uU(8," Refresh "),t.qZA(),t.TgZ(9,"b",7),t._uU(10),t.qZA()()(),t.YNc(11,Et,4,6,"div",8),t.qZA(),t.TgZ(12,"div",3)(13,"div",4)(14,"h2",5)(15,"span",6),t.NdJ("click",function(){return n.getUserFeedLikeDislike()}),t._uU(16," Refresh "),t.qZA(),t.TgZ(17,"b",7),t._uU(18),t.qZA()()(),t.YNc(19,Ct,4,6,"div",8),t.qZA(),t.TgZ(20,"div",3)(21,"div",4)(22,"h2",5)(23,"span",6),t.NdJ("click",function(){return n.getUserFeedVisit()}),t._uU(24," Refresh "),t.qZA(),t.TgZ(25,"b",7),t._uU(26),t.qZA()()(),t.YNc(27,St,4,6,"div",8),t.qZA()(),t.TgZ(28,"div",9)(29,"div",10)(30,"div",11)(31,"div",3)(32,"div",4)(33,"h2",5)(34,"b",12),t._uU(35,"Alamat Email"),t.qZA()()(),t.TgZ(36,"div",13)(37,"a",14),t._UZ(38,"mat-icon",15),t._uU(39),t.qZA()()(),t.TgZ(40,"div",3)(41,"div",4)(42,"h2",5)(43,"span",6),t.NdJ("click",function(){return n.getUserApiKey()}),t._uU(44," Refresh "),t.qZA(),t.TgZ(45,"b",16),t._uU(46,"API Key"),t.qZA()()(),t.TgZ(47,"div",13)(48,"a",17),t.NdJ("click",function(){return n.openApiDocs()}),t._UZ(49,"mat-icon",18),t._uU(50," Lihat API Endpoint "),t.qZA(),t.TgZ(51,"a",17),t.NdJ("click",function(){return n.generateNewApiKey()}),t._UZ(52,"mat-icon",19),t._uU(53," Buat API Key Baru "),t.qZA(),t.YNc(54,It,16,3,"div",20),t.qZA()(),t.TgZ(55,"div",21)(56,"div",4)(57,"h2",22)(58,"span",6),t.NdJ("click",function(){return n.getUserGroup()}),t._uU(59," Refresh "),t.qZA(),t.TgZ(60,"b",7),t._uU(61,"DNS Fansub"),t.qZA()()(),t.YNc(62,yt,4,2,"div",23),t.qZA()()()()()(),t.YNc(63,Zt,1,0,"ng-template",null,24,t.W1O)),2&s){const a=t.MAs(64);t.xp6(10),t.hij("Riwayat Komentar :: ",n.totalKomentar,""),t.xp6(1),t.Q6J("ngIf",n.feedKomentarData.length>0)("ngIfElse",a),t.xp6(7),t.hij("Riwayat Like & Dislike :: ",n.totalLikeDislike,""),t.xp6(1),t.Q6J("ngIf",n.feedLikeDislikeData.length>0)("ngIfElse",a),t.xp6(7),t.hij("Riwayat Kunjungan :: ",n.totalKunjungan,""),t.xp6(1),t.Q6J("ngIf",n.feedVisitData.length>0)("ngIfElse",a),t.xp6(12),t.AsE(" '",null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.username,"@",n.ENV.domain,"' "),t.xp6(6),t.MGl("matTooltip","Aktivitas Terakhir :: ",null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value._session_origin,""),t.xp6(9),t.Q6J("ngForOf",n.apiKey),t.xp6(8),t.Q6J("ngIf",n.groupFansub.length>0)("ngIfElse",a)}},dependencies:[p.sg,p.O5,r.rH,Z.Nr,L.Hw,T.Wx,T.ap,T.kh,T.O$,N.Kd,xt.t,vt.d,p.OU,p.uU,Ut.R]})}return i})();var Ot=o(2693),wt=o(7245),Kt=o(5643),R=o(8455),Pt=o(9203),Lt=o(7732),Nt=o(7443);function Mt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imagePhotoLimitExceeded)," !")}}function Bt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imagePhotoErrorText)}}function Ft(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",45)(1,"button",46),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitPhotoImage())}),t._UZ(2,"mat-icon",47),t._uU(3," Unggah "),t.qZA()()}if(2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Jt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Nama Tidak Boleh Kosong"),t.qZA())}function Yt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Nama Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Gt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageCoverLimitExceeded)," !")}}function qt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageCoverErrorText)}}function Qt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",16)(1,"button",46),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitCoverImage())}),t._UZ(2,"mat-icon",47),t._uU(3," Unggah "),t.qZA()()}if(2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Ht(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Tidak Boleh Kosong"),t.qZA())}function jt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Minimal 6 Huruf"),t.qZA())}function Vt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function $t(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Minimal 6 Huruf"),t.qZA())}function zt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Wt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"form",1),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",7),t._UZ(7,"img",8),t.TgZ(8,"mat-form-field",9)(9,"mat-label"),t._uU(10,"Profile Image"),t.qZA(),t.TgZ(11,"ngx-mat-file-input",10,11),t.NdJ("change",function(n){t.CHM(e);const a=t.MAs(12),c=t.oxw();return t.KtG(c.uploadPhotoImage(n,a))}),t.qZA(),t._UZ(13,"mat-icon",12),t.qZA(),t.TgZ(14,"mat-error",13)(15,"small"),t.YNc(16,Mt,3,3,"div",14),t.YNc(17,Bt,2,1,"div",14),t.qZA()()(),t.YNc(18,Ft,4,1,"div",15),t.TgZ(19,"div",16)(20,"mat-slide-toggle",17),t._uU(21," Jadikan Private, Sembunyikan Aktivitas "),t.qZA()(),t.TgZ(22,"div",18),t._uU(23," * Jika ingin mengubah "),t.TgZ(24,"i"),t._uU(25,"username"),t.qZA(),t._uU(26," silahkan menghubungi Admin menggunakan surel "),t.TgZ(27,"span",19),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.changeUname())}),t._uU(28),t.qZA()()()(),t.TgZ(29,"div",20),t._UZ(30,"div",21),t.TgZ(31,"div",22)(32,"mat-form-field",23)(33,"mat-label"),t._uU(34,"Nama Lengkap"),t.qZA(),t._UZ(35,"input",24)(36,"mat-icon",25),t.TgZ(37,"mat-error"),t.YNc(38,Jt,2,0,"div",14),t.YNc(39,Yt,2,0,"div",14),t.qZA()(),t.TgZ(40,"mat-form-field",9)(41,"mat-label"),t._uU(42,"Cover Image"),t.qZA(),t.TgZ(43,"ngx-mat-file-input",26,27),t.NdJ("change",function(n){t.CHM(e);const a=t.MAs(44),c=t.oxw();return t.KtG(c.uploadCoverImage(n,a))}),t.qZA(),t._UZ(45,"mat-icon",12),t.qZA(),t.TgZ(46,"mat-error",13)(47,"small"),t.YNc(48,Gt,3,3,"div",14),t.YNc(49,qt,2,1,"div",14),t.qZA()(),t.YNc(50,Qt,4,1,"div",28),t._UZ(51,"angular-editor",29),t.TgZ(52,"mat-form-field",30)(53,"mat-label"),t._uU(54,"Konfirmasi Kata Sandi"),t.qZA(),t._UZ(55,"input",31),t.TgZ(56,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.togglePassword())}),t._UZ(57,"mat-icon",33),t.qZA(),t.TgZ(58,"mat-error"),t.YNc(59,Ht,2,0,"div",14),t.YNc(60,jt,2,0,"div",14),t.YNc(61,Vt,2,0,"div",14),t.qZA()(),t.TgZ(62,"mat-form-field",30)(63,"mat-label"),t._uU(64,"Ubah Kata Sandi"),t.qZA(),t._UZ(65,"input",34),t.TgZ(66,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.togglePassword())}),t._UZ(67,"mat-icon",33),t.qZA(),t.TgZ(68,"mat-error"),t.YNc(69,$t,2,0,"div",14),t.YNc(70,zt,2,0,"div",14),t.qZA()()(),t.TgZ(71,"div",35)(72,"div",7)(73,"div",36),t._UZ(74,"div",37),t.TgZ(75,"div",38)(76,"a",39),t._UZ(77,"mat-icon",40),t._uU(78," Batal "),t.qZA()(),t.TgZ(79,"div",38)(80,"button",41),t._uU(81," Simpan "),t._UZ(82,"mat-icon",42),t.qZA()()()()()()()(),t._UZ(83,"div",43)(84,"div",44),t.qZA()()}if(2&i){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(7),t.s9C("src",e.image_photo,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imagePhotoLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imagePhotoErrorText),t.xp6(1),t.Q6J("ngIf",e.imagePhoto&&!e.fg.value.image_photo),t.xp6(10),t.AsE("",e.userData.username,"@",e.ENV.domain,""),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("nama").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("nama").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imageCoverLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imageCoverErrorText),t.xp6(1),t.Q6J("ngIf",e.imageCover&&!e.fg.value.image_cover),t.xp6(1),t.Q6J("config",e.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("type",e.passwordHide?"password":"text"),t.xp6(2),t.Q6J("fontIcon",e.passwordHide?"visibility_off":"visibility"),t.xp6(2),t.Q6J("ngIf",e.fg.get("old_password").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("old_password").hasError("minlength")),t.xp6(1),t.Q6J("ngIf",e.fg.get("old_password").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("type",e.passwordHide?"password":"text"),t.xp6(2),t.Q6J("fontIcon",e.passwordHide?"visibility_off":"visibility"),t.xp6(2),t.Q6J("ngIf",e.fg.get("new_password").hasError("minlength")),t.xp6(1),t.Q6J("ngIf",e.fg.get("new_password").hasError("pattern")),t.xp6(6),t.Q6J("disabled",e.submitted),t.xp6(4),t.Q6J("disabled",e.submitted||e.fg.invalid||!e.fg.dirty),t.xp6(3),t.Udp("background-image","url("+e.image_cover+")")}}const te=[{path:"",pathMatch:"full",component:Rt,canActivate:[k.t],data:{[h.t.decoratorRoles]:[d.yS.ADMIN,d.yS.MODERATOR,d.yS.FANSUBBER,d.yS.USER]}},{path:":username",children:[{path:"",pathMatch:"full",component:mt},{path:"edit",component:(()=>{class i{constructor(e,s,n,a,c,g,A,S,I,D){this.router=e,this.activatedRoute=s,this.toast=n,this.bs=a,this.us=c,this.fb=g,this.imgbb=A,this.gs=S,this.as=I,this.cs=D,this.submitted=!1,this.username=null,this.userData=null,this.imagePhoto=null,this.imagePhotoErrorText=null,this.imagePhotoLimitExceeded=null,this.image_photo=null,this.image_photo_original=null,this.imageCover=null,this.imageCoverErrorText=null,this.imageCoverLimitExceeded=null,this.image_cover=null,this.image_cover_original=null,this.passwordHide=!0,this.photoImage=null,this.coverImage=null,this.subsUserDetail=null,this.subsImgbb1=null,this.subsImgbb2=null,this.subsUserUpdate=null,this.subsVerify=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get ENV(){return b.N}get GS(){return this.gs}togglePassword(){this.passwordHide=!this.passwordHide}ngOnDestroy(){this.subsUserDetail?.unsubscribe(),this.subsImgbb1?.unsubscribe(),this.subsImgbb2?.unsubscribe(),this.subsUserUpdate?.unsubscribe(),this.subsVerify?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.username=this.activatedRoute.snapshot.paramMap.get("username"),this.bs.busy(),this.subsUserDetail=this.us.getUserData(this.username).subscribe({next:e=>{this.gs.log("[USER_DETAIL_SUCCESS]",e),this.bs.idle(),this.as.currentUserSubject?.value?.id!==e.result.id?(this.toast.warning("Profile Ini Milik Orang Lain","Whoops!",null,!0),this.router.navigateByUrl(`/user/${this.username}`)):this.initForm(e.result)},error:e=>{this.gs.log("[USER_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/user/${this.username}`}})}}))}initForm(e){this.fg=this.fb.group({nama:[e.kartu_tanda_penduduk_.nama,[u.kI.required,u.kI.pattern(/^[a-zA-Z. ]+$/)]],description:[e.profile_.description,u.kI.compose([u.kI.pattern(h.t.regexEnglishKeyboardKeys)])],old_password:[null,u.kI.compose([u.kI.required,u.kI.minLength(6),u.kI.pattern(h.t.regexEnglishKeyboardKeys)])],new_password:[null,u.kI.compose([u.kI.minLength(6),u.kI.pattern(h.t.regexEnglishKeyboardKeys)])],image_photo:[null,u.kI.compose([u.kI.pattern(h.t.regexUrl)])],image_cover:[null,u.kI.compose([u.kI.pattern(h.t.regexUrl)])],private:[e.private,u.kI.compose([u.kI.required])]}),this.image_photo=e.image_url,this.image_photo_original=this.image_photo,this.image_cover=e.profile_.cover_url,this.image_cover_original=this.image_cover,this.userData=e}uploadPhotoImage(e,s){this.photoImage=s,this.imagePhoto=null,this.imagePhotoLimitExceeded=null,this.imagePhotoErrorText=null,this.fg.controls.image_photo.patchValue(null),this.fg.controls.image_photo.markAsPristine();const n=e.target.files[0];try{const a=new FileReader;a.readAsDataURL(n),a.onload=c=>{if(this.gs.log("[IMAGE_PHOTO_SELECTED]",c),n.size<=h.t.fileSizeImageLimit){const g=this.gs.document.createElement("img");g.onload=()=>{this.imagePhoto=n,this.image_photo=a.result.toString()},g.src=a.result.toString()}else this.imagePhoto=null,this.image_photo="/assets/img/form/image-error.png",this.imagePhotoLimitExceeded=h.t.fileSizeImageLimit,this.photoImage.clear(e)}}catch{this.imagePhoto=null,this.image_photo=this.image_photo_original,this.photoImage.clear(e)}}submitPhotoImage(){this.submitted=!0,this.subsImgbb1=this.imgbb.uploadImage({file:this.imagePhoto}).subscribe({next:e=>{this.gs.log("[IMAGE_PHOTO_SUCCESS]",e),this.fg.controls.image_photo.patchValue(e.result.url),this.fg.controls.image_photo.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_PHOTO_ERROR]",e,"error"),this.fg.controls.image_photo.patchValue(null),this.fg.controls.image_photo.markAsPristine(),this.submitted=!1,this.imagePhotoErrorText=e.result?.message||e.info}})}uploadCoverImage(e,s){this.coverImage=s,this.imageCover=null,this.imageCoverLimitExceeded=null,this.imageCoverErrorText=null,this.fg.controls.image_cover.patchValue(null),this.fg.controls.image_cover.markAsPristine();const n=e.target.files[0];try{const a=new FileReader;a.readAsDataURL(n),a.onload=c=>{if(this.gs.log("[IMAGE_COVER_SELECTED]",c),n.size<=h.t.fileSizeImageLimit){const g=this.gs.document.createElement("img");g.onload=()=>{this.imageCover=n,this.image_cover=a.result.toString()},g.src=a.result.toString()}else this.imageCover=null,this.image_cover="/assets/img/form/image-error.png",this.imageCoverLimitExceeded=h.t.fileSizeImageLimit,this.coverImage.clear(e)}}catch{this.imageCover=null,this.image_cover=this.image_cover_original,this.coverImage.clear(e)}}submitCoverImage(){this.submitted=!0,this.subsImgbb2=this.imgbb.uploadImage({file:this.imageCover}).subscribe({next:e=>{this.gs.log("[IMAGE_COVER_SUCCESS]",e),this.fg.controls.image_cover.patchValue(e.result.url),this.fg.controls.image_cover.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_COVER_ERROR]",e,"error"),this.fg.controls.image_cover.patchValue(null),this.fg.controls.image_cover.markAsPristine(),this.submitted=!1,this.imageCoverErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e=this.gs.getDirtyValues(this.fg);if(e.old_password=this.cs.hashPassword(this.fg.value.old_password),"new_password"in e&&e.new_password&&(e.new_password=this.cs.hashPassword(this.fg.value.new_password)),this.gs.log("[USER_EDIT_DIRTY]",e),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsUserUpdate=this.us.updateUser(this.username,{...e}).subscribe({next:s=>{this.gs.log("[USER_EDIT_SUCCESS]",s),this.submitted=!1,this.bs.idle(),this.as.removeUser(),this.bs.busy(),this.subsVerify=this.as.verify(this.as.token).subscribe({next:n=>{this.gs.log("[VERIFY_LOGIN_SUCCESS]",n),this.bs.idle(),this.router.navigateByUrl(`/user/${this.username}`)},error:n=>{this.gs.log("[VERIFY_LOGIN_ERROR]",n,"error"),this.bs.idle(),this.as.removeUser(),this.router.navigateByUrl(`/user/${this.username}`)}})},error:s=>{this.gs.log("[USER_EDIT_ERROR]",s,"error"),this.submitted=!1,this.bs.idle()}})}changeUname(){this.router.navigate(["/create/mailbox"],{queryParams:{subject:"[ReqUName] Pengajuan Ganti Username",to:["bifeldy"].map(s=>`${s}@${b.N.domain}`).join(",")}})}static#t=this.\u0275fac=function(s){return new(s||i)(t.Y36(r.F0),t.Y36(r.gz),t.Y36(Ot.k),t.Y36(K.z),t.Y36(P.K),t.Y36(u.QS),t.Y36(wt.X),t.Y36(y.U),t.Y36(Y.e),t.Y36(Kt.$))};static#e=this.\u0275cmp=t.Xpm({type:i,selectors:[["app-user-edit"]],decls:1,vars:1,consts:[[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"container"],[1,"profile-info","align-items-center",2,"top","64px","position","relative"],[1,"row","py-3","px-2"],[1,"col-md-4","col-xl-3","p-3"],[1,"row","sticky-top","pt-3"],[1,"col-12"],[1,"w-100",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"accept","change"],["photoImage",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],[1,"col-12","py-3"],["formControlName","private","matTooltip","Hanya Tampilkan Informasi Profil"],[1,"col-12","py-3","text-warning"],[1,"text-success",2,"cursor","pointer",3,"click"],[1,"col-md-8","col-xl-9","p-3"],[1,"row","py-3","px-0","profile-height-large"],[1,"row","py-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","nama","placeholder","Nama Lengkap"],["fontIcon","wysiwyg","matSuffix",""],["placeholder","Basic Input",1,"w-100",3,"accept","change"],["coverImage",""],["class","col-12 py-3",4,"ngIf"],["formControlName","description",1,"py-3","w-100",3,"config"],["appearance","outline",1,"py-3","w-100",3,"color"],["matInput","","formControlName","old_password","required","","placeholder","Password Sekarang","autocomplete","current-password",3,"type"],["type","button","mat-icon-button","","matSuffix","",3,"click"],[3,"fontIcon"],["matInput","","formControlName","new_password","placeholder","Isi Jika Ingin Ubah Password Baru","autocomplete","new-password",3,"type"],[1,"row"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],[1,"profile-banner","profile-banner-1","align-items-center"],[1,"profile-banner","profile-banner-2","align-items-center"],[1,"col-12","mb-4"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"]],template:function(s,n){1&s&&t.YNc(0,Wt,85,33,"form",0),2&s&&t.Q6J("ngIf",n.fg)},dependencies:[p.O5,r.rH,Z.eB,Z.Nr,L.Hw,R.nI,R.v_,R.$V,R.nX,Pt.k0,Lt.iZ,N.Kd,u._Y,u.Fj,u.JJ,u.JL,u.Q7,u.sg,u.u,x.Yh,U.s6,Nt.$],styles:[".profile-banner[_ngcontent-%COMP%]{height:192px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:.75}.profile-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.profile-banner-2[_ngcontent-%COMP%]{position:absolute;top:192px;left:0}.profile-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}@media only screen and (min-width: 769px){.profile-height-large[_ngcontent-%COMP%]{height:100px}}@media only screen and (max-width: 768px){.profile-image[_ngcontent-%COMP%]{padding-top:3rem}}"]})}return i})(),canActivate:[k.t],data:{title:"User - Ubah Profil",description:"Halaman Pembaharuan Profil Pengguna",keywords:"Ubah Profil",[h.t.decoratorRoles]:[d.yS.ADMIN,d.yS.MODERATOR,d.yS.FANSUBBER,d.yS.USER]}}]}];let ee=(()=>{class i{static#t=this.\u0275fac=function(s){return new(s||i)};static#e=this.\u0275mod=t.oAB({type:i});static#i=this.\u0275inj=t.cJS({imports:[p.ez,r.Bz.forChild(te),w.m,_.$,C.L,u.u5,u.UX,x.Ad,U.UM,m.b,f.F,O.T,v.d]})}return i})()},801:(M,E,o)=>{o.d(E,{Q:()=>w});var p=o(7084),r=o(4650),u=o(9816),U=o(6895),x=o(7392),h=o(7462);function d(_,C){if(1&_&&r._UZ(0,"h3",8),2&_){const m=r.oxw().$implicit;r.Q6J("innerHTML",m.text,r.oJD)}}function k(_,C){if(1&_&&(r.TgZ(0,"mat-expansion-panel",3)(1,"mat-expansion-panel-header")(2,"mat-panel-title",4)(3,"span",5),r._uU(4),r.qZA()(),r.TgZ(5,"mat-panel-description"),r._UZ(6,"mat-icon",6),r.qZA()(),r.YNc(7,d,1,1,"ng-template",7),r.qZA()),2&_){const m=C.$implicit,f=C.first,v=r.oxw(2);r.Q6J("expanded",v.GS.isDesktop&&f),r.xp6(3),r.s9C("matTooltip",m.tooltip),r.Q6J("matTooltipPosition","above"),r.xp6(1),r.hij(" ",m.title," "),r.xp6(2),r.Q6J("fontIcon",m.icon)}}function O(_,C){if(1&_&&(r.TgZ(0,"mat-accordion",1),r.YNc(1,k,8,5,"mat-expansion-panel",2),r.qZA()),2&_){const m=r.oxw();r.xp6(1),r.Q6J("ngForOf",m.panelData)}}let w=(()=>{class _{onResize(m){this.gs.onResize(m,"MATERIAL_EXPANSION_PANEL"),this.gs.isDesktop?this.accordion.openAll():this.accordion.closeAll()}constructor(m){this.gs=m,this.panelData=[{title:"Title",icon:"warning",text:"Lorem ipsum ...",tooltip:"Info"}]}get GS(){return this.gs}ngOnInit(){}static#t=this.\u0275fac=function(f){return new(f||_)(r.Y36(u.U))};static#e=this.\u0275cmp=r.Xpm({type:_,selectors:[["app-material-expansion-panel"]],viewQuery:function(f,v){if(1&f&&r.Gf(p.pp,5),2&f){let b;r.iGM(b=r.CRH())&&(v.accordion=b.first)}},hostBindings:function(f,v){1&f&&r.NdJ("resize",function(t){return v.onResize(t)},!1,r.Jf7)},inputs:{panelData:"panelData"},decls:1,vars:1,consts:[["class","example-headers-align","multi","",4,"ngIf"],["multi","",1,"example-headers-align"],[3,"expanded",4,"ngFor","ngForOf"],[3,"expanded"],[1,"font-weight-bold"],[3,"matTooltip","matTooltipPosition"],[1,"ms-auto",3,"fontIcon"],["matExpansionPanelContent",""],[1,"m-0","text-justify",2,"white-space","pre-line !important",3,"innerHTML"]],template:function(f,v){1&f&&r.YNc(0,O,2,1,"mat-accordion",0),2&f&&r.Q6J("ngIf",v.panelData.length>0)},dependencies:[U.sg,U.O5,p.pp,p.ib,p.yz,p.yK,p.u4,p.HS,x.Hw,h.Kd]})}return _})()},9560:(M,E,o)=>{o.d(E,{$:()=>U});var p=o(6895),r=o(2314),u=o(4650);let U=(()=>{class x{static#t=this.\u0275fac=function(k){return new(k||x)};static#e=this.\u0275mod=u.oAB({type:x});static#i=this.\u0275inj=u.cJS({imports:[p.ez,r.m]})}return x})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[109],{9109:(M,E,o)=>{o.r(E),o.d(E,{UserModule:()=>ee});var p=o(6895),r=o(1390),u=o(4006),U=o(7375),x=o(5128),h=o(3659),d=o(1741),k=o(5816),O=o(3811),w=o(2314),_=o(9560),C=o(9736),m=o(8866),f=o(6319),v=o(5208),b=o(4674),t=o(4650),B=o(2972),y=o(9816),K=o(3322),F=o(5312),G=o(5141),P=o(1140),q=o(7396),Q=o(1428),Z=o(9818),H=o(3238),L=o(7392),T=o(9982),N=o(7462),j=o(801),V=o(1338),$=o(3710);function z(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",31),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.userData.role))}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("matTooltip",e.userData.role)}}function W(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.userData.role))}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("matTooltip",e.userData.role)}}function X(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",33),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.userData.role))}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("matTooltip",e.userData.role)}}function tt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",34),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Terverifikasi"))}),t.qZA()}}function et(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",35),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Banned :: "+n.userBanned.reason))}),t.qZA()}if(2&i){const e=t.oxw(2);t.MGl("matTooltip","Banned :: ",e.userBanned.reason,"")}}function it(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",36),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked(n.accountAge+" Years of Service"))}),t.qZA()}if(2&i){const e=t.oxw(2);t.MGl("matTooltip","",e.accountAge," Years of Service")}}function st(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",37),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Sharing is Caring"))}),t.qZA()}}function nt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-icon",38),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.badgeClicked("Akun Private"))}),t.qZA()}}function ot(i,l){if(1&i&&(t.TgZ(0,"mat-list-option",47),t._UZ(1,"img",48),t.TgZ(2,"a",49)(3,"span",50),t._uU(4),t.qZA(),t.TgZ(5,"span",51),t._uU(6),t.qZA()()()),2&i){const e=l.$implicit;t.MGl("routerLink","/fansub/",e.fansub_.slug,""),t.xp6(1),t.s9C("src",e.fansub_.image_url,t.LSH),t.xp6(3),t.hij(" ",e.keterangan," "),t.xp6(2),t.Oqu(e.fansub_.slug)}}function at(i,l){if(1&i&&(t.TgZ(0,"div",6)(1,"div",39)(2,"div",40)(3,"h2",41)(4,"b",42),t._uU(5,"Group Fansub"),t.qZA()()(),t.TgZ(6,"div",43)(7,"div",44)(8,"mat-selection-list",45),t.YNc(9,ot,7,4,"mat-list-option",46),t.qZA()()()()()),2&i){const e=t.oxw(2);t.xp6(8),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.groupFansub)}}function rt(i,l){if(1&i&&(t.TgZ(0,"button",52),t._UZ(1,"mat-icon",53),t._uU(2),t.qZA()),2&i){const e=t.oxw(2);t.xp6(2),t.hij(" ",e.userData.id," ")}}function lt(i,l){if(1&i&&(t.TgZ(0,"button",54),t._UZ(1,"mat-icon",55),t._uU(2),t.ALo(3,"date"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(2),t.hij(" ",t.xi3(3,1,e.userData.created_at,"d/M/yyyy, hh:mm:ss a z")," ")}}function ut(i,l){if(1&i&&(t.TgZ(0,"div",39),t._UZ(1,"app-material-expansion-panel",56),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("panelData",e.panelData)}}function ct(i,l){1&i&&(t.TgZ(0,"div",39)(1,"div",6),t._UZ(2,"app-report"),t.qZA()())}function pt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),t._UZ(6,"img",7),t.qZA(),t.TgZ(7,"div",8),t.YNc(8,z,1,1,"mat-icon",9),t.YNc(9,W,1,1,"mat-icon",10),t.YNc(10,X,1,1,"mat-icon",11),t.YNc(11,tt,1,0,"mat-icon",12),t.YNc(12,et,1,1,"mat-icon",13),t.YNc(13,it,1,1,"mat-icon",14),t.YNc(14,st,1,0,"mat-icon",15),t.YNc(15,nt,1,0,"mat-icon",16),t.qZA(),t.YNc(16,at,10,2,"div",17),t.qZA()(),t.TgZ(17,"div",18)(18,"div",19)(19,"h1",20)(20,"b"),t._uU(21),t.qZA()()(),t.TgZ(22,"div",21),t.YNc(23,rt,3,1,"button",22),t.YNc(24,lt,4,4,"button",23),t.TgZ(25,"button",24),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.createMailbox())}),t._UZ(26,"mat-icon",25),t._uU(27),t.qZA()(),t.YNc(28,ut,2,1,"div",26),t.YNc(29,ct,3,0,"div",26),t.qZA()(),t.TgZ(30,"div",27)(31,"div",6)(32,"app-material-tab",28),t.NdJ("tableRowClicked",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.openBerkas(n))})("paginatorClicked",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onPaginatorClicked(n))})("serverSideFilter",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onServerSideFilter(n))})("serverSideOrder",function(n){t.CHM(e);const a=t.oxw();return t.KtG(a.onServerSideOrder(n))}),t.qZA()()()(),t._UZ(33,"div",29)(34,"div",30),t.qZA()}if(2&i){const e=t.oxw();t.xp6(6),t.s9C("src",e.userData.image_url,t.LSH),t.xp6(2),t.Q6J("ngIf",e.userData.role===e.ADMIN),t.xp6(1),t.Q6J("ngIf",e.userData.role===e.MODERATOR),t.xp6(1),t.Q6J("ngIf",e.userData.role===e.FANSUBBER),t.xp6(1),t.Q6J("ngIf",e.userData.verified),t.xp6(1),t.Q6J("ngIf",e.userBanned),t.xp6(1),t.Q6J("ngIf",e.accountAge>0),t.xp6(1),t.Q6J("ngIf",e.count>0),t.xp6(1),t.Q6J("ngIf",e.userData.private),t.xp6(1),t.Q6J("ngIf",e.groupFansub.length>0),t.xp6(5),t.Oqu(e.userData.kartu_tanda_penduduk_.nama),t.xp6(2),t.Q6J("ngIf",e.userData.id),t.xp6(1),t.Q6J("ngIf",e.userData.created_at),t.xp6(3),t.AsE(" ",e.userData.username,"@",e.ENV.domain," "),t.xp6(1),t.Q6J("ngIf",e.panelData.length>0),t.xp6(1),t.Q6J("ngIf",null==e.SS.mySocket?null:e.SS.mySocket.id),t.xp6(3),t.Q6J("tabData",e.tabData)("count",e.count)("serverSide",!0),t.xp6(1),t.Udp("background-image","url("+e.userData.profile_.cover_url+")")}}let mt=(()=>{class i{constructor(e,s,n,a,c,g,A,S,I,D){this.snackBar=e,this.router=s,this.activatedRoute=n,this.gs=a,this.bs=c,this.fs=g,this.pi=A,this.us=S,this.ss=I,this.berkas=D,this.username="",this.userData=null,this.userBanned=null,this.groupFansub=[],this.berkasUser=[],this.allBerkasUserId=[],this.panelData=[],this.tabData=[{name:"Berkas",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Kunjungan","Pemilik"],row:[]}}],this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.subsUser=null,this.subsBerkas=null,this.subsBanned=null,this.subsParam=null,this.subsGroupGet=null,this.subsTrusted=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get SS(){return this.ss}ngOnDestroy(){this.subsUser?.unsubscribe(),this.subsBerkas?.unsubscribe(),this.subsBanned?.unsubscribe(),this.subsParam?.unsubscribe(),this.subsGroupGet?.unsubscribe(),this.subsTrusted?.unsubscribe()}get ADMIN(){return d.yS.ADMIN}get MODERATOR(){return d.yS.MODERATOR}get FANSUBBER(){return d.yS.FANSUBBER}get accountAge(){return Math.abs(new Date(Date.now()-new Date(this.userData.created_at).getTime()).getUTCFullYear()-1970)}get ENV(){return b.N}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:e=>{this.username=e.username,this.bs.busy(),this.subsUser=this.us.getUserData(this.username).subscribe({next:s=>{this.gs.log("[USER_DETAIL_SUCCESS]",s),this.userData=s.result,this.pi.updatePageMetaData(this.userData.kartu_tanda_penduduk_.nama,this.userData.profile_.description,this.userData.username,this.userData.image_url,this.userData.username),this.bs.idle(),this.gs.isBrowser&&(this.panelData=[],this.panelData.push({title:"Tentang Saya",icon:"info",text:this.userData.profile_.description}),this.fs.initializeFab("edit",null,"Ubah Profil",`/user/${this.username}/edit`,!1),this.checkBanned(),this.getUserGroup(),this.getUserBerkas())},error:s=>{this.gs.log("[USER_DETAIL_ERROR]",s,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/"}})}})}})}checkBanned(){this.bs.busy(),this.subsBanned=this.us.checkBanned(this.userData.username).subscribe({next:e=>{this.gs.log("[USER_CHECK_BANNED_SUCCESS]",e),Object.keys(e.results[this.userData.username]).length>0&&(this.userBanned=e.results[this.userData.username]),this.bs.idle()},error:e=>{this.gs.log("[USER_CHECK_BANNED_ERROR]",e,"error"),this.bs.idle()}})}getUserBerkas(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.us.getUserBerkas(this.username,this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[USER_BERKAS_LIST_SUCCESS]",e),this.count=e.count,this.berkasUser=[];for(const s of e.results)this.allBerkasUserId.push(s.id),this.berkasUser.push({id:s.id,private:s.private,foto:s.user_.image_url,Proyek:s.project_type_.name,Tanggal:s.created_at,Kunjungan:s.view_count,Pemilik:s.user_.username,"Nama Berkas":s.name});this.tabData[0].data.row=this.berkasUser,this.allBerkasUserId.length>0&&this.checkTrusted(),this.bs.idle()},error:e=>{this.gs.log("[USER_BERKAS_LIST_ERROR]",e,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted&&(this.subsTrusted.unsubscribe(),this.bs.idle()),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasUserId).subscribe({next:e=>{this.gs.log("[USER_BERKAS_TRUSTED_SUCCESS]",e);for(const s of this.berkasUser)s.trusted=e.results[s.id];this.bs.idle()},error:e=>{this.gs.log("[USER_BERKAS_TRUSTED_ERROR]",e,"error"),this.bs.idle()}})}openBerkas(e){this.gs.log("[USER_BERKAS_LIST_CLICK_BERKAS]",e),this.router.navigateByUrl(`/berkas/${e.id}`)}onPaginatorClicked(e){this.gs.log("[USER_BERKAS_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getUserBerkas()}onServerSideFilter(e){this.gs.log("[USER_BERKAS_LIST_ENTER_FILTER]",e),this.q=e,this.getUserBerkas()}onServerSideOrder(e){this.gs.log("[USER_BERKAS_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getUserBerkas()}getUserGroup(){this.bs.busy(),this.subsGroupGet=this.us.getUserGroup(this.username).subscribe({next:e=>{this.gs.log("[USER_DETAIL_GROUP_LIST_SUCCESS]",e),this.groupFansub=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_DETAIL_GROUP_LIST_ERROR]",e,"error"),this.bs.idle()}})}createMailbox(){this.router.navigate(["/create/mailbox"],{queryParams:{to:`${this.userData.username}@${b.N.domain}`}})}badgeClicked(e){this.snackBar.open(e,"Ok")}static#t=this.\u0275fac=function(s){return new(s||i)(t.Y36(B.pl),t.Y36(r.F0),t.Y36(r.gz),t.Y36(y.U),t.Y36(K.z),t.Y36(F.r),t.Y36(G.Z),t.Y36(P.K),t.Y36(q.R),t.Y36(Q.A))};static#e=this.\u0275cmp=t.Xpm({type:i,selectors:[["app-user-detail"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"profile-info","align-items-center",2,"top","64px","position","relative"],[1,"row","py-3","px-2"],[1,"col-md-4","col-xl-3","px-3"],[1,"row","sticky-top","pt-3"],[1,"col-12"],[1,"profile-image",3,"src"],[1,"col-12","my-3"],["fontIcon","handyman","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","security","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","rate_review","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","verified","class","mx-1","matTooltip","Terverifikasi","style","cursor: pointer;",3,"click",4,"ngIf"],["fontIcon","lock","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","military_tech","class","mx-1","style","cursor: pointer;",3,"matTooltip","click",4,"ngIf"],["fontIcon","volunteer_activism","class","mx-1","matTooltip","Sharing is Caring","style","cursor: pointer;",3,"click",4,"ngIf"],["fontIcon","sensor_occupied","class","mx-1","matTooltip","Akun Private","style","cursor: pointer;",3,"click",4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-md-8","col-xl-9","pt-3"],[1,"row","py-3","px-0","profile-height-large"],[1,"m-0","mt-auto"],[1,"row","p-3"],["type","button","mat-stroked-button","","matLine","","class","col-12 col-md-4 text-truncate","matTooltip","Nomor ID Pengguna","color","accent","style","overflow: hidden;",4,"ngIf"],["type","button","mat-stroked-button","","matLine","","class","col-12 col-md-8 text-truncate","matTooltip","Tanggal Bergabung","color","accent","style","overflow: hidden;",4,"ngIf"],["type","button","mat-stroked-button","","matLine","","matTooltip","Alamat Surel","color","accent",1,"col","text-truncate",2,"overflow","hidden",3,"click"],["fontIcon","email",1,"me-1"],["class","row py-3",4,"ngIf"],[1,"row"],[3,"tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"profile-banner","profile-banner-1","align-items-center"],[1,"profile-banner","profile-banner-2","align-items-center"],["fontIcon","handyman",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","security",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","rate_review",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","verified","matTooltip","Terverifikasi",1,"mx-1",2,"cursor","pointer",3,"click"],["fontIcon","lock",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","military_tech",1,"mx-1",2,"cursor","pointer",3,"matTooltip","click"],["fontIcon","volunteer_activism","matTooltip","Sharing is Caring",1,"mx-1",2,"cursor","pointer",3,"click"],["fontIcon","sensor_occupied","matTooltip","Akun Private",1,"mx-1",2,"cursor","pointer",3,"click"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12",2,"max-height","288px"],[1,"h-100",2,"overflow-y","auto"],[3,"multiple"],["class","h-100",3,"routerLink",4,"ngFor","ngForOf"],[1,"h-100",3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],[1,"text-truncate","text-decoration-none"],[1,"bg-bifeldy","px-2","me-1","text-warning",2,"position","absolute","right","0"],[1,"text-success"],["type","button","mat-stroked-button","","matLine","","matTooltip","Nomor ID Pengguna","color","accent",1,"col-12","col-md-4","text-truncate",2,"overflow","hidden"],["fontIcon","accessibility_new",1,"me-1"],["type","button","mat-stroked-button","","matLine","","matTooltip","Tanggal Bergabung","color","accent",1,"col-12","col-md-8","text-truncate",2,"overflow","hidden"],["fontIcon","access_time",1,"me-1"],[3,"panelData"]],template:function(s,n){1&s&&t.YNc(0,pt,35,22,"div",0),2&s&&t.Q6J("ngIf",n.userData)},dependencies:[p.sg,p.O5,r.rH,Z.eB,H.X2,L.Hw,T.Wx,T.kh,T.O$,N.Kd,j.Q,V.H,$.Y,p.uU],styles:[".profile-banner[_ngcontent-%COMP%]{height:192px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:.75}.profile-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.profile-banner-2[_ngcontent-%COMP%]{position:absolute;top:192px;left:0}.profile-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}.profile-image[_ngcontent-%COMP%]{width:50%}@media only screen and (min-width: 769px){.profile-height-large[_ngcontent-%COMP%]{height:100px}.profile-image[_ngcontent-%COMP%]{width:100%}}@media only screen and (max-width: 768px){.profile-image[_ngcontent-%COMP%]{padding-top:3rem}}"]})}return i})();var J=o(5861),_t=o(4425),Y=o(80),gt=o(2970),dt=o(3842),ht=o(9222);let ft=(()=>{class i{constructor(e,s){this.api=e,this.gs=s}getUserApiKey(e){return this.api.getData(`/api-key?username=${e}`)}createApiKey(e){return this.api.postData("/api-key",e)}editApiKey(e,s){return this.api.putData(`/api-key/${e}`,s)}revokeApiKey(e){return this.api.deleteData(`/api-key/${e}`)}static#t=this.\u0275fac=function(s){return new(s||i)(t.LFG(ht.s),t.LFG(y.U))};static#e=this.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var bt=o(8151),xt=o(4758),vt=o(7397),Ut=o(1105);function Tt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-list-option",27),t._UZ(1,"mat-icon",28),t.TgZ(2,"a",29),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.openComment(a))}),t.TgZ(3,"span",30),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t.TgZ(6,"span",31),t._uU(7),t.qZA()()()}if(2&i){const e=l.$implicit;t.xp6(4),t.Oqu(t.lcZ(5,2,e.created_at)),t.xp6(3),t.Oqu(e.comment)}}function Et(i,l){if(1&i&&(t.TgZ(0,"div",11)(1,"mat-selection-list",25),t.YNc(2,Tt,8,4,"mat-list-option",26),t.ALo(3,"slice"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",t.Dn7(3,2,e.feedKomentarData,0,5))}}function kt(i,l){if(1&i&&(t.TgZ(0,"mat-list-option",27),t._UZ(1,"mat-icon",32),t.TgZ(2,"a",33)(3,"span",30),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t.TgZ(6,"span",34),t._uU(7),t.qZA(),t.TgZ(8,"span",35),t._uU(9),t.qZA(),t.TgZ(10,"span",31),t._uU(11),t.qZA()()()),2&i){const e=l.$implicit;t.xp6(2),t.Q6J("routerLink",e.berkas_?"/berkas/"+(null==e.berkas_?null:e.berkas_.id):e.fansub_?"/fansub/"+(null==e.fansub_?null:e.fansub_.slug):e.user_?"/user/"+(null==e.user_?null:e.user_.username):e.news_?"/news/"+(null==e.news_?null:e.news_.id):""),t.xp6(2),t.Oqu(t.lcZ(5,5,e.created_at)),t.xp6(3),t.Oqu(e.type),t.xp6(2),t.Oqu(e.berkas_?"Berkas":e.fansub_?"Fansub":e.user_?"User":e.news_?"News":""),t.xp6(2),t.Oqu((null==e.berkas_?null:e.berkas_.name)||(null==e.fansub_?null:e.fansub_.name)||(null==e.user_||null==e.user_.kartu_tanda_penduduk_?null:e.user_.kartu_tanda_penduduk_.nama)||(null==e.news_?null:e.news_.title))}}function Ct(i,l){if(1&i&&(t.TgZ(0,"div",11)(1,"mat-selection-list",25),t.YNc(2,kt,12,7,"mat-list-option",26),t.ALo(3,"slice"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",t.Dn7(3,2,e.feedLikeDislikeData,0,5))}}function At(i,l){if(1&i&&(t.TgZ(0,"mat-list-option",27),t._UZ(1,"mat-icon",36),t.TgZ(2,"a",33)(3,"span",30),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t.TgZ(6,"span",35),t._uU(7),t.qZA(),t.TgZ(8,"span",31),t._uU(9),t.qZA()()()),2&i){const e=l.$implicit;t.xp6(2),t.Q6J("routerLink",e.berkas_?"/berkas/"+(null==e.berkas_?null:e.berkas_.id):e.fansub_?"/fansub/"+(null==e.fansub_?null:e.fansub_.slug):e.user_?"/user/"+(null==e.user_?null:e.user_.username):e.news_?"/news/"+(null==e.news_?null:e.news_.id):""),t.xp6(2),t.Oqu(t.lcZ(5,4,e.created_at)),t.xp6(3),t.Oqu(e.berkas_?"Berkas":e.fansub_?"Fansub":e.user_?"User":e.news_?"News":""),t.xp6(2),t.Oqu((null==e.berkas_?null:e.berkas_.name)||(null==e.fansub_?null:e.fansub_.name)||(null==e.user_||null==e.user_.kartu_tanda_penduduk_?null:e.user_.kartu_tanda_penduduk_.nama)||(null==e.news_?null:e.news_.title))}}function St(i,l){if(1&i&&(t.TgZ(0,"div",11)(1,"mat-selection-list",25),t.YNc(2,At,10,6,"mat-list-option",26),t.ALo(3,"slice"),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",t.Dn7(3,2,e.feedVisitData,0,5))}}function It(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",37),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw();return c.copyApiKey(a),t.KtG(c.editApiKey(a))}),t.TgZ(1,"p",38),t._uU(2," Nama :: "),t.TgZ(3,"span",39),t._uU(4),t.qZA()(),t.TgZ(5,"p",40),t._uU(6," Origin :: "),t.TgZ(7,"span",39),t._uU(8),t.qZA()(),t.TgZ(9,"p",41),t._uU(10," Key :: "),t.TgZ(11,"span",39),t._uU(12),t.qZA()(),t.TgZ(13,"a",17),t.NdJ("click",function(n){const c=t.CHM(e).$implicit,g=t.oxw();return n.stopPropagation(),t.KtG(g.revokeApiKey(c))}),t._UZ(14,"mat-icon",42),t._uU(15," Hapus Akses "),t.qZA()()}if(2&i){const e=l.$implicit;t.xp6(4),t.hij(" ",e.name," "),t.xp6(4),t.hij(" ",e.ip_domain," "),t.xp6(4),t.hij(" ",e.api_key," ")}}function Dt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"mat-list-option",46),t.NdJ("click",function(){const a=t.CHM(e).$implicit,c=t.oxw(2);return t.KtG(c.editSubDomain(a.fansub_))}),t._UZ(1,"img",47),t.TgZ(2,"a",48),t.NdJ("click",function(n){const c=t.CHM(e).$implicit,g=t.oxw(2);return n.stopPropagation(),t.KtG(g.revokeDns(c.fansub_))}),t._UZ(3,"mat-icon",42),t.qZA(),t.TgZ(4,"a",49)(5,"span",50),t._uU(6),t.ALo(7,"date"),t.qZA(),t.TgZ(8,"span",39),t._uU(9),t.qZA()()()}if(2&i){const e=l.$implicit;t.xp6(1),t.s9C("src",e.fansub_.image_url,t.LSH),t.xp6(5),t.hij(" ",t.xi3(7,3,e.updated_at,"d-MM-y")," "),t.xp6(3),t.Oqu(e.fansub_.slug)}}function yt(i,l){if(1&i&&(t.TgZ(0,"div",43)(1,"div",44)(2,"mat-selection-list",25),t.YNc(3,Dt,10,6,"mat-list-option",45),t.qZA()()()),2&i){const e=t.oxw();t.xp6(2),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.groupFansub)}}function Zt(i,l){1&i&&t._UZ(0,"app-no-data",51)}let Rt=(()=>{class i{constructor(e,s,n,a,c,g,A,S,I,D,ie,se){this.clipboard=e,this.router=s,this.snackBar=n,this.as=a,this.ds=c,this.gs=g,this.fs=A,this.bs=S,this.us=I,this.fansub=D,this.aks=ie,this.wb=se,this.feedKomentarData=[],this.feedLikeDislikeData=[],this.feedVisitData=[],this.subsFeedKomentar=null,this.subsFeedLikeDislike=null,this.subsFeedVisit=null,this.subsGetApiKey=null,this.subsDialog=null,this.subsCreateApiKey=null,this.subsEditApiKey=null,this.subsRevokeApiKey=null,this.subsGroupGet=null,this.subsUpdateSubDomain=null,this.subsGetSubDomain=null,this.apiKey=[],this.groupFansub=[],this.totalKomentar=0,this.totalLikeDislike=0,this.totalKunjungan=0,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get ENV(){return b.N}ngOnInit(){this.gs.isBrowser&&(this.getUserFeedComment(),this.getUserFeedLikeDislike(),this.getUserFeedVisit(),this.getUserApiKey(),this.getUserGroup(),this.fs.initializeFab("arrow_forward",null,"Menuju Halaman Profile",`/user/${this.as.currentUserSubject?.value?.username}`,!1))}ngOnDestroy(){this.subsFeedKomentar?.unsubscribe(),this.subsFeedLikeDislike?.unsubscribe(),this.subsFeedVisit?.unsubscribe(),this.subsGetApiKey?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsCreateApiKey?.unsubscribe(),this.subsEditApiKey?.unsubscribe(),this.subsRevokeApiKey?.unsubscribe(),this.subsGroupGet?.unsubscribe(),this.subsUpdateSubDomain?.unsubscribe(),this.subsGetSubDomain?.unsubscribe()}getUserFeedComment(){this.bs.busy(),this.subsFeedKomentar=this.us.getUserFeedComment(this.as.currentUserSubject?.value?.username,"",1,5).subscribe({next:e=>{this.gs.log("[USER_FEED_COMMENT_SUCCESS]",e),this.totalKomentar=e.count,this.feedKomentarData=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_COMMENT_ERROR]",e,"error"),this.bs.idle()}})}getUserFeedLikeDislike(){this.bs.busy(),this.subsFeedLikeDislike=this.us.getUserFeedLikeDislike(this.as.currentUserSubject?.value?.username,"",1,5).subscribe({next:e=>{this.gs.log("[USER_FEED_LIKEDISLIKE_SUCCESS]",e),this.totalLikeDislike=e.count,this.feedLikeDislikeData=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_LIKEDISLIKE_ERROR]",e,"error"),this.bs.idle()}})}getUserFeedVisit(){this.bs.busy(),this.subsFeedVisit=this.us.getUserFeedVisit(this.as.currentUserSubject?.value?.username,"",1,5).subscribe({next:e=>{this.gs.log("[USER_FEED_VISIT_SUCCESS]",e),this.totalKunjungan=e.count,this.feedVisitData=e.results,this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_VISIT_ERROR]",e,"error"),this.bs.idle()}})}getUserApiKey(){this.bs.busy(),this.subsGetApiKey=this.aks.getUserApiKey(this.as.currentUserSubject?.value?.username).subscribe({next:e=>{this.gs.log("[USER_FEED_VISIT_SUCCESS]",e),this.apiKey=e.results[this.as.currentUserSubject?.value?.username],this.bs.idle()},error:e=>{this.gs.log("[USER_FEED_VISIT_ERROR]",e,"error"),this.bs.idle()}})}copyApiKey(e){this.clipboard.copy(e.api_key)&&this.snackBar.open("API Key :: Telah Di Salin Pada Clipboard","Ok")}generateNewApiKey(){this.subsDialog=this.ds.openInputDialog({data:{title:"Tambah API Key Baru",input:{name:{inputLabel:"Nama / Deskripsi",inputPlaceholder:`${this.as.currentUserSubject?.value?.username}_${Date.now()}`,inputValue:null,inputRequired:!0},ip_domain:{inputLabel:"Origin Tanpa http://",inputPlaceholder:"example.com; 1.1.1.1; *",inputValue:null,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Gunakan * Saja Untuk Perbolehkan Semua Dan Titik Koma ; Untuk Lebih Dari Satu"}}).afterClosed().subscribe({next:e=>{this.gs.log("[INPUT_DIALOG_CLOSED]",e),e&&(this.bs.busy(),this.subsCreateApiKey=this.aks.createApiKey({name:e.name,ip_domain:e.ip_domain}).subscribe({next:s=>{this.gs.log("[USER_CREATE_APIKEY_SUCCESS]",s),this.bs.idle(),this.getUserApiKey()},error:s=>{this.gs.log("[USER_CREATE_APIKEY_ERROR]",s,"error"),this.bs.idle(),this.getUserApiKey()}})),this.subsDialog.unsubscribe()}})}editApiKey(e){this.subsDialog=this.ds.openInputDialog({data:{title:"Ubah API Key",input:{name:{inputLabel:"Nama / Deskripsi",inputPlaceholder:e.name,inputValue:e.name,inputRequired:!0},ip_domain:{inputLabel:"Origin Tanpa http://",inputPlaceholder:e.ip_domain,inputValue:e.ip_domain,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Gunakan * Saja Untuk Perbolehkan Semua Dan Titik Koma ; Untuk Lebih Dari Satu"}}).afterClosed().subscribe({next:s=>{this.gs.log("[INPUT_DIALOG_CLOSED]",s),s&&(this.bs.busy(),this.subsEditApiKey=this.aks.editApiKey(e.id,{name:s.name,ip_domain:s.ip_domain}).subscribe({next:n=>{this.gs.log("[USER_EDIT_APIKEY_SUCCESS]",n),this.bs.idle(),this.getUserApiKey()},error:n=>{this.gs.log("[USER_EDIT_APIKEY_ERROR]",n,"error"),this.bs.idle(),this.getUserApiKey()}})),this.subsDialog.unsubscribe()}})}revokeApiKey(e){var s=this;return(0,J.Z)(function*(){s.subsDialog=(yield s.ds.openKonfirmasiDialog(`Hapus API Key -- '${e.api_key}'`,`Apakah Yakin Akan Menghapus ${e.ip_domain} ?`,!1)).afterClosed().subscribe({next:n=>{s.gs.log("[INFO_DIALOG_CLOSED]",n),!0===n&&(s.bs.busy(),s.subsRevokeApiKey=s.aks.revokeApiKey(e.id).subscribe({next:a=>{s.gs.log("[USER_REVOKE_APIKEY_SUCCESS]",a),s.bs.idle(),s.getUserApiKey()},error:a=>{s.gs.log("[USER_REVOKE_APIKEY_ERROR]",a,"error"),s.bs.idle(),s.getUserApiKey()}})),s.subsDialog.unsubscribe()}})})()}getUserGroup(){this.bs.busy(),this.subsGroupGet=this.us.getUserGroup(this.as.currentUserSubject?.value?.username).subscribe({next:e=>{this.gs.log("[USER_GROUP_LIST_SUCCESS]",e),this.groupFansub=e.results.filter(s=>s.fansub_.dns_id),this.bs.idle()},error:e=>{this.gs.log("[USER_GROUP_LIST_ERROR]",e,"error"),this.bs.idle()}})}editSubDomain(e){this.bs.busy(),this.subsGetSubDomain=this.fansub.getSubDomain(e.slug).subscribe({next:s=>{this.gs.log("[USER_FANSUB_SUBDOMAIN_SUCCESS]",s),this.bs.idle();const n=s.result;this.subsDialog=this.ds.openInputDialog({data:{title:`Ubah CNAME / A Record IP v4 v6 :: '${e.slug}'`,input:{server_target:{inputLabel:"Server Target Domain IP Publik",inputPlaceholder:"127.0.0.1 | ghs.google.com | blablabla.id.repl.co",inputValue:n.dns_id.content,inputRequired:!0},verification_name:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-name | slug-fs",inputValue:n.dns_id_alt?.name,inputRequired:!1},verification_target:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-target.dv.googlehosted.com | replit-verify=blablabla",inputValue:n.dns_id_alt?.content,inputRequired:!1}},confirmText:"OK",cancelText:"Batal",infoText:"Abaikan 2 Input Terakhir Jika Bukan Blogger / Replit"}}).afterClosed().subscribe({next:a=>{this.gs.log("[INPUT_DIALOG_CLOSED]",a),a&&(this.bs.busy(),this.subsUpdateSubDomain=this.fansub.updateSubDomain(e.slug,{server_target:a.server_target,verification_name:a.verification_name,verification_target:a.verification_target}).subscribe({next:c=>{this.gs.log("[FANSUB_UPDATE_SUBDOMAIN_SUCCESS]",c),this.bs.idle(),this.getUserGroup()},error:c=>{this.gs.log("[FANSUB_UPDATE_SUBDOMAIN_ERROR]",c,"error"),this.bs.idle(),this.getUserGroup()}})),this.subsDialog.unsubscribe()}})},error:s=>{this.gs.log("[USER_FANSUB_SUBDOMAIN_ERROR]",s,"error"),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:`Sepertinya Sub-Domain '${e.slug}' Belum Di Klaim`,htmlMessage:"Silahkan ambil sub-domain pada halaman fansub, ingin ke sana sekarang?",confirmText:"Ya",cancelText:"Tidak"},disableClose:!1}).afterClosed().subscribe({next:n=>{this.gs.log("[INFO_DIALOG_CLOSED]",n),!0===n?this.router.navigateByUrl(`/fansub/${e.slug}`):this.getUserGroup(),this.subsDialog.unsubscribe()}})}})}openComment(e){this.router.navigate([e.path],{queryParams:{comment:e.id}})}openApiDocs(){this.wb.winboxOpenUri(`${b.N.baseUrl}/api`,"_self",!0)}revokeDns(e){var s=this;return(0,J.Z)(function*(){s.subsDialog=(yield s.ds.openKonfirmasiDialog(`Hapus Sub-Domain -- '${e.slug}'`,"Apakah Yakin Ingin Menghapus / Nonaktifkan Sub-Domain ?",!1)).afterClosed().subscribe({next:n=>{s.gs.log("[INFO_DIALOG_CLOSED]",n),!0===n&&(s.bs.busy(),s.subsRevokeApiKey=s.fansub.revokeDomain(e.slug).subscribe({next:a=>{s.gs.log("[USER_REVOKE_DNS_SUCCESS]",a),s.bs.idle()},error:a=>{s.gs.log("[USER_REVOKE_DNS_ERROR]",a,"error"),s.bs.idle()}})),s.subsDialog.unsubscribe()}})})()}static#t=this.\u0275fac=function(s){return new(s||i)(t.Y36(_t.TU),t.Y36(r.F0),t.Y36(B.pl),t.Y36(Y.e),t.Y36(gt.x),t.Y36(y.U),t.Y36(F.r),t.Y36(K.z),t.Y36(P.K),t.Y36(dt.T),t.Y36(ft),t.Y36(bt.N))};static#e=this.\u0275cmp=t.Xpm({type:i,selectors:[["app-user-list"]],decls:65,vars:15,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-lg-8","col-xl-9"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"float-end","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[1,"text-bifeldy"],["class","col-12",4,"ngIf","ngIfElse"],[1,"col-lg-4","col-xl-3"],[1,"row","sticky-top"],[1,"col-12"],["matTooltip","Khusus Pengguna Terverifikasi",1,"text-bifeldy"],[1,"col-12","mb-2"],["mat-button","","color","accent","matTooltip","Buka Kotak Pesan","routerLink","/mailbox",1,"w-100"],["fontIcon","email",1,"me-1"],[1,"text-bifeldy",3,"matTooltip"],["mat-button","","color","accent",1,"w-100",3,"click"],["fontIcon","api",1,"me-1"],["fontIcon","webhook",1,"me-1"],["class","my-2 gradient-border",3,"click",4,"ngFor","ngForOf"],[1,"row","mt-4"],[1,"border-bottom-dotted"],["class","col-12 mb-2","style","max-height: 288px;",4,"ngIf","ngIfElse"],["noData",""],[3,"multiple"],["class","h-100",4,"ngFor","ngForOf"],[1,"h-100"],["fontIcon","add_comment","mat-list-icon","",1,"ps-3"],[1,"text-truncate","text-decoration-none",3,"click"],[1,"bg-bifeldy","px-2","me-1","text-danger",2,"position","absolute","right","0"],[1,"text-warning"],["fontIcon","volunteer_activism","mat-list-icon","",1,"ps-3"],[1,"text-truncate","text-decoration-none",3,"routerLink"],[1,"me-3","text-success"],[1,"me-3","text-info"],["fontIcon","directions_run","mat-list-icon","",1,"ps-3"],[1,"my-2","gradient-border",3,"click"],[1,"ps-2","pe-2","pt-2","text-truncate","my-0"],[1,"text-success"],[1,"ps-2","pe-2","pt-0","text-truncate","my-0"],[1,"ps-2","pe-2","pb-2","text-truncate","my-0"],["fontIcon","delete_sweep",1,"me-1"],[1,"col-12","mb-2",2,"max-height","288px"],[1,"h-100",2,"overflow-y","auto"],["class","h-100",3,"click",4,"ngFor","ngForOf"],[1,"h-100",3,"click"],["matListAvatar","",2,"border-radius","0",3,"src"],["mat-button","","matListAvatar","","color","accent",2,"border-radius","0",3,"click"],[1,"text-truncate","text-decoration-none"],[1,"bg-bifeldy","px-2","me-1","text-warning",2,"position","absolute","right","0"],[1,"col-12","p-3"]],template:function(s,n){if(1&s&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"span",6),t.NdJ("click",function(){return n.getUserFeedComment()}),t._uU(8," Refresh "),t.qZA(),t.TgZ(9,"b",7),t._uU(10),t.qZA()()(),t.YNc(11,Et,4,6,"div",8),t.qZA(),t.TgZ(12,"div",3)(13,"div",4)(14,"h2",5)(15,"span",6),t.NdJ("click",function(){return n.getUserFeedLikeDislike()}),t._uU(16," Refresh "),t.qZA(),t.TgZ(17,"b",7),t._uU(18),t.qZA()()(),t.YNc(19,Ct,4,6,"div",8),t.qZA(),t.TgZ(20,"div",3)(21,"div",4)(22,"h2",5)(23,"span",6),t.NdJ("click",function(){return n.getUserFeedVisit()}),t._uU(24," Refresh "),t.qZA(),t.TgZ(25,"b",7),t._uU(26),t.qZA()()(),t.YNc(27,St,4,6,"div",8),t.qZA()(),t.TgZ(28,"div",9)(29,"div",10)(30,"div",11)(31,"div",3)(32,"div",4)(33,"h2",5)(34,"b",12),t._uU(35,"Alamat Email"),t.qZA()()(),t.TgZ(36,"div",13)(37,"a",14),t._UZ(38,"mat-icon",15),t._uU(39),t.qZA()()(),t.TgZ(40,"div",3)(41,"div",4)(42,"h2",5)(43,"span",6),t.NdJ("click",function(){return n.getUserApiKey()}),t._uU(44," Refresh "),t.qZA(),t.TgZ(45,"b",16),t._uU(46,"API Key"),t.qZA()()(),t.TgZ(47,"div",13)(48,"a",17),t.NdJ("click",function(){return n.openApiDocs()}),t._UZ(49,"mat-icon",18),t._uU(50," Lihat API Endpoint "),t.qZA(),t.TgZ(51,"a",17),t.NdJ("click",function(){return n.generateNewApiKey()}),t._UZ(52,"mat-icon",19),t._uU(53," Buat API Key Baru "),t.qZA(),t.YNc(54,It,16,3,"div",20),t.qZA()(),t.TgZ(55,"div",21)(56,"div",4)(57,"h2",22)(58,"span",6),t.NdJ("click",function(){return n.getUserGroup()}),t._uU(59," Refresh "),t.qZA(),t.TgZ(60,"b",7),t._uU(61,"DNS Fansub"),t.qZA()()(),t.YNc(62,yt,4,2,"div",23),t.qZA()()()()()(),t.YNc(63,Zt,1,0,"ng-template",null,24,t.W1O)),2&s){const a=t.MAs(64);t.xp6(10),t.hij("Riwayat Komentar :: ",n.totalKomentar,""),t.xp6(1),t.Q6J("ngIf",n.feedKomentarData.length>0)("ngIfElse",a),t.xp6(7),t.hij("Riwayat Like & Dislike :: ",n.totalLikeDislike,""),t.xp6(1),t.Q6J("ngIf",n.feedLikeDislikeData.length>0)("ngIfElse",a),t.xp6(7),t.hij("Riwayat Kunjungan :: ",n.totalKunjungan,""),t.xp6(1),t.Q6J("ngIf",n.feedVisitData.length>0)("ngIfElse",a),t.xp6(12),t.AsE(" '",null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.username,"@",n.ENV.domain,"' "),t.xp6(6),t.MGl("matTooltip","Aktivitas Terakhir :: ",null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value._session_origin,""),t.xp6(9),t.Q6J("ngForOf",n.apiKey),t.xp6(8),t.Q6J("ngIf",n.groupFansub.length>0)("ngIfElse",a)}},dependencies:[p.sg,p.O5,r.rH,Z.Nr,L.Hw,T.Wx,T.ap,T.kh,T.O$,N.Kd,xt.t,vt.d,p.OU,p.uU,Ut.R]})}return i})();var Ot=o(2693),wt=o(7245),Kt=o(5643),R=o(8455),Pt=o(9203),Lt=o(7732),Nt=o(7443);function Mt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imagePhotoLimitExceeded)," !")}}function Bt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imagePhotoErrorText)}}function Ft(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",45)(1,"button",46),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitPhotoImage())}),t._UZ(2,"mat-icon",47),t._uU(3," Unggah "),t.qZA()()}if(2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Jt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Nama Tidak Boleh Kosong"),t.qZA())}function Yt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Nama Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Gt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageCoverLimitExceeded)," !")}}function qt(i,l){if(1&i&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageCoverErrorText)}}function Qt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"div",16)(1,"button",46),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitCoverImage())}),t._UZ(2,"mat-icon",47),t._uU(3," Unggah "),t.qZA()()}if(2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Ht(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Tidak Boleh Kosong"),t.qZA())}function jt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Minimal 6 Huruf"),t.qZA())}function Vt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function $t(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Minimal 6 Huruf"),t.qZA())}function zt(i,l){1&i&&(t.TgZ(0,"div"),t._uU(1,"Password Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Wt(i,l){if(1&i){const e=t.EpF();t.TgZ(0,"form",1),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",7),t._UZ(7,"img",8),t.TgZ(8,"mat-form-field",9)(9,"mat-label"),t._uU(10,"Profile Image"),t.qZA(),t.TgZ(11,"ngx-mat-file-input",10,11),t.NdJ("change",function(n){t.CHM(e);const a=t.MAs(12),c=t.oxw();return t.KtG(c.uploadPhotoImage(n,a))}),t.qZA(),t._UZ(13,"mat-icon",12),t.qZA(),t.TgZ(14,"mat-error",13)(15,"small"),t.YNc(16,Mt,3,3,"div",14),t.YNc(17,Bt,2,1,"div",14),t.qZA()()(),t.YNc(18,Ft,4,1,"div",15),t.TgZ(19,"div",16)(20,"mat-slide-toggle",17),t._uU(21," Jadikan Private, Sembunyikan Aktivitas "),t.qZA()(),t.TgZ(22,"div",18),t._uU(23," * Jika ingin mengubah "),t.TgZ(24,"i"),t._uU(25,"username"),t.qZA(),t._uU(26," silahkan menghubungi Admin menggunakan surel "),t.TgZ(27,"span",19),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.changeUname())}),t._uU(28),t.qZA()()()(),t.TgZ(29,"div",20),t._UZ(30,"div",21),t.TgZ(31,"div",22)(32,"mat-form-field",23)(33,"mat-label"),t._uU(34,"Nama Lengkap"),t.qZA(),t._UZ(35,"input",24)(36,"mat-icon",25),t.TgZ(37,"mat-error"),t.YNc(38,Jt,2,0,"div",14),t.YNc(39,Yt,2,0,"div",14),t.qZA()(),t.TgZ(40,"mat-form-field",9)(41,"mat-label"),t._uU(42,"Cover Image"),t.qZA(),t.TgZ(43,"ngx-mat-file-input",26,27),t.NdJ("change",function(n){t.CHM(e);const a=t.MAs(44),c=t.oxw();return t.KtG(c.uploadCoverImage(n,a))}),t.qZA(),t._UZ(45,"mat-icon",12),t.qZA(),t.TgZ(46,"mat-error",13)(47,"small"),t.YNc(48,Gt,3,3,"div",14),t.YNc(49,qt,2,1,"div",14),t.qZA()(),t.YNc(50,Qt,4,1,"div",28),t._UZ(51,"angular-editor",29),t.TgZ(52,"mat-form-field",30)(53,"mat-label"),t._uU(54,"Konfirmasi Kata Sandi"),t.qZA(),t._UZ(55,"input",31),t.TgZ(56,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.togglePassword())}),t._UZ(57,"mat-icon",33),t.qZA(),t.TgZ(58,"mat-error"),t.YNc(59,Ht,2,0,"div",14),t.YNc(60,jt,2,0,"div",14),t.YNc(61,Vt,2,0,"div",14),t.qZA()(),t.TgZ(62,"mat-form-field",30)(63,"mat-label"),t._uU(64,"Ubah Kata Sandi"),t.qZA(),t._UZ(65,"input",34),t.TgZ(66,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.togglePassword())}),t._UZ(67,"mat-icon",33),t.qZA(),t.TgZ(68,"mat-error"),t.YNc(69,$t,2,0,"div",14),t.YNc(70,zt,2,0,"div",14),t.qZA()()(),t.TgZ(71,"div",35)(72,"div",7)(73,"div",36),t._UZ(74,"div",37),t.TgZ(75,"div",38)(76,"a",39),t._UZ(77,"mat-icon",40),t._uU(78," Batal "),t.qZA()(),t.TgZ(79,"div",38)(80,"button",41),t._uU(81," Simpan "),t._UZ(82,"mat-icon",42),t.qZA()()()()()()()(),t._UZ(83,"div",43)(84,"div",44),t.qZA()()}if(2&i){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(7),t.s9C("src",e.image_photo,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imagePhotoLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imagePhotoErrorText),t.xp6(1),t.Q6J("ngIf",e.imagePhoto&&!e.fg.value.image_photo),t.xp6(10),t.AsE("",e.userData.username,"@",e.ENV.domain,""),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("nama").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("nama").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imageCoverLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imageCoverErrorText),t.xp6(1),t.Q6J("ngIf",e.imageCover&&!e.fg.value.image_cover),t.xp6(1),t.Q6J("config",e.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("type",e.passwordHide?"password":"text"),t.xp6(2),t.Q6J("fontIcon",e.passwordHide?"visibility_off":"visibility"),t.xp6(2),t.Q6J("ngIf",e.fg.get("old_password").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("old_password").hasError("minlength")),t.xp6(1),t.Q6J("ngIf",e.fg.get("old_password").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("type",e.passwordHide?"password":"text"),t.xp6(2),t.Q6J("fontIcon",e.passwordHide?"visibility_off":"visibility"),t.xp6(2),t.Q6J("ngIf",e.fg.get("new_password").hasError("minlength")),t.xp6(1),t.Q6J("ngIf",e.fg.get("new_password").hasError("pattern")),t.xp6(6),t.Q6J("disabled",e.submitted),t.xp6(4),t.Q6J("disabled",e.submitted||e.fg.invalid||!e.fg.dirty),t.xp6(3),t.Udp("background-image","url("+e.image_cover+")")}}const te=[{path:"",pathMatch:"full",component:Rt,canActivate:[k.t],data:{[h.t.decoratorRoles]:[d.yS.ADMIN,d.yS.MODERATOR,d.yS.FANSUBBER,d.yS.USER]}},{path:":username",children:[{path:"",pathMatch:"full",component:mt},{path:"edit",component:(()=>{class i{constructor(e,s,n,a,c,g,A,S,I,D){this.router=e,this.activatedRoute=s,this.toast=n,this.bs=a,this.us=c,this.fb=g,this.imgbb=A,this.gs=S,this.as=I,this.cs=D,this.submitted=!1,this.username=null,this.userData=null,this.imagePhoto=null,this.imagePhotoErrorText=null,this.imagePhotoLimitExceeded=null,this.image_photo=null,this.image_photo_original=null,this.imageCover=null,this.imageCoverErrorText=null,this.imageCoverLimitExceeded=null,this.image_cover=null,this.image_cover_original=null,this.passwordHide=!0,this.photoImage=null,this.coverImage=null,this.subsUserDetail=null,this.subsImgbb1=null,this.subsImgbb2=null,this.subsUserUpdate=null,this.subsVerify=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get ENV(){return b.N}get GS(){return this.gs}togglePassword(){this.passwordHide=!this.passwordHide}ngOnDestroy(){this.subsUserDetail?.unsubscribe(),this.subsImgbb1?.unsubscribe(),this.subsImgbb2?.unsubscribe(),this.subsUserUpdate?.unsubscribe(),this.subsVerify?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.username=this.activatedRoute.snapshot.paramMap.get("username"),this.bs.busy(),this.subsUserDetail=this.us.getUserData(this.username).subscribe({next:e=>{this.gs.log("[USER_DETAIL_SUCCESS]",e),this.bs.idle(),this.as.currentUserSubject?.value?.id!==e.result.id?(this.toast.warning("Profile Ini Milik Orang Lain","Whoops!",null,!0),this.router.navigateByUrl(`/user/${this.username}`)):this.initForm(e.result)},error:e=>{this.gs.log("[USER_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/user/${this.username}`}})}}))}initForm(e){this.fg=this.fb.group({nama:[e.kartu_tanda_penduduk_.nama,[u.kI.required,u.kI.pattern(/^[a-zA-Z. ]+$/)]],description:[e.profile_.description,u.kI.compose([u.kI.pattern(h.t.regexEnglishKeyboardKeys)])],old_password:[null,u.kI.compose([u.kI.required,u.kI.minLength(6),u.kI.pattern(h.t.regexEnglishKeyboardKeys)])],new_password:[null,u.kI.compose([u.kI.minLength(6),u.kI.pattern(h.t.regexEnglishKeyboardKeys)])],image_photo:[null,u.kI.compose([u.kI.pattern(h.t.regexUrl)])],image_cover:[null,u.kI.compose([u.kI.pattern(h.t.regexUrl)])],private:[e.private,u.kI.compose([u.kI.required])]}),this.image_photo=e.image_url,this.image_photo_original=this.image_photo,this.image_cover=e.profile_.cover_url,this.image_cover_original=this.image_cover,this.userData=e}uploadPhotoImage(e,s){this.photoImage=s,this.imagePhoto=null,this.imagePhotoLimitExceeded=null,this.imagePhotoErrorText=null,this.fg.controls.image_photo.patchValue(null),this.fg.controls.image_photo.markAsPristine();const n=e.target.files[0];try{const a=new FileReader;a.readAsDataURL(n),a.onload=c=>{if(this.gs.log("[IMAGE_PHOTO_SELECTED]",c),n.size<=h.t.fileSizeImageLimit){const g=this.gs.document.createElement("img");g.onload=()=>{this.imagePhoto=n,this.image_photo=a.result.toString()},g.src=a.result.toString()}else this.imagePhoto=null,this.image_photo="/assets/img/form/image-error.png",this.imagePhotoLimitExceeded=h.t.fileSizeImageLimit,this.photoImage.clear(e)}}catch{this.imagePhoto=null,this.image_photo=this.image_photo_original,this.photoImage.clear(e)}}submitPhotoImage(){this.submitted=!0,this.subsImgbb1=this.imgbb.uploadImage({file:this.imagePhoto}).subscribe({next:e=>{this.gs.log("[IMAGE_PHOTO_SUCCESS]",e),this.fg.controls.image_photo.patchValue(e.result.url),this.fg.controls.image_photo.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_PHOTO_ERROR]",e,"error"),this.fg.controls.image_photo.patchValue(null),this.fg.controls.image_photo.markAsPristine(),this.submitted=!1,this.imagePhotoErrorText=e.result?.message||e.info}})}uploadCoverImage(e,s){this.coverImage=s,this.imageCover=null,this.imageCoverLimitExceeded=null,this.imageCoverErrorText=null,this.fg.controls.image_cover.patchValue(null),this.fg.controls.image_cover.markAsPristine();const n=e.target.files[0];try{const a=new FileReader;a.readAsDataURL(n),a.onload=c=>{if(this.gs.log("[IMAGE_COVER_SELECTED]",c),n.size<=h.t.fileSizeImageLimit){const g=this.gs.document.createElement("img");g.onload=()=>{this.imageCover=n,this.image_cover=a.result.toString()},g.src=a.result.toString()}else this.imageCover=null,this.image_cover="/assets/img/form/image-error.png",this.imageCoverLimitExceeded=h.t.fileSizeImageLimit,this.coverImage.clear(e)}}catch{this.imageCover=null,this.image_cover=this.image_cover_original,this.coverImage.clear(e)}}submitCoverImage(){this.submitted=!0,this.subsImgbb2=this.imgbb.uploadImage({file:this.imageCover}).subscribe({next:e=>{this.gs.log("[IMAGE_COVER_SUCCESS]",e),this.fg.controls.image_cover.patchValue(e.result.url),this.fg.controls.image_cover.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_COVER_ERROR]",e,"error"),this.fg.controls.image_cover.patchValue(null),this.fg.controls.image_cover.markAsPristine(),this.submitted=!1,this.imageCoverErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e=this.gs.getDirtyValues(this.fg);if(e.old_password=this.cs.hashPassword(this.fg.value.old_password),"new_password"in e&&e.new_password&&(e.new_password=this.cs.hashPassword(this.fg.value.new_password)),this.gs.log("[USER_EDIT_DIRTY]",e),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsUserUpdate=this.us.updateUser(this.username,{...e}).subscribe({next:s=>{this.gs.log("[USER_EDIT_SUCCESS]",s),this.submitted=!1,this.bs.idle(),this.as.removeUser(),this.bs.busy(),this.subsVerify=this.as.verify(this.as.token).subscribe({next:n=>{this.gs.log("[VERIFY_LOGIN_SUCCESS]",n),this.bs.idle(),this.router.navigateByUrl(`/user/${this.username}`)},error:n=>{this.gs.log("[VERIFY_LOGIN_ERROR]",n,"error"),this.bs.idle(),this.as.removeUser(),this.router.navigateByUrl(`/user/${this.username}`)}})},error:s=>{this.gs.log("[USER_EDIT_ERROR]",s,"error"),this.submitted=!1,this.bs.idle()}})}changeUname(){this.router.navigate(["/create/mailbox"],{queryParams:{subject:"[ReqUName] Pengajuan Ganti Username",to:["bifeldy"].map(s=>`${s}@${b.N.domain}`).join(",")}})}static#t=this.\u0275fac=function(s){return new(s||i)(t.Y36(r.F0),t.Y36(r.gz),t.Y36(Ot.k),t.Y36(K.z),t.Y36(P.K),t.Y36(u.QS),t.Y36(wt.X),t.Y36(y.U),t.Y36(Y.e),t.Y36(Kt.$))};static#e=this.\u0275cmp=t.Xpm({type:i,selectors:[["app-user-edit"]],decls:1,vars:1,consts:[[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"container"],[1,"profile-info","align-items-center",2,"top","64px","position","relative"],[1,"row","py-3","px-2"],[1,"col-md-4","col-xl-3","p-3"],[1,"row","sticky-top","pt-3"],[1,"col-12"],[1,"w-100",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"accept","change"],["photoImage",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],[1,"col-12","py-3"],["formControlName","private","matTooltip","Hanya Tampilkan Informasi Profil"],[1,"col-12","py-3","text-warning"],[1,"text-success",2,"cursor","pointer",3,"click"],[1,"col-md-8","col-xl-9","p-3"],[1,"row","py-3","px-0","profile-height-large"],[1,"row","py-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","nama","placeholder","Nama Lengkap"],["fontIcon","wysiwyg","matSuffix",""],["placeholder","Basic Input",1,"w-100",3,"accept","change"],["coverImage",""],["class","col-12 py-3",4,"ngIf"],["formControlName","description",1,"py-3","w-100",3,"config"],["appearance","outline",1,"py-3","w-100",3,"color"],["matInput","","formControlName","old_password","required","","placeholder","Password Sekarang","autocomplete","current-password",3,"type"],["type","button","mat-icon-button","","matSuffix","",3,"click"],[3,"fontIcon"],["matInput","","formControlName","new_password","placeholder","Isi Jika Ingin Ubah Password Baru","autocomplete","new-password",3,"type"],[1,"row"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],[1,"profile-banner","profile-banner-1","align-items-center"],[1,"profile-banner","profile-banner-2","align-items-center"],[1,"col-12","mb-4"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"]],template:function(s,n){1&s&&t.YNc(0,Wt,85,33,"form",0),2&s&&t.Q6J("ngIf",n.fg)},dependencies:[p.O5,r.rH,Z.eB,Z.Nr,L.Hw,R.nI,R.v_,R.$V,R.nX,Pt.k0,Lt.iZ,N.Kd,u._Y,u.Fj,u.JJ,u.JL,u.Q7,u.sg,u.u,x.Yh,U.s6,Nt.$],styles:[".profile-banner[_ngcontent-%COMP%]{height:192px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:.75}.profile-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.profile-banner-2[_ngcontent-%COMP%]{position:absolute;top:192px;left:0}.profile-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}@media only screen and (min-width: 769px){.profile-height-large[_ngcontent-%COMP%]{height:100px}}@media only screen and (max-width: 768px){.profile-image[_ngcontent-%COMP%]{padding-top:3rem}}"]})}return i})(),canActivate:[k.t],data:{title:"User - Ubah Profil",description:"Halaman Pembaharuan Profil Pengguna",keywords:"Ubah Profil",[h.t.decoratorRoles]:[d.yS.ADMIN,d.yS.MODERATOR,d.yS.FANSUBBER,d.yS.USER]}}]}];let ee=(()=>{class i{static#t=this.\u0275fac=function(s){return new(s||i)};static#e=this.\u0275mod=t.oAB({type:i});static#i=this.\u0275inj=t.cJS({imports:[p.ez,r.Bz.forChild(te),w.m,_.$,C.L,u.u5,u.UX,x.Ad,U.UM,m.b,f.F,O.T,v.d]})}return i})()},801:(M,E,o)=>{o.d(E,{Q:()=>w});var p=o(7084),r=o(4650),u=o(9816),U=o(6895),x=o(7392),h=o(7462);function d(_,C){if(1&_&&r._UZ(0,"h3",8),2&_){const m=r.oxw().$implicit;r.Q6J("innerHTML",m.text,r.oJD)}}function k(_,C){if(1&_&&(r.TgZ(0,"mat-expansion-panel",3)(1,"mat-expansion-panel-header")(2,"mat-panel-title",4)(3,"span",5),r._uU(4),r.qZA()(),r.TgZ(5,"mat-panel-description"),r._UZ(6,"mat-icon",6),r.qZA()(),r.YNc(7,d,1,1,"ng-template",7),r.qZA()),2&_){const m=C.$implicit,f=C.first,v=r.oxw(2);r.Q6J("expanded",v.GS.isDesktop&&f),r.xp6(3),r.s9C("matTooltip",m.tooltip),r.Q6J("matTooltipPosition","above"),r.xp6(1),r.hij(" ",m.title," "),r.xp6(2),r.Q6J("fontIcon",m.icon)}}function O(_,C){if(1&_&&(r.TgZ(0,"mat-accordion",1),r.YNc(1,k,8,5,"mat-expansion-panel",2),r.qZA()),2&_){const m=r.oxw();r.xp6(1),r.Q6J("ngForOf",m.panelData)}}let w=(()=>{class _{onResize(m){this.gs.onResize(m,"MATERIAL_EXPANSION_PANEL"),this.gs.isDesktop?this.accordion.openAll():this.accordion.closeAll()}constructor(m){this.gs=m,this.panelData=[{title:"Title",icon:"warning",text:"Lorem ipsum ...",tooltip:"Info"}]}get GS(){return this.gs}ngOnInit(){}static#t=this.\u0275fac=function(f){return new(f||_)(r.Y36(u.U))};static#e=this.\u0275cmp=r.Xpm({type:_,selectors:[["app-material-expansion-panel"]],viewQuery:function(f,v){if(1&f&&r.Gf(p.pp,5),2&f){let b;r.iGM(b=r.CRH())&&(v.accordion=b.first)}},hostBindings:function(f,v){1&f&&r.NdJ("resize",function(t){return v.onResize(t)},!1,r.Jf7)},inputs:{panelData:"panelData"},decls:1,vars:1,consts:[["class","example-headers-align","multi","",4,"ngIf"],["multi","",1,"example-headers-align"],[3,"expanded",4,"ngFor","ngForOf"],[3,"expanded"],[1,"font-weight-bold"],[3,"matTooltip","matTooltipPosition"],[1,"ms-auto",3,"fontIcon"],["matExpansionPanelContent",""],[1,"m-0","text-justify",2,"white-space","pre-line !important",3,"innerHTML"]],template:function(f,v){1&f&&r.YNc(0,O,2,1,"mat-accordion",0),2&f&&r.Q6J("ngIf",v.panelData.length>0)},dependencies:[U.sg,U.O5,p.pp,p.ib,p.yz,p.yK,p.u4,p.HS,x.Hw,h.Kd]})}return _})()},9560:(M,E,o)=>{o.d(E,{$:()=>U});var p=o(6895),r=o(2314),u=o(4650);let U=(()=>{class x{static#t=this.\u0275fac=function(k){return new(k||x)};static#e=this.\u0275mod=u.oAB({type:x});static#i=this.\u0275inj=u.cJS({imports:[p.ez,r.m]})}return x})()}}]); \ No newline at end of file diff --git a/dist/main-site/browser/370.1ea0a06ad8a61453.js b/dist/main-site/browser/370.00945484f5682803.js similarity index 75% rename from dist/main-site/browser/370.1ea0a06ad8a61453.js rename to dist/main-site/browser/370.00945484f5682803.js index 0bd7766f..f902a48f 100644 --- a/dist/main-site/browser/370.1ea0a06ad8a61453.js +++ b/dist/main-site/browser/370.00945484f5682803.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[370],{1370:(Si,ye,c)=>{c.r(ye),c.d(ye,{AdminModule:()=>ki});var h=c(6895),X=c(1390),l=c(4006),V=c(4080),t=c(4650),O=c(7579),w=c(727),je=c(6451),L=c(3238),u=c(9521),se=c(5698),oe=c(8675),Qe=c(2722),$e=c(8372),ze=c(9300),W=c(3353),H=c(445),F=c(4859),le=c(2687),q=c(8184),Xe=c(5589),P=c(1281),Me=c(9549),p=c(7340),de=c(284),Y=c(7392);const We=["ngx-mat-calendar-body",""];function et(n,o){if(1&n&&(t.TgZ(0,"tr",3)(1,"td",4),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Udp("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),t.uIk("colspan",e.numCols),t.xp6(1),t.hij(" ",e.label," ")}}function tt(n,o){if(1&n&&(t.TgZ(0,"td",4),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.Udp("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),t.uIk("colspan",e._firstRowOffset),t.xp6(1),t.hij(" ",e._firstRowOffset>=e.labelMinRequiredCells?e.label:""," ")}}function at(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td",8)(1,"button",9),t.NdJ("click",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d._cellClicked(s,i))})("focus",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d._emitActiveDateChange(s,i))}),t.TgZ(2,"span",10),t._uU(3),t.qZA(),t._UZ(4,"span",11),t.qZA()()}if(2&n){const e=o.$implicit,a=o.index,i=t.oxw().index,r=t.oxw();t.Udp("width",r._cellWidth)("padding-top",r._cellPadding)("padding-bottom",r._cellPadding),t.uIk("data-mat-row",i)("data-mat-col",a),t.xp6(1),t.ekj("mat-calendar-body-disabled",!e.enabled)("mat-calendar-body-active",r._isActiveCell(i,a))("mat-calendar-body-range-start",r._isRangeStart(e.compareValue))("mat-calendar-body-range-end",r._isRangeEnd(e.compareValue))("mat-calendar-body-in-range",r._isInRange(e.compareValue))("mat-calendar-body-comparison-bridge-start",r._isComparisonBridgeStart(e.compareValue,i,a))("mat-calendar-body-comparison-bridge-end",r._isComparisonBridgeEnd(e.compareValue,i,a))("mat-calendar-body-comparison-start",r._isComparisonStart(e.compareValue))("mat-calendar-body-comparison-end",r._isComparisonEnd(e.compareValue))("mat-calendar-body-in-comparison-range",r._isInComparisonRange(e.compareValue))("mat-calendar-body-preview-start",r._isPreviewStart(e.compareValue))("mat-calendar-body-preview-end",r._isPreviewEnd(e.compareValue))("mat-calendar-body-in-preview",r._isInPreview(e.compareValue)),t.Q6J("ngClass",e.cssClasses)("tabindex",r._isActiveCell(i,a)?0:-1),t.uIk("aria-label",e.ariaLabel)("aria-disabled",!e.enabled||null)("aria-pressed",r._isSelected(e.compareValue))("aria-current",r.todayValue===e.compareValue?"date":null)("aria-describedby",r._getDescribedby(e.compareValue)),t.xp6(1),t.ekj("mat-calendar-body-selected",r._isSelected(e.compareValue))("mat-calendar-body-comparison-identical",r._isComparisonIdentical(e.compareValue))("mat-calendar-body-today",r.todayValue===e.compareValue),t.xp6(1),t.hij(" ",e.displayValue," ")}}function it(n,o){if(1&n&&(t.TgZ(0,"tr",5),t.YNc(1,tt,2,6,"td",6),t.YNc(2,at,5,48,"td",7),t.qZA()),2&n){const e=o.$implicit,a=o.index,i=t.oxw();t.xp6(1),t.Q6J("ngIf",0===a&&i._firstRowOffset),t.xp6(1),t.Q6J("ngForOf",e)}}function nt(n,o){if(1&n&&(t.TgZ(0,"th",5)(1,"span",6),t._uU(2),t.qZA(),t.TgZ(3,"span",7),t._uU(4),t.qZA()()),2&n){const e=o.$implicit;t.xp6(2),t.Oqu(e.long),t.xp6(2),t.Oqu(e.narrow)}}const ke=["*"];function rt(n,o){}function st(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-mat-month-view",5),t.NdJ("activeDateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.activeDate=i)})("_userSelection",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._dateSelected(i))})("dragStarted",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._dragStarted(i))})("dragEnded",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._dragEnded(i))}),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)("comparisonStart",e.comparisonStart)("comparisonEnd",e.comparisonEnd)("startDateAccessibleName",e.startDateAccessibleName)("endDateAccessibleName",e.endDateAccessibleName)("activeDrag",e._activeDrag)}}function ot(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-mat-year-view",6),t.NdJ("activeDateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.activeDate=i)})("monthSelected",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._monthSelectedInYearView(i))})("selectedChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._goToDateInView(i,"month"))}),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function lt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-mat-multi-year-view",7),t.NdJ("activeDateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.activeDate=i)})("yearSelected",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._yearSelectedInMultiYearView(i))})("selectedChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._goToDateInView(i,"year"))}),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function dt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"button",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.change("second",!0))}),t.TgZ(2,"mat-icon"),t._uU(3,"expand_less"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.disabled||e.disableMinute)}}function ct(n,o){1&n&&t._UZ(0,"td",6)}function ut(n,o){1&n&&t._UZ(0,"td")}function ht(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td")(2,"button",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("hour",!0))}),t.TgZ(3,"mat-icon"),t._uU(4,"expand_less"),t.qZA()()(),t._UZ(5,"td"),t.TgZ(6,"td")(7,"button",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("minute",!0))}),t.TgZ(8,"mat-icon"),t._uU(9,"expand_less"),t.qZA()()(),t._UZ(10,"td"),t.YNc(11,dt,4,1,"td",3),t.YNc(12,ct,1,0,"td",8),t.YNc(13,ut,1,0,"td",3),t.qZA()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("disabled",e.disabled),t.xp6(5),t.Q6J("disabled",e.disabled||e.disableMinute),t.xp6(4),t.Q6J("ngIf",e.showSeconds),t.xp6(1),t.Q6J("ngIf",e.enableMeridian),t.xp6(1),t.Q6J("ngIf",e.enableMeridian)}}function pt(n,o){1&n&&(t.TgZ(0,"td",6),t._uU(1,":"),t.qZA())}function mt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"mat-form-field",4)(2,"input",11),t.NdJ("input",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formatInput(i.target))})("keydown.ArrowUp",function(i){return t.CHM(e),t.oxw().change("second",!0),t.KtG(i.preventDefault())})("keydown.ArrowDown",function(i){return t.CHM(e),t.oxw().change("second",!1),t.KtG(i.preventDefault())})("blur",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("second"))}),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("color",e.color)}}function gt(n,o){1&n&&t._UZ(0,"td",6)}function _t(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td",12)(1,"button",13),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.toggleMeridian())}),t._uU(2),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("color",e.color)("disabled",e.disabled),t.xp6(1),t.hij(" ",e.meridian," ")}}function ft(n,o){1&n&&t._UZ(0,"td")}function bt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.change("second",!1))}),t.TgZ(2,"mat-icon"),t._uU(3,"expand_more"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.disabled||e.disableMinute)}}function vt(n,o){1&n&&t._UZ(0,"td",6)}function Dt(n,o){1&n&&t._UZ(0,"td")}function Ct(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td")(2,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("hour",!1))}),t.TgZ(3,"mat-icon"),t._uU(4,"expand_more"),t.qZA()()(),t._UZ(5,"td"),t.TgZ(6,"td")(7,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("minute",!1))}),t.TgZ(8,"mat-icon"),t._uU(9,"expand_more"),t.qZA()()(),t.YNc(10,ft,1,0,"td",3),t.YNc(11,bt,4,1,"td",3),t.YNc(12,vt,1,0,"td",8),t.YNc(13,Dt,1,0,"td",3),t.qZA()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("disabled",e.disabled),t.xp6(5),t.Q6J("disabled",e.disabled||e.disableMinute),t.xp6(3),t.Q6J("ngIf",e.showSeconds),t.xp6(1),t.Q6J("ngIf",e.showSeconds),t.xp6(1),t.Q6J("ngIf",e.enableMeridian),t.xp6(1),t.Q6J("ngIf",e.enableMeridian)}}function At(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"ngx-mat-timepicker",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r._modelTime=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onTimeChanged(i))}),t.qZA()()}if(2&n){const e=t.oxw(2);t.ekj("disable-seconds",!e.datepicker._showSeconds),t.xp6(1),t.Q6J("showSpinners",e.datepicker._showSpinners)("showSeconds",e.datepicker._showSeconds)("disabled",e.datepicker._disabled||!e._modelTime)("stepHour",e.datepicker._stepHour)("stepMinute",e.datepicker._stepMinute)("stepSecond",e.datepicker._stepSecond)("ngModel",e._modelTime)("color",e.datepicker._color)("enableMeridian",e.datepicker._enableMeridian)("disableMinute",e.datepicker._disableMinute)}}function xt(n,o){if(1&n&&(t.ynx(0),t.YNc(1,At,2,12,"div",5),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.datepicker._hideTime)}}function yt(n,o){}function Mt(n,o){1&n&&(t.TgZ(0,"div",0),t.Hsn(1),t.qZA())}const N=new t.OlP("ngx-mat-date-formats");class m extends L._A{isSameTime(o,e){return null==o||null==e||this.getHour(o)===this.getHour(e)&&this.getMinute(o)===this.getMinute(e)&&this.getSecond(o)===this.getSecond(e)}copyTime(o,e){this.setHour(o,this.getHour(e)),this.setMinute(o,this.getMinute(e)),this.setSecond(o,this.getSecond(e))}compareDateWithTime(o,e,a){let i=super.compareDate(o,e)||this.getHour(o)-this.getHour(e)||this.getMinute(o)-this.getMinute(e);return a&&(i=i||this.getSecond(o)-this.getSecond(e)),i}setTimeByDefaultValues(o,e){if(!Array.isArray(e))throw Error("@Input DefaultTime should be an array");this.setHour(o,e[0]||0),this.setMinute(o,e[1]||0),this.setSecond(o,e[2]||0)}}class b{constructor(o,e){this.start=o,this.end=e}}let E=(()=>{class n{constructor(e,a){this.selection=e,this._adapter=a,this._selectionChanged=new O.x,this.selectionChanged=this._selectionChanged,this.selection=e}updateSelection(e,a){const i=this.selection;this.selection=e,this._selectionChanged.next({selection:e,source:a,oldValue:i})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}}return n.\u0275fac=function(e){t.$Z()},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})(),kt=(()=>{class n extends E{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return null!=this.selection&&this._isValidDateInstance(this.selection)}isComplete(){return null!=this.selection}clone(){const e=new n(this._adapter);return e.updateSelection(this.selection,this),e}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(m))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})();const Te={provide:E,deps:[[new t.FiY,new t.tp0,E],m],useFactory:function St(n,o){return n||new kt(o)}};function x(n){return Error(`NgxMatDatetimePicker: No provider found for ${n}. You must import one of the following modules at your application root: NgxMatNativeDateModule, NgxMatMomentDateModule, or provide a custom implementation.`)}new t.FiY,new t.tp0;class ce{constructor(o,e,a,i,r={},s=o,d){this.value=o,this.displayValue=e,this.ariaLabel=a,this.enabled=i,this.cssClasses=r,this.compareValue=s,this.rawValue=d}}let wt=1,U=(()=>{class n{constructor(e,a){this._elementRef=e,this._ngZone=a,this._platform=(0,t.f3M)(W.t4),this._focusActiveCellAfterViewChecked=!1,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new t.vpe,this.previewChange=new t.vpe,this.activeDateChange=new t.vpe,this.dragStarted=new t.vpe,this.dragEnded=new t.vpe,this._didDragSinceMouseDown=!1,this._enterHandler=i=>{if(this._skipNextFocus&&"focus"===i.type)this._skipNextFocus=!1;else if(i.target&&this.isRange){const r=this._getCellFromElement(i.target);r&&this._ngZone.run(()=>this.previewChange.emit({value:r.enabled?r:null,event:i}))}},this._touchmoveHandler=i=>{if(!this.isRange)return;const r=Se(i),s=r?this._getCellFromElement(r):null;r!==i.target&&(this._didDragSinceMouseDown=!0),he(i.target)&&i.preventDefault(),this._ngZone.run(()=>this.previewChange.emit({value:s?.enabled?s:null,event:i}))},this._leaveHandler=i=>{null!==this.previewEnd&&this.isRange&&("blur"!==i.type&&(this._didDragSinceMouseDown=!0),i.target&&this._getCellFromElement(i.target)&&(!i.relatedTarget||!this._getCellFromElement(i.relatedTarget))&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:i})))},this._mousedownHandler=i=>{if(!this.isRange)return;this._didDragSinceMouseDown=!1;const r=i.target&&this._getCellFromElement(i.target);!r||!this._isInRange(r.rawValue)||this._ngZone.run(()=>{this.dragStarted.emit({value:r.rawValue,event:i})})},this._mouseupHandler=i=>{if(!this.isRange)return;const r=he(i.target);r?r.closest(".mat-calendar-body")===this._elementRef.nativeElement&&this._ngZone.run(()=>{const s=this._getCellFromElement(r);this.dragEnded.emit({value:s?.rawValue??null,event:i})}):this._ngZone.run(()=>{this.dragEnded.emit({value:null,event:i})})},this._touchendHandler=i=>{const r=Se(i);r&&this._mouseupHandler({target:r})},this._id="mat-calendar-body-"+wt++,this._startDateLabelId=`${this._id}-start-date`,this._endDateLabelId=`${this._id}-end-date`,a.runOutsideAngular(()=>{const i=e.nativeElement;i.addEventListener("mouseenter",this._enterHandler,!0),i.addEventListener("touchmove",this._touchmoveHandler,!0),i.addEventListener("focus",this._enterHandler,!0),i.addEventListener("mouseleave",this._leaveHandler,!0),i.addEventListener("blur",this._leaveHandler,!0),i.addEventListener("mousedown",this._mousedownHandler),i.addEventListener("touchstart",this._mousedownHandler),this._platform.isBrowser&&(window.addEventListener("mouseup",this._mouseupHandler),window.addEventListener("touchend",this._touchendHandler))})}ngAfterViewChecked(){this._focusActiveCellAfterViewChecked&&(this._focusActiveCell(),this._focusActiveCellAfterViewChecked=!1)}_cellClicked(e,a){this._didDragSinceMouseDown||e.enabled&&this.selectedValueChange.emit({value:e.value,event:a})}_emitActiveDateChange(e,a){e.enabled&&this.activeDateChange.emit({value:e.value,event:a})}_isSelected(e){return this.startValue===e||this.endValue===e}ngOnChanges(e){const a=e.numCols,{rows:i,numCols:r}=this;(e.rows||a)&&(this._firstRowOffset=i&&i.length&&i[0].length?r-i[0].length:0),(e.cellAspectRatio||a||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/r+"%"),(a||!this._cellWidth)&&(this._cellWidth=100/r+"%")}ngOnDestroy(){const e=this._elementRef.nativeElement;e.removeEventListener("mouseenter",this._enterHandler,!0),e.removeEventListener("touchmove",this._touchmoveHandler,!0),e.removeEventListener("focus",this._enterHandler,!0),e.removeEventListener("mouseleave",this._leaveHandler,!0),e.removeEventListener("blur",this._leaveHandler,!0),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("touchstart",this._mousedownHandler),this._platform.isBrowser&&(window.removeEventListener("mouseup",this._mouseupHandler),window.removeEventListener("touchend",this._touchendHandler))}_isActiveCell(e,a){let i=e*this.numCols+a;return e&&(i-=this._firstRowOffset),i==this.activeCell}_focusActiveCell(e=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe((0,se.q)(1)).subscribe(()=>{setTimeout(()=>{const a=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");a&&(e||(this._skipNextFocus=!0),a.focus())})})})}_scheduleFocusActiveCellAfterViewChecked(){this._focusActiveCellAfterViewChecked=!0}_isRangeStart(e){return pe(e,this.startValue,this.endValue)}_isRangeEnd(e){return me(e,this.startValue,this.endValue)}_isInRange(e){return ge(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return pe(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,a,i){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let r=this.rows[a][i-1];if(!r){const s=this.rows[a-1];r=s&&s[s.length-1]}return r&&!this._isRangeEnd(r.compareValue)}_isComparisonBridgeEnd(e,a,i){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let r=this.rows[a][i+1];if(!r){const s=this.rows[a+1];r=s&&s[0]}return r&&!this._isRangeStart(r.compareValue)}_isComparisonEnd(e){return me(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return ge(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(e){return this.comparisonStart===this.comparisonEnd&&e===this.comparisonStart}_isPreviewStart(e){return pe(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return me(e,this.previewStart,this.previewEnd)}_isInPreview(e){return ge(e,this.previewStart,this.previewEnd,this.isRange)}_getDescribedby(e){return this.isRange?this.startValue===e&&this.endValue===e?`${this._startDateLabelId} ${this._endDateLabelId}`:this.startValue===e?this._startDateLabelId:this.endValue===e?this._endDateLabelId:null:null}_getCellFromElement(e){const a=he(e);if(a){const i=a.getAttribute("data-mat-row"),r=a.getAttribute("data-mat-col");if(i&&r)return this.rows[parseInt(i)][parseInt(r)]}return null}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(t.R0b))},n.\u0275cmp=t.Xpm({type:n,selectors:[["","ngx-mat-calendar-body",""]],hostAttrs:[1,"ngx-mat-calendar-body"],inputs:{label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",previewStart:"previewStart",previewEnd:"previewEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange",activeDateChange:"activeDateChange",dragStarted:"dragStarted",dragEnded:"dragEnded"},exportAs:["matCalendarBody"],features:[t.TTD],attrs:We,decls:6,vars:6,consts:[["aria-hidden","true",4,"ngIf"],["role","row",4,"ngFor","ngForOf"],[1,"mat-calendar-body-hidden-label",3,"id"],["aria-hidden","true"],[1,"mat-calendar-body-label"],["role","row"],["class","mat-calendar-body-label",3,"paddingTop","paddingBottom",4,"ngIf"],["role","gridcell","class","mat-calendar-body-cell-container",3,"width","paddingTop","paddingBottom",4,"ngFor","ngForOf"],["role","gridcell",1,"mat-calendar-body-cell-container"],["type","button",1,"mat-calendar-body-cell",3,"ngClass","tabindex","click","focus"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],["aria-hidden","true",1,"mat-calendar-body-cell-preview"]],template:function(e,a){1&e&&(t.YNc(0,et,3,6,"tr",0),t.YNc(1,it,3,2,"tr",1),t.TgZ(2,"label",2),t._uU(3),t.qZA(),t.TgZ(4,"label",2),t._uU(5),t.qZA()),2&e&&(t.Q6J("ngIf",a._firstRowOffset=o&&n===e}function ge(n,o,e,a){return a&&null!==o&&null!==e&&o!==e&&n>=o&&n<=e}function Se(n){const o=n.changedTouches[0];return document.elementFromPoint(o.clientX,o.clientY)}const ee=new t.OlP("NGX_MAT_DATE_RANGE_SELECTION_STRATEGY");new t.FiY,new t.tp0;let Ie=(()=>{class n{constructor(e,a,i,r,s){if(this._changeDetectorRef=e,this._dateFormats=a,this._dateAdapter=i,this._dir=r,this._rangeStrategy=s,this._rerenderSubscription=w.w0.EMPTY,this.activeDrag=null,this.selectedChange=new t.vpe,this._userSelection=new t.vpe,this.dragStarted=new t.vpe,this.dragEnded=new t.vpe,this.activeDateChange=new t.vpe,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){const a=this._activeDate,i=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(i,this.minDate,this.maxDate),this._hasSameMonthAndYear(a,this._activeDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setRanges(this._selected)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,oe.O)(null)).subscribe(()=>this._init())}ngOnChanges(e){const a=e.comparisonStart||e.comparisonEnd;a&&!a.firstChange&&this._setRanges(this.selected),e.activeDrag&&!this.activeDrag&&this._clearPreview()}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(e){const a=e.value,i=this._getDateFromDayOfMonth(a);let r,s;this._selected instanceof b?(r=this._getDateInCurrentMonth(this._selected.start),s=this._getDateInCurrentMonth(this._selected.end)):r=s=this._getDateInCurrentMonth(this._selected),(r!==a||s!==a)&&this.selectedChange.emit(i),this._userSelection.emit({value:i,event:e.event}),this._clearPreview(),this._changeDetectorRef.markForCheck()}_updateActiveDate(e){const i=this._activeDate;this.activeDate=this._getDateFromDayOfMonth(e.value),this._dateAdapter.compareDate(i,this.activeDate)&&this.activeDateChange.emit(this._activeDate)}_handleCalendarBodyKeydown(e){const a=this._activeDate,i=this._isRtl();switch(e.keyCode){case u.oh:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,i?1:-1);break;case u.SV:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,i?-1:1);break;case u.LH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case u.JH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case u.Sd:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case u.uR:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case u.Ku:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case u.VM:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case u.K5:case u.L_:return this._selectionKeyPressed=!0,void(this._canSelect(this._activeDate)&&e.preventDefault());case u.hY:return void(null!=this._previewEnd&&!(0,u.Vb)(e)&&(this._clearPreview(),this.activeDrag?this.dragEnded.emit({value:null,event:e}):(this.selectedChange.emit(null),this._userSelection.emit({value:null,event:e})),e.preventDefault(),e.stopPropagation()));default:return}this._dateAdapter.compareDate(a,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===u.L_||e.keyCode===u.K5)&&(this._selectionKeyPressed&&this._canSelect(this._activeDate)&&this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(e){this._matCalendarBody._focusActiveCell(e)}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_previewChanged({event:e,value:a}){if(this._rangeStrategy){const i=a?a.rawValue:null,r=this._rangeStrategy.createPreview(i,this.selected,e);if(this._previewStart=this._getCellCompareValue(r.start),this._previewEnd=this._getCellCompareValue(r.end),this.activeDrag&&i){const s=this._rangeStrategy.createDrag?.(this.activeDrag.value,this.selected,i,e);s&&(this._previewStart=this._getCellCompareValue(s.start),this._previewEnd=this._getCellCompareValue(s.end))}this._changeDetectorRef.detectChanges()}}_dragEnded(e){if(this.activeDrag)if(e.value){const a=this._rangeStrategy?.createDrag?.(this.activeDrag.value,this.selected,e.value,e.event);this.dragEnded.emit({value:a??null,event:e.event})}else this.dragEnded.emit({value:null,event:e.event})}_getDateFromDayOfMonth(e){return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),e)}_initWeekdays(){const e=this._dateAdapter.getFirstDayOfWeek(),a=this._dateAdapter.getDayOfWeekNames("narrow");let r=this._dateAdapter.getDayOfWeekNames("long").map((s,d)=>({long:s,narrow:a[d]}));this._weekdays=r.slice(e).concat(r.slice(0,e))}_createWeekCells(){const e=this._dateAdapter.getNumDaysInMonth(this.activeDate),a=this._dateAdapter.getDateNames();this._weeks=[[]];for(let i=0,r=this._firstWeekOffset;i=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(e))}_getDateInCurrentMonth(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null}_hasSameMonthAndYear(e,a){return!(!e||!a||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(a)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(a))}_getCellCompareValue(e){if(e){const a=this._dateAdapter.getYear(e),i=this._dateAdapter.getMonth(e),r=this._dateAdapter.getDate(e);return new Date(a,i,r).getTime()}return null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setRanges(e){e instanceof b?(this._rangeStart=this._getCellCompareValue(e.start),this._rangeEnd=this._getCellCompareValue(e.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(e),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}_canSelect(e){return!this.dateFilter||this.dateFilter(e)}_clearPreview(){this._previewStart=this._previewEnd=null}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.sBO),t.Y36(N,8),t.Y36(m,8),t.Y36(H.Is,8),t.Y36(ee,8))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-month-view"]],viewQuery:function(e,a){if(1&e&&t.Gf(U,5),2&e){let i;t.iGM(i=t.CRH())&&(a._matCalendarBody=i.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName",activeDrag:"activeDrag"},outputs:{selectedChange:"selectedChange",_userSelection:"_userSelection",dragStarted:"dragStarted",dragEnded:"dragEnded",activeDateChange:"activeDateChange"},exportAs:["ngxMatMonthView"],features:[t.TTD],decls:7,vars:15,consts:[["role","grid",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["scope","col",4,"ngFor","ngForOf"],["aria-hidden","true","colspan","7",1,"mat-calendar-table-header-divider"],["ngx-mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","comparisonStart","comparisonEnd","previewStart","previewEnd","isRange","labelMinRequiredCells","activeCell","startDateAccessibleName","endDateAccessibleName","selectedValueChange","activeDateChange","previewChange","dragStarted","dragEnded","keyup","keydown"],["scope","col"],[1,"cdk-visually-hidden"],["aria-hidden","true"]],template:function(e,a){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr"),t.YNc(3,nt,5,2,"th",2),t.qZA(),t.TgZ(4,"tr"),t._UZ(5,"th",3),t.qZA()(),t.TgZ(6,"tbody",4),t.NdJ("selectedValueChange",function(r){return a._dateSelected(r)})("activeDateChange",function(r){return a._updateActiveDate(r)})("previewChange",function(r){return a._previewChanged(r)})("dragStarted",function(r){return a.dragStarted.emit(r)})("dragEnded",function(r){return a._dragEnded(r)})("keyup",function(r){return a._handleCalendarBodyKeyup(r)})("keydown",function(r){return a._handleCalendarBodyKeydown(r)}),t.qZA()()),2&e&&(t.xp6(3),t.Q6J("ngForOf",a._weekdays),t.xp6(3),t.Q6J("label",a._monthLabel)("rows",a._weeks)("todayValue",a._todayDate)("startValue",a._rangeStart)("endValue",a._rangeEnd)("comparisonStart",a._comparisonRangeStart)("comparisonEnd",a._comparisonRangeEnd)("previewStart",a._previewStart)("previewEnd",a._previewEnd)("isRange",a._isRange)("labelMinRequiredCells",3)("activeCell",a._dateAdapter.getDate(a.activeDate)-1)("startDateAccessibleName",a.startDateAccessibleName)("endDateAccessibleName",a.endDateAccessibleName))},dependencies:[h.sg,U],encapsulation:2,changeDetection:0}),n})();const v=24;let we=(()=>{class n{constructor(e,a,i){if(this._changeDetectorRef=e,this._dateAdapter=a,this._dir=i,this._rerenderSubscription=w.w0.EMPTY,this.selectedChange=new t.vpe,this.yearSelected=new t.vpe,this.activeDateChange=new t.vpe,!this._dateAdapter)throw x("NgxMatDateAdapter");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate;const i=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(i,this.minDate,this.maxDate),Ne(this._dateAdapter,a,this._activeDate,this.minDate,this.maxDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedYear(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,oe.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());const a=this._dateAdapter.getYear(this._activeDate)-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let i=0,r=[];ithis._createCellForYear(s))),r=[]);this._changeDetectorRef.markForCheck()}_yearSelected(e){const a=e.value,i=this._dateAdapter.createDate(a,0,1),r=this._getDateFromYear(a);this.yearSelected.emit(i),this.selectedChange.emit(r)}_updateActiveDate(e){const i=this._activeDate;this.activeDate=this._getDateFromYear(e.value),this._dateAdapter.compareDate(i,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){const a=this._activeDate,i=this._isRtl();switch(e.keyCode){case u.oh:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,i?1:-1);break;case u.SV:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,i?-1:1);break;case u.LH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case u.JH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case u.Sd:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case u.uR:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,v-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case u.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10*-v:-v);break;case u.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10*v:v);break;case u.K5:case u.L_:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked(),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===u.L_||e.keyCode===u.K5)&&(this._selectionKeyPressed&&this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_getActiveCell(){return G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getDateFromYear(e){const a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,a,1));return this._dateAdapter.createDate(e,a,Math.min(this._dateAdapter.getDate(this.activeDate),i))}_createCellForYear(e){const a=this._dateAdapter.createDate(e,0,1),i=this._dateAdapter.getYearName(a),r=this.dateClass?this.dateClass(a,"multi-year"):void 0;return new ce(e,i,i,this._shouldEnableYear(e),r)}_shouldEnableYear(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e{class n{constructor(e,a,i,r){if(this._changeDetectorRef=e,this._dateFormats=a,this._dateAdapter=i,this._dir=r,this._rerenderSubscription=w.w0.EMPTY,this.selectedChange=new t.vpe,this.monthSelected=new t.vpe,this.activeDateChange=new t.vpe,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate;const i=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(i,this.minDate,this.maxDate),this._dateAdapter.getYear(a)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedMonth(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,oe.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(e){const a=e.value,i=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),a,1);this.monthSelected.emit(i);const r=this._getDateFromMonth(a);this.selectedChange.emit(r)}_updateActiveDate(e){const i=this._activeDate;this.activeDate=this._getDateFromMonth(e.value),this._dateAdapter.compareDate(i,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){const a=this._activeDate,i=this._isRtl();switch(e.keyCode){case u.oh:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,i?1:-1);break;case u.SV:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,i?-1:1);break;case u.LH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case u.JH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case u.Sd:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case u.uR:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case u.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case u.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case u.K5:case u.L_:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===u.L_||e.keyCode===u.K5)&&(this._selectionKeyPressed&&this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(a=>a.map(i=>this._createCellForMonth(i,e[i]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getMonthInCurrentYear(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null}_getDateFromMonth(e){const a=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),i=this._dateAdapter.getNumDaysInMonth(a);return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),i))}_createCellForMonth(e,a){const i=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),r=this._dateAdapter.format(i,this._dateFormats.display.monthYearA11yLabel),s=this.dateClass?this.dateClass(i,"year"):void 0;return new ce(e,a.toLocaleUpperCase(),r,this._shouldEnableMonth(e),s)}_shouldEnableMonth(e){const a=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(a,e)||this._isYearAndMonthBeforeMinDate(a,e))return!1;if(!this.dateFilter)return!0;for(let r=this._dateAdapter.createDate(a,e,1);this._dateAdapter.getMonth(r)==e;r=this._dateAdapter.addCalendarDays(r,1))if(this.dateFilter(r))return!0;return!1}_isYearAndMonthAfterMaxDate(e,a){if(this.maxDate){const i=this._dateAdapter.getYear(this.maxDate),r=this._dateAdapter.getMonth(this.maxDate);return e>i||e===i&&a>r}return!1}_isYearAndMonthBeforeMinDate(e,a){if(this.minDate){const i=this._dateAdapter.getYear(this.minDate),r=this._dateAdapter.getMonth(this.minDate);return e{class n{constructor(){this.changes=new O.x,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 24 years",this.nextMultiYearLabel="Next 24 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year",this.startDateLabel="Start date",this.endDateLabel="End date"}formatYearRange(e,a){return`${e} \u2013 ${a}`}formatYearRangeLabel(e,a){return`${e} to ${a}`}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Ot=1,Lt=(()=>{class n{constructor(e,a,i,r,s){this._intl=e,this.calendar=a,this._dateAdapter=i,this._dateFormats=r,this._id="mat-calendar-header-"+Ot++,this._periodButtonLabelId=`${this._id}-period-label`,this.calendar.stateChanges.subscribe(()=>s.markForCheck())}get periodButtonText(){return"month"==this.calendar.currentView?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():"year"==this.calendar.currentView?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRange(...this._formatMinAndMaxYearLabels())}get periodButtonDescription(){return"month"==this.calendar.currentView?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():"year"==this.calendar.currentView?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRangeLabel(...this._formatMinAndMaxYearLabels())}get periodButtonLabel(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel}get prevButtonLabel(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]}get nextButtonLabel(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]}currentPeriodClicked(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"}previousClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-v)}nextClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:v)}previousEnabled(){return!this.calendar.minDate||!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate)}nextEnabled(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)}_isSameView(e,a){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(a):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a):Ne(this._dateAdapter,e,a,this.calendar.minDate,this.calendar.maxDate)}_formatMinAndMaxYearLabels(){const a=this._dateAdapter.getYear(this.calendar.activeDate)-G(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),i=a+v-1;return[this._dateAdapter.getYearName(this._dateAdapter.createDate(a,0,1)),this._dateAdapter.getYearName(this._dateAdapter.createDate(i,0,1))]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(te),t.Y36((0,t.Gpc)(()=>be)),t.Y36(m,8),t.Y36(N,8),t.Y36(t.sBO))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-calendar-header"]],exportAs:["ngxMatCalendarHeader"],ngContentSelectors:ke,decls:13,vars:11,consts:[[1,"mat-calendar-header"],[1,"mat-calendar-controls"],["mat-button","","type","button","aria-live","polite",1,"mat-calendar-period-button",3,"click"],["aria-hidden","true"],["viewBox","0 0 10 5","focusable","false","aria-hidden","true",1,"mat-calendar-arrow"],["points","0,0 5,5 10,0"],[1,"mat-calendar-spacer"],["mat-icon-button","","type","button",1,"mat-calendar-previous-button",3,"disabled","click"],["mat-icon-button","","type","button",1,"mat-calendar-next-button",3,"disabled","click"],[1,"mat-calendar-hidden-label",3,"id"]],template:function(e,a){1&e&&(t.F$t(),t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return a.currentPeriodClicked()}),t.TgZ(3,"span",3),t._uU(4),t.qZA(),t.O4$(),t.TgZ(5,"svg",4),t._UZ(6,"polygon",5),t.qZA()(),t.kcU(),t._UZ(7,"div",6),t.Hsn(8),t.TgZ(9,"button",7),t.NdJ("click",function(){return a.previousClicked()}),t.qZA(),t.TgZ(10,"button",8),t.NdJ("click",function(){return a.nextClicked()}),t.qZA()()(),t.TgZ(11,"label",9),t._uU(12),t.qZA()),2&e&&(t.xp6(2),t.uIk("aria-label",a.periodButtonLabel)("aria-describedby",a._periodButtonLabelId),t.xp6(2),t.Oqu(a.periodButtonText),t.xp6(1),t.ekj("mat-calendar-invert","month"!==a.calendar.currentView),t.xp6(4),t.Q6J("disabled",!a.previousEnabled()),t.uIk("aria-label",a.prevButtonLabel),t.xp6(1),t.Q6J("disabled",!a.nextEnabled()),t.uIk("aria-label",a.nextButtonLabel),t.xp6(1),t.Q6J("id",a._periodButtonLabelId),t.xp6(1),t.Oqu(a.periodButtonDescription))},dependencies:[F.lW,F.RK],encapsulation:2,changeDetection:0}),n})(),be=(()=>{class n{constructor(e,a,i,r){if(this._dateAdapter=a,this._dateFormats=i,this._changeDetectorRef=r,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new t.vpe,this.yearSelected=new t.vpe,this.monthSelected=new t.vpe,this.viewChanged=new t.vpe(!0),this._userSelection=new t.vpe,this._userDragDrop=new t.vpe,this._activeDrag=null,this.stateChanges=new O.x,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._intlChanges=e.changes.subscribe(()=>{r.markForCheck(),this.stateChanges.next()})}get startAt(){return this._startAt}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get activeDate(){return this._clampedActiveDate}set activeDate(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}get currentView(){return this._currentView}set currentView(e){const a=this._currentView!==e?e:null;this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck(),a&&this.viewChanged.emit(a)}ngAfterContentInit(){this._calendarHeaderPortal=new V.C5(this.headerComponent||Lt),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView}ngAfterViewChecked(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())}ngOnDestroy(){this._intlChanges.unsubscribe(),this.stateChanges.complete()}ngOnChanges(e){const a=e.minDate&&!this._dateAdapter.sameDate(e.minDate.previousValue,e.minDate.currentValue)?e.minDate:void 0,i=e.maxDate&&!this._dateAdapter.sameDate(e.maxDate.previousValue,e.maxDate.currentValue)?e.maxDate:void 0,r=a||i||e.dateFilter;if(r&&!r.firstChange){const s=this._getCurrentViewComponent();s&&(this._changeDetectorRef.detectChanges(),s._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){this._getCurrentViewComponent()._init()}_dateSelected(e){e.value&&this.selected&&this._dateAdapter.copyTime(e.value,this.selected);const a=e.value;(this.selected instanceof b||a&&!this._dateAdapter.sameDate(a,this.selected))&&this.selectedChange.emit(a),this._userSelection.emit(e)}_yearSelectedInMultiYearView(e){this.yearSelected.emit(e)}_monthSelectedInYearView(e){this.monthSelected.emit(e)}_goToDateInView(e,a){this.activeDate=e,this.currentView=a}_dragStarted(e){this._activeDrag=e}_dragEnded(e){this._activeDrag&&(e.value&&this._userDragDrop.emit(e),this._activeDrag=null)}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(te),t.Y36(m,8),t.Y36(N,8),t.Y36(t.sBO))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-calendar"]],viewQuery:function(e,a){if(1&e&&(t.Gf(Ie,5),t.Gf(Re,5),t.Gf(we,5)),2&e){let i;t.iGM(i=t.CRH())&&(a.monthView=i.first),t.iGM(i=t.CRH())&&(a.yearView=i.first),t.iGM(i=t.CRH())&&(a.multiYearView=i.first)}},hostAttrs:[1,"mat-calendar"],inputs:{headerComponent:"headerComponent",startAt:"startAt",startView:"startView",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",_userSelection:"_userSelection",_userDragDrop:"_userDragDrop"},exportAs:["ngxMatCalendar"],features:[t._Bn([Te]),t.TTD],decls:5,vars:5,consts:[[3,"cdkPortalOutlet"],["cdkMonitorSubtreeFocus","","tabindex","-1",1,"mat-calendar-content",3,"ngSwitch"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag","activeDateChange","_userSelection","dragStarted","dragEnded",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag","activeDateChange","_userSelection","dragStarted","dragEnded"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange"]],template:function(e,a){1&e&&(t.YNc(0,rt,0,0,"ng-template",0),t.TgZ(1,"div",1),t.YNc(2,st,1,11,"ngx-mat-month-view",2),t.YNc(3,ot,1,6,"ngx-mat-year-view",3),t.YNc(4,lt,1,6,"ngx-mat-multi-year-view",4),t.qZA()),2&e&&(t.Q6J("cdkPortalOutlet",a._calendarHeaderPortal),t.xp6(1),t.Q6J("ngSwitch",a.currentView),t.xp6(1),t.Q6J("ngSwitchCase","month"),t.xp6(1),t.Q6J("ngSwitchCase","year"),t.xp6(1),t.Q6J("ngSwitchCase","multi-year"))},dependencies:[h.RF,h.n9,le.kH,V.Pl,Ie,Re,we],styles:['.mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0}.mat-calendar-content{padding:0 8px 8px;outline:none}.mat-calendar-controls{display:flex;align-items:center;margin:5% calc(4.7142857143% - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0;margin:0 8px}.mat-calendar-arrow{display:inline-block;width:10px;height:5px;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.cdk-high-contrast-active .mat-calendar-arrow{fill:CanvasText}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-calendar-previous-button:after,.mat-calendar-next-button:after{top:0;left:0;right:0;bottom:0;position:absolute;content:"";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button:after{border-left-width:2px;transform:translate(2px) rotate(-45deg)}.mat-calendar-next-button:after{border-right-width:2px;transform:translate(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider:after{content:"";position:absolute;top:0;left:-8px;right:-8px;height:1px}.mat-calendar-body-cell-content:before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px) * -1)}.mat-calendar-body-cell:focus .mat-focus-indicator:before{content:""}.mat-calendar-hidden-label{display:none}\n'],encapsulation:2,changeDetection:0}),n})();try{Z=typeof Intl<"u"}catch{Z=!1}const Ft={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},Pt=ae(31,n=>String(n+1)),Zt={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},Vt=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function ae(n,o){const e=Array(n);for(let a=0;a{class n extends m{constructor(e,a){super(),this.useUtcForDisplay=!0,super.setLocale(e),this.useUtcForDisplay=!a.TRIDENT,this._clampDate=a.TRIDENT||a.EDGE}getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getMonthNames(e){if(Z){const a=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return ae(12,i=>this._stripDirectionalityCharacters(this._format(a,new Date(2017,i,1))))}return Ft[e]}getDateNames(){if(Z){const e=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return ae(31,a=>this._stripDirectionalityCharacters(this._format(e,new Date(2017,0,a+1))))}return Pt}getDayOfWeekNames(e){if(Z){const a=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return ae(7,i=>this._stripDirectionalityCharacters(this._format(a,new Date(2017,0,i+1))))}return Zt[e]}getYearName(e){if(Z){const a=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this._stripDirectionalityCharacters(this._format(a,e))}return String(this.getYear(e))}getFirstDayOfWeek(){return 0}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0))}clone(e){return new Date(e.getTime())}createDate(e,a,i){if(a<0||a>11)throw Error(`Invalid month index "${a}". Month index has to be between 0 and 11.`);if(i<1)throw Error(`Invalid date "${i}". Date has to be greater than 0.`);let r=this._createDateWithOverflow(e,a,i);if(r.getMonth()!=a)throw Error(`Invalid date "${i}" for month with index "${a}".`);return r}today(){return new Date}parse(e){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null}format(e,a){if(!this.isValid(e))throw Error("NativeDateAdapter: Cannot format invalid date.");if(Z){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e)).setFullYear(Math.max(1,Math.min(9999,e.getFullYear()))),a={...a,timeZone:"utc"};const i=new Intl.DateTimeFormat(this.locale,a);return this._stripDirectionalityCharacters(this._format(i,e))}return this._stripDirectionalityCharacters(e.toDateString())}addCalendarYears(e,a){return this.addCalendarMonths(e,12*a)}addCalendarMonths(e,a){let i=this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+a,this.getDate(e));return this.getMonth(i)!=((this.getMonth(e)+a)%12+12)%12&&(i=this._createDateWithOverflow(this.getYear(i),this.getMonth(i),0)),i}addCalendarDays(e,a){return this._createDateWithOverflow(this.getYear(e),this.getMonth(e),this.getDate(e)+a)}toIso8601(e){return[e.getUTCFullYear(),this._2digit(e.getUTCMonth()+1),this._2digit(e.getUTCDate())].join("-")}deserialize(e){if("string"==typeof e){if(!e)return null;if(Vt.test(e)){let a=new Date(e);if(this.isValid(a))return a}}return super.deserialize(e)}isDateInstance(e){return e instanceof Date}isValid(e){return!isNaN(e.getTime())}invalid(){return new Date(NaN)}getHour(e){return e.getHours()}getMinute(e){return e.getMinutes()}getSecond(e){return e.getSeconds()}setHour(e,a){e.setHours(a)}setMinute(e,a){e.setMinutes(a)}setSecond(e,a){e.setSeconds(a)}_createDateWithOverflow(e,a,i){const r=new Date(e,a,i);return e>=0&&e<100&&r.setFullYear(this.getYear(r)-1900),r}_2digit(e){return("00"+e).slice(-2)}_stripDirectionalityCharacters(e){return e.replace(/[\u200e\u200f]/g,"")}_format(e,a){const i=new Date;return i.setUTCFullYear(a.getFullYear(),a.getMonth(),a.getDate()),i.setUTCHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),e.format(i)}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(L.Ad,8),t.LFG(W.t4))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})();const Oe={year:"numeric",month:"numeric",day:"numeric",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"},Ut={parse:{dateInput:Oe},display:{dateInput:Oe,monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}};let Bt=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[{provide:m,useClass:Yt}],imports:[W.ud]}),n})(),Kt=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[{provide:N,useValue:Ut}],imports:[Bt]}),n})();function Jt(n){return ve(n,!0)}function Le(n){return n.nodeType===Node.ELEMENT_NODE}function ve(n,o){if(Le(n)&&o){const a=(n.getAttribute?.("aria-labelledby")?.split(/\s+/g)||[]).reduce((i,r)=>{const s=document.getElementById(r);return s&&i.push(s),i},[]);if(a.length)return a.map(i=>ve(i,!1)).join(" ")}if(Le(n)){const e=n.getAttribute("aria-label")?.trim();if(e)return e}if(function Ht(n){return"INPUT"===n.nodeName}(n)||function qt(n){return"TEXTAREA"===n.nodeName}(n)){if(n.labels?.length)return Array.from(n.labels).map(i=>ve(i,!1)).join(" ");const e=n.getAttribute("placeholder")?.trim();if(e)return e;const a=n.getAttribute("title")?.trim();if(a)return a}return(n.textContent||"").replace(/\s+/g," ").trim()}class ie{constructor(o,e){this.target=o,this.targetElement=e,this.value=this.target.value}}let Fe=(()=>{class n{constructor(e,a,i){if(this._elementRef=e,this._dateAdapter=a,this._dateFormats=i,this.dateChange=new t.vpe,this.dateInput=new t.vpe,this.stateChanges=new O.x,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=w.w0.EMPTY,this._localeSubscription=w.w0.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=r=>{const s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(r.value));return!s||this._matchesFilter(s)?null:{matDatepickerFilter:!0}},this._minValidator=r=>{const s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(r.value)),d=this._getMinDate();return!d||!s||this._dateAdapter.compareDateWithTime(d,s)<=0?null:{matDatetimePickerMin:{min:d,actual:s}}},this._maxValidator=r=>{const s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(r.value)),d=this._getMaxDate();return!d||!s||this._dateAdapter.compareDateWithTime(d,s)>=0?null:{matDatetimePickerMax:{max:d,actual:s}}},this._lastValueValid=!1,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._localeSubscription=a.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){this._assignValueProgrammatically(e)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){const a=(0,P.Ig)(e),i=this._elementRef.nativeElement;this._disabled!==a&&(this._disabled=a,this.stateChanges.next(void 0)),a&&this._isInitialized&&i.blur&&i.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(a=>{if(this._shouldHandleChangeEvent(a)){const i=this._getValueFromModel(a.selection);this._lastValueValid=this._isValidValue(i),this._cvaOnChange(i),this._onTouched(),this._formatValue(i),this.dateInput.emit(new ie(this,this._elementRef.nativeElement)),this.dateChange.emit(new ie(this,this._elementRef.nativeElement))}})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(e){(function Gt(n,o){const e=Object.keys(n);for(let a of e){const{previousValue:i,currentValue:r}=n[a];if(!o.isDateInstance(i)||!o.isDateInstance(r))return!0;if(!o.sameDate(i,r))return!0}return!1})(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this._assignValueProgrammatically(e)}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){(0,u.Vb)(e,"altKey")&&e.keyCode===u.JH&&["ctrlKey","shiftKey","metaKey"].every(r=>!(0,u.Vb)(e,r))&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){const a=this._lastValueValid;let i=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(i),i=this._dateAdapter.getValidDateOrNull(i);const r=this._dateAdapter.isSameTime(i,this.value),_=!(this._dateAdapter.sameDate(i,this.value)&&r);!i||_?this._cvaOnChange(i):(e&&!this.value&&this._cvaOnChange(i),a!==this._lastValueValid&&this._validatorOnChange()),_&&(this._assignValue(i),this.dateInput.emit(new ie(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new ie(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=null!=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}_assignValueProgrammatically(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._dateAdapter.getValidDateOrNull(e),this._assignValue(e),this._formatValue(e)}_matchesFilter(e){const a=this._getDateFilter();return!a||a(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(m,8),t.Y36(N,8))},n.\u0275dir=t.lG2({type:n,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[t.TTD]}),n})();const jt=new t.OlP("NGX_MAT_DATE_RANGE_INPUT_PARENT");(0,L.FD)((()=>{class n extends Fe{constructor(e,a,i,r,s,d,_,C){super(a,_,C),this._rangeInput=e,this._elementRef=a,this._defaultErrorStateMatcher=i,this._injector=r,this._parentForm=s,this._parentFormGroup=d,this._dir=(0,t.f3M)(H.Is,{optional:!0})}ngOnInit(){const e=this._injector.get(l.a5,null,{optional:!0,self:!0});e&&(this.ngControl=e)}ngDoCheck(){this.ngControl&&this.updateErrorState()}isEmpty(){return 0===this._elementRef.nativeElement.value.length}_getPlaceholder(){return this._elementRef.nativeElement.placeholder}focus(){this._elementRef.nativeElement.focus()}getMirrorValue(){const e=this._elementRef.nativeElement,a=e.value;return a.length>0?a:e.placeholder}_onInput(e){super._onInput(e),this._rangeInput._handleChildValueChange()}_openPopup(){this._rangeInput._openDatepicker()}_getMinDate(){return this._rangeInput.min}_getMaxDate(){return this._rangeInput.max}_getDateFilter(){return this._rangeInput.dateFilter}_parentDisabled(){return this._rangeInput._groupDisabled}_shouldHandleChangeEvent({source:e}){return e!==this._rangeInput._startInput&&e!==this._rangeInput._endInput}_assignValueProgrammatically(e){super._assignValueProgrammatically(e),(this===this._rangeInput._startInput?this._rangeInput._endInput:this._rangeInput._startInput)?._validatorOnChange()}_getAccessibleName(){return Jt(this._elementRef.nativeElement)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(jt),t.Y36(t.SBq),t.Y36(L.rD),t.Y36(t.zs3),t.Y36(l.F,8),t.Y36(l.sg,8),t.Y36(m,8),t.Y36(N,8))},n.\u0275dir=t.lG2({type:n,features:[t.qOj]}),n})());const Pe={transformPanel:(0,p.X$)("transformPanel",[(0,p.eR)("void => enter-dropdown",(0,p.jt)("120ms cubic-bezier(0, 0, 0.2, 1)",(0,p.F4)([(0,p.oB)({opacity:0,transform:"scale(1, 0.8)"}),(0,p.oB)({opacity:1,transform:"scale(1, 1)"})]))),(0,p.eR)("void => enter-dialog",(0,p.jt)("150ms cubic-bezier(0, 0, 0.2, 1)",(0,p.F4)([(0,p.oB)({opacity:0,transform:"scale(0.7)"}),(0,p.oB)({transform:"none",opacity:1})]))),(0,p.eR)("* => void",(0,p.jt)("100ms linear",(0,p.oB)({opacity:0})))]),fadeInCalendar:(0,p.X$)("fadeInCalendar",[(0,p.SB)("void",(0,p.oB)({opacity:0})),(0,p.SB)("enter",(0,p.oB)({opacity:1})),(0,p.eR)("void => *",(0,p.jt)("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},T={minHour:0,maxHour:24,minMinute:0,maxMinute:60,minSecond:0,maxSecond:60,meridian:12},$t=/[^0-9]/g,Ze=/^(2[0-3]|[0-1][0-9]|[0-9])$/,zt=/^([0-5][0-9]|[0-9])$/,Xt=/^([0-5][0-9]|[0-9])$/;function ne(n){const o=n.toString();return o.length>1?o:`0${o}`}let ea=(()=>{class n{constructor(e,a,i){if(this._dateAdapter=e,this.cd=a,this.formBuilder=i,this.disabled=!1,this.showSpinners=!0,this.stepHour=1,this.stepMinute=1,this.stepSecond=1,this.showSeconds=!1,this.disableMinute=!1,this.enableMeridian=!1,this.color="primary",this.meridian="AM",this._onChange=()=>{},this._onTouched=()=>{},this._destroyed=new O.x,this.pattern=Ze,!this._dateAdapter)throw function Wt(n){return Error(`NgxMatDatetimePicker: No provider found for ${n}. You must import one of the following modules at your application root: NgxMatNativeDateModule, NgxMatMomentModule, or provide a custom implementation.`)}("NgxMatDateAdapter");this.form=this.formBuilder.group({hour:[{value:null,disabled:this.disabled},[l.kI.required,l.kI.pattern(Ze)]],minute:[{value:null,disabled:this.disabled},[l.kI.required,l.kI.pattern(zt)]],second:[{value:null,disabled:this.disabled},[l.kI.required,l.kI.pattern(Xt)]]})}get hour(){let e=Number(this.form.controls.hour.value);return isNaN(e)?0:e}get minute(){let e=Number(this.form.controls.minute.value);return isNaN(e)?0:e}get second(){let e=Number(this.form.controls.second.value);return isNaN(e)?0:e}get valid(){return this.form.valid}ngOnInit(){this.form.valueChanges.pipe((0,Qe.R)(this._destroyed),(0,$e.b)(400)).subscribe(e=>{this._updateModel()})}ngOnChanges(e){(e.disabled||e.disableMinute)&&this._setDisableStates()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}writeValue(e){null!=e&&(this._model=e,this._updateHourMinuteSecond())}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._disabled=e,this.cd.markForCheck()}formatInput(e){e.value=e.value.replace($t,"")}toggleMeridian(){this.meridian="AM"===this.meridian?"PM":"AM",this.change("hour")}change(e,a){const i=this._getNextValueByProp(e,a);this.form.controls[e].setValue(ne(i),{onlySelf:!1,emitEvent:!1}),this._updateModel()}_updateHourMinuteSecond(){let e=this._dateAdapter.getHour(this._model);const a=this._dateAdapter.getMinute(this._model),i=this._dateAdapter.getSecond(this._model);this.enableMeridian&&(e>=T.meridian?(e-=T.meridian,this.meridian="PM"):this.meridian="AM",0===e&&(e=T.meridian)),this.form.patchValue({hour:ne(e),minute:ne(a),second:ne(i)},{emitEvent:!1})}_updateModel(){let e=this.hour;if(this.enableMeridian&&("AM"===this.meridian&&e===T.meridian?e=0:"PM"===this.meridian&&e!==T.meridian&&(e+=T.meridian)),this._model){const a=this._dateAdapter.clone(this._model);this._dateAdapter.setHour(a,e),this._dateAdapter.setMinute(a,this.minute),this._dateAdapter.setSecond(a,this.second),this._onChange(a)}}_getNextValueByProp(e,a){const i=e[0].toUpperCase()+e.slice(1),r=T[`min${i}`];let d,s=T[`max${i}`];return"hour"===e&&this.enableMeridian&&(s=T.meridian),null==a?(d=this[e]%s,"hour"===e&&this.enableMeridian&&0===d&&(d=s)):(d=a?this[e]+this[`step${i}`]:this[e]-this[`step${i}`],"hour"===e&&this.enableMeridian?(d%=s+1,0===d&&(d=a?1:s)):d%=s,d=a?d>s?d-s+r:d:dn),multi:!0}]),t.TTD],decls:18,vars:9,consts:[[3,"formGroup"],[1,"ngx-mat-timepicker-table"],[1,"ngx-mat-timepicker-tbody"],[4,"ngIf"],["appearance","fill",3,"color"],["type","text","matInput","","maxlength","2","formControlName","hour",3,"input","keydown.ArrowUp","keydown.ArrowDown","blur"],[1,"ngx-mat-timepicker-spacer"],["type","text","matInput","","maxlength","2","formControlName","minute",3,"input","keydown.ArrowUp","keydown.ArrowDown","blur"],["class","ngx-mat-timepicker-spacer",4,"ngIf"],["class","ngx-mat-timepicker-meridian",4,"ngIf"],["type","button","mat-icon-button","","aria-label","expand_less icon",3,"disabled","click"],["type","text","matInput","","maxlength","2","formControlName","second",3,"input","keydown.ArrowUp","keydown.ArrowDown","blur"],[1,"ngx-mat-timepicker-meridian"],["mat-button","","mat-stroked-button","",3,"color","disabled","click"],["type","button","mat-icon-button","","aria-label","expand_more icon",3,"disabled","click"]],template:function(e,a){1&e&&(t.TgZ(0,"form",0)(1,"table",1)(2,"tbody",2),t.YNc(3,ht,14,5,"tr",3),t.TgZ(4,"tr")(5,"td")(6,"mat-form-field",4)(7,"input",5),t.NdJ("input",function(r){return a.formatInput(r.target)})("keydown.ArrowUp",function(r){return a.change("hour",!0),r.preventDefault()})("keydown.ArrowDown",function(r){return a.change("hour",!1),r.preventDefault()})("blur",function(){return a.change("hour")}),t.qZA()()(),t.TgZ(8,"td",6),t._uU(9,":"),t.qZA(),t.TgZ(10,"td")(11,"mat-form-field",4)(12,"input",7),t.NdJ("input",function(r){return a.formatInput(r.target)})("keydown.ArrowUp",function(r){return a.change("minute",!0),r.preventDefault()})("keydown.ArrowDown",function(r){return a.change("minute",!1),r.preventDefault()})("blur",function(){return a.change("minute")}),t.qZA()()(),t.YNc(13,pt,2,0,"td",8),t.YNc(14,mt,3,1,"td",3),t.YNc(15,gt,1,0,"td",8),t.YNc(16,_t,3,3,"td",9),t.qZA(),t.YNc(17,Ct,14,6,"tr",3),t.qZA()()()),2&e&&(t.Q6J("formGroup",a.form),t.xp6(3),t.Q6J("ngIf",a.showSpinners),t.xp6(3),t.Q6J("color",a.color),t.xp6(5),t.Q6J("color",a.color),t.xp6(2),t.Q6J("ngIf",a.showSeconds),t.xp6(1),t.Q6J("ngIf",a.showSeconds),t.xp6(1),t.Q6J("ngIf",a.enableMeridian),t.xp6(1),t.Q6J("ngIf",a.enableMeridian),t.xp6(1),t.Q6J("ngIf",a.showSpinners))},dependencies:[h.O5,de.Nt,Me.KE,l._Y,l.Fj,l.JJ,l.JL,l.nD,l.sg,l.u,Y.Hw,F.lW,F.RK],styles:[".ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td{text-align:center}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td.ngx-mat-timepicker-spacer{font-weight:700}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td.ngx-mat-timepicker-meridian .mdc-button{min-width:64px;line-height:36px;min-width:0;border-radius:50%;width:36px;height:36px;padding:0;flex-shrink:0}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-icon-button{height:24px;width:24px;line-height:24px;padding:0}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-icon-button .mat-icon{font-size:24px}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field{width:24px;max-width:24px;text-align:center}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field.mat-focused .mdc-text-field--filled .mat-mdc-form-field-focus-overlay,.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field:hover .mdc-text-field--filled .mat-mdc-form-field-focus-overlay{background-color:transparent}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field .mdc-text-field--filled{background-color:transparent!important;padding:0!important}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-infix{padding:4px 0;min-height:1px!important}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-infix input{text-align:center;font-size:14px}\n"],encapsulation:2}),n})(),ta=0;const Ve=new t.OlP("ngx-mat-datepicker-scroll-strategy"),ia={provide:Ve,deps:[q.aV],useFactory:function aa(n){return()=>n.scrollStrategies.reposition()}},na=(0,L.pj)(class{constructor(n){this._elementRef=n}});let ra=(()=>{class n extends na{constructor(e,a,i,r,s,d){super(e),this._changeDetectorRef=a,this._globalModel=i,this._dateAdapter=r,this._rangeSelectionStrategy=s,this._subscriptions=new w.w0,this._animationDone=new O.x,this._isAnimating=!1,this._actionsPortal=null,this._closeButtonText=d.closeCalendarLabel}get isViewMonth(){return!this._calendar||null==this._calendar.currentView||"month"==this._calendar.currentView}ngOnInit(){this._animationState=this.datepicker.touchUi?"enter-dialog":"enter-dropdown"}ngAfterViewInit(){this._subscriptions.add(this.datepicker.stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})),this._calendar.focusActiveCell()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._animationDone.complete()}onTimeChanged(e){this._updateUserSelectionWithCalendarUserEvent({value:e,event:null})}_handleUserSelection(e){this._updateUserSelectionWithCalendarUserEvent(e),this.datepicker.hideTime&&(!this._model||this._model.isComplete())&&!this._actionsPortal&&this.datepicker.close()}_updateUserSelectionWithCalendarUserEvent(e){const a=this._model.selection,i=e.value,r=a instanceof b;if(r&&this._rangeSelectionStrategy){const s=this._rangeSelectionStrategy.selectionFinished(i,a,e.event);this._model.updateSelection(s,this)}else{const s=this._dateAdapter.isSameTime(a,i),_=this._dateAdapter.sameDate(i,a)&&s;i&&(r||!_)&&this._model.add(i)}}_handleUserDragDrop(e){this._model.updateSelection(e.value,this)}_startExitAnimation(){this._animationState="void",this._changeDetectorRef.markForCheck()}_handleAnimationEvent(e){this._isAnimating="start"===e.phaseName,this._isAnimating||this._animationDone.next()}_getSelected(){return this._modelTime=this._model.selection,this._model.selection}_applyPendingSelection(){this._model!==this._globalModel&&this._globalModel.updateSelection(this._model.selection,this)}_assignActions(e,a){this._model=e?this._globalModel.clone():this._globalModel,this._actionsPortal=e,a&&this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(E),t.Y36(m),t.Y36(ee,8),t.Y36(te))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-datepicker-content"]],viewQuery:function(e,a){if(1&e&&t.Gf(be,5),2&e){let i;t.iGM(i=t.CRH())&&(a._calendar=i.first)}},hostAttrs:[1,"mat-datepicker-content"],hostVars:5,hostBindings:function(e,a){1&e&&t.WFA("@transformPanel.start",function(r){return a._handleAnimationEvent(r)})("@transformPanel.done",function(r){return a._handleAnimationEvent(r)}),2&e&&(t.d8E("@transformPanel",a._animationState),t.ekj("mat-datepicker-content-touch",a.datepicker.touchUi)("mat-datepicker-content-touch-with-time",!a.datepicker.hideTime))},inputs:{color:"color"},exportAs:["ngxMatDatepickerContent"],features:[t.qOj],decls:6,vars:29,consts:[["cdkTrapFocus","","role","dialog",1,"mat-datepicker-content-container"],[3,"id","ngClass","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","yearSelected","monthSelected","viewChanged","_userSelection","_userDragDrop"],[4,"ngIf"],[3,"cdkPortalOutlet"],["type","button","mat-raised-button","",1,"mat-datepicker-close-button",3,"color","focus","blur","click"],["class","time-container",3,"disable-seconds",4,"ngIf"],[1,"time-container"],[3,"showSpinners","showSeconds","disabled","stepHour","stepMinute","stepSecond","ngModel","color","enableMeridian","disableMinute","ngModelChange"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0)(1,"ngx-mat-calendar",1),t.NdJ("yearSelected",function(r){return a.datepicker._selectYear(r)})("monthSelected",function(r){return a.datepicker._selectMonth(r)})("viewChanged",function(r){return a.datepicker._viewChanged(r)})("_userSelection",function(r){return a._handleUserSelection(r)})("_userDragDrop",function(r){return a._handleUserDragDrop(r)}),t.qZA(),t.YNc(2,xt,2,1,"ng-container",2),t.YNc(3,yt,0,0,"ng-template",3),t.TgZ(4,"button",4),t.NdJ("focus",function(){return a._closeButtonFocused=!0})("blur",function(){return a._closeButtonFocused=!1})("click",function(){return a.datepicker.close()}),t._uU(5),t.qZA()()),2&e){let i;t.ekj("mat-datepicker-content-container-with-custom-header",a.datepicker.calendarHeaderComponent)("mat-datepicker-content-container-with-actions",a._actionsPortal)("mat-datepicker-content-container-with-time",!a.datepicker._hideTime),t.uIk("aria-modal",!0)("aria-labelledby",null!==(i=a._dialogLabelId)&&void 0!==i?i:void 0),t.xp6(1),t.Q6J("id",a.datepicker.id)("ngClass",a.datepicker.panelClass)("startAt",a.datepicker.startAt)("startView",a.datepicker.startView)("minDate",a.datepicker._getMinDate())("maxDate",a.datepicker._getMaxDate())("dateFilter",a.datepicker._getDateFilter())("headerComponent",a.datepicker.calendarHeaderComponent)("selected",a._getSelected())("dateClass",a.datepicker.dateClass)("comparisonStart",a.comparisonStart)("comparisonEnd",a.comparisonEnd)("@fadeInCalendar","enter")("startDateAccessibleName",a.startDateAccessibleName)("endDateAccessibleName",a.endDateAccessibleName),t.xp6(1),t.Q6J("ngIf",a.isViewMonth),t.xp6(1),t.Q6J("cdkPortalOutlet",a._actionsPortal),t.xp6(1),t.ekj("cdk-visually-hidden",!a._closeButtonFocused),t.Q6J("color",a.color||"primary"),t.xp6(1),t.hij("",a._closeButtonText," ")}},dependencies:[h.mk,h.O5,F.lW,le.mK,V.Pl,ea,l.JJ,l.On,be],styles:['.mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-content-container-with-custom-header .mat-calendar{height:auto}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.time-container{display:flex;position:relative;padding-top:5px;justify-content:center}.time-container.disable-seconds .ngx-mat-timepicker .table{margin-left:9px}.time-container:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#0000001f}.mat-datepicker-content-touch{display:block;max-height:90vh;position:relative;overflow:visible}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:815px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:90vh}.mat-datepicker-content-touch .mat-datepicker-content-container.mat-datepicker-content-container-with-time{height:auto}}@media all and (orientation: portrait){.mat-datepicker-content-touch{max-height:100vh}.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container.mat-datepicker-content-container-with-time{height:auto;max-height:870px}.mat-datepicker-content-touch .mat-datepicker-content-container.mat-datepicker-content-container-with-time.mat-datepicker-content-container-with-actions{max-height:none!important}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n'],encapsulation:2,data:{animation:[Pe.transformPanel,Pe.fadeInCalendar]},changeDetection:0}),n})(),j=(()=>{class n{constructor(e,a,i,r,s,d,_){if(this._overlay=e,this._ngZone=a,this._viewContainerRef=i,this._dateAdapter=s,this._dir=d,this._model=_,this._inputStateChanges=w.w0.EMPTY,this._document=(0,t.f3M)(h.K0),this.startView="month",this._touchUi=!1,this._hideTime=!1,this.xPosition="start",this.yPosition="below",this._restoreFocus=!0,this.yearSelected=new t.vpe,this.monthSelected=new t.vpe,this.viewChanged=new t.vpe(!0),this.openedStream=new t.vpe,this.closedStream=new t.vpe,this._opened=!1,this._showSpinners=!0,this._showSeconds=!1,this._stepHour=1,this._stepMinute=1,this._stepSecond=1,this._enableMeridian=!1,this.id="mat-datepicker-"+ta++,this._focusedElementBeforeOpen=null,this._backdropHarnessClass=`${this.id}-backdrop`,this.stateChanges=new O.x,!this._dateAdapter)throw x("NgxMatDateAdapter");this._scrollStrategy=r}get startAt(){return this._startAt||(this.datepickerInput?this.datepickerInput.getStartValue():null)}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get color(){return this._color||(this.datepickerInput?this.datepickerInput.getThemePalette():void 0)}set color(e){this._color=e}get touchUi(){return this._touchUi}set touchUi(e){this._touchUi=(0,P.Ig)(e)}get hideTime(){return this._hideTime}set hideTime(e){this._hideTime=(0,P.Ig)(e)}get disabled(){return void 0===this._disabled&&this.datepickerInput?this.datepickerInput.disabled:!!this._disabled}set disabled(e){const a=(0,P.Ig)(e);a!==this._disabled&&(this._disabled=a,this.stateChanges.next(void 0))}get restoreFocus(){return this._restoreFocus}set restoreFocus(e){this._restoreFocus=(0,P.Ig)(e)}get panelClass(){return this._panelClass}set panelClass(e){this._panelClass=(0,P.du)(e)}get opened(){return this._opened}set opened(e){(0,P.Ig)(e)?this.open():this.close()}get showSpinners(){return this._showSpinners}set showSpinners(e){this._showSpinners=e}get showSeconds(){return this._showSeconds}set showSeconds(e){this._showSeconds=e}get stepHour(){return this._stepHour}set stepHour(e){this._stepHour=e}get stepMinute(){return this._stepMinute}set stepMinute(e){this._stepMinute=e}get stepSecond(){return this._stepSecond}set stepSecond(e){this._stepSecond=e}get enableMeridian(){return this._enableMeridian}set enableMeridian(e){this._enableMeridian=e}get disableMinute(){return this._disableMinute}set disableMinute(e){this._disableMinute=e}get defaultTime(){return this._defaultTime}set defaultTime(e){this._defaultTime=e}_getMinDate(){return this.datepickerInput&&this.datepickerInput.min}_getMaxDate(){return this.datepickerInput&&this.datepickerInput.max}_getDateFilter(){return this.datepickerInput&&this.datepickerInput.dateFilter}ngOnChanges(e){const a=e.xPosition||e.yPosition;if(a&&!a.firstChange&&this._overlayRef){const i=this._overlayRef.getConfig().positionStrategy;i instanceof q._G&&(this._setConnectedPositions(i),this.opened&&this._overlayRef.updatePosition())}this.stateChanges.next(void 0)}ngOnDestroy(){this._destroyOverlay(),this.close(),this._inputStateChanges.unsubscribe(),this.stateChanges.complete()}select(e){this._model.add(e)}_selectYear(e){this.yearSelected.emit(e)}_selectMonth(e){this.monthSelected.emit(e)}_viewChanged(e){this.viewChanged.emit(e)}registerInput(e){if(this.datepickerInput)throw Error("A MatDatepicker can only be associated with a single input.");return this._inputStateChanges.unsubscribe(),this.datepickerInput=e,this._inputStateChanges=e.stateChanges.subscribe(()=>this.stateChanges.next(void 0)),this._model}registerActions(e){if(this._actionsPortal)throw Error("A MatDatepicker can only be associated with a single actions row.");this._actionsPortal=e,this._componentRef?.instance._assignActions(e,!0)}removeActions(e){e===this._actionsPortal&&(this._actionsPortal=null,this._componentRef?.instance._assignActions(null,!0))}open(){if(!(this._opened||this.disabled||this._componentRef?.instance._isAnimating)){if(!this.datepickerInput)throw Error("Attempted to open an MatDatepicker with no associated input.");this._focusedElementBeforeOpen=(0,W.ht)(),this._openOverlay(),this._opened=!0,this.openedStream.emit()}}close(){if(!this._opened||this._componentRef?.instance._isAnimating)return;const e=this._restoreFocus&&this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus,a=()=>{this._opened&&(this._opened=!1,this.closedStream.emit())};if(this._componentRef){const{instance:i,location:r}=this._componentRef;i._startExitAnimation(),i._animationDone.pipe((0,se.q)(1)).subscribe(()=>{const s=this._document.activeElement;e&&(!s||s===this._document.activeElement||r.nativeElement.contains(s))&&this._focusedElementBeforeOpen.focus(),this._focusedElementBeforeOpen=null,this._destroyOverlay()})}e?setTimeout(a):a()}_applyPendingSelection(){this._componentRef?.instance?._applyPendingSelection()}_forwardContentValues(e){e.datepicker=this,e.color=this.color,e._dialogLabelId=this.datepickerInput.getOverlayLabelId(),e._assignActions(this._actionsPortal,!1)}_openOverlay(){this._destroyOverlay();const e=this.touchUi,a=new V.C5(ra,this._viewContainerRef),i=this._overlayRef=this._overlay.create(new q.X_({positionStrategy:e?this._getDialogStrategy():this._getDropdownStrategy(),hasBackdrop:!0,backdropClass:[e?"cdk-overlay-dark-backdrop":"mat-overlay-transparent-backdrop",this._backdropHarnessClass],direction:this._dir,scrollStrategy:e?this._overlay.scrollStrategies.block():this._scrollStrategy(),panelClass:"mat-datepicker-"+(e?"dialog":"popup")}));this._getCloseStream(i).subscribe(r=>{r&&r.preventDefault(),this.close()}),i.keydownEvents().subscribe(r=>{const s=r.keyCode;(s===u.LH||s===u.JH||s===u.oh||s===u.SV||s===u.Ku||s===u.VM)&&r.preventDefault()}),this._componentRef=i.attach(a),this._forwardContentValues(this._componentRef.instance),e||this._ngZone.onStable.pipe((0,se.q)(1)).subscribe(()=>i.updatePosition())}_destroyOverlay(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=this._componentRef=null)}_getDialogStrategy(){return this._overlay.position().global().centerHorizontally().centerVertically()}_getDropdownStrategy(){const e=this._overlay.position().flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition();return this._setConnectedPositions(e)}_setConnectedPositions(e){const a="end"===this.xPosition?"end":"start",i="start"===a?"end":"start",r="above"===this.yPosition?"bottom":"top",s="top"===r?"bottom":"top";return e.withPositions([{originX:a,originY:s,overlayX:a,overlayY:r},{originX:a,originY:r,overlayX:a,overlayY:s},{originX:i,originY:s,overlayX:i,overlayY:r},{originX:i,originY:r,overlayX:i,overlayY:s}])}_getCloseStream(e){const a=["ctrlKey","shiftKey","metaKey"];return(0,je.T)(e.backdropClick(),e.detachments(),e.keydownEvents().pipe((0,ze.h)(i=>i.keyCode===u.hY&&!(0,u.Vb)(i)||this.datepickerInput&&(0,u.Vb)(i,"altKey")&&i.keyCode===u.LH&&a.every(r=>!(0,u.Vb)(i,r)))))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.aV),t.Y36(t.R0b),t.Y36(t.s_b),t.Y36(Ve),t.Y36(m,8),t.Y36(H.Is,8),t.Y36(E))},n.\u0275dir=t.lG2({type:n,inputs:{calendarHeaderComponent:"calendarHeaderComponent",startAt:"startAt",startView:"startView",color:"color",touchUi:"touchUi",hideTime:"hideTime",disabled:"disabled",xPosition:"xPosition",yPosition:"yPosition",restoreFocus:"restoreFocus",dateClass:"dateClass",panelClass:"panelClass",opened:"opened",showSpinners:"showSpinners",showSeconds:"showSeconds",stepHour:"stepHour",stepMinute:"stepMinute",stepSecond:"stepSecond",enableMeridian:"enableMeridian",disableMinute:"disableMinute",defaultTime:"defaultTime"},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",openedStream:"opened",closedStream:"closed"},features:[t.TTD]}),n})(),sa=(()=>{class n extends j{}return n.\u0275fac=function(){let o;return function(a){return(o||(o=t.n5z(n)))(a||n)}}(),n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-datetime-picker"]],exportAs:["ngxMatDatetimePicker"],features:[t._Bn([Te,{provide:j,useExisting:n}]),t.qOj],decls:0,vars:0,template:function(e,a){},encapsulation:2,changeDetection:0}),n})(),oa=(()=>{class n{constructor(e){this._datepicker=e}_applySelection(){this._datepicker._applyPendingSelection(),this._datepicker.close()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(j))},n.\u0275dir=t.lG2({type:n,selectors:[["","ngxMatDatepickerApply",""],["","ngxMatDateRangePickerApply",""]],hostBindings:function(e,a){1&e&&t.NdJ("click",function(){return a._applySelection()})}}),n})(),la=(()=>{class n{constructor(e){this._datepicker=e}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(j))},n.\u0275dir=t.lG2({type:n,selectors:[["","ngxMatDatepickerCancel",""],["","ngxMatDateRangePickerCancel",""]],hostBindings:function(e,a){1&e&&t.NdJ("click",function(){return a._datepicker.close()})}}),n})(),da=(()=>{class n{constructor(e,a){this._datepicker=e,this._viewContainerRef=a}ngAfterViewInit(){this._portal=new V.UE(this._template,this._viewContainerRef),this._datepicker.registerActions(this._portal)}ngOnDestroy(){this._datepicker.removeActions(this._portal),this._portal&&this._portal.isAttached&&this._portal?.detach()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(j),t.Y36(t.s_b))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-datepicker-actions"],["ngx-mat-date-range-picker-actions"]],viewQuery:function(e,a){if(1&e&&t.Gf(t.Rgc,5),2&e){let i;t.iGM(i=t.CRH())&&(a._template=i.first)}},ngContentSelectors:ke,decls:1,vars:0,consts:[[1,"mat-datepicker-actions"]],template:function(e,a){1&e&&(t.F$t(),t.YNc(0,Mt,2,0,"ng-template"))},styles:[".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:8px}.mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n})();const ca={provide:l.JU,useExisting:(0,t.Gpc)(()=>De),multi:!0},ua={provide:l.Cf,useExisting:(0,t.Gpc)(()=>De),multi:!0};let De=(()=>{class n extends Fe{constructor(e,a,i,r){super(e,a,i),this._formField=r,this._closedSubscription=w.w0.EMPTY,this._validator=l.kI.compose(super._getValidators())}set ngxMatDatetimePicker(e){e&&(this._datepicker=e,this._closedSubscription=e.closedStream.subscribe(()=>this._onTouched()),this._registerModel(e.registerInput(this)))}get min(){return this._min}set min(e){const a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._min)||(this._min=a,this._validatorOnChange())}get max(){return this._max}set max(e){const a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._max)||(this._max=a,this._validatorOnChange())}get dateFilter(){return this._dateFilter}set dateFilter(e){const a=this._matchesFilter(this.value);this._dateFilter=e,this._matchesFilter(this.value)!==a&&this._validatorOnChange()}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():this._elementRef.nativeElement.getAttribute("aria-labelledby")}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(e){return e.source!==this}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(m,8),t.Y36(N,8),t.Y36(Me.G_,8))},n.\u0275dir=t.lG2({type:n,selectors:[["input","ngxMatDatetimePicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(e,a){1&e&&t.NdJ("input",function(r){return a._onInput(r.target.value)})("change",function(){return a._onChange()})("blur",function(){return a._onBlur()})("keydown",function(r){return a._onKeydown(r)}),2&e&&(t.Ikx("disabled",a.disabled),t.uIk("aria-haspopup",a._datepicker?"dialog":null)("aria-owns",(null==a._datepicker?null:a._datepicker.opened)&&a._datepicker.id||null)("min",a.min?a._dateAdapter.toIso8601(a.min):null)("max",a.max?a._dateAdapter.toIso8601(a.max):null)("data-mat-calendar",a._datepicker?a._datepicker.id:null))},inputs:{ngxMatDatetimePicker:"ngxMatDatetimePicker",min:"min",max:"max",dateFilter:["matDatepickerFilter","dateFilter"]},exportAs:["ngxMatDatepickerInput"],features:[t._Bn([ca,ua,{provide:de.Jk,useExisting:n}]),t.qOj]}),n})(),Ye=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[h.ez,de.c,l.UX,l.u5,Y.Ps,F.ot]}),n})(),ha=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[te,ia],imports:[h.ez,F.ot,q.U8,le.rt,V.eL,L.BQ,Ye,l.u5,l.UX,Xe.ZD]}),n})();var Ue=c(7375),Be=c(5128),pa=c(2314),ma=c(3811),ga=c(7299),_a=c(6319),S=c(5861),y=c(3322),A=c(9816),Ce=c(80),Q=c(7141),Ke=c(7396),fa=c(9222);let ba=(()=>{class n{constructor(e,a){this.api=e,this.gs=a}getAllTaskCronJobs(){return this.api.getData("/task-cron-job")}toggleOnOffTaskCronJob(e){return this.api.putData(`/task-cron-job/${e}`)}static#e=this.\u0275fac=function(a){return new(a||n)(t.LFG(fa.s),t.LFG(A.U))};static#t=this.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var M=c(2970),$=c(8377),Je=c(782),f=c(8455),re=c(9203),Ae=c(9982),He=c(7732),k=c(4758);function va(n,o){if(1&n&&t._UZ(0,"mat-icon",26),2&n){const e=t.oxw().$implicit;t.Q6J("fontIcon",e.icon)}}function Da(n,o){if(1&n&&(t.TgZ(0,"div",20)(1,"mat-card",21)(2,"mat-card-header",22)(3,"div",23),t.YNc(4,va,1,1,"mat-icon",24),t.qZA(),t.TgZ(5,"mat-card-title",25)(6,"h3",7),t._uU(7),t.qZA()(),t.TgZ(8,"mat-card-subtitle",7),t._uU(9),t.qZA()()()()),2&n){const e=o.$implicit;t.xp6(2),t.MGl("routerLink","/admin-mod/",e.url,""),t.xp6(2),t.Q6J("ngIf",e.icon),t.xp6(3),t.Oqu(e.name),t.xp6(2),t.Oqu(e.deskripsi)}}function Ca(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"mat-slide-toggle",28),t.NdJ("ngModelChange",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG((null==d.SS.currentServerSubject?null:d.SS.currentServerSubject.value)[s.key]=i)})("change",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d.toggleSetting(s.key,i.checked))}),t._uU(1),t.qZA()}if(2&n){const e=o.$implicit,a=t.oxw(2);t.Q6J("disabled",!(null!=a.SS.mySocket&&a.SS.mySocket.id))("ngModel",null==a.SS.currentServerSubject?null:a.SS.currentServerSubject.value[e.key]),t.xp6(1),t.AsE(" ",e.key," - ",e.value," ")}}function Aa(n,o){if(1&n&&(t.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),t._uU(4,"Web & Server Configuration"),t.qZA()()(),t.TgZ(5,"div",10)(6,"div",11),t.YNc(7,Ca,2,4,"mat-slide-toggle",27),t.ALo(8,"keyvalue"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(7),t.Q6J("ngForOf",t.lcZ(8,1,null==e.SS.currentServerSubject?null:e.SS.currentServerSubject.value))}}function xa(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"mat-grid-tile")(1,"mat-list-option",33),t.NdJ("click",function(){const r=t.CHM(e).$implicit,s=t.oxw(2);return t.KtG(s.toggleCronJob(r))}),t._UZ(2,"mat-icon",34),t.TgZ(3,"h4",35),t._uU(4),t.qZA(),t.TgZ(5,"p",35),t._uU(6),t.ALo(7,"date"),t._UZ(8,"br"),t._uU(9),t.ALo(10,"date"),t.qZA()()()}if(2&n){const e=o.$implicit;t.xp6(1),t.Gre("text-",e.running?"warning":"danger",""),t.xp6(3),t.Oqu(e.id),t.xp6(2),t.hij(" last: ",t.xi3(7,6,e.last_date,"d MMMM y, HH:mm:ss z")," "),t.xp6(3),t.hij(" next: ",t.xi3(10,9,e.next_date,"d MMMM y, HH:mm:ss z")," ")}}function ya(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"span",29),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getAllTaskCronJobs())}),t._uU(4," Refresh "),t.qZA(),t.TgZ(5,"b",17),t._uU(6,"Cron & Task Scheduler"),t.qZA()()(),t.TgZ(7,"div",10)(8,"div",11)(9,"mat-selection-list",30)(10,"mat-grid-list",31),t.YNc(11,xa,11,12,"mat-grid-tile",32),t.qZA()()()()()}if(2&n){const e=t.oxw();t.xp6(9),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("cols",e.GS.gridListBreakpoint),t.xp6(1),t.Q6J("ngForOf",e.cronJobs)}}let Ma=(()=>{class n{constructor(e,a,i,r,s,d,_){this.bs=e,this.gs=a,this.as=i,this.adm=r,this.ss=s,this.tcj=d,this.ds=_,this.cronJobs=[],this.subsCronJobsGet=null,this.subsCronJobsPut=null,this.subsDialog=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get GS(){return this.gs}get ADM(){return this.adm}get SS(){return this.ss}ngOnInit(){this.gs.isBrowser&&this.getAllTaskCronJobs()}ngOnDestroy(){this.subsCronJobsGet?.unsubscribe(),this.subsCronJobsPut?.unsubscribe(),this.subsDialog?.unsubscribe()}toggleSetting(e,a){this.ss.socketEmit("server-set",{[e]:a})}getAllTaskCronJobs(){this.bs.busy(),this.subsCronJobsGet=this.tcj.getAllTaskCronJobs().subscribe({next:e=>{this.gs.log("[TASK_CRON_JOB_LIST_SUCCESS]",e),this.cronJobs=e.results,this.bs.idle()},error:e=>{this.gs.log("[TASK_CRON_JOB_LIST_ERROR]",e,"error"),this.bs.idle()}})}toggleCronJob(e){var a=this;return(0,S.Z)(function*(){const i=e.running?"Matikan":"Nyalakan";a.subsDialog=(yield a.ds.openKonfirmasiDialog(`${i} ${e.id}`,`Apakah Yakin Ingin Memaksa ${i} Jadwal Ini ?`)).afterClosed().subscribe({next:r=>{a.gs.log("[INFO_DIALOG_CLOSED]",r),!0===r?(a.bs.busy(),a.subsCronJobsPut=a.tcj.toggleOnOffTaskCronJob(e.id).subscribe({next:s=>{a.gs.log("[TASK_CRON_JOB_TOGGLE_SUCCESS]",s),a.bs.idle(),a.getAllTaskCronJobs()},error:s=>{a.gs.log("[TASK_CRON_JOB_TOGGLE_ERROR]",s,"error"),a.bs.idle(),a.getAllTaskCronJobs()}})):!1===r&&a.getAllTaskCronJobs(),a.subsDialog.unsubscribe()}})})()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(A.U),t.Y36(Ce.e),t.Y36(Q.l),t.Y36(Ke.R),t.Y36(ba),t.Y36(M.x))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-menu"]],decls:37,vars:9,consts:[[1,"container-fluid","p-0"],[1,"wrapper"],[1,"bg-bubbles","align-items-center","p-0"],[1,"row","align-items-center","h-100"],[1,"col-12","mx-auto"],[1,"container","text-light"],[1,"mb-1",2,"line-height","normal"],[1,"mb-0"],[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row","px-3"],["class","col-12 col-md-6 col-xl-3 p-2",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","rows","10",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-3","p-2"],[1,"gradient-border","rgb-border"],[2,"cursor","pointer",3,"routerLink"],["mat-card-avatar",""],["style","font-size: 300%;",3,"fontIcon",4,"ngIf"],[1,"text-warning","mb-1",2,"cursor","pointer"],[2,"font-size","300%",3,"fontIcon"],["class","my-2 col-12 col-md-6 col-xl-3",3,"disabled","ngModel","ngModelChange","change",4,"ngFor","ngForOf"],[1,"my-2","col-12","col-md-6","col-xl-3",3,"disabled","ngModel","ngModelChange","change"],[1,"float-end","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[1,"p-0",3,"multiple"],["rowHeight","72px",3,"cols"],[4,"ngFor","ngForOf"],[3,"click"],["fontIcon","update","mat-list-icon","",1,"ps-3"],["matLine",""]],template:function(a,i){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"ul",2),t._UZ(3,"li")(4,"li")(5,"li")(6,"li")(7,"li")(8,"li")(9,"li")(10,"li")(11,"li")(12,"li"),t.TgZ(13,"div",3)(14,"div",4)(15,"div",5)(16,"h2",6),t._uU(17),t.qZA(),t.TgZ(18,"p",7),t._uU(19,"Admin & Mod Panel List, Halaman Khusus Orang Dalam ..."),t.qZA()()()()()()(),t._UZ(20,"app-notifications"),t.TgZ(21,"div",8)(22,"div",9)(23,"div",10)(24,"div",11),t.YNc(25,Da,10,4,"div",12),t.qZA(),t.YNc(26,Aa,9,3,"div",13),t.YNc(27,ya,12,3,"div",13),t.TgZ(28,"div",14)(29,"div",15)(30,"h2",16)(31,"b",17),t._uU(32,"Request & Response Logs"),t.qZA()()(),t.TgZ(33,"mat-form-field",18)(34,"mat-label"),t._uU(35,"Request & Response Logs"),t.qZA(),t.TgZ(36,"textarea",19),t.NdJ("ngModelChange",function(s){return i.SS.serverLog=s}),t.qZA()()()()()()),2&a&&(t.xp6(1),t.Udp("background","linear-gradient(to bottom, "+(i.GS.isDarkMode?"#673ab7":"#3f51b5")+" 0%, #ee0dfd 100%)"),t.xp6(16),t.AsE(" ",null==i.AS.currentUserSubject||null==i.AS.currentUserSubject.value?null:i.AS.currentUserSubject.value.kartu_tanda_penduduk_.nama," :: ",null==i.AS.currentUserSubject||null==i.AS.currentUserSubject.value?null:i.AS.currentUserSubject.value.role," "),t.xp6(8),t.Q6J("ngForOf",i.ADM.menuList),t.xp6(1),t.Q6J("ngIf",null==i.SS.currentServerSubject?null:i.SS.currentServerSubject.value),t.xp6(1),t.Q6J("ngIf",i.cronJobs.length>0),t.xp6(6),t.Q6J("color","accent"),t.xp6(3),t.Q6J("ngModel",i.SS.serverLog))},dependencies:[h.sg,h.O5,X.rH,$.S$,$.u7,$.mi,$._K,$.lb,Je.Il,Je.DX,L.X2,Y.Hw,f.v_,f.$V,re.k0,Ae.ap,Ae.kh,Ae.O$,He.iZ,k.t,l.Fj,l.JJ,l.On,h.uU,h.Nd],styles:[".wrapper[_ngcontent-%COMP%]{position:sticky;left:0;width:100%;height:128px;overflow:hidden}.bg-bubbles[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:#ffffff26;bottom:-160px;animation:_ngcontent-%COMP%_square 25s infinite;transition-timing-function:linear}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(1){left:10%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:#ffffff40}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(5){left:70%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:#fff3}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:#ffffff4d}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes _ngcontent-%COMP%_square{0%{transform:translateY(0)}to{transform:translateY(-512px) rotate(512deg)}}"]})}return n})();var z=c(4674),ka=c(8925),I=c(9558);let Ta=(()=>{class n{constructor(e,a,i,r){this.dls=e,this.bs=a,this.ds=i,this.gs=r,this.subsAttachmentGet=null,this.subsAttachmentReUpload=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.attachmentData={column:["Nama Lampiran","Ext","Size","Mime","Tanggal","Pemilik","Aksi"],row:[]},this.failed=!0,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getAttachment()}ngOnDestroy(){this.subsAttachmentGet?.unsubscribe(),this.subsAttachmentReUpload?.unsubscribe(),this.subsDialog?.unsubscribe()}getAttachment(){this.bs.busy(),this.subsAttachmentGet&&(this.subsAttachmentGet.unsubscribe(),this.bs.idle()),this.subsAttachmentGet=this.dls.getAttachmentNotUploaded(this.q,this.page,this.row,this.sort,this.order,this.failed).subscribe({next:e=>{this.gs.log("[LAMPIRAN_PENDING_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({foto:i.user_?.image_url||i.parent_attachment_?.user_?.image_url||`${z.N.baseUrl}/assets/img/favicon.png`,pending:i.pending,"Nama Lampiran":i.name,Ext:i.ext,Size:i.size,Mime:i.mime,Tanggal:i.created_at,Pemilik:i.user_?.username||i.parent_attachment_?.user_?.username||"SYSTEM",Aksi:i.pending||i.discord||i.google_drive||i.aws_s3?[]:[{type:"button",icon:"cloud_upload",name:"ReUpload",row:i}]});this.attachmentData.row=a,this.bs.idle()},error:e=>{this.gs.log("[LAMPIRAN_PENDING_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[LAMPIRAN_LIST_CLICK_AKSI]",e),"ReUpload"===e.name&&this.reUpload(e.row)}reUpload(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_REUPLOAD]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog("Upload Ulang ?",`\n Id: ${e.id}
\n Filename: ${e.name}.${e.ext}
\n Size: ${e.size} Bytes
\n Mime: ${e.mime}
\n Pemilik: ${e.user_.username}\n `)).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsAttachmentReUpload=a.dls.reUpload({id:e.id}).subscribe({next:r=>{a.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_REUPLOAD_SUCCESS]",r),a.bs.idle(),a.getAttachment()},error:r=>{a.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_REUPLOAD_ERROR]",r,"error"),a.bs.idle(),a.getAttachment()}})):!1===i&&a.getAttachment(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getAttachment()}onServerSideFilter(e){this.gs.log("[LAMPIRAN_PENDING_LIST_ENTER_FILTER]",e),this.q=e,this.getAttachment()}onServerSideOrder(e){this.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getAttachment()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(ka.v),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-ddl"]],decls:15,vars:5,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row","my-4"],[1,"col-12","text-end","text-success"],["labelPosition","before",3,"ngModel","ngModelChange","change"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"mat-slide-toggle",5),t.NdJ("ngModelChange",function(s){return i.failed=s})("change",function(){return i.getAttachment()}),t._uU(7," Tampilkan Yang Tidak Selesai Saja "),t.qZA()()(),t.TgZ(8,"div",6)(9,"div",7)(10,"h2",8)(11,"b",9),t._uU(12,"Kelola Berkas DDL"),t.qZA()()(),t.TgZ(13,"div",10)(14,"app-material-table",11),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)}),t.qZA()()()()()()),2&a&&(t.xp6(6),t.Q6J("ngModel",i.failed),t.xp6(8),t.Q6J("tableDataColumn",i.attachmentData.column)("tableDataRow",i.attachmentData.row)("count",i.count)("serverSide",!0))},dependencies:[He.iZ,I.I,k.t,l.JJ,l.On]})}return n})();var D=c(1741),Sa=c(1140);let Ia=(()=>{class n{constructor(e,a,i,r,s,d,_,C){this.router=e,this.bs=a,this.ds=i,this.as=r,this.gs=s,this.ss=d,this.adm=_,this.user=C,this.subsUserGet=null,this.subsUserDelete=null,this.subsPromote=null,this.subsDialog=null,this.subsBannedGet=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.userData={column:["Id","Role","Image","Username","Nama Lengkap","Email","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getUser()}ngOnDestroy(){this.subsUserGet?.unsubscribe(),this.subsUserDelete?.unsubscribe(),this.subsPromote?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsBannedGet?.unsubscribe()}getUser(){this.bs.busy(),this.subsUserGet&&(this.subsUserGet.unsubscribe(),this.bs.idle()),this.subsUserGet=this.user.getAllUser(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[USER_LIST_SUCCESS]",e),this.count=e.count,this.userData.row=[],this.bs.busy(),e.results.length>0&&(this.subsBannedGet=this.adm.getBanned({username:e.results.map(a=>a.username)}).subscribe({next:a=>{this.gs.log("[BANNED_LIST_SUCCESS]",e);const i=[];let r=[];r=this.as.currentUserSubject?.value?.role===D.yS.ADMIN?[D.yS.ADMIN]:[D.yS.ADMIN,D.yS.MODERATOR];for(const s of e.results)i.push({Id:s.id,Role:s.role,Image:s.image_url,Username:s.username,Email:s._email,"Nama Lengkap":s.kartu_tanda_penduduk_.nama,banned:Object.keys(a.results[s.username]).length>0,Aksi:[{type:"button",icon:"mail_outline",name:"MAIL",row:s},...Object.keys(a.results[s.username]).length>0||s.username===this.as.currentUserSubject?.value?.username||this.gs.includesOneOf(s.role,r)?[]:[{type:"button",icon:"lock",name:"BAN",row:s},{type:"button",icon:"handyman",name:D.yS.ADMIN,row:s},{type:"button",icon:"security",name:D.yS.MODERATOR,row:s},{type:"button",icon:"rate_review",name:D.yS.FANSUBBER,row:s},{type:"button",icon:"person",name:D.yS.USER,row:s}]]});this.userData.row=i,this.bs.idle()},error:a=>{this.gs.log("[BANNED_LIST_ERROR]",a,"error"),this.bs.idle()}})),this.bs.idle()},error:e=>{this.gs.log("[USER_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[USER_LIST_CLICK_AKSI]",e),"BAN"===e.name?this.ban(e.row):"MAIL"===e.name?this.router.navigate(["/create/mailbox"],{queryParams:{to:`${e.row.username}@${z.N.domain}`,cc:e.row._email}}):this.proDemote(e.row,e.name)}ban(e){this.gs.log("[USER_LIST_CLICK_BAN]",e),this.subsDialog=this.ds.openInputDialog({data:{title:`BAN Akun -- '${e.username}'`,input:{reason:{inputLabel:"Alasan",inputPlaceholder:`Manually Banned By ${this.as.currentUserSubject?.value?.role}`,inputValue:null,inputRequired:!0}},confirmText:"Ya, BAN Akun",cancelText:"Tidak, Batal"},disableClose:!1}).afterClosed().subscribe({next:a=>{this.gs.log("[INPUT_DIALOG_CLOSED]",a),a?(this.bs.busy(),this.subsUserDelete=this.adm.ban({id:e.id,email:e.email,username:e.username,reason:a.reason}).subscribe({next:i=>{this.gs.log("[USER_LIST_CLICK_BAN_SUCCESS]",i),this.bs.idle(),this.getUser(),this.ss.socketEmitVolatile("force-logout",{username:e.username,reason:a.reason})},error:i=>{this.gs.log("[USER_LIST_CLICK_BAN_ERROR]",i,"error"),this.bs.idle(),this.getUser()}})):this.getUser(),this.subsDialog.unsubscribe()}})}proDemote(e,a){var i=this;return(0,S.Z)(function*(){i.gs.log("[USER_LIST_CLICK_PROMOTE]",e),i.subsDialog=(yield i.ds.openKonfirmasiDialog(`Pro/Demosikan Akun -- '${e.username}'`,`Apakah Yakin Ingin Menjadikannya Sebagai ${a} ?`)).afterClosed().subscribe({next:r=>{i.gs.log("[INFO_DIALOG_CLOSED]",r),!0===r?(i.bs.busy(),i.subsPromote=i.adm.proDemote({id:e.id,role:a}).subscribe({next:s=>{i.gs.log("[USER_LIST_CLICK_PROMOTE_SUCCESS]",s),i.bs.idle(),i.getUser()},error:s=>{i.gs.log("[USER_LIST_CLICK_PROMOTE_ERROR]",s,"error"),i.bs.idle(),i.getUser()}})):!1===r&&i.getUser(),i.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[USER_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getUser()}onServerSideFilter(e){this.gs.log("[USER_LIST_ENTER_FILTER]",e),this.q=e,this.getUser()}onServerSideOrder(e){this.gs.log("[USER_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getUser()}openUser(e){this.gs.log("[USER_LIST_CLICK_USER]",e),this.router.navigateByUrl(`/user/${e.Username}`)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(X.F0),t.Y36(y.z),t.Y36(M.x),t.Y36(Ce.e),t.Y36(A.U),t.Y36(Ke.R),t.Y36(Q.l),t.Y36(Sa.K))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-user"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Kelola Seluruh Member"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openUser(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.userData.column)("tableDataRow",i.userData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})();var g=c(3659),wa=c(7245),Na=c(3719),xe=c(9818),Ea=c(7443);function Ra(n,o){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function Oa(n,o){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageErrorText)}}function La(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",2)(1,"button",34),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.submitImage())}),t._UZ(2,"mat-icon",35),t._uU(3," Unggah "),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Fa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Nama Tidak Boleh Kosong"),t.qZA())}function Pa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Nama Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Za(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Deskripsi Tidak Boleh Kosong"),t.qZA())}function Va(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Deskripsi Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ya(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",10),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSubmit())}),t.TgZ(1,"div",11)(2,"h2",6)(3,"b",7),t._uU(4,"Buat Tipe Jenis Proyek Baru"),t.qZA()()(),t.TgZ(5,"div",2)(6,"div",3)(7,"div",12)(8,"div",3)(9,"div",2),t._UZ(10,"img",13),t.TgZ(11,"mat-form-field",14)(12,"mat-label"),t._uU(13,"Gambar"),t.qZA(),t.TgZ(14,"ngx-mat-file-input",15,16),t.NdJ("change",function(i){t.CHM(e);const r=t.MAs(15),s=t.oxw();return t.KtG(s.uploadImage(i,r))}),t.qZA(),t._UZ(16,"mat-icon",17),t.qZA(),t.TgZ(17,"mat-error",18)(18,"small"),t.YNc(19,Ra,3,3,"div",19),t.YNc(20,Oa,2,1,"div",19),t.qZA()()(),t.YNc(21,La,4,1,"div",20),t.qZA()(),t.TgZ(22,"div",21)(23,"div",3)(24,"mat-form-field",22)(25,"mat-label"),t._uU(26,"Nama"),t.qZA(),t._UZ(27,"input",23)(28,"mat-icon",24),t.TgZ(29,"mat-hint",25),t._uU(30,"Untuk Jenis Berkas"),t.qZA(),t.TgZ(31,"mat-error"),t.YNc(32,Fa,2,0,"div",19),t.YNc(33,Pa,2,0,"div",19),t.qZA()(),t.TgZ(34,"mat-form-field",22)(35,"mat-label"),t._uU(36,"Deskripsi"),t.qZA(),t._UZ(37,"input",26)(38,"mat-icon",27),t.TgZ(39,"mat-error"),t.YNc(40,Za,2,0,"div",19),t.YNc(41,Va,2,0,"div",19),t.qZA()()()(),t.TgZ(42,"div",8)(43,"div",28)(44,"div",2)(45,"div",29),t._UZ(46,"div",30),t.TgZ(47,"div",31)(48,"button",32),t._uU(49," Simpan "),t._UZ(50,"mat-icon",33),t.qZA()()()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(10),t.Q6J("src",e.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",e.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imageErrorText),t.xp6(1),t.Q6J("ngIf",e.image&&!e.fg.value.image),t.xp6(3),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",e.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("description").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("description").hasError("pattern")),t.xp6(7),t.Q6J("disabled",e.submitted||e.fg.invalid)}}let Ua=(()=>{class n{constructor(e,a,i,r,s,d){this.fb=e,this.bs=a,this.gs=i,this.ds=r,this.imgbb=s,this.project=d,this.submitted=!1,this.subsProjectGet=null,this.subsProjectCreate=null,this.subsProjectDelete=null,this.subsImgbb=null,this.subsDialog=null,this.gambar=null,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.projectData={column:["Nama","Image","Deskripsi","Berkas","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.getProject())}ngOnDestroy(){this.subsProjectCreate?.unsubscribe(),this.subsProjectGet?.unsubscribe(),this.subsProjectDelete?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsDialog?.unsubscribe()}initForm(){this.fg=this.fb.group({name:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],description:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],image:[null,l.kI.compose([l.kI.pattern(g.t.regexUrl)])]})}getProject(){this.bs.busy(),this.subsProjectGet&&(this.subsProjectGet.unsubscribe(),this.bs.idle()),this.subsProjectGet=this.project.getProject().subscribe({next:e=>{this.gs.log("[PROJECT_LIST_SUCCESS]",e);const a=[];for(const i of e.results)a.push({Nama:i.name,Image:i.image_url,Deskripsi:i.description,Berkas:i.total_berkas,Aksi:i.total_berkas>0?[]:[{type:"button",icon:"delete_forever",name:"Hapus",row:i}]});this.projectData.row=a,this.bs.idle()},error:e=>{this.gs.log("[PROJECT_LIST_ERROR]",e,"error"),this.bs.idle()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsProjectCreate=this.project.createProject({name:this.fg.value.name,description:this.fg.value.description,image:this.fg.value.image}).subscribe({next:e=>{this.gs.log("[PROJECT_CREATE_SUCCESS]",e),this.submitted=!1,this.bs.idle();for(const a in this.fg.controls)this.fg.controls[a]&&(this.fg.controls[a].patchValue(null),this.fg.controls[a].updateValueAndValidity(),this.fg.controls[a].setErrors(null),this.fg.controls[a].markAsUntouched(),this.fg.controls[a].markAsPristine());this.getProject()},error:e=>{this.gs.log("[PROJECT_CREATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle(),this.getProject()}})}action(e){this.gs.log("[PROJECT_LIST_CLICK_AKSI]",e),"Hapus"===e.name&&this.deleteProject(e.row)}deleteProject(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[PROJECT_LIST_CLICK_DELETE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Hapus Proyek -- '${e.id}' :: '${e.nama}'`,"Menghapus Dapat Membuat Error / Menghapus Berkas Yang Menunjuk Ke Tipe Ini !")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsProjectDelete=a.project.deleteProject(e.id).subscribe({next:r=>{a.gs.log("[PROJECT_LIST_CLICK_DELETE_SUCCESS]",r),a.bs.idle(),a.getProject()},error:r=>{a.gs.log("[PROJECT_LIST_CLICK_DELETE_ERROR]",r,"error"),a.bs.idle(),a.getProject()}})):!1===i&&a.getProject(),a.subsDialog.unsubscribe()}})})()}uploadImage(e,a){this.gambar=a,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const i=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(i),r.onload=s=>{if(this.gs.log("[IMAGE_SELECTED]",s),i.size<=g.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=i,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=g.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.imageErrorText=e.result?.message||e.info,this.submitted=!1}})}openProject(e){this.gs.log("[PROJECT_LIST_CLICK_PROJECT]",e)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(l.QS),t.Y36(y.z),t.Y36(A.U),t.Y36(M.x),t.Y36(wa.X),t.Y36(Na.Y))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-project-type"]],decls:13,vars:3,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[3,"formGroup","submit",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","rowClicked","buttonClicked"],[3,"formGroup","submit"],[1,"col-12","sticky-top","bg-bifeldy","pb-1"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","**_BD","required",""],["fontIcon","short_text","matSuffix",""],["align","end"],["matInput","","formControlName","description","placeholder","Edisi Terbatas","required",""],["fontIcon","wysiwyg","matSuffix",""],[1,"row","mt-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,Ya,51,15,"form",4),t.qZA(),t.TgZ(6,"div",3)(7,"div",5)(8,"h2",6)(9,"b",7),t._uU(10,"Hapus Jenis Proyek Yang Ada"),t.qZA()()(),t.TgZ(11,"div",8)(12,"app-material-table",9),t.NdJ("rowClicked",function(s){return i.openProject(s)})("buttonClicked",function(s){return i.action(s)}),t.qZA()()()()()()),2&a&&(t.xp6(5),t.Q6J("ngIf",i.fg),t.xp6(7),t.Q6J("tableDataColumn",i.projectData.column)("tableDataRow",i.projectData.row))},dependencies:[h.O5,xe.eB,Y.Hw,f.nI,f.v_,f.pH,f.$V,f.nX,re.k0,I.I,k.t,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.sg,l.u,Be.Yh,Ea.$]})}return n})();var qe=c(4363),Ba=c(9602),Ge=c(6289);const Ka=["kalender"];function Ja(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Tidak Boleh Kosong"),t.qZA())}function Ha(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function qa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Isi Tidak Boleh Kosong"),t.qZA())}function Ga(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Isi Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ja(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function Qa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tipe Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function $a(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function za(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Dismissible Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Xa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Timeout Hanya Boleh Angka"),t.qZA())}function Wa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Tidak Valid"),t.qZA())}function ei(n,o){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij("Paling Lama ",e.maxNotificationDays," Hari Mendatang")}}function ti(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Paling Cepat Detik Ini Sekarang"),t.qZA())}function ai(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ii(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",10),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSubmit())}),t.TgZ(1,"div",11)(2,"h2",6)(3,"b",7),t._uU(4,"Buat Push Notifikasi"),t.qZA()()(),t.TgZ(5,"div",2)(6,"div",3)(7,"mat-form-field",12)(8,"mat-label"),t._uU(9,"Judul"),t.qZA(),t._UZ(10,"input",13)(11,"mat-icon",14),t.TgZ(12,"mat-hint",15),t._uU(13,"Teks Tebal Di Kiri"),t.qZA(),t.TgZ(14,"mat-error"),t.YNc(15,Ja,2,0,"div",16),t.YNc(16,Ha,2,0,"div",16),t.qZA()(),t.TgZ(17,"mat-form-field",17)(18,"mat-label"),t._uU(19,"Konten / Isi"),t.qZA(),t._UZ(20,"input",18)(21,"mat-icon",19),t.TgZ(22,"mat-error"),t.YNc(23,qa,2,0,"div",16),t.YNc(24,Ga,2,0,"div",16),t.qZA()(),t.TgZ(25,"mat-form-field",20)(26,"mat-label"),t._uU(27,"Jenis Warna"),t.qZA(),t.TgZ(28,"mat-select",21)(29,"mat-option",22),t._uU(30,"Merah"),t.qZA(),t.TgZ(31,"mat-option",23),t._uU(32,"Kuning"),t.qZA(),t.TgZ(33,"mat-option",24),t._uU(34,"Hijau"),t.qZA(),t.TgZ(35,"mat-option",25),t._uU(36,"Putih"),t.qZA(),t.TgZ(37,"mat-option",26),t._uU(38,"Hitam"),t.qZA(),t.TgZ(39,"mat-option",27),t._uU(40,"Abu Abu"),t.qZA(),t.TgZ(41,"mat-option",28),t._uU(42,"Biru Tua"),t.qZA(),t.TgZ(43,"mat-option",29),t._uU(44,"Biru Muda"),t.qZA()(),t.TgZ(45,"mat-error"),t.YNc(46,ja,2,0,"div",16),t.YNc(47,Qa,2,0,"div",16),t.qZA()(),t.TgZ(48,"mat-form-field",20)(49,"mat-label"),t._uU(50,"Dapat Ditutup"),t.qZA(),t.TgZ(51,"mat-select",30)(52,"mat-option",31),t._uU(53,"Ya"),t.qZA(),t.TgZ(54,"mat-option",32),t._uU(55,"Tidak"),t.qZA()(),t.TgZ(56,"mat-hint",15),t._uU(57,"Tombol X Di Kanan"),t.qZA(),t.TgZ(58,"mat-error"),t.YNc(59,$a,2,0,"div",16),t.YNc(60,za,2,0,"div",16),t.qZA()(),t.TgZ(61,"mat-form-field",20)(62,"mat-label"),t._uU(63,"Timeout"),t.qZA(),t._UZ(64,"input",33)(65,"mat-icon",34),t.TgZ(66,"mat-hint",15),t._uU(67,"Dalam Mili-Detik"),t.qZA(),t.TgZ(68,"mat-error"),t.YNc(69,Xa,2,0,"div",16),t.qZA()(),t.TgZ(70,"mat-form-field",20)(71,"mat-label"),t._uU(72,"Deadline"),t.qZA(),t.TgZ(73,"input",35),t.NdJ("focus",function(){t.CHM(e);const i=t.MAs(77);return t.KtG(i.open())}),t.ALo(74,"date"),t.qZA(),t._UZ(75,"mat-datepicker-toggle",36),t.TgZ(76,"ngx-mat-datetime-picker",37,38)(78,"ngx-mat-datepicker-actions")(79,"button",39),t._uU(80,"Batal"),t.qZA(),t.TgZ(81,"button",40),t._uU(82,"Simpan"),t.qZA()()(),t.TgZ(83,"mat-hint",15),t._uU(84,"Muncul Setiap Halaman Di Refresh"),t.qZA(),t.TgZ(85,"mat-error"),t.YNc(86,Wa,2,0,"div",16),t.YNc(87,ei,2,1,"div",16),t.YNc(88,ti,2,0,"div",16),t.YNc(89,ai,2,0,"div",16),t.qZA()()(),t.TgZ(90,"div",41)(91,"div",2)(92,"div",42),t._UZ(93,"div",43),t.TgZ(94,"div",44)(95,"button",45),t._uU(96," Simpan "),t._UZ(97,"mat-icon",46),t.qZA()()()()()()()}if(2&n){const e=t.MAs(77),a=t.oxw();t.Q6J("formGroup",a.fg),t.xp6(7),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",a.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("title").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",a.fg.get("content").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("content").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(21),t.Q6J("ngIf",a.fg.get("type").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("type").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",a.fg.get("dismissible").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("dismissible").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",a.fg.get("timeout").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.s9C("placeholder",t.xi3(74,31,a.currentDateTime,"d MMMM y, HH:mm:ss")),t.Q6J("ngxMatDatetimePicker",e)("min",a.currentDateTime)("max",a.maxDateTime),t.xp6(2),t.Q6J("for",a.dateTimePicker),t.xp6(1),t.Q6J("showSpinners",!0)("showSeconds",!0)("enableMeridian",!0),t.xp6(3),t.Q6J("color","warn"),t.xp6(2),t.Q6J("color","primary"),t.xp6(5),t.Q6J("ngIf",a.fg.get("deadline").hasError("matDatetimePickerParse")),t.xp6(1),t.Q6J("ngIf",a.fg.get("deadline").hasError("matDatetimePickerMax")),t.xp6(1),t.Q6J("ngIf",a.fg.get("deadline").hasError("matDatetimePickerMin")),t.xp6(1),t.Q6J("ngIf",a.fg.get("deadline").hasError("pattern")),t.xp6(6),t.Q6J("disabled",a.submitted||a.fg.invalid)}}let ni=(()=>{class n{constructor(e,a,i,r,s){this.fb=e,this.bs=a,this.ds=i,this.gs=r,this.adm=s,this.submitted=!1,this.subsNotifGet=null,this.subsNotifCreate=null,this.subsNotifDelete=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.notifData={column:["Deadline","Judul","Konten","Pemilik","Aksi"],row:[]},this.currentDateTime=new Date,this.maxDateTime=new Date(Date.now()+g.t.timeMaxDaysNotification),this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.getNotif())}get maxNotificationDays(){return g.t.timeMaxDaysNotification/24/60/60/1e3}ngOnDestroy(){this.subsNotifCreate?.unsubscribe(),this.subsNotifGet?.unsubscribe(),this.subsNotifDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}initForm(){this.fg=this.fb.group({title:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],content:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],type:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],dismissible:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],timeout:[null,l.kI.compose([l.kI.pattern(/^[0-9]+$/)])],deadline:[null,l.kI.compose([l.kI.pattern(g.t.regexEnglishKeyboardKeys)])]})}get dateTimePicker(){return this.kalender}getNotif(){this.bs.busy(),this.subsNotifGet&&(this.subsNotifGet.unsubscribe(),this.bs.idle()),this.subsNotifGet=this.adm.getAllNotif(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[NOTIFICATION_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({foto:i.user_.image_url,deleted:new Date(i.deadline).getTime()===new Date(0).getTime(),Deadline:i.deadline,Judul:i.title,Konten:i.content,Pemilik:i.user_.username,Aksi:(new Date).getTime()>new Date(i.deadline).getTime()?[]:[{type:"button",icon:"close",name:"Hapus",row:i}]});this.notifData.row=a,this.bs.idle()},error:e=>{this.gs.log("[NOTIFICATION_LIST_ERROR]",e,"error"),this.bs.idle()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNotifCreate=this.adm.createNotif({type:this.fg.value.type,title:this.fg.value.title,content:this.fg.value.content,dismissible:"1"===this.fg.value.dismissible,timeout:this.fg.value.timeout,deadline:this.fg.value.deadline}).subscribe({next:e=>{this.gs.log("[NOTIFICATION_CREATE_SUCCESS]",e),this.submitted=!1,this.bs.idle();for(const a in this.fg.controls)this.fg.controls[a]&&(this.fg.controls[a].patchValue(null),this.fg.controls[a].updateValueAndValidity(),this.fg.controls[a].setErrors(null),this.fg.controls[a].markAsUntouched(),this.fg.controls[a].markAsPristine());this.getNotif()},error:e=>{this.gs.log("[NOTIFICATION_CREATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle(),this.getNotif()}})}action(e){this.gs.log("[NOTIFICATION_LIST_CLICK_AKSI]",e),"Hapus"===e.name&&this.deleteNotif(e.row)}deleteNotif(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[NOTIFICATION_LIST_CLICK_DELETE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Hapus Notif -- '${e.id}' :: '${e.title}'`,"Yakin Akan Menghapus Notifikasi Ini ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsNotifDelete=a.adm.deleteNotif(e.id).subscribe({next:r=>{a.gs.log("[NOTIFICATION_LIST_CLICK_DELETE_SUCCESS]",r),a.bs.idle(),a.getNotif()},error:r=>{a.gs.log("[NOTIFICATION_LIST_CLICK_DELETE_ERROR]",r,"error"),a.bs.idle(),a.getNotif()}})):!1===i&&a.getNotif(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[NOTIFICATION_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getNotif()}onServerSideFilter(e){this.gs.log("[NOTIFICATION_LIST_ENTER_FILTER]",e),this.q=e,this.getNotif()}onServerSideOrder(e){this.gs.log("[NOTIFICATION_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getNotif()}openNotif(e){this.gs.log("[NOTIFICATION_LIST_CLICK_NOTIFICATION]",e)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(l.QS),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(Q.l))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-push-notification"]],viewQuery:function(a,i){if(1&a&&t.Gf(Ka,7),2&a){let r;t.iGM(r=t.CRH())&&(i.kalender=r.first)}},decls:13,vars:5,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[3,"formGroup","submit",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"],[3,"formGroup","submit"],[1,"col-12","sticky-top","bg-bifeldy","pb-1"],["appearance","outline",1,"p-3","col-12","col-md-4",3,"color"],["matInput","","formControlName","title","placeholder","Perhatian!","required",""],["fontIcon","short_text","matSuffix",""],["align","end"],[4,"ngIf"],["appearance","outline",1,"p-3","col-12","col-md-8",3,"color"],["matInput","","formControlName","content","placeholder","Akan Diadakan Maintenance Pada ...","required",""],["fontIcon","wysiwyg","matSuffix",""],["appearance","outline",1,"p-3","col-12","col-md-3",3,"color"],["formControlName","type","placeholder","Class Warna Bootstrap","required",""],["value","danger"],["value","warning"],["value","success"],["value","light"],["value","dark"],["value","secondary"],["value","primary"],["value","info"],["formControlName","dismissible","placeholder","Ya / Tidak","required",""],["value","1"],["value","0"],["type","number","matInput","","formControlName","timeout","placeholder","10000"],["fontIcon","123","matSuffix",""],["matInput","","formControlName","deadline",3,"ngxMatDatetimePicker","placeholder","min","max","focus"],["matSuffix","",3,"for"],[3,"showSpinners","showSeconds","enableMeridian"],["kalender",""],["mat-stroked-button","","ngxMatDatepickerCancel","",3,"color"],["mat-flat-button","","ngxMatDatepickerApply","",3,"color"],[1,"row","mt-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,ii,98,34,"form",4),t.qZA(),t.TgZ(6,"div",3)(7,"div",5)(8,"h2",6)(9,"b",7),t._uU(10,"Deadline Notifikasi"),t.qZA()()(),t.TgZ(11,"div",8)(12,"app-material-table",9),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openNotif(s)}),t.qZA()()()()()()),2&a&&(t.xp6(5),t.Q6J("ngIf",i.fg),t.xp6(7),t.Q6J("tableDataColumn",i.notifData.column)("tableDataRow",i.notifData.row)("count",i.count)("serverSide",!0))},dependencies:[h.O5,qe.CK,xe.eB,Ba.nW,Y.Hw,f.nI,f.v_,f.pH,f.$V,f.nX,re.k0,Ge.x8,I.I,k.t,l._Y,l.Fj,l.wV,l.JJ,l.JL,l.Q7,l.sg,l.u,sa,De,da,la,oa,h.uU]})}return n})();var ri=c(3842);let si=(()=>{class n{constructor(e,a,i,r){this.bs=e,this.ds=a,this.fansub=i,this.gs=r,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.memberData={column:["Id","Fansub","Anggota","Keterangan","Aksi"],row:[]},this.subsMemberGet=null,this.subsMemberPut=null,this.subsMemberDelete=null,this.subsDialog=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getFansubMember()}ngOnDestroy(){this.subsMemberGet?.unsubscribe(),this.subsMemberPut?.unsubscribe(),this.subsMemberDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}getFansubMember(){this.bs.busy(),this.subsMemberGet&&(this.subsMemberGet.unsubscribe(),this.bs.idle()),this.subsMemberGet=this.fansub.getAllFansubMember(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[FANSUB_MEMBER_LIST_SUCCESS]",e);const a=[];this.count=e.count;for(const i of e.results)a.push({foto_fansub:i.fansub_.image_url,foto_anggota:i.user_.image_url,Id:i.id,Fansub:i.fansub_.slug,Anggota:i.user_.username,Keterangan:i.keterangan,Aksi:i.approved?[{type:"button",icon:"no_meeting_room",name:"KICK",row:i}]:[{type:"button",icon:"done",name:"ACCEPT",row:i},{type:"button",icon:"close",name:"REJECT",row:i}]});this.memberData.row=a,this.bs.idle()},error:e=>{this.gs.log("[FANSUB_MEMBER_LIST_ERROR]",e,"error"),this.bs.idle()}})}onPaginatorClicked(e){this.gs.log("[FANSUB_MEMBER_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getFansubMember()}onServerSideFilter(e){this.gs.log("[FANSUB_MEMBER_LIST_ENTER_FILTER]",e),this.q=e,this.getFansubMember()}onServerSideOrder(e){this.gs.log("[FANSUB_MEMBER_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getFansubMember()}action(e){this.gs.log("[FANSUB_MEMBER_LIST_CLICK_AKSI]",e),"KICK"===e.name?this.kickMember(e.row):"ACCEPT"===e.name?this.approveOrRejectFansubMember(e.row,!0):"REJECT"===e.name&&this.approveOrRejectFansubMember(e.row,!1)}approveOrRejectFansubMember(e,a){this.subsDialog=this.ds.openInputDialog({data:{title:`Keterangan ${a?"Approve":"Reject"} '${e.user_.username}' :: '${e.fansub_.slug}'`,input:{keterangan:{inputLabel:"Keterangan",inputPlaceholder:"Pemilik, Translator, Timer, QA / QC, TypeSetter, dll.",inputValue:null,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Max. 10 Huruf"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INPUT_DIALOG_CLOSED]",i),i?(this.bs.busy(),this.subsMemberPut=this.fansub.approveRejectFansubMember(e.id,{approved:a,keterangan:i.keterangan?.substring(0,10)}).subscribe({next:r=>{this.gs.log("[FANSUB_MEMBER_APPROVE_REJECT_SUCCESS]",r),this.getFansubMember(),this.bs.idle()},error:r=>{this.gs.log("[FANSUB_MEMBER_APPROVE_REJECT_ERROR]",r,"error"),this.getFansubMember(),this.bs.idle()}})):!1===i&&this.getFansubMember(),this.subsDialog.unsubscribe()}})}kickMember(e){var a=this;return(0,S.Z)(function*(){a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Kick Member -- '${e.user_.username}' :: '${e.fansub_.slug}'`,"Apakah Yakin Dan Akun Telah Direview Sebelum Dikeluarkan ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsMemberDelete=a.fansub.leaveFansubMember(e.id).subscribe({next:r=>{a.gs.log("[FANSUB_MEMBER_KICK_SUCCESS]",r),a.getFansubMember(),a.bs.idle()},error:r=>{a.gs.log("[FANSUB_MEMBER_KICK_ERROR]",r,"error"),a.getFansubMember(),a.bs.idle()}})):!1===i&&a.getFansubMember(),a.subsDialog.unsubscribe()}})})()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(M.x),t.Y36(ri.T),t.Y36(A.U))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-fansub-member"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Atur Keanggotaan Fansub"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.memberData.column)("tableDataRow",i.memberData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})(),oi=(()=>{class n{constructor(e,a,i,r,s,d){this.router=e,this.adm=a,this.bs=i,this.ds=r,this.gs=s,this.as=d,this.subsBannedGet=null,this.subsBannedDelete=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.bannedData={column:["Id","Korban","Alasan","Pelaku","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getBan()}ngOnDestroy(){this.subsBannedGet?.unsubscribe(),this.subsBannedDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}getBan(){this.bs.busy(),this.subsBannedGet&&(this.subsBannedGet.unsubscribe(),this.bs.idle()),this.subsBannedGet=this.adm.getAllBanned(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[BANNED_LIST_SUCCESS]",e),this.count=e.count;const a=[];let i=[];i=this.as.currentUserSubject?.value?.role===D.yS.ADMIN?[D.yS.ADMIN]:[D.yS.ADMIN,D.yS.MODERATOR];for(const r of e.results)a.push({Id:r.id,foto_korban:r.user_.image_url,foto_pelaku:r.banned_by_?.image_url||`${z.N.baseUrl}/assets/img/favicon.png`,Korban:r.user_.username,Pelaku:r.banned_by_?.username||"AUTO_BANNED",Alasan:r.reason,Aksi:[...this.gs.includesOneOf(r.user_.role,i)?[]:[{type:"button",icon:"lock_open",name:"UnBAN",row:r}]]});this.bannedData.row=a,this.bs.idle()},error:e=>{this.gs.log("[BANNED_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[BANNED_LIST_CLICK_AKSI]",e),"UnBAN"===e.name&&this.unBan(e.row)}unBan(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[BANNED_LIST_CLICK_UNBAN]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`UnBAN Akun -- '${e.user_.username}'`,"Apakah Yakin Dan Akun Telah Direview Sebelum UnBAN ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsBannedDelete=a.adm.unBan(e.id).subscribe({next:r=>{a.gs.log("[BANNED_LIST_CLICK_UNBAN_SUCCESS]",r),a.bs.idle(),a.getBan()},error:r=>{a.gs.log("[BANNED_LIST_CLICK_UNBAN_ERROR]",r,"error"),a.bs.idle(),a.getBan()}})):!1===i&&a.getBan(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[BANNED_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getBan()}onServerSideFilter(e){this.gs.log("[BANNED_LIST_ENTER_FILTER]",e),this.q=e,this.getBan()}onServerSideOrder(e){this.gs.log("[BANNED_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getBan()}openBan(e){this.gs.log("[BANNED_LIST_CLICK_BANNED]",e),this.router.navigateByUrl(`/user/${e.Korban}`)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(X.F0),t.Y36(Q.l),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(Ce.e))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-banned"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"User Yang Terkena BAN"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openBan(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.bannedData.column)("tableDataRow",i.bannedData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})(),li=(()=>{class n{constructor(e,a,i,r){this.bs=e,this.ds=a,this.gs=i,this.adm=r,this.subsCorsGet=null,this.subsCorsDelete=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.corsData={column:["Id","Nama Api","IP Domain","Api Key","Pemilik","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getCors()}ngOnDestroy(){this.subsCorsGet?.unsubscribe(),this.subsCorsDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}getCors(){this.bs.busy(),this.subsCorsGet&&(this.subsCorsGet.unsubscribe(),this.bs.idle()),this.subsCorsGet=this.adm.getAllCors(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[CORS_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({Id:i.id,"Nama Api":i.name,"IP Domain":i.ip_domain,"Api Key":i.api_key,foto:i.user_?.image_url||`${z.N.baseUrl}/assets/img/favicon.png`,Pemilik:i.user_?.username||"SYSTEM",Aksi:[{type:"button",icon:"layers_clear",name:"Revoke",row:i}]});this.corsData.row=a,this.bs.idle()},error:e=>{this.gs.log("[CORS_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[CORS_LIST_CLICK_AKSI]",e),"Revoke"===e.name&&this.revokeCors(e.row)}revokeCors(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[CORS_LIST_CLICK_REVOKE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Revoke Kunci -- '${e.id}' :: '${e.ip_domain}'`,"Apakah Yakin Untuk Menonaktifkan Kunci Ini ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsCorsDelete=a.adm.revokeCors(e.id).subscribe({next:r=>{a.gs.log("[CORS_LIST_CLICK_REVOKE_SUCCESS]",r),a.bs.idle(),a.getCors()},error:r=>{a.gs.log("[CORS_LIST_CLICK_REVOKE_ERROR]",r,"error"),a.bs.idle(),a.getCors()}})):!1===i&&a.getCors(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[CORS_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getCors()}onServerSideFilter(e){this.gs.log("[CORS_LIST_ENTER_FILTER]",e),this.q=e,this.getCors()}onServerSideOrder(e){this.gs.log("[CORS_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getCors()}openCors(e){this.gs.log("[CORS_LIST_CLICK_CORS]",e)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(Q.l))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-cors"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Kelola API Key"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openCors(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.corsData.column)("tableDataRow",i.corsData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})();var di=c(1092);function ci(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Kode Tidak Boleh Kosong"),t.qZA())}function ui(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Kode Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function hi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Tidak Boleh Kosong"),t.qZA())}function pi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function mi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tombol OK Tidak Boleh Kosong"),t.qZA())}function gi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tombol OK Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function _i(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Tidak Boleh Kosong"),t.qZA())}function fi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function bi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function vi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Di(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function Ci(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ai(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",10),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSubmit())}),t.TgZ(1,"div",11)(2,"h2",6)(3,"b",7),t._uU(4,"Tambah / Ubah Informasi Dialog Pop-Up!"),t.qZA()()(),t.TgZ(5,"div",2)(6,"div",3)(7,"mat-form-field",12)(8,"mat-label"),t._uU(9,"Kode ID"),t.qZA(),t._UZ(10,"input",13)(11,"mat-icon",14),t.TgZ(12,"mat-hint",15),t._uU(13,"ID Untuk Request API"),t.qZA(),t.TgZ(14,"mat-error"),t.YNc(15,ci,2,0,"div",16),t.YNc(16,ui,2,0,"div",16),t.qZA()(),t.TgZ(17,"mat-form-field",17)(18,"mat-label"),t._uU(19,"Judul Dialog"),t.qZA(),t._UZ(20,"input",18)(21,"mat-icon",14),t.TgZ(22,"mat-error"),t.YNc(23,hi,2,0,"div",16),t.YNc(24,pi,2,0,"div",16),t.qZA()()(),t.TgZ(25,"div",3)(26,"div",19)(27,"div",3)(28,"mat-form-field",20)(29,"mat-label"),t._uU(30,"Tombol OK"),t.qZA(),t._UZ(31,"input",21)(32,"mat-icon",14),t.TgZ(33,"mat-error"),t.YNc(34,mi,2,0,"div",16),t.YNc(35,gi,2,0,"div",16),t.qZA()(),t.TgZ(36,"mat-form-field",20)(37,"mat-label"),t._uU(38,"Tombol Cancel"),t.qZA(),t._UZ(39,"input",22)(40,"mat-icon",14),t.TgZ(41,"mat-error"),t.YNc(42,_i,2,0,"div",16),t.YNc(43,fi,2,0,"div",16),t.qZA()(),t.TgZ(44,"mat-form-field",20)(45,"mat-label"),t._uU(46,"Cegah Klik Tutup Dimana Saja"),t.qZA(),t.TgZ(47,"mat-select",23)(48,"mat-option",24),t._uU(49,"Tidak"),t.qZA(),t.TgZ(50,"mat-option",25),t._uU(51,"Ya"),t.qZA()(),t.TgZ(52,"mat-hint",15),t._uU(53,"Antisipasi Kesalahan Klik"),t.qZA(),t.TgZ(54,"mat-error"),t.YNc(55,bi,2,0,"div",16),t.YNc(56,vi,2,0,"div",16),t.qZA()(),t.TgZ(57,"mat-form-field",20)(58,"mat-label"),t._uU(59,"Langsung Disiarkan Saja"),t.qZA(),t.TgZ(60,"mat-select",26)(61,"mat-option",24),t._uU(62,"Tidak"),t.qZA(),t.TgZ(63,"mat-option",25),t._uU(64,"Ya"),t.qZA()(),t.TgZ(65,"mat-hint",15),t._uU(66,"Live Popup Message Tidak Disimpan"),t.qZA(),t.TgZ(67,"mat-error"),t.YNc(68,Di,2,0,"div",16),t.YNc(69,Ci,2,0,"div",16),t.qZA()()()(),t.TgZ(70,"div",27)(71,"div",3),t._UZ(72,"angular-editor",28),t.qZA()()(),t.TgZ(73,"div",29)(74,"div",2)(75,"div",30),t._UZ(76,"div",31),t.TgZ(77,"div",32)(78,"button",33),t._uU(79," Simpan "),t._UZ(80,"mat-icon",34),t.qZA()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(7),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",e.fg.get("id").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("id").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("title").hasError("pattern")),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("confirm").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("confirm").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("cancel").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("cancel").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",e.fg.get("close").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("close").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",e.fg.get("broadcast").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("broadcast").hasError("pattern")),t.xp6(3),t.Q6J("config",e.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",e.submitted||e.fg.invalid)}}let xi=(()=>{class n{constructor(e,a,i,r,s){this.fb=e,this.bs=a,this.ds=i,this.gs=r,this.info=s,this.submitted=!1,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.infoData={column:["Id","Judul","Pemilik","Aksi"],row:[]},this.subsInfoGet=null,this.subsInfoCreateOrUpdate=null,this.subsInfoDelete=null,this.subsDialog=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.getInfo())}ngOnDestroy(){this.subsInfoGet?.unsubscribe(),this.subsInfoCreateOrUpdate?.unsubscribe(),this.subsInfoDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}get GS(){return this.gs}initForm(){this.fg=this.fb.group({id:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],title:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],content:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],confirm:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],cancel:[null,l.kI.compose([l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],close:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],broadcast:[null,l.kI.compose([l.kI.pattern(g.t.regexEnglishKeyboardKeys)])]})}getInfo(){this.bs.busy(),this.subsInfoGet&&(this.subsInfoGet.unsubscribe(),this.bs.idle()),this.subsInfoGet=this.info.getAllInfo(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[INFORMATION_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({content:i.content,confirm:i.confirm,cancel:i.cancel,close:i.close,foto:i.user_.image_url,Id:i.id,Judul:i.title,Pemilik:i.user_.username,Aksi:[{type:"button",icon:"close",name:"Hapus",row:i}]});this.infoData.row=a,this.bs.idle()},error:e=>{this.gs.log("[INFORMATION_LIST_ERROR]",e,"error"),this.bs.idle()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsInfoCreateOrUpdate=this.info.createUpdateInfo({id:this.fg.value.id,title:this.fg.value.title,content:this.fg.value.content,confirm:this.fg.value.confirm,cancel:this.fg.value.cancel,close:"1"===this.fg.value.close,broadcast:"1"===this.fg.value.broadcast}).subscribe({next:e=>{this.gs.log("[INFORMATION_CREATE_UPDATE_SUCCESS]",e),this.submitted=!1,this.bs.idle();for(const a in this.fg.controls)this.fg.controls[a]&&(this.fg.controls[a].patchValue(null),this.fg.controls[a].updateValueAndValidity(),this.fg.controls[a].setErrors(null),this.fg.controls[a].markAsUntouched(),this.fg.controls[a].markAsPristine());this.getInfo()},error:e=>{this.gs.log("[INFORMATION_CREATE_UPDATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle(),this.getInfo()}})}action(e){this.gs.log("[INFORMMATION_LIST_CLICK_AKSI]",e),"Hapus"===e.name&&this.deleteInfo(e.row)}deleteInfo(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[INFORMATION_LIST_CLICK_DELETE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Hapus Info -- '${e.id}' :: '${e.title}'`,"Yakin Akan Menghapus Informasi Ini ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsInfoDelete=a.info.deleteInfo(e.id).subscribe({next:r=>{a.gs.log("[INFORMATION_LIST_CLICK_DELETE_SUCCESS]",r),a.bs.idle(),a.getInfo()},error:r=>{a.gs.log("[INFORMATION_LIST_CLICK_DELETE_ERROR]",r,"error"),a.bs.idle(),a.getInfo()}})):!1===i&&a.getInfo(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[INFORMATION_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getInfo()}onServerSideFilter(e){this.gs.log("[INFORMATION_LIST_ENTER_FILTER]",e),this.q=e,this.getInfo()}onServerSideOrder(e){this.gs.log("[INFORMATION_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getInfo()}editInfo(e){this.gs.log("[INFORMATION_LIST_CLICK_INFORMATION]",e),this.fg.controls.id.patchValue(e.Id),this.fg.controls.title.patchValue(e.Judul),this.fg.controls.content.patchValue(e.content),this.fg.controls.confirm.patchValue(e.confirm),this.fg.controls.cancel.patchValue(e.cancel),this.fg.controls.close.patchValue(""+ +e?.close),this.fg.controls.broadcast.patchValue(""+ +e?.broadcast)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(l.QS),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(di.O))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-information-dialog"]],decls:13,vars:5,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[3,"formGroup","submit",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"],[3,"formGroup","submit"],[1,"col-12","sticky-top","bg-bifeldy","pb-1"],["appearance","outline",1,"p-3","col-12","col-md-4",3,"color"],["matInput","","formControlName","id","placeholder","ID_DIALOG","required",""],["fontIcon","short_text","matSuffix",""],["align","end"],[4,"ngIf"],["appearance","outline",1,"p-3","col-12","col-md-8",3,"color"],["matInput","","formControlName","title","placeholder","Judul Dialog","required",""],[1,"col-12","col-md-5","col-xl-4","p-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","confirm","placeholder","OK!","required",""],["matInput","","formControlName","cancel","placeholder","Batal!"],["formControlName","close","placeholder","Ya / Tidak","required",""],["value","0"],["value","1"],["formControlName","broadcast","placeholder","Ya / Tidak","required",""],[1,"col-12","col-md-7","col-xl-8","p-3"],["formControlName","content","required","",1,"p-3","w-100",3,"config"],[1,"row","mt-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,Ai,81,21,"form",4),t.qZA(),t.TgZ(6,"div",3)(7,"div",5)(8,"h2",6)(9,"b",7),t._uU(10,"Informasi Dialog Pop-Up Tersimpan"),t.qZA()()(),t.TgZ(11,"div",8)(12,"app-material-table",9),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.editInfo(s)}),t.qZA()()()()()()),2&a&&(t.xp6(5),t.Q6J("ngIf",i.fg),t.xp6(7),t.Q6J("tableDataColumn",i.infoData.column)("tableDataRow",i.infoData.row)("count",i.count)("serverSide",!0))},dependencies:[h.O5,qe.CK,xe.eB,Y.Hw,f.nI,f.v_,f.pH,f.$V,f.nX,re.k0,Ge.x8,I.I,k.t,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.sg,l.u,Ue.s6]})}return n})();var yi=c(217);const Mi=[{path:"",pathMatch:"full",component:Ma},{path:"banned-list",component:oi,data:{title:"Admin - List All Banned User",description:"Kelola Banned User",keywords:"Kelola Banned User"}},{path:"cors-list",component:li,data:{title:"CORS - List All Api Key",description:"Kelola Api Key",keywords:"Kelola Api Key"}},{path:"ddl-list",component:Ta,data:{title:"Admin - List All Berkas DDL",description:"Kelola Berkas DDL",keywords:"Kelola Berkas DDL"}},{path:"user-list",component:Ia,data:{title:"Admin - List All Users",description:"Atur Seluruh Member",keywords:"BAN & UN-BAN User"}},{path:"project-type",component:Ua,data:{title:"Admin - List All Project Type",description:"Atur Kategori Garapan",keywords:"Jenis Proyek Berkas"}},{path:"fansub-member",component:si,data:{title:"Admin - List All Fansub Member",description:"Atur Keanggotaan Fansub",keywords:"Keanggotaan Fansub"}},{path:"push-notification",component:ni,data:{title:"Admin - Push Notification",description:"Buat Pengumuman Dadakan",keywords:"Push Notification"}},{path:"information",component:xi,data:{title:"Admin - List All Information",description:"Atur Informasi Dialog",keywords:"Informations"}},{path:"email",component:(()=>{class n{constructor(e,a,i,r){this.bs=e,this.gs=a,this.ms=i,this.ds=r,this.subsAllMail=null,this.subsDialog=null,this.subsMail=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.mailData={column:["Tanggal","Pengirim","Penerima","Topik","Lampiran"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getAllMail()}ngOnDestroy(){this.subsAllMail?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsMail?.unsubscribe()}filterAddress(e){let a="";if(e)for(const i of e.split(","))a&&(a+=", "),i.includes("<")&&i.includes(">")?a+=i.split("<")[1].split(">")[0].trim():a+=i.trim();return a}filterLampiran(e){let a="";if(e)for(const i of e)a&&(a+=", "),a+=`\n \n ${i.name}.${i.ext} (${i.size} Bytes)\n \n `;return a}getAllMail(){this.bs.busy(),this.subsMail&&(this.subsMail.unsubscribe(),this.bs.idle()),this.subsAllMail=this.ms.getAllMail(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[MAIL_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({id:i.id,Tanggal:i.date,Pengirim:this.filterAddress(i.from),Penerima:this.filterAddress(i.to),Topik:i.subject,Lampiran:`${i.attachment_count} Berkas`});this.mailData.row=a,this.bs.idle()},error:e=>{this.gs.log("[MAIL_LIST_ERROR]",e,"error"),this.bs.idle()}})}getMail(e){this.subsMail=this.ms.getMail(e).subscribe({next:a=>{this.gs.log("[MAIL_DETAIL_SUCCESS]",a),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:a.result.subject,htmlMessage:`\n From: ${this.filterAddress(a.result.from)}\n
\n To: ${this.filterAddress(a.result.to)}\n
\n Cc: ${this.filterAddress(a.result.cc)}\n
\n Bcc: ${this.filterAddress(a.result.bcc)}\n

\n Date: ${new Date(a.result.date)}\n
\n Lampiran: ${this.filterLampiran(a.result.attachment_)}\n
\n
\n
\n
\n ${a.result.html||a.result.text}\n
\n `,confirmText:"Tutup",infoText:a.result.id},disableClose:!1}).afterClosed().subscribe({next:i=>{this.gs.log("[INFO_DIALOG_CLOSED]",i),this.getAllMail(),this.subsDialog.unsubscribe()}})},error:a=>{this.gs.log("[MAIL_DETAIL_ERROR]",a,"error"),this.bs.idle(),this.getAllMail()}})}onRowClicked(e){this.gs.log("[MAIL_LIST_CLICK_EMAIL]",e),this.getMail(e.id)}onPaginatorClicked(e){this.gs.log("[MAIL_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getAllMail()}onServerSideFilter(e){this.gs.log("[MAIL_LIST_ENTER_FILTER]",e),this.q=e,this.getAllMail()}onServerSideOrder(e){this.gs.log("[MAIL_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,"created_at"===this.sort?this.sort="date":"title"===this.sort&&(this.sort="subject"),this.order=e.direction,this.getAllMail()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(A.U),t.Y36(yi.Y),t.Y36(M.x))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-email"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","rowClicked","paginatorClicked","serverSideOrder"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Semua Email Pengguna"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("rowClicked",function(s){return i.onRowClicked(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.mailData.column)("tableDataRow",i.mailData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})(),data:{title:"Admin - List All Email",description:"Email Inbox & Outbox",keywords:"Surat Elektronik"}}];let ki=(()=>{class n{static#e=this.\u0275fac=function(a){return new(a||n)};static#t=this.\u0275mod=t.oAB({type:n});static#a=this.\u0275inj=t.cJS({imports:[h.ez,X.Bz.forChild(Mi),pa.m,ga.H,_a.F,l.u5,l.UX,Kt,ha,Ye,Be.Ad,Ue.UM,ma.T]})}return n})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[370],{1370:(Si,ye,c)=>{c.r(ye),c.d(ye,{AdminModule:()=>ki});var h=c(6895),X=c(1390),l=c(4006),V=c(4080),t=c(4650),O=c(7579),w=c(727),je=c(6451),L=c(3238),u=c(9521),se=c(5698),oe=c(8675),Qe=c(2722),$e=c(8372),ze=c(9300),W=c(3353),H=c(445),F=c(4859),le=c(2687),q=c(8184),Xe=c(5589),P=c(1281),Me=c(9549),p=c(7340),de=c(284),Y=c(7392);const We=["ngx-mat-calendar-body",""];function et(n,o){if(1&n&&(t.TgZ(0,"tr",3)(1,"td",4),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Udp("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),t.uIk("colspan",e.numCols),t.xp6(1),t.hij(" ",e.label," ")}}function tt(n,o){if(1&n&&(t.TgZ(0,"td",4),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.Udp("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),t.uIk("colspan",e._firstRowOffset),t.xp6(1),t.hij(" ",e._firstRowOffset>=e.labelMinRequiredCells?e.label:""," ")}}function at(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td",8)(1,"button",9),t.NdJ("click",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d._cellClicked(s,i))})("focus",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d._emitActiveDateChange(s,i))}),t.TgZ(2,"span",10),t._uU(3),t.qZA(),t._UZ(4,"span",11),t.qZA()()}if(2&n){const e=o.$implicit,a=o.index,i=t.oxw().index,r=t.oxw();t.Udp("width",r._cellWidth)("padding-top",r._cellPadding)("padding-bottom",r._cellPadding),t.uIk("data-mat-row",i)("data-mat-col",a),t.xp6(1),t.ekj("mat-calendar-body-disabled",!e.enabled)("mat-calendar-body-active",r._isActiveCell(i,a))("mat-calendar-body-range-start",r._isRangeStart(e.compareValue))("mat-calendar-body-range-end",r._isRangeEnd(e.compareValue))("mat-calendar-body-in-range",r._isInRange(e.compareValue))("mat-calendar-body-comparison-bridge-start",r._isComparisonBridgeStart(e.compareValue,i,a))("mat-calendar-body-comparison-bridge-end",r._isComparisonBridgeEnd(e.compareValue,i,a))("mat-calendar-body-comparison-start",r._isComparisonStart(e.compareValue))("mat-calendar-body-comparison-end",r._isComparisonEnd(e.compareValue))("mat-calendar-body-in-comparison-range",r._isInComparisonRange(e.compareValue))("mat-calendar-body-preview-start",r._isPreviewStart(e.compareValue))("mat-calendar-body-preview-end",r._isPreviewEnd(e.compareValue))("mat-calendar-body-in-preview",r._isInPreview(e.compareValue)),t.Q6J("ngClass",e.cssClasses)("tabindex",r._isActiveCell(i,a)?0:-1),t.uIk("aria-label",e.ariaLabel)("aria-disabled",!e.enabled||null)("aria-pressed",r._isSelected(e.compareValue))("aria-current",r.todayValue===e.compareValue?"date":null)("aria-describedby",r._getDescribedby(e.compareValue)),t.xp6(1),t.ekj("mat-calendar-body-selected",r._isSelected(e.compareValue))("mat-calendar-body-comparison-identical",r._isComparisonIdentical(e.compareValue))("mat-calendar-body-today",r.todayValue===e.compareValue),t.xp6(1),t.hij(" ",e.displayValue," ")}}function it(n,o){if(1&n&&(t.TgZ(0,"tr",5),t.YNc(1,tt,2,6,"td",6),t.YNc(2,at,5,48,"td",7),t.qZA()),2&n){const e=o.$implicit,a=o.index,i=t.oxw();t.xp6(1),t.Q6J("ngIf",0===a&&i._firstRowOffset),t.xp6(1),t.Q6J("ngForOf",e)}}function nt(n,o){if(1&n&&(t.TgZ(0,"th",5)(1,"span",6),t._uU(2),t.qZA(),t.TgZ(3,"span",7),t._uU(4),t.qZA()()),2&n){const e=o.$implicit;t.xp6(2),t.Oqu(e.long),t.xp6(2),t.Oqu(e.narrow)}}const ke=["*"];function rt(n,o){}function st(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-mat-month-view",5),t.NdJ("activeDateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.activeDate=i)})("_userSelection",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._dateSelected(i))})("dragStarted",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._dragStarted(i))})("dragEnded",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._dragEnded(i))}),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)("comparisonStart",e.comparisonStart)("comparisonEnd",e.comparisonEnd)("startDateAccessibleName",e.startDateAccessibleName)("endDateAccessibleName",e.endDateAccessibleName)("activeDrag",e._activeDrag)}}function ot(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-mat-year-view",6),t.NdJ("activeDateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.activeDate=i)})("monthSelected",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._monthSelectedInYearView(i))})("selectedChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._goToDateInView(i,"month"))}),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function lt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-mat-multi-year-view",7),t.NdJ("activeDateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.activeDate=i)})("yearSelected",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._yearSelectedInMultiYearView(i))})("selectedChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r._goToDateInView(i,"year"))}),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function dt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"button",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.change("second",!0))}),t.TgZ(2,"mat-icon"),t._uU(3,"expand_less"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.disabled||e.disableMinute)}}function ct(n,o){1&n&&t._UZ(0,"td",6)}function ut(n,o){1&n&&t._UZ(0,"td")}function ht(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td")(2,"button",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("hour",!0))}),t.TgZ(3,"mat-icon"),t._uU(4,"expand_less"),t.qZA()()(),t._UZ(5,"td"),t.TgZ(6,"td")(7,"button",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("minute",!0))}),t.TgZ(8,"mat-icon"),t._uU(9,"expand_less"),t.qZA()()(),t._UZ(10,"td"),t.YNc(11,dt,4,1,"td",3),t.YNc(12,ct,1,0,"td",8),t.YNc(13,ut,1,0,"td",3),t.qZA()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("disabled",e.disabled),t.xp6(5),t.Q6J("disabled",e.disabled||e.disableMinute),t.xp6(4),t.Q6J("ngIf",e.showSeconds),t.xp6(1),t.Q6J("ngIf",e.enableMeridian),t.xp6(1),t.Q6J("ngIf",e.enableMeridian)}}function pt(n,o){1&n&&(t.TgZ(0,"td",6),t._uU(1,":"),t.qZA())}function mt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"mat-form-field",4)(2,"input",11),t.NdJ("input",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formatInput(i.target))})("keydown.ArrowUp",function(i){return t.CHM(e),t.oxw().change("second",!0),t.KtG(i.preventDefault())})("keydown.ArrowDown",function(i){return t.CHM(e),t.oxw().change("second",!1),t.KtG(i.preventDefault())})("blur",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("second"))}),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("color",e.color)}}function gt(n,o){1&n&&t._UZ(0,"td",6)}function _t(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td",12)(1,"button",13),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.toggleMeridian())}),t._uU(2),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("color",e.color)("disabled",e.disabled),t.xp6(1),t.hij(" ",e.meridian," ")}}function ft(n,o){1&n&&t._UZ(0,"td")}function bt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.change("second",!1))}),t.TgZ(2,"mat-icon"),t._uU(3,"expand_more"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.disabled||e.disableMinute)}}function vt(n,o){1&n&&t._UZ(0,"td",6)}function Dt(n,o){1&n&&t._UZ(0,"td")}function Ct(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td")(2,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("hour",!1))}),t.TgZ(3,"mat-icon"),t._uU(4,"expand_more"),t.qZA()()(),t._UZ(5,"td"),t.TgZ(6,"td")(7,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.change("minute",!1))}),t.TgZ(8,"mat-icon"),t._uU(9,"expand_more"),t.qZA()()(),t.YNc(10,ft,1,0,"td",3),t.YNc(11,bt,4,1,"td",3),t.YNc(12,vt,1,0,"td",8),t.YNc(13,Dt,1,0,"td",3),t.qZA()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("disabled",e.disabled),t.xp6(5),t.Q6J("disabled",e.disabled||e.disableMinute),t.xp6(3),t.Q6J("ngIf",e.showSeconds),t.xp6(1),t.Q6J("ngIf",e.showSeconds),t.xp6(1),t.Q6J("ngIf",e.enableMeridian),t.xp6(1),t.Q6J("ngIf",e.enableMeridian)}}function At(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"ngx-mat-timepicker",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r._modelTime=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onTimeChanged(i))}),t.qZA()()}if(2&n){const e=t.oxw(2);t.ekj("disable-seconds",!e.datepicker._showSeconds),t.xp6(1),t.Q6J("showSpinners",e.datepicker._showSpinners)("showSeconds",e.datepicker._showSeconds)("disabled",e.datepicker._disabled||!e._modelTime)("stepHour",e.datepicker._stepHour)("stepMinute",e.datepicker._stepMinute)("stepSecond",e.datepicker._stepSecond)("ngModel",e._modelTime)("color",e.datepicker._color)("enableMeridian",e.datepicker._enableMeridian)("disableMinute",e.datepicker._disableMinute)}}function xt(n,o){if(1&n&&(t.ynx(0),t.YNc(1,At,2,12,"div",5),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.datepicker._hideTime)}}function yt(n,o){}function Mt(n,o){1&n&&(t.TgZ(0,"div",0),t.Hsn(1),t.qZA())}const N=new t.OlP("ngx-mat-date-formats");class m extends L._A{isSameTime(o,e){return null==o||null==e||this.getHour(o)===this.getHour(e)&&this.getMinute(o)===this.getMinute(e)&&this.getSecond(o)===this.getSecond(e)}copyTime(o,e){this.setHour(o,this.getHour(e)),this.setMinute(o,this.getMinute(e)),this.setSecond(o,this.getSecond(e))}compareDateWithTime(o,e,a){let i=super.compareDate(o,e)||this.getHour(o)-this.getHour(e)||this.getMinute(o)-this.getMinute(e);return a&&(i=i||this.getSecond(o)-this.getSecond(e)),i}setTimeByDefaultValues(o,e){if(!Array.isArray(e))throw Error("@Input DefaultTime should be an array");this.setHour(o,e[0]||0),this.setMinute(o,e[1]||0),this.setSecond(o,e[2]||0)}}class b{constructor(o,e){this.start=o,this.end=e}}let E=(()=>{class n{constructor(e,a){this.selection=e,this._adapter=a,this._selectionChanged=new O.x,this.selectionChanged=this._selectionChanged,this.selection=e}updateSelection(e,a){const i=this.selection;this.selection=e,this._selectionChanged.next({selection:e,source:a,oldValue:i})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}}return n.\u0275fac=function(e){t.$Z()},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})(),kt=(()=>{class n extends E{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return null!=this.selection&&this._isValidDateInstance(this.selection)}isComplete(){return null!=this.selection}clone(){const e=new n(this._adapter);return e.updateSelection(this.selection,this),e}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(m))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})();const Te={provide:E,deps:[[new t.FiY,new t.tp0,E],m],useFactory:function St(n,o){return n||new kt(o)}};function x(n){return Error(`NgxMatDatetimePicker: No provider found for ${n}. You must import one of the following modules at your application root: NgxMatNativeDateModule, NgxMatMomentDateModule, or provide a custom implementation.`)}new t.FiY,new t.tp0;class ce{constructor(o,e,a,i,r={},s=o,d){this.value=o,this.displayValue=e,this.ariaLabel=a,this.enabled=i,this.cssClasses=r,this.compareValue=s,this.rawValue=d}}let wt=1,U=(()=>{class n{constructor(e,a){this._elementRef=e,this._ngZone=a,this._platform=(0,t.f3M)(W.t4),this._focusActiveCellAfterViewChecked=!1,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new t.vpe,this.previewChange=new t.vpe,this.activeDateChange=new t.vpe,this.dragStarted=new t.vpe,this.dragEnded=new t.vpe,this._didDragSinceMouseDown=!1,this._enterHandler=i=>{if(this._skipNextFocus&&"focus"===i.type)this._skipNextFocus=!1;else if(i.target&&this.isRange){const r=this._getCellFromElement(i.target);r&&this._ngZone.run(()=>this.previewChange.emit({value:r.enabled?r:null,event:i}))}},this._touchmoveHandler=i=>{if(!this.isRange)return;const r=Se(i),s=r?this._getCellFromElement(r):null;r!==i.target&&(this._didDragSinceMouseDown=!0),he(i.target)&&i.preventDefault(),this._ngZone.run(()=>this.previewChange.emit({value:s?.enabled?s:null,event:i}))},this._leaveHandler=i=>{null!==this.previewEnd&&this.isRange&&("blur"!==i.type&&(this._didDragSinceMouseDown=!0),i.target&&this._getCellFromElement(i.target)&&(!i.relatedTarget||!this._getCellFromElement(i.relatedTarget))&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:i})))},this._mousedownHandler=i=>{if(!this.isRange)return;this._didDragSinceMouseDown=!1;const r=i.target&&this._getCellFromElement(i.target);!r||!this._isInRange(r.rawValue)||this._ngZone.run(()=>{this.dragStarted.emit({value:r.rawValue,event:i})})},this._mouseupHandler=i=>{if(!this.isRange)return;const r=he(i.target);r?r.closest(".mat-calendar-body")===this._elementRef.nativeElement&&this._ngZone.run(()=>{const s=this._getCellFromElement(r);this.dragEnded.emit({value:s?.rawValue??null,event:i})}):this._ngZone.run(()=>{this.dragEnded.emit({value:null,event:i})})},this._touchendHandler=i=>{const r=Se(i);r&&this._mouseupHandler({target:r})},this._id="mat-calendar-body-"+wt++,this._startDateLabelId=`${this._id}-start-date`,this._endDateLabelId=`${this._id}-end-date`,a.runOutsideAngular(()=>{const i=e.nativeElement;i.addEventListener("mouseenter",this._enterHandler,!0),i.addEventListener("touchmove",this._touchmoveHandler,!0),i.addEventListener("focus",this._enterHandler,!0),i.addEventListener("mouseleave",this._leaveHandler,!0),i.addEventListener("blur",this._leaveHandler,!0),i.addEventListener("mousedown",this._mousedownHandler),i.addEventListener("touchstart",this._mousedownHandler),this._platform.isBrowser&&(window.addEventListener("mouseup",this._mouseupHandler),window.addEventListener("touchend",this._touchendHandler))})}ngAfterViewChecked(){this._focusActiveCellAfterViewChecked&&(this._focusActiveCell(),this._focusActiveCellAfterViewChecked=!1)}_cellClicked(e,a){this._didDragSinceMouseDown||e.enabled&&this.selectedValueChange.emit({value:e.value,event:a})}_emitActiveDateChange(e,a){e.enabled&&this.activeDateChange.emit({value:e.value,event:a})}_isSelected(e){return this.startValue===e||this.endValue===e}ngOnChanges(e){const a=e.numCols,{rows:i,numCols:r}=this;(e.rows||a)&&(this._firstRowOffset=i&&i.length&&i[0].length?r-i[0].length:0),(e.cellAspectRatio||a||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/r+"%"),(a||!this._cellWidth)&&(this._cellWidth=100/r+"%")}ngOnDestroy(){const e=this._elementRef.nativeElement;e.removeEventListener("mouseenter",this._enterHandler,!0),e.removeEventListener("touchmove",this._touchmoveHandler,!0),e.removeEventListener("focus",this._enterHandler,!0),e.removeEventListener("mouseleave",this._leaveHandler,!0),e.removeEventListener("blur",this._leaveHandler,!0),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("touchstart",this._mousedownHandler),this._platform.isBrowser&&(window.removeEventListener("mouseup",this._mouseupHandler),window.removeEventListener("touchend",this._touchendHandler))}_isActiveCell(e,a){let i=e*this.numCols+a;return e&&(i-=this._firstRowOffset),i==this.activeCell}_focusActiveCell(e=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe((0,se.q)(1)).subscribe(()=>{setTimeout(()=>{const a=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");a&&(e||(this._skipNextFocus=!0),a.focus())})})})}_scheduleFocusActiveCellAfterViewChecked(){this._focusActiveCellAfterViewChecked=!0}_isRangeStart(e){return pe(e,this.startValue,this.endValue)}_isRangeEnd(e){return me(e,this.startValue,this.endValue)}_isInRange(e){return ge(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return pe(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,a,i){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let r=this.rows[a][i-1];if(!r){const s=this.rows[a-1];r=s&&s[s.length-1]}return r&&!this._isRangeEnd(r.compareValue)}_isComparisonBridgeEnd(e,a,i){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let r=this.rows[a][i+1];if(!r){const s=this.rows[a+1];r=s&&s[0]}return r&&!this._isRangeStart(r.compareValue)}_isComparisonEnd(e){return me(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return ge(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(e){return this.comparisonStart===this.comparisonEnd&&e===this.comparisonStart}_isPreviewStart(e){return pe(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return me(e,this.previewStart,this.previewEnd)}_isInPreview(e){return ge(e,this.previewStart,this.previewEnd,this.isRange)}_getDescribedby(e){return this.isRange?this.startValue===e&&this.endValue===e?`${this._startDateLabelId} ${this._endDateLabelId}`:this.startValue===e?this._startDateLabelId:this.endValue===e?this._endDateLabelId:null:null}_getCellFromElement(e){const a=he(e);if(a){const i=a.getAttribute("data-mat-row"),r=a.getAttribute("data-mat-col");if(i&&r)return this.rows[parseInt(i)][parseInt(r)]}return null}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(t.R0b))},n.\u0275cmp=t.Xpm({type:n,selectors:[["","ngx-mat-calendar-body",""]],hostAttrs:[1,"ngx-mat-calendar-body"],inputs:{label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",previewStart:"previewStart",previewEnd:"previewEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange",activeDateChange:"activeDateChange",dragStarted:"dragStarted",dragEnded:"dragEnded"},exportAs:["matCalendarBody"],features:[t.TTD],attrs:We,decls:6,vars:6,consts:[["aria-hidden","true",4,"ngIf"],["role","row",4,"ngFor","ngForOf"],[1,"mat-calendar-body-hidden-label",3,"id"],["aria-hidden","true"],[1,"mat-calendar-body-label"],["role","row"],["class","mat-calendar-body-label",3,"paddingTop","paddingBottom",4,"ngIf"],["role","gridcell","class","mat-calendar-body-cell-container",3,"width","paddingTop","paddingBottom",4,"ngFor","ngForOf"],["role","gridcell",1,"mat-calendar-body-cell-container"],["type","button",1,"mat-calendar-body-cell",3,"ngClass","tabindex","click","focus"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],["aria-hidden","true",1,"mat-calendar-body-cell-preview"]],template:function(e,a){1&e&&(t.YNc(0,et,3,6,"tr",0),t.YNc(1,it,3,2,"tr",1),t.TgZ(2,"label",2),t._uU(3),t.qZA(),t.TgZ(4,"label",2),t._uU(5),t.qZA()),2&e&&(t.Q6J("ngIf",a._firstRowOffset=o&&n===e}function ge(n,o,e,a){return a&&null!==o&&null!==e&&o!==e&&n>=o&&n<=e}function Se(n){const o=n.changedTouches[0];return document.elementFromPoint(o.clientX,o.clientY)}const ee=new t.OlP("NGX_MAT_DATE_RANGE_SELECTION_STRATEGY");new t.FiY,new t.tp0;let Ie=(()=>{class n{constructor(e,a,i,r,s){if(this._changeDetectorRef=e,this._dateFormats=a,this._dateAdapter=i,this._dir=r,this._rangeStrategy=s,this._rerenderSubscription=w.w0.EMPTY,this.activeDrag=null,this.selectedChange=new t.vpe,this._userSelection=new t.vpe,this.dragStarted=new t.vpe,this.dragEnded=new t.vpe,this.activeDateChange=new t.vpe,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){const a=this._activeDate,i=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(i,this.minDate,this.maxDate),this._hasSameMonthAndYear(a,this._activeDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setRanges(this._selected)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,oe.O)(null)).subscribe(()=>this._init())}ngOnChanges(e){const a=e.comparisonStart||e.comparisonEnd;a&&!a.firstChange&&this._setRanges(this.selected),e.activeDrag&&!this.activeDrag&&this._clearPreview()}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(e){const a=e.value,i=this._getDateFromDayOfMonth(a);let r,s;this._selected instanceof b?(r=this._getDateInCurrentMonth(this._selected.start),s=this._getDateInCurrentMonth(this._selected.end)):r=s=this._getDateInCurrentMonth(this._selected),(r!==a||s!==a)&&this.selectedChange.emit(i),this._userSelection.emit({value:i,event:e.event}),this._clearPreview(),this._changeDetectorRef.markForCheck()}_updateActiveDate(e){const i=this._activeDate;this.activeDate=this._getDateFromDayOfMonth(e.value),this._dateAdapter.compareDate(i,this.activeDate)&&this.activeDateChange.emit(this._activeDate)}_handleCalendarBodyKeydown(e){const a=this._activeDate,i=this._isRtl();switch(e.keyCode){case u.oh:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,i?1:-1);break;case u.SV:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,i?-1:1);break;case u.LH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case u.JH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case u.Sd:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case u.uR:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case u.Ku:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case u.VM:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case u.K5:case u.L_:return this._selectionKeyPressed=!0,void(this._canSelect(this._activeDate)&&e.preventDefault());case u.hY:return void(null!=this._previewEnd&&!(0,u.Vb)(e)&&(this._clearPreview(),this.activeDrag?this.dragEnded.emit({value:null,event:e}):(this.selectedChange.emit(null),this._userSelection.emit({value:null,event:e})),e.preventDefault(),e.stopPropagation()));default:return}this._dateAdapter.compareDate(a,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===u.L_||e.keyCode===u.K5)&&(this._selectionKeyPressed&&this._canSelect(this._activeDate)&&this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(e){this._matCalendarBody._focusActiveCell(e)}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_previewChanged({event:e,value:a}){if(this._rangeStrategy){const i=a?a.rawValue:null,r=this._rangeStrategy.createPreview(i,this.selected,e);if(this._previewStart=this._getCellCompareValue(r.start),this._previewEnd=this._getCellCompareValue(r.end),this.activeDrag&&i){const s=this._rangeStrategy.createDrag?.(this.activeDrag.value,this.selected,i,e);s&&(this._previewStart=this._getCellCompareValue(s.start),this._previewEnd=this._getCellCompareValue(s.end))}this._changeDetectorRef.detectChanges()}}_dragEnded(e){if(this.activeDrag)if(e.value){const a=this._rangeStrategy?.createDrag?.(this.activeDrag.value,this.selected,e.value,e.event);this.dragEnded.emit({value:a??null,event:e.event})}else this.dragEnded.emit({value:null,event:e.event})}_getDateFromDayOfMonth(e){return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),e)}_initWeekdays(){const e=this._dateAdapter.getFirstDayOfWeek(),a=this._dateAdapter.getDayOfWeekNames("narrow");let r=this._dateAdapter.getDayOfWeekNames("long").map((s,d)=>({long:s,narrow:a[d]}));this._weekdays=r.slice(e).concat(r.slice(0,e))}_createWeekCells(){const e=this._dateAdapter.getNumDaysInMonth(this.activeDate),a=this._dateAdapter.getDateNames();this._weeks=[[]];for(let i=0,r=this._firstWeekOffset;i=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(e))}_getDateInCurrentMonth(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null}_hasSameMonthAndYear(e,a){return!(!e||!a||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(a)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(a))}_getCellCompareValue(e){if(e){const a=this._dateAdapter.getYear(e),i=this._dateAdapter.getMonth(e),r=this._dateAdapter.getDate(e);return new Date(a,i,r).getTime()}return null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setRanges(e){e instanceof b?(this._rangeStart=this._getCellCompareValue(e.start),this._rangeEnd=this._getCellCompareValue(e.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(e),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}_canSelect(e){return!this.dateFilter||this.dateFilter(e)}_clearPreview(){this._previewStart=this._previewEnd=null}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.sBO),t.Y36(N,8),t.Y36(m,8),t.Y36(H.Is,8),t.Y36(ee,8))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-month-view"]],viewQuery:function(e,a){if(1&e&&t.Gf(U,5),2&e){let i;t.iGM(i=t.CRH())&&(a._matCalendarBody=i.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName",activeDrag:"activeDrag"},outputs:{selectedChange:"selectedChange",_userSelection:"_userSelection",dragStarted:"dragStarted",dragEnded:"dragEnded",activeDateChange:"activeDateChange"},exportAs:["ngxMatMonthView"],features:[t.TTD],decls:7,vars:15,consts:[["role","grid",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["scope","col",4,"ngFor","ngForOf"],["aria-hidden","true","colspan","7",1,"mat-calendar-table-header-divider"],["ngx-mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","comparisonStart","comparisonEnd","previewStart","previewEnd","isRange","labelMinRequiredCells","activeCell","startDateAccessibleName","endDateAccessibleName","selectedValueChange","activeDateChange","previewChange","dragStarted","dragEnded","keyup","keydown"],["scope","col"],[1,"cdk-visually-hidden"],["aria-hidden","true"]],template:function(e,a){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr"),t.YNc(3,nt,5,2,"th",2),t.qZA(),t.TgZ(4,"tr"),t._UZ(5,"th",3),t.qZA()(),t.TgZ(6,"tbody",4),t.NdJ("selectedValueChange",function(r){return a._dateSelected(r)})("activeDateChange",function(r){return a._updateActiveDate(r)})("previewChange",function(r){return a._previewChanged(r)})("dragStarted",function(r){return a.dragStarted.emit(r)})("dragEnded",function(r){return a._dragEnded(r)})("keyup",function(r){return a._handleCalendarBodyKeyup(r)})("keydown",function(r){return a._handleCalendarBodyKeydown(r)}),t.qZA()()),2&e&&(t.xp6(3),t.Q6J("ngForOf",a._weekdays),t.xp6(3),t.Q6J("label",a._monthLabel)("rows",a._weeks)("todayValue",a._todayDate)("startValue",a._rangeStart)("endValue",a._rangeEnd)("comparisonStart",a._comparisonRangeStart)("comparisonEnd",a._comparisonRangeEnd)("previewStart",a._previewStart)("previewEnd",a._previewEnd)("isRange",a._isRange)("labelMinRequiredCells",3)("activeCell",a._dateAdapter.getDate(a.activeDate)-1)("startDateAccessibleName",a.startDateAccessibleName)("endDateAccessibleName",a.endDateAccessibleName))},dependencies:[h.sg,U],encapsulation:2,changeDetection:0}),n})();const v=24;let we=(()=>{class n{constructor(e,a,i){if(this._changeDetectorRef=e,this._dateAdapter=a,this._dir=i,this._rerenderSubscription=w.w0.EMPTY,this.selectedChange=new t.vpe,this.yearSelected=new t.vpe,this.activeDateChange=new t.vpe,!this._dateAdapter)throw x("NgxMatDateAdapter");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate;const i=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(i,this.minDate,this.maxDate),Ne(this._dateAdapter,a,this._activeDate,this.minDate,this.maxDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedYear(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,oe.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());const a=this._dateAdapter.getYear(this._activeDate)-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let i=0,r=[];ithis._createCellForYear(s))),r=[]);this._changeDetectorRef.markForCheck()}_yearSelected(e){const a=e.value,i=this._dateAdapter.createDate(a,0,1),r=this._getDateFromYear(a);this.yearSelected.emit(i),this.selectedChange.emit(r)}_updateActiveDate(e){const i=this._activeDate;this.activeDate=this._getDateFromYear(e.value),this._dateAdapter.compareDate(i,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){const a=this._activeDate,i=this._isRtl();switch(e.keyCode){case u.oh:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,i?1:-1);break;case u.SV:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,i?-1:1);break;case u.LH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case u.JH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case u.Sd:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case u.uR:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,v-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case u.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10*-v:-v);break;case u.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10*v:v);break;case u.K5:case u.L_:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked(),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===u.L_||e.keyCode===u.K5)&&(this._selectionKeyPressed&&this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_getActiveCell(){return G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getDateFromYear(e){const a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,a,1));return this._dateAdapter.createDate(e,a,Math.min(this._dateAdapter.getDate(this.activeDate),i))}_createCellForYear(e){const a=this._dateAdapter.createDate(e,0,1),i=this._dateAdapter.getYearName(a),r=this.dateClass?this.dateClass(a,"multi-year"):void 0;return new ce(e,i,i,this._shouldEnableYear(e),r)}_shouldEnableYear(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e{class n{constructor(e,a,i,r){if(this._changeDetectorRef=e,this._dateFormats=a,this._dateAdapter=i,this._dir=r,this._rerenderSubscription=w.w0.EMPTY,this.selectedChange=new t.vpe,this.monthSelected=new t.vpe,this.activeDateChange=new t.vpe,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate;const i=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(i,this.minDate,this.maxDate),this._dateAdapter.getYear(a)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedMonth(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,oe.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(e){const a=e.value,i=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),a,1);this.monthSelected.emit(i);const r=this._getDateFromMonth(a);this.selectedChange.emit(r)}_updateActiveDate(e){const i=this._activeDate;this.activeDate=this._getDateFromMonth(e.value),this._dateAdapter.compareDate(i,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){const a=this._activeDate,i=this._isRtl();switch(e.keyCode){case u.oh:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,i?1:-1);break;case u.SV:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,i?-1:1);break;case u.LH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case u.JH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case u.Sd:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case u.uR:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case u.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case u.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case u.K5:case u.L_:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===u.L_||e.keyCode===u.K5)&&(this._selectionKeyPressed&&this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(a=>a.map(i=>this._createCellForMonth(i,e[i]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getMonthInCurrentYear(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null}_getDateFromMonth(e){const a=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),i=this._dateAdapter.getNumDaysInMonth(a);return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),i))}_createCellForMonth(e,a){const i=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),r=this._dateAdapter.format(i,this._dateFormats.display.monthYearA11yLabel),s=this.dateClass?this.dateClass(i,"year"):void 0;return new ce(e,a.toLocaleUpperCase(),r,this._shouldEnableMonth(e),s)}_shouldEnableMonth(e){const a=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(a,e)||this._isYearAndMonthBeforeMinDate(a,e))return!1;if(!this.dateFilter)return!0;for(let r=this._dateAdapter.createDate(a,e,1);this._dateAdapter.getMonth(r)==e;r=this._dateAdapter.addCalendarDays(r,1))if(this.dateFilter(r))return!0;return!1}_isYearAndMonthAfterMaxDate(e,a){if(this.maxDate){const i=this._dateAdapter.getYear(this.maxDate),r=this._dateAdapter.getMonth(this.maxDate);return e>i||e===i&&a>r}return!1}_isYearAndMonthBeforeMinDate(e,a){if(this.minDate){const i=this._dateAdapter.getYear(this.minDate),r=this._dateAdapter.getMonth(this.minDate);return e{class n{constructor(){this.changes=new O.x,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 24 years",this.nextMultiYearLabel="Next 24 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year",this.startDateLabel="Start date",this.endDateLabel="End date"}formatYearRange(e,a){return`${e} \u2013 ${a}`}formatYearRangeLabel(e,a){return`${e} to ${a}`}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Ot=1,Lt=(()=>{class n{constructor(e,a,i,r,s){this._intl=e,this.calendar=a,this._dateAdapter=i,this._dateFormats=r,this._id="mat-calendar-header-"+Ot++,this._periodButtonLabelId=`${this._id}-period-label`,this.calendar.stateChanges.subscribe(()=>s.markForCheck())}get periodButtonText(){return"month"==this.calendar.currentView?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():"year"==this.calendar.currentView?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRange(...this._formatMinAndMaxYearLabels())}get periodButtonDescription(){return"month"==this.calendar.currentView?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():"year"==this.calendar.currentView?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRangeLabel(...this._formatMinAndMaxYearLabels())}get periodButtonLabel(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel}get prevButtonLabel(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]}get nextButtonLabel(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]}currentPeriodClicked(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"}previousClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-v)}nextClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:v)}previousEnabled(){return!this.calendar.minDate||!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate)}nextEnabled(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)}_isSameView(e,a){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(a):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a):Ne(this._dateAdapter,e,a,this.calendar.minDate,this.calendar.maxDate)}_formatMinAndMaxYearLabels(){const a=this._dateAdapter.getYear(this.calendar.activeDate)-G(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),i=a+v-1;return[this._dateAdapter.getYearName(this._dateAdapter.createDate(a,0,1)),this._dateAdapter.getYearName(this._dateAdapter.createDate(i,0,1))]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(te),t.Y36((0,t.Gpc)(()=>be)),t.Y36(m,8),t.Y36(N,8),t.Y36(t.sBO))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-calendar-header"]],exportAs:["ngxMatCalendarHeader"],ngContentSelectors:ke,decls:13,vars:11,consts:[[1,"mat-calendar-header"],[1,"mat-calendar-controls"],["mat-button","","type","button","aria-live","polite",1,"mat-calendar-period-button",3,"click"],["aria-hidden","true"],["viewBox","0 0 10 5","focusable","false","aria-hidden","true",1,"mat-calendar-arrow"],["points","0,0 5,5 10,0"],[1,"mat-calendar-spacer"],["mat-icon-button","","type","button",1,"mat-calendar-previous-button",3,"disabled","click"],["mat-icon-button","","type","button",1,"mat-calendar-next-button",3,"disabled","click"],[1,"mat-calendar-hidden-label",3,"id"]],template:function(e,a){1&e&&(t.F$t(),t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return a.currentPeriodClicked()}),t.TgZ(3,"span",3),t._uU(4),t.qZA(),t.O4$(),t.TgZ(5,"svg",4),t._UZ(6,"polygon",5),t.qZA()(),t.kcU(),t._UZ(7,"div",6),t.Hsn(8),t.TgZ(9,"button",7),t.NdJ("click",function(){return a.previousClicked()}),t.qZA(),t.TgZ(10,"button",8),t.NdJ("click",function(){return a.nextClicked()}),t.qZA()()(),t.TgZ(11,"label",9),t._uU(12),t.qZA()),2&e&&(t.xp6(2),t.uIk("aria-label",a.periodButtonLabel)("aria-describedby",a._periodButtonLabelId),t.xp6(2),t.Oqu(a.periodButtonText),t.xp6(1),t.ekj("mat-calendar-invert","month"!==a.calendar.currentView),t.xp6(4),t.Q6J("disabled",!a.previousEnabled()),t.uIk("aria-label",a.prevButtonLabel),t.xp6(1),t.Q6J("disabled",!a.nextEnabled()),t.uIk("aria-label",a.nextButtonLabel),t.xp6(1),t.Q6J("id",a._periodButtonLabelId),t.xp6(1),t.Oqu(a.periodButtonDescription))},dependencies:[F.lW,F.RK],encapsulation:2,changeDetection:0}),n})(),be=(()=>{class n{constructor(e,a,i,r){if(this._dateAdapter=a,this._dateFormats=i,this._changeDetectorRef=r,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new t.vpe,this.yearSelected=new t.vpe,this.monthSelected=new t.vpe,this.viewChanged=new t.vpe(!0),this._userSelection=new t.vpe,this._userDragDrop=new t.vpe,this._activeDrag=null,this.stateChanges=new O.x,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._intlChanges=e.changes.subscribe(()=>{r.markForCheck(),this.stateChanges.next()})}get startAt(){return this._startAt}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get selected(){return this._selected}set selected(e){this._selected=e instanceof b?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get activeDate(){return this._clampedActiveDate}set activeDate(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}get currentView(){return this._currentView}set currentView(e){const a=this._currentView!==e?e:null;this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck(),a&&this.viewChanged.emit(a)}ngAfterContentInit(){this._calendarHeaderPortal=new V.C5(this.headerComponent||Lt),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView}ngAfterViewChecked(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())}ngOnDestroy(){this._intlChanges.unsubscribe(),this.stateChanges.complete()}ngOnChanges(e){const a=e.minDate&&!this._dateAdapter.sameDate(e.minDate.previousValue,e.minDate.currentValue)?e.minDate:void 0,i=e.maxDate&&!this._dateAdapter.sameDate(e.maxDate.previousValue,e.maxDate.currentValue)?e.maxDate:void 0,r=a||i||e.dateFilter;if(r&&!r.firstChange){const s=this._getCurrentViewComponent();s&&(this._changeDetectorRef.detectChanges(),s._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){this._getCurrentViewComponent()._init()}_dateSelected(e){e.value&&this.selected&&this._dateAdapter.copyTime(e.value,this.selected);const a=e.value;(this.selected instanceof b||a&&!this._dateAdapter.sameDate(a,this.selected))&&this.selectedChange.emit(a),this._userSelection.emit(e)}_yearSelectedInMultiYearView(e){this.yearSelected.emit(e)}_monthSelectedInYearView(e){this.monthSelected.emit(e)}_goToDateInView(e,a){this.activeDate=e,this.currentView=a}_dragStarted(e){this._activeDrag=e}_dragEnded(e){this._activeDrag&&(e.value&&this._userDragDrop.emit(e),this._activeDrag=null)}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(te),t.Y36(m,8),t.Y36(N,8),t.Y36(t.sBO))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-calendar"]],viewQuery:function(e,a){if(1&e&&(t.Gf(Ie,5),t.Gf(Re,5),t.Gf(we,5)),2&e){let i;t.iGM(i=t.CRH())&&(a.monthView=i.first),t.iGM(i=t.CRH())&&(a.yearView=i.first),t.iGM(i=t.CRH())&&(a.multiYearView=i.first)}},hostAttrs:[1,"mat-calendar"],inputs:{headerComponent:"headerComponent",startAt:"startAt",startView:"startView",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",_userSelection:"_userSelection",_userDragDrop:"_userDragDrop"},exportAs:["ngxMatCalendar"],features:[t._Bn([Te]),t.TTD],decls:5,vars:5,consts:[[3,"cdkPortalOutlet"],["cdkMonitorSubtreeFocus","","tabindex","-1",1,"mat-calendar-content",3,"ngSwitch"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag","activeDateChange","_userSelection","dragStarted","dragEnded",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag","activeDateChange","_userSelection","dragStarted","dragEnded"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange"]],template:function(e,a){1&e&&(t.YNc(0,rt,0,0,"ng-template",0),t.TgZ(1,"div",1),t.YNc(2,st,1,11,"ngx-mat-month-view",2),t.YNc(3,ot,1,6,"ngx-mat-year-view",3),t.YNc(4,lt,1,6,"ngx-mat-multi-year-view",4),t.qZA()),2&e&&(t.Q6J("cdkPortalOutlet",a._calendarHeaderPortal),t.xp6(1),t.Q6J("ngSwitch",a.currentView),t.xp6(1),t.Q6J("ngSwitchCase","month"),t.xp6(1),t.Q6J("ngSwitchCase","year"),t.xp6(1),t.Q6J("ngSwitchCase","multi-year"))},dependencies:[h.RF,h.n9,le.kH,V.Pl,Ie,Re,we],styles:['.mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0}.mat-calendar-content{padding:0 8px 8px;outline:none}.mat-calendar-controls{display:flex;align-items:center;margin:5% calc(4.7142857143% - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0;margin:0 8px}.mat-calendar-arrow{display:inline-block;width:10px;height:5px;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.cdk-high-contrast-active .mat-calendar-arrow{fill:CanvasText}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-calendar-previous-button:after,.mat-calendar-next-button:after{top:0;left:0;right:0;bottom:0;position:absolute;content:"";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button:after{border-left-width:2px;transform:translate(2px) rotate(-45deg)}.mat-calendar-next-button:after{border-right-width:2px;transform:translate(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider:after{content:"";position:absolute;top:0;left:-8px;right:-8px;height:1px}.mat-calendar-body-cell-content:before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px) * -1)}.mat-calendar-body-cell:focus .mat-focus-indicator:before{content:""}.mat-calendar-hidden-label{display:none}\n'],encapsulation:2,changeDetection:0}),n})();try{Z=typeof Intl<"u"}catch{Z=!1}const Ft={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},Pt=ae(31,n=>String(n+1)),Zt={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},Vt=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function ae(n,o){const e=Array(n);for(let a=0;a{class n extends m{constructor(e,a){super(),this.useUtcForDisplay=!0,super.setLocale(e),this.useUtcForDisplay=!a.TRIDENT,this._clampDate=a.TRIDENT||a.EDGE}getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getMonthNames(e){if(Z){const a=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return ae(12,i=>this._stripDirectionalityCharacters(this._format(a,new Date(2017,i,1))))}return Ft[e]}getDateNames(){if(Z){const e=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return ae(31,a=>this._stripDirectionalityCharacters(this._format(e,new Date(2017,0,a+1))))}return Pt}getDayOfWeekNames(e){if(Z){const a=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return ae(7,i=>this._stripDirectionalityCharacters(this._format(a,new Date(2017,0,i+1))))}return Zt[e]}getYearName(e){if(Z){const a=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this._stripDirectionalityCharacters(this._format(a,e))}return String(this.getYear(e))}getFirstDayOfWeek(){return 0}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0))}clone(e){return new Date(e.getTime())}createDate(e,a,i){if(a<0||a>11)throw Error(`Invalid month index "${a}". Month index has to be between 0 and 11.`);if(i<1)throw Error(`Invalid date "${i}". Date has to be greater than 0.`);let r=this._createDateWithOverflow(e,a,i);if(r.getMonth()!=a)throw Error(`Invalid date "${i}" for month with index "${a}".`);return r}today(){return new Date}parse(e){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null}format(e,a){if(!this.isValid(e))throw Error("NativeDateAdapter: Cannot format invalid date.");if(Z){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e)).setFullYear(Math.max(1,Math.min(9999,e.getFullYear()))),a={...a,timeZone:"utc"};const i=new Intl.DateTimeFormat(this.locale,a);return this._stripDirectionalityCharacters(this._format(i,e))}return this._stripDirectionalityCharacters(e.toDateString())}addCalendarYears(e,a){return this.addCalendarMonths(e,12*a)}addCalendarMonths(e,a){let i=this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+a,this.getDate(e));return this.getMonth(i)!=((this.getMonth(e)+a)%12+12)%12&&(i=this._createDateWithOverflow(this.getYear(i),this.getMonth(i),0)),i}addCalendarDays(e,a){return this._createDateWithOverflow(this.getYear(e),this.getMonth(e),this.getDate(e)+a)}toIso8601(e){return[e.getUTCFullYear(),this._2digit(e.getUTCMonth()+1),this._2digit(e.getUTCDate())].join("-")}deserialize(e){if("string"==typeof e){if(!e)return null;if(Vt.test(e)){let a=new Date(e);if(this.isValid(a))return a}}return super.deserialize(e)}isDateInstance(e){return e instanceof Date}isValid(e){return!isNaN(e.getTime())}invalid(){return new Date(NaN)}getHour(e){return e.getHours()}getMinute(e){return e.getMinutes()}getSecond(e){return e.getSeconds()}setHour(e,a){e.setHours(a)}setMinute(e,a){e.setMinutes(a)}setSecond(e,a){e.setSeconds(a)}_createDateWithOverflow(e,a,i){const r=new Date(e,a,i);return e>=0&&e<100&&r.setFullYear(this.getYear(r)-1900),r}_2digit(e){return("00"+e).slice(-2)}_stripDirectionalityCharacters(e){return e.replace(/[\u200e\u200f]/g,"")}_format(e,a){const i=new Date;return i.setUTCFullYear(a.getFullYear(),a.getMonth(),a.getDate()),i.setUTCHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),e.format(i)}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(L.Ad,8),t.LFG(W.t4))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})();const Oe={year:"numeric",month:"numeric",day:"numeric",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"},Ut={parse:{dateInput:Oe},display:{dateInput:Oe,monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}};let Bt=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[{provide:m,useClass:Yt}],imports:[W.ud]}),n})(),Kt=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[{provide:N,useValue:Ut}],imports:[Bt]}),n})();function Jt(n){return ve(n,!0)}function Le(n){return n.nodeType===Node.ELEMENT_NODE}function ve(n,o){if(Le(n)&&o){const a=(n.getAttribute?.("aria-labelledby")?.split(/\s+/g)||[]).reduce((i,r)=>{const s=document.getElementById(r);return s&&i.push(s),i},[]);if(a.length)return a.map(i=>ve(i,!1)).join(" ")}if(Le(n)){const e=n.getAttribute("aria-label")?.trim();if(e)return e}if(function Ht(n){return"INPUT"===n.nodeName}(n)||function qt(n){return"TEXTAREA"===n.nodeName}(n)){if(n.labels?.length)return Array.from(n.labels).map(i=>ve(i,!1)).join(" ");const e=n.getAttribute("placeholder")?.trim();if(e)return e;const a=n.getAttribute("title")?.trim();if(a)return a}return(n.textContent||"").replace(/\s+/g," ").trim()}class ie{constructor(o,e){this.target=o,this.targetElement=e,this.value=this.target.value}}let Fe=(()=>{class n{constructor(e,a,i){if(this._elementRef=e,this._dateAdapter=a,this._dateFormats=i,this.dateChange=new t.vpe,this.dateInput=new t.vpe,this.stateChanges=new O.x,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=w.w0.EMPTY,this._localeSubscription=w.w0.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=r=>{const s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(r.value));return!s||this._matchesFilter(s)?null:{matDatepickerFilter:!0}},this._minValidator=r=>{const s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(r.value)),d=this._getMinDate();return!d||!s||this._dateAdapter.compareDateWithTime(d,s)<=0?null:{matDatetimePickerMin:{min:d,actual:s}}},this._maxValidator=r=>{const s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(r.value)),d=this._getMaxDate();return!d||!s||this._dateAdapter.compareDateWithTime(d,s)>=0?null:{matDatetimePickerMax:{max:d,actual:s}}},this._lastValueValid=!1,!this._dateAdapter)throw x("NgxMatDateAdapter");if(!this._dateFormats)throw x("NGX_MAT_DATE_FORMATS");this._localeSubscription=a.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){this._assignValueProgrammatically(e)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){const a=(0,P.Ig)(e),i=this._elementRef.nativeElement;this._disabled!==a&&(this._disabled=a,this.stateChanges.next(void 0)),a&&this._isInitialized&&i.blur&&i.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(a=>{if(this._shouldHandleChangeEvent(a)){const i=this._getValueFromModel(a.selection);this._lastValueValid=this._isValidValue(i),this._cvaOnChange(i),this._onTouched(),this._formatValue(i),this.dateInput.emit(new ie(this,this._elementRef.nativeElement)),this.dateChange.emit(new ie(this,this._elementRef.nativeElement))}})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(e){(function Gt(n,o){const e=Object.keys(n);for(let a of e){const{previousValue:i,currentValue:r}=n[a];if(!o.isDateInstance(i)||!o.isDateInstance(r))return!0;if(!o.sameDate(i,r))return!0}return!1})(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this._assignValueProgrammatically(e)}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){(0,u.Vb)(e,"altKey")&&e.keyCode===u.JH&&["ctrlKey","shiftKey","metaKey"].every(r=>!(0,u.Vb)(e,r))&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){const a=this._lastValueValid;let i=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(i),i=this._dateAdapter.getValidDateOrNull(i);const r=this._dateAdapter.isSameTime(i,this.value),_=!(this._dateAdapter.sameDate(i,this.value)&&r);!i||_?this._cvaOnChange(i):(e&&!this.value&&this._cvaOnChange(i),a!==this._lastValueValid&&this._validatorOnChange()),_&&(this._assignValue(i),this.dateInput.emit(new ie(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new ie(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=null!=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}_assignValueProgrammatically(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._dateAdapter.getValidDateOrNull(e),this._assignValue(e),this._formatValue(e)}_matchesFilter(e){const a=this._getDateFilter();return!a||a(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(m,8),t.Y36(N,8))},n.\u0275dir=t.lG2({type:n,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[t.TTD]}),n})();const jt=new t.OlP("NGX_MAT_DATE_RANGE_INPUT_PARENT");(0,L.FD)((()=>{class n extends Fe{constructor(e,a,i,r,s,d,_,C){super(a,_,C),this._rangeInput=e,this._elementRef=a,this._defaultErrorStateMatcher=i,this._injector=r,this._parentForm=s,this._parentFormGroup=d,this._dir=(0,t.f3M)(H.Is,{optional:!0})}ngOnInit(){const e=this._injector.get(l.a5,null,{optional:!0,self:!0});e&&(this.ngControl=e)}ngDoCheck(){this.ngControl&&this.updateErrorState()}isEmpty(){return 0===this._elementRef.nativeElement.value.length}_getPlaceholder(){return this._elementRef.nativeElement.placeholder}focus(){this._elementRef.nativeElement.focus()}getMirrorValue(){const e=this._elementRef.nativeElement,a=e.value;return a.length>0?a:e.placeholder}_onInput(e){super._onInput(e),this._rangeInput._handleChildValueChange()}_openPopup(){this._rangeInput._openDatepicker()}_getMinDate(){return this._rangeInput.min}_getMaxDate(){return this._rangeInput.max}_getDateFilter(){return this._rangeInput.dateFilter}_parentDisabled(){return this._rangeInput._groupDisabled}_shouldHandleChangeEvent({source:e}){return e!==this._rangeInput._startInput&&e!==this._rangeInput._endInput}_assignValueProgrammatically(e){super._assignValueProgrammatically(e),(this===this._rangeInput._startInput?this._rangeInput._endInput:this._rangeInput._startInput)?._validatorOnChange()}_getAccessibleName(){return Jt(this._elementRef.nativeElement)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(jt),t.Y36(t.SBq),t.Y36(L.rD),t.Y36(t.zs3),t.Y36(l.F,8),t.Y36(l.sg,8),t.Y36(m,8),t.Y36(N,8))},n.\u0275dir=t.lG2({type:n,features:[t.qOj]}),n})());const Pe={transformPanel:(0,p.X$)("transformPanel",[(0,p.eR)("void => enter-dropdown",(0,p.jt)("120ms cubic-bezier(0, 0, 0.2, 1)",(0,p.F4)([(0,p.oB)({opacity:0,transform:"scale(1, 0.8)"}),(0,p.oB)({opacity:1,transform:"scale(1, 1)"})]))),(0,p.eR)("void => enter-dialog",(0,p.jt)("150ms cubic-bezier(0, 0, 0.2, 1)",(0,p.F4)([(0,p.oB)({opacity:0,transform:"scale(0.7)"}),(0,p.oB)({transform:"none",opacity:1})]))),(0,p.eR)("* => void",(0,p.jt)("100ms linear",(0,p.oB)({opacity:0})))]),fadeInCalendar:(0,p.X$)("fadeInCalendar",[(0,p.SB)("void",(0,p.oB)({opacity:0})),(0,p.SB)("enter",(0,p.oB)({opacity:1})),(0,p.eR)("void => *",(0,p.jt)("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},T={minHour:0,maxHour:24,minMinute:0,maxMinute:60,minSecond:0,maxSecond:60,meridian:12},$t=/[^0-9]/g,Ze=/^(2[0-3]|[0-1][0-9]|[0-9])$/,zt=/^([0-5][0-9]|[0-9])$/,Xt=/^([0-5][0-9]|[0-9])$/;function ne(n){const o=n.toString();return o.length>1?o:`0${o}`}let ea=(()=>{class n{constructor(e,a,i){if(this._dateAdapter=e,this.cd=a,this.formBuilder=i,this.disabled=!1,this.showSpinners=!0,this.stepHour=1,this.stepMinute=1,this.stepSecond=1,this.showSeconds=!1,this.disableMinute=!1,this.enableMeridian=!1,this.color="primary",this.meridian="AM",this._onChange=()=>{},this._onTouched=()=>{},this._destroyed=new O.x,this.pattern=Ze,!this._dateAdapter)throw function Wt(n){return Error(`NgxMatDatetimePicker: No provider found for ${n}. You must import one of the following modules at your application root: NgxMatNativeDateModule, NgxMatMomentModule, or provide a custom implementation.`)}("NgxMatDateAdapter");this.form=this.formBuilder.group({hour:[{value:null,disabled:this.disabled},[l.kI.required,l.kI.pattern(Ze)]],minute:[{value:null,disabled:this.disabled},[l.kI.required,l.kI.pattern(zt)]],second:[{value:null,disabled:this.disabled},[l.kI.required,l.kI.pattern(Xt)]]})}get hour(){let e=Number(this.form.controls.hour.value);return isNaN(e)?0:e}get minute(){let e=Number(this.form.controls.minute.value);return isNaN(e)?0:e}get second(){let e=Number(this.form.controls.second.value);return isNaN(e)?0:e}get valid(){return this.form.valid}ngOnInit(){this.form.valueChanges.pipe((0,Qe.R)(this._destroyed),(0,$e.b)(400)).subscribe(e=>{this._updateModel()})}ngOnChanges(e){(e.disabled||e.disableMinute)&&this._setDisableStates()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}writeValue(e){null!=e&&(this._model=e,this._updateHourMinuteSecond())}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._disabled=e,this.cd.markForCheck()}formatInput(e){e.value=e.value.replace($t,"")}toggleMeridian(){this.meridian="AM"===this.meridian?"PM":"AM",this.change("hour")}change(e,a){const i=this._getNextValueByProp(e,a);this.form.controls[e].setValue(ne(i),{onlySelf:!1,emitEvent:!1}),this._updateModel()}_updateHourMinuteSecond(){let e=this._dateAdapter.getHour(this._model);const a=this._dateAdapter.getMinute(this._model),i=this._dateAdapter.getSecond(this._model);this.enableMeridian&&(e>=T.meridian?(e-=T.meridian,this.meridian="PM"):this.meridian="AM",0===e&&(e=T.meridian)),this.form.patchValue({hour:ne(e),minute:ne(a),second:ne(i)},{emitEvent:!1})}_updateModel(){let e=this.hour;if(this.enableMeridian&&("AM"===this.meridian&&e===T.meridian?e=0:"PM"===this.meridian&&e!==T.meridian&&(e+=T.meridian)),this._model){const a=this._dateAdapter.clone(this._model);this._dateAdapter.setHour(a,e),this._dateAdapter.setMinute(a,this.minute),this._dateAdapter.setSecond(a,this.second),this._onChange(a)}}_getNextValueByProp(e,a){const i=e[0].toUpperCase()+e.slice(1),r=T[`min${i}`];let d,s=T[`max${i}`];return"hour"===e&&this.enableMeridian&&(s=T.meridian),null==a?(d=this[e]%s,"hour"===e&&this.enableMeridian&&0===d&&(d=s)):(d=a?this[e]+this[`step${i}`]:this[e]-this[`step${i}`],"hour"===e&&this.enableMeridian?(d%=s+1,0===d&&(d=a?1:s)):d%=s,d=a?d>s?d-s+r:d:dn),multi:!0}]),t.TTD],decls:18,vars:9,consts:[[3,"formGroup"],[1,"ngx-mat-timepicker-table"],[1,"ngx-mat-timepicker-tbody"],[4,"ngIf"],["appearance","fill",3,"color"],["type","text","matInput","","maxlength","2","formControlName","hour",3,"input","keydown.ArrowUp","keydown.ArrowDown","blur"],[1,"ngx-mat-timepicker-spacer"],["type","text","matInput","","maxlength","2","formControlName","minute",3,"input","keydown.ArrowUp","keydown.ArrowDown","blur"],["class","ngx-mat-timepicker-spacer",4,"ngIf"],["class","ngx-mat-timepicker-meridian",4,"ngIf"],["type","button","mat-icon-button","","aria-label","expand_less icon",3,"disabled","click"],["type","text","matInput","","maxlength","2","formControlName","second",3,"input","keydown.ArrowUp","keydown.ArrowDown","blur"],[1,"ngx-mat-timepicker-meridian"],["mat-button","","mat-stroked-button","",3,"color","disabled","click"],["type","button","mat-icon-button","","aria-label","expand_more icon",3,"disabled","click"]],template:function(e,a){1&e&&(t.TgZ(0,"form",0)(1,"table",1)(2,"tbody",2),t.YNc(3,ht,14,5,"tr",3),t.TgZ(4,"tr")(5,"td")(6,"mat-form-field",4)(7,"input",5),t.NdJ("input",function(r){return a.formatInput(r.target)})("keydown.ArrowUp",function(r){return a.change("hour",!0),r.preventDefault()})("keydown.ArrowDown",function(r){return a.change("hour",!1),r.preventDefault()})("blur",function(){return a.change("hour")}),t.qZA()()(),t.TgZ(8,"td",6),t._uU(9,":"),t.qZA(),t.TgZ(10,"td")(11,"mat-form-field",4)(12,"input",7),t.NdJ("input",function(r){return a.formatInput(r.target)})("keydown.ArrowUp",function(r){return a.change("minute",!0),r.preventDefault()})("keydown.ArrowDown",function(r){return a.change("minute",!1),r.preventDefault()})("blur",function(){return a.change("minute")}),t.qZA()()(),t.YNc(13,pt,2,0,"td",8),t.YNc(14,mt,3,1,"td",3),t.YNc(15,gt,1,0,"td",8),t.YNc(16,_t,3,3,"td",9),t.qZA(),t.YNc(17,Ct,14,6,"tr",3),t.qZA()()()),2&e&&(t.Q6J("formGroup",a.form),t.xp6(3),t.Q6J("ngIf",a.showSpinners),t.xp6(3),t.Q6J("color",a.color),t.xp6(5),t.Q6J("color",a.color),t.xp6(2),t.Q6J("ngIf",a.showSeconds),t.xp6(1),t.Q6J("ngIf",a.showSeconds),t.xp6(1),t.Q6J("ngIf",a.enableMeridian),t.xp6(1),t.Q6J("ngIf",a.enableMeridian),t.xp6(1),t.Q6J("ngIf",a.showSpinners))},dependencies:[h.O5,de.Nt,Me.KE,l._Y,l.Fj,l.JJ,l.JL,l.nD,l.sg,l.u,Y.Hw,F.lW,F.RK],styles:[".ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td{text-align:center}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td.ngx-mat-timepicker-spacer{font-weight:700}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td.ngx-mat-timepicker-meridian .mdc-button{min-width:64px;line-height:36px;min-width:0;border-radius:50%;width:36px;height:36px;padding:0;flex-shrink:0}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-icon-button{height:24px;width:24px;line-height:24px;padding:0}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-icon-button .mat-icon{font-size:24px}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field{width:24px;max-width:24px;text-align:center}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field.mat-focused .mdc-text-field--filled .mat-mdc-form-field-focus-overlay,.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field:hover .mdc-text-field--filled .mat-mdc-form-field-focus-overlay{background-color:transparent}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field .mdc-text-field--filled{background-color:transparent!important;padding:0!important}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-infix{padding:4px 0;min-height:1px!important}.ngx-mat-timepicker form .ngx-mat-timepicker-table .ngx-mat-timepicker-tbody tr td .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-infix input{text-align:center;font-size:14px}\n"],encapsulation:2}),n})(),ta=0;const Ve=new t.OlP("ngx-mat-datepicker-scroll-strategy"),ia={provide:Ve,deps:[q.aV],useFactory:function aa(n){return()=>n.scrollStrategies.reposition()}},na=(0,L.pj)(class{constructor(n){this._elementRef=n}});let ra=(()=>{class n extends na{constructor(e,a,i,r,s,d){super(e),this._changeDetectorRef=a,this._globalModel=i,this._dateAdapter=r,this._rangeSelectionStrategy=s,this._subscriptions=new w.w0,this._animationDone=new O.x,this._isAnimating=!1,this._actionsPortal=null,this._closeButtonText=d.closeCalendarLabel}get isViewMonth(){return!this._calendar||null==this._calendar.currentView||"month"==this._calendar.currentView}ngOnInit(){this._animationState=this.datepicker.touchUi?"enter-dialog":"enter-dropdown"}ngAfterViewInit(){this._subscriptions.add(this.datepicker.stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})),this._calendar.focusActiveCell()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._animationDone.complete()}onTimeChanged(e){this._updateUserSelectionWithCalendarUserEvent({value:e,event:null})}_handleUserSelection(e){this._updateUserSelectionWithCalendarUserEvent(e),this.datepicker.hideTime&&(!this._model||this._model.isComplete())&&!this._actionsPortal&&this.datepicker.close()}_updateUserSelectionWithCalendarUserEvent(e){const a=this._model.selection,i=e.value,r=a instanceof b;if(r&&this._rangeSelectionStrategy){const s=this._rangeSelectionStrategy.selectionFinished(i,a,e.event);this._model.updateSelection(s,this)}else{const s=this._dateAdapter.isSameTime(a,i),_=this._dateAdapter.sameDate(i,a)&&s;i&&(r||!_)&&this._model.add(i)}}_handleUserDragDrop(e){this._model.updateSelection(e.value,this)}_startExitAnimation(){this._animationState="void",this._changeDetectorRef.markForCheck()}_handleAnimationEvent(e){this._isAnimating="start"===e.phaseName,this._isAnimating||this._animationDone.next()}_getSelected(){return this._modelTime=this._model.selection,this._model.selection}_applyPendingSelection(){this._model!==this._globalModel&&this._globalModel.updateSelection(this._model.selection,this)}_assignActions(e,a){this._model=e?this._globalModel.clone():this._globalModel,this._actionsPortal=e,a&&this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(t.sBO),t.Y36(E),t.Y36(m),t.Y36(ee,8),t.Y36(te))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-datepicker-content"]],viewQuery:function(e,a){if(1&e&&t.Gf(be,5),2&e){let i;t.iGM(i=t.CRH())&&(a._calendar=i.first)}},hostAttrs:[1,"mat-datepicker-content"],hostVars:5,hostBindings:function(e,a){1&e&&t.WFA("@transformPanel.start",function(r){return a._handleAnimationEvent(r)})("@transformPanel.done",function(r){return a._handleAnimationEvent(r)}),2&e&&(t.d8E("@transformPanel",a._animationState),t.ekj("mat-datepicker-content-touch",a.datepicker.touchUi)("mat-datepicker-content-touch-with-time",!a.datepicker.hideTime))},inputs:{color:"color"},exportAs:["ngxMatDatepickerContent"],features:[t.qOj],decls:6,vars:29,consts:[["cdkTrapFocus","","role","dialog",1,"mat-datepicker-content-container"],[3,"id","ngClass","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","yearSelected","monthSelected","viewChanged","_userSelection","_userDragDrop"],[4,"ngIf"],[3,"cdkPortalOutlet"],["type","button","mat-raised-button","",1,"mat-datepicker-close-button",3,"color","focus","blur","click"],["class","time-container",3,"disable-seconds",4,"ngIf"],[1,"time-container"],[3,"showSpinners","showSeconds","disabled","stepHour","stepMinute","stepSecond","ngModel","color","enableMeridian","disableMinute","ngModelChange"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0)(1,"ngx-mat-calendar",1),t.NdJ("yearSelected",function(r){return a.datepicker._selectYear(r)})("monthSelected",function(r){return a.datepicker._selectMonth(r)})("viewChanged",function(r){return a.datepicker._viewChanged(r)})("_userSelection",function(r){return a._handleUserSelection(r)})("_userDragDrop",function(r){return a._handleUserDragDrop(r)}),t.qZA(),t.YNc(2,xt,2,1,"ng-container",2),t.YNc(3,yt,0,0,"ng-template",3),t.TgZ(4,"button",4),t.NdJ("focus",function(){return a._closeButtonFocused=!0})("blur",function(){return a._closeButtonFocused=!1})("click",function(){return a.datepicker.close()}),t._uU(5),t.qZA()()),2&e){let i;t.ekj("mat-datepicker-content-container-with-custom-header",a.datepicker.calendarHeaderComponent)("mat-datepicker-content-container-with-actions",a._actionsPortal)("mat-datepicker-content-container-with-time",!a.datepicker._hideTime),t.uIk("aria-modal",!0)("aria-labelledby",null!==(i=a._dialogLabelId)&&void 0!==i?i:void 0),t.xp6(1),t.Q6J("id",a.datepicker.id)("ngClass",a.datepicker.panelClass)("startAt",a.datepicker.startAt)("startView",a.datepicker.startView)("minDate",a.datepicker._getMinDate())("maxDate",a.datepicker._getMaxDate())("dateFilter",a.datepicker._getDateFilter())("headerComponent",a.datepicker.calendarHeaderComponent)("selected",a._getSelected())("dateClass",a.datepicker.dateClass)("comparisonStart",a.comparisonStart)("comparisonEnd",a.comparisonEnd)("@fadeInCalendar","enter")("startDateAccessibleName",a.startDateAccessibleName)("endDateAccessibleName",a.endDateAccessibleName),t.xp6(1),t.Q6J("ngIf",a.isViewMonth),t.xp6(1),t.Q6J("cdkPortalOutlet",a._actionsPortal),t.xp6(1),t.ekj("cdk-visually-hidden",!a._closeButtonFocused),t.Q6J("color",a.color||"primary"),t.xp6(1),t.hij("",a._closeButtonText," ")}},dependencies:[h.mk,h.O5,F.lW,le.mK,V.Pl,ea,l.JJ,l.On,be],styles:['.mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-content-container-with-custom-header .mat-calendar{height:auto}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.time-container{display:flex;position:relative;padding-top:5px;justify-content:center}.time-container.disable-seconds .ngx-mat-timepicker .table{margin-left:9px}.time-container:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#0000001f}.mat-datepicker-content-touch{display:block;max-height:90vh;position:relative;overflow:visible}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:815px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:90vh}.mat-datepicker-content-touch .mat-datepicker-content-container.mat-datepicker-content-container-with-time{height:auto}}@media all and (orientation: portrait){.mat-datepicker-content-touch{max-height:100vh}.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container.mat-datepicker-content-container-with-time{height:auto;max-height:870px}.mat-datepicker-content-touch .mat-datepicker-content-container.mat-datepicker-content-container-with-time.mat-datepicker-content-container-with-actions{max-height:none!important}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n'],encapsulation:2,data:{animation:[Pe.transformPanel,Pe.fadeInCalendar]},changeDetection:0}),n})(),j=(()=>{class n{constructor(e,a,i,r,s,d,_){if(this._overlay=e,this._ngZone=a,this._viewContainerRef=i,this._dateAdapter=s,this._dir=d,this._model=_,this._inputStateChanges=w.w0.EMPTY,this._document=(0,t.f3M)(h.K0),this.startView="month",this._touchUi=!1,this._hideTime=!1,this.xPosition="start",this.yPosition="below",this._restoreFocus=!0,this.yearSelected=new t.vpe,this.monthSelected=new t.vpe,this.viewChanged=new t.vpe(!0),this.openedStream=new t.vpe,this.closedStream=new t.vpe,this._opened=!1,this._showSpinners=!0,this._showSeconds=!1,this._stepHour=1,this._stepMinute=1,this._stepSecond=1,this._enableMeridian=!1,this.id="mat-datepicker-"+ta++,this._focusedElementBeforeOpen=null,this._backdropHarnessClass=`${this.id}-backdrop`,this.stateChanges=new O.x,!this._dateAdapter)throw x("NgxMatDateAdapter");this._scrollStrategy=r}get startAt(){return this._startAt||(this.datepickerInput?this.datepickerInput.getStartValue():null)}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get color(){return this._color||(this.datepickerInput?this.datepickerInput.getThemePalette():void 0)}set color(e){this._color=e}get touchUi(){return this._touchUi}set touchUi(e){this._touchUi=(0,P.Ig)(e)}get hideTime(){return this._hideTime}set hideTime(e){this._hideTime=(0,P.Ig)(e)}get disabled(){return void 0===this._disabled&&this.datepickerInput?this.datepickerInput.disabled:!!this._disabled}set disabled(e){const a=(0,P.Ig)(e);a!==this._disabled&&(this._disabled=a,this.stateChanges.next(void 0))}get restoreFocus(){return this._restoreFocus}set restoreFocus(e){this._restoreFocus=(0,P.Ig)(e)}get panelClass(){return this._panelClass}set panelClass(e){this._panelClass=(0,P.du)(e)}get opened(){return this._opened}set opened(e){(0,P.Ig)(e)?this.open():this.close()}get showSpinners(){return this._showSpinners}set showSpinners(e){this._showSpinners=e}get showSeconds(){return this._showSeconds}set showSeconds(e){this._showSeconds=e}get stepHour(){return this._stepHour}set stepHour(e){this._stepHour=e}get stepMinute(){return this._stepMinute}set stepMinute(e){this._stepMinute=e}get stepSecond(){return this._stepSecond}set stepSecond(e){this._stepSecond=e}get enableMeridian(){return this._enableMeridian}set enableMeridian(e){this._enableMeridian=e}get disableMinute(){return this._disableMinute}set disableMinute(e){this._disableMinute=e}get defaultTime(){return this._defaultTime}set defaultTime(e){this._defaultTime=e}_getMinDate(){return this.datepickerInput&&this.datepickerInput.min}_getMaxDate(){return this.datepickerInput&&this.datepickerInput.max}_getDateFilter(){return this.datepickerInput&&this.datepickerInput.dateFilter}ngOnChanges(e){const a=e.xPosition||e.yPosition;if(a&&!a.firstChange&&this._overlayRef){const i=this._overlayRef.getConfig().positionStrategy;i instanceof q._G&&(this._setConnectedPositions(i),this.opened&&this._overlayRef.updatePosition())}this.stateChanges.next(void 0)}ngOnDestroy(){this._destroyOverlay(),this.close(),this._inputStateChanges.unsubscribe(),this.stateChanges.complete()}select(e){this._model.add(e)}_selectYear(e){this.yearSelected.emit(e)}_selectMonth(e){this.monthSelected.emit(e)}_viewChanged(e){this.viewChanged.emit(e)}registerInput(e){if(this.datepickerInput)throw Error("A MatDatepicker can only be associated with a single input.");return this._inputStateChanges.unsubscribe(),this.datepickerInput=e,this._inputStateChanges=e.stateChanges.subscribe(()=>this.stateChanges.next(void 0)),this._model}registerActions(e){if(this._actionsPortal)throw Error("A MatDatepicker can only be associated with a single actions row.");this._actionsPortal=e,this._componentRef?.instance._assignActions(e,!0)}removeActions(e){e===this._actionsPortal&&(this._actionsPortal=null,this._componentRef?.instance._assignActions(null,!0))}open(){if(!(this._opened||this.disabled||this._componentRef?.instance._isAnimating)){if(!this.datepickerInput)throw Error("Attempted to open an MatDatepicker with no associated input.");this._focusedElementBeforeOpen=(0,W.ht)(),this._openOverlay(),this._opened=!0,this.openedStream.emit()}}close(){if(!this._opened||this._componentRef?.instance._isAnimating)return;const e=this._restoreFocus&&this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus,a=()=>{this._opened&&(this._opened=!1,this.closedStream.emit())};if(this._componentRef){const{instance:i,location:r}=this._componentRef;i._startExitAnimation(),i._animationDone.pipe((0,se.q)(1)).subscribe(()=>{const s=this._document.activeElement;e&&(!s||s===this._document.activeElement||r.nativeElement.contains(s))&&this._focusedElementBeforeOpen.focus(),this._focusedElementBeforeOpen=null,this._destroyOverlay()})}e?setTimeout(a):a()}_applyPendingSelection(){this._componentRef?.instance?._applyPendingSelection()}_forwardContentValues(e){e.datepicker=this,e.color=this.color,e._dialogLabelId=this.datepickerInput.getOverlayLabelId(),e._assignActions(this._actionsPortal,!1)}_openOverlay(){this._destroyOverlay();const e=this.touchUi,a=new V.C5(ra,this._viewContainerRef),i=this._overlayRef=this._overlay.create(new q.X_({positionStrategy:e?this._getDialogStrategy():this._getDropdownStrategy(),hasBackdrop:!0,backdropClass:[e?"cdk-overlay-dark-backdrop":"mat-overlay-transparent-backdrop",this._backdropHarnessClass],direction:this._dir,scrollStrategy:e?this._overlay.scrollStrategies.block():this._scrollStrategy(),panelClass:"mat-datepicker-"+(e?"dialog":"popup")}));this._getCloseStream(i).subscribe(r=>{r&&r.preventDefault(),this.close()}),i.keydownEvents().subscribe(r=>{const s=r.keyCode;(s===u.LH||s===u.JH||s===u.oh||s===u.SV||s===u.Ku||s===u.VM)&&r.preventDefault()}),this._componentRef=i.attach(a),this._forwardContentValues(this._componentRef.instance),e||this._ngZone.onStable.pipe((0,se.q)(1)).subscribe(()=>i.updatePosition())}_destroyOverlay(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=this._componentRef=null)}_getDialogStrategy(){return this._overlay.position().global().centerHorizontally().centerVertically()}_getDropdownStrategy(){const e=this._overlay.position().flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition();return this._setConnectedPositions(e)}_setConnectedPositions(e){const a="end"===this.xPosition?"end":"start",i="start"===a?"end":"start",r="above"===this.yPosition?"bottom":"top",s="top"===r?"bottom":"top";return e.withPositions([{originX:a,originY:s,overlayX:a,overlayY:r},{originX:a,originY:r,overlayX:a,overlayY:s},{originX:i,originY:s,overlayX:i,overlayY:r},{originX:i,originY:r,overlayX:i,overlayY:s}])}_getCloseStream(e){const a=["ctrlKey","shiftKey","metaKey"];return(0,je.T)(e.backdropClick(),e.detachments(),e.keydownEvents().pipe((0,ze.h)(i=>i.keyCode===u.hY&&!(0,u.Vb)(i)||this.datepickerInput&&(0,u.Vb)(i,"altKey")&&i.keyCode===u.LH&&a.every(r=>!(0,u.Vb)(i,r)))))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(q.aV),t.Y36(t.R0b),t.Y36(t.s_b),t.Y36(Ve),t.Y36(m,8),t.Y36(H.Is,8),t.Y36(E))},n.\u0275dir=t.lG2({type:n,inputs:{calendarHeaderComponent:"calendarHeaderComponent",startAt:"startAt",startView:"startView",color:"color",touchUi:"touchUi",hideTime:"hideTime",disabled:"disabled",xPosition:"xPosition",yPosition:"yPosition",restoreFocus:"restoreFocus",dateClass:"dateClass",panelClass:"panelClass",opened:"opened",showSpinners:"showSpinners",showSeconds:"showSeconds",stepHour:"stepHour",stepMinute:"stepMinute",stepSecond:"stepSecond",enableMeridian:"enableMeridian",disableMinute:"disableMinute",defaultTime:"defaultTime"},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",openedStream:"opened",closedStream:"closed"},features:[t.TTD]}),n})(),sa=(()=>{class n extends j{}return n.\u0275fac=function(){let o;return function(a){return(o||(o=t.n5z(n)))(a||n)}}(),n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-datetime-picker"]],exportAs:["ngxMatDatetimePicker"],features:[t._Bn([Te,{provide:j,useExisting:n}]),t.qOj],decls:0,vars:0,template:function(e,a){},encapsulation:2,changeDetection:0}),n})(),oa=(()=>{class n{constructor(e){this._datepicker=e}_applySelection(){this._datepicker._applyPendingSelection(),this._datepicker.close()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(j))},n.\u0275dir=t.lG2({type:n,selectors:[["","ngxMatDatepickerApply",""],["","ngxMatDateRangePickerApply",""]],hostBindings:function(e,a){1&e&&t.NdJ("click",function(){return a._applySelection()})}}),n})(),la=(()=>{class n{constructor(e){this._datepicker=e}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(j))},n.\u0275dir=t.lG2({type:n,selectors:[["","ngxMatDatepickerCancel",""],["","ngxMatDateRangePickerCancel",""]],hostBindings:function(e,a){1&e&&t.NdJ("click",function(){return a._datepicker.close()})}}),n})(),da=(()=>{class n{constructor(e,a){this._datepicker=e,this._viewContainerRef=a}ngAfterViewInit(){this._portal=new V.UE(this._template,this._viewContainerRef),this._datepicker.registerActions(this._portal)}ngOnDestroy(){this._datepicker.removeActions(this._portal),this._portal&&this._portal.isAttached&&this._portal?.detach()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(j),t.Y36(t.s_b))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ngx-mat-datepicker-actions"],["ngx-mat-date-range-picker-actions"]],viewQuery:function(e,a){if(1&e&&t.Gf(t.Rgc,5),2&e){let i;t.iGM(i=t.CRH())&&(a._template=i.first)}},ngContentSelectors:ke,decls:1,vars:0,consts:[[1,"mat-datepicker-actions"]],template:function(e,a){1&e&&(t.F$t(),t.YNc(0,Mt,2,0,"ng-template"))},styles:[".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:8px}.mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n})();const ca={provide:l.JU,useExisting:(0,t.Gpc)(()=>De),multi:!0},ua={provide:l.Cf,useExisting:(0,t.Gpc)(()=>De),multi:!0};let De=(()=>{class n extends Fe{constructor(e,a,i,r){super(e,a,i),this._formField=r,this._closedSubscription=w.w0.EMPTY,this._validator=l.kI.compose(super._getValidators())}set ngxMatDatetimePicker(e){e&&(this._datepicker=e,this._closedSubscription=e.closedStream.subscribe(()=>this._onTouched()),this._registerModel(e.registerInput(this)))}get min(){return this._min}set min(e){const a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._min)||(this._min=a,this._validatorOnChange())}get max(){return this._max}set max(e){const a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._max)||(this._max=a,this._validatorOnChange())}get dateFilter(){return this._dateFilter}set dateFilter(e){const a=this._matchesFilter(this.value);this._dateFilter=e,this._matchesFilter(this.value)!==a&&this._validatorOnChange()}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():this._elementRef.nativeElement.getAttribute("aria-labelledby")}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(e){return e.source!==this}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq),t.Y36(m,8),t.Y36(N,8),t.Y36(Me.G_,8))},n.\u0275dir=t.lG2({type:n,selectors:[["input","ngxMatDatetimePicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(e,a){1&e&&t.NdJ("input",function(r){return a._onInput(r.target.value)})("change",function(){return a._onChange()})("blur",function(){return a._onBlur()})("keydown",function(r){return a._onKeydown(r)}),2&e&&(t.Ikx("disabled",a.disabled),t.uIk("aria-haspopup",a._datepicker?"dialog":null)("aria-owns",(null==a._datepicker?null:a._datepicker.opened)&&a._datepicker.id||null)("min",a.min?a._dateAdapter.toIso8601(a.min):null)("max",a.max?a._dateAdapter.toIso8601(a.max):null)("data-mat-calendar",a._datepicker?a._datepicker.id:null))},inputs:{ngxMatDatetimePicker:"ngxMatDatetimePicker",min:"min",max:"max",dateFilter:["matDatepickerFilter","dateFilter"]},exportAs:["ngxMatDatepickerInput"],features:[t._Bn([ca,ua,{provide:de.Jk,useExisting:n}]),t.qOj]}),n})(),Ye=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[h.ez,de.c,l.UX,l.u5,Y.Ps,F.ot]}),n})(),ha=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[te,ia],imports:[h.ez,F.ot,q.U8,le.rt,V.eL,L.BQ,Ye,l.u5,l.UX,Xe.ZD]}),n})();var Ue=c(7375),Be=c(5128),pa=c(2314),ma=c(3811),ga=c(7299),_a=c(6319),S=c(5861),y=c(3322),A=c(9816),Ce=c(80),Q=c(7141),Ke=c(7396),fa=c(9222);let ba=(()=>{class n{constructor(e,a){this.api=e,this.gs=a}getAllTaskCronJobs(){return this.api.getData("/task-cron-job")}toggleOnOffTaskCronJob(e){return this.api.putData(`/task-cron-job/${e}`)}static#e=this.\u0275fac=function(a){return new(a||n)(t.LFG(fa.s),t.LFG(A.U))};static#t=this.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var M=c(2970),$=c(8377),Je=c(782),f=c(8455),re=c(9203),Ae=c(9982),He=c(7732),k=c(4758);function va(n,o){if(1&n&&t._UZ(0,"mat-icon",26),2&n){const e=t.oxw().$implicit;t.Q6J("fontIcon",e.icon)}}function Da(n,o){if(1&n&&(t.TgZ(0,"div",20)(1,"mat-card",21)(2,"mat-card-header",22)(3,"div",23),t.YNc(4,va,1,1,"mat-icon",24),t.qZA(),t.TgZ(5,"mat-card-title",25)(6,"h3",7),t._uU(7),t.qZA()(),t.TgZ(8,"mat-card-subtitle",7),t._uU(9),t.qZA()()()()),2&n){const e=o.$implicit;t.xp6(2),t.MGl("routerLink","/admin-mod/",e.url,""),t.xp6(2),t.Q6J("ngIf",e.icon),t.xp6(3),t.Oqu(e.name),t.xp6(2),t.Oqu(e.deskripsi)}}function Ca(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"mat-slide-toggle",28),t.NdJ("ngModelChange",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG((null==d.SS.currentServerSubject?null:d.SS.currentServerSubject.value)[s.key]=i)})("change",function(i){const s=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d.toggleSetting(s.key,i.checked))}),t._uU(1),t.qZA()}if(2&n){const e=o.$implicit,a=t.oxw(2);t.Q6J("disabled",!(null!=a.SS.mySocket&&a.SS.mySocket.id))("ngModel",null==a.SS.currentServerSubject?null:a.SS.currentServerSubject.value[e.key]),t.xp6(1),t.AsE(" ",e.key," - ",e.value," ")}}function Aa(n,o){if(1&n&&(t.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),t._uU(4,"Web & Server Configuration"),t.qZA()()(),t.TgZ(5,"div",10)(6,"div",11),t.YNc(7,Ca,2,4,"mat-slide-toggle",27),t.ALo(8,"keyvalue"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(7),t.Q6J("ngForOf",t.lcZ(8,1,null==e.SS.currentServerSubject?null:e.SS.currentServerSubject.value))}}function xa(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"mat-grid-tile")(1,"mat-list-option",33),t.NdJ("click",function(){const r=t.CHM(e).$implicit,s=t.oxw(2);return t.KtG(s.toggleCronJob(r))}),t._UZ(2,"mat-icon",34),t.TgZ(3,"h4",35),t._uU(4),t.qZA(),t.TgZ(5,"p",35),t._uU(6),t.ALo(7,"date"),t._UZ(8,"br"),t._uU(9),t.ALo(10,"date"),t.qZA()()()}if(2&n){const e=o.$implicit;t.xp6(1),t.Gre("text-",e.running?"warning":"danger",""),t.xp6(3),t.Oqu(e.id),t.xp6(2),t.hij(" last: ",t.xi3(7,6,e.last_date,"d MMMM y, HH:mm:ss z")," "),t.xp6(3),t.hij(" next: ",t.xi3(10,9,e.next_date,"d MMMM y, HH:mm:ss z")," ")}}function ya(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"span",29),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getAllTaskCronJobs())}),t._uU(4," Refresh "),t.qZA(),t.TgZ(5,"b",17),t._uU(6,"Cron & Task Scheduler"),t.qZA()()(),t.TgZ(7,"div",10)(8,"div",11)(9,"mat-selection-list",30)(10,"mat-grid-list",31),t.YNc(11,xa,11,12,"mat-grid-tile",32),t.qZA()()()()()}if(2&n){const e=t.oxw();t.xp6(9),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("cols",e.GS.gridListBreakpoint),t.xp6(1),t.Q6J("ngForOf",e.cronJobs)}}let Ma=(()=>{class n{constructor(e,a,i,r,s,d,_){this.bs=e,this.gs=a,this.as=i,this.adm=r,this.ss=s,this.tcj=d,this.ds=_,this.cronJobs=[],this.subsCronJobsGet=null,this.subsCronJobsPut=null,this.subsDialog=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get GS(){return this.gs}get ADM(){return this.adm}get SS(){return this.ss}ngOnInit(){this.gs.isBrowser&&this.getAllTaskCronJobs()}ngOnDestroy(){this.subsCronJobsGet?.unsubscribe(),this.subsCronJobsPut?.unsubscribe(),this.subsDialog?.unsubscribe()}toggleSetting(e,a){this.ss.socketEmit("server-set",{[e]:a})}getAllTaskCronJobs(){this.bs.busy(),this.subsCronJobsGet=this.tcj.getAllTaskCronJobs().subscribe({next:e=>{this.gs.log("[TASK_CRON_JOB_LIST_SUCCESS]",e),this.cronJobs=e.results,this.bs.idle()},error:e=>{this.gs.log("[TASK_CRON_JOB_LIST_ERROR]",e,"error"),this.bs.idle()}})}toggleCronJob(e){var a=this;return(0,S.Z)(function*(){const i=e.running?"Matikan":"Nyalakan";a.subsDialog=(yield a.ds.openKonfirmasiDialog(`${i} ${e.id}`,`Apakah Yakin Ingin Memaksa ${i} Jadwal Ini ?`)).afterClosed().subscribe({next:r=>{a.gs.log("[INFO_DIALOG_CLOSED]",r),!0===r?(a.bs.busy(),a.subsCronJobsPut=a.tcj.toggleOnOffTaskCronJob(e.id).subscribe({next:s=>{a.gs.log("[TASK_CRON_JOB_TOGGLE_SUCCESS]",s),a.bs.idle(),a.getAllTaskCronJobs()},error:s=>{a.gs.log("[TASK_CRON_JOB_TOGGLE_ERROR]",s,"error"),a.bs.idle(),a.getAllTaskCronJobs()}})):!1===r&&a.getAllTaskCronJobs(),a.subsDialog.unsubscribe()}})})()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(A.U),t.Y36(Ce.e),t.Y36(Q.l),t.Y36(Ke.R),t.Y36(ba),t.Y36(M.x))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-menu"]],decls:37,vars:9,consts:[[1,"container-fluid","p-0"],[1,"wrapper"],[1,"bg-bubbles","align-items-center","p-0"],[1,"row","align-items-center","h-100"],[1,"col-12","mx-auto"],[1,"container","text-light"],[1,"mb-1",2,"line-height","normal"],[1,"mb-0"],[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row","px-3"],["class","col-12 col-md-6 col-xl-3 p-2",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","rows","10",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-3","p-2"],[1,"gradient-border","rgb-border"],[2,"cursor","pointer",3,"routerLink"],["mat-card-avatar",""],["style","font-size: 300%;",3,"fontIcon",4,"ngIf"],[1,"text-warning","mb-1",2,"cursor","pointer"],[2,"font-size","300%",3,"fontIcon"],["class","my-2 col-12 col-md-6 col-xl-3",3,"disabled","ngModel","ngModelChange","change",4,"ngFor","ngForOf"],[1,"my-2","col-12","col-md-6","col-xl-3",3,"disabled","ngModel","ngModelChange","change"],[1,"float-end","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[1,"p-0",3,"multiple"],["rowHeight","72px",3,"cols"],[4,"ngFor","ngForOf"],[3,"click"],["fontIcon","update","mat-list-icon","",1,"ps-3"],["matLine",""]],template:function(a,i){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"ul",2),t._UZ(3,"li")(4,"li")(5,"li")(6,"li")(7,"li")(8,"li")(9,"li")(10,"li")(11,"li")(12,"li"),t.TgZ(13,"div",3)(14,"div",4)(15,"div",5)(16,"h2",6),t._uU(17),t.qZA(),t.TgZ(18,"p",7),t._uU(19,"Admin & Mod Panel List, Halaman Khusus Orang Dalam ..."),t.qZA()()()()()()(),t._UZ(20,"app-notifications"),t.TgZ(21,"div",8)(22,"div",9)(23,"div",10)(24,"div",11),t.YNc(25,Da,10,4,"div",12),t.qZA(),t.YNc(26,Aa,9,3,"div",13),t.YNc(27,ya,12,3,"div",13),t.TgZ(28,"div",14)(29,"div",15)(30,"h2",16)(31,"b",17),t._uU(32,"Request & Response Logs"),t.qZA()()(),t.TgZ(33,"mat-form-field",18)(34,"mat-label"),t._uU(35,"Request & Response Logs"),t.qZA(),t.TgZ(36,"textarea",19),t.NdJ("ngModelChange",function(s){return i.SS.serverLog=s}),t.qZA()()()()()()),2&a&&(t.xp6(1),t.Udp("background","linear-gradient(to bottom, "+(i.GS.isDarkMode?"#673ab7":"#3f51b5")+" 0%, #ee0dfd 100%)"),t.xp6(16),t.AsE(" ",null==i.AS.currentUserSubject||null==i.AS.currentUserSubject.value?null:i.AS.currentUserSubject.value.kartu_tanda_penduduk_.nama," :: ",null==i.AS.currentUserSubject||null==i.AS.currentUserSubject.value?null:i.AS.currentUserSubject.value.role," "),t.xp6(8),t.Q6J("ngForOf",i.ADM.menuList),t.xp6(1),t.Q6J("ngIf",null==i.SS.currentServerSubject?null:i.SS.currentServerSubject.value),t.xp6(1),t.Q6J("ngIf",i.cronJobs.length>0),t.xp6(6),t.Q6J("color","accent"),t.xp6(3),t.Q6J("ngModel",i.SS.serverLog))},dependencies:[h.sg,h.O5,X.rH,$.S$,$.u7,$.mi,$._K,$.lb,Je.Il,Je.DX,L.X2,Y.Hw,f.v_,f.$V,re.k0,Ae.ap,Ae.kh,Ae.O$,He.iZ,k.t,l.Fj,l.JJ,l.On,h.uU,h.Nd],styles:[".wrapper[_ngcontent-%COMP%]{position:sticky;left:0;width:100%;height:128px;overflow:hidden}.bg-bubbles[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:#ffffff26;bottom:-160px;animation:_ngcontent-%COMP%_square 25s infinite;transition-timing-function:linear}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(1){left:10%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:#ffffff40}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(5){left:70%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:#fff3}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:#ffffff4d}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes _ngcontent-%COMP%_square{0%{transform:translateY(0)}to{transform:translateY(-512px) rotate(512deg)}}"]})}return n})();var z=c(4674),ka=c(8925),I=c(9558);let Ta=(()=>{class n{constructor(e,a,i,r){this.dls=e,this.bs=a,this.ds=i,this.gs=r,this.subsAttachmentGet=null,this.subsAttachmentReUpload=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.attachmentData={column:["Nama Lampiran","Ext","Size","Mime","Tanggal","Pemilik","Aksi"],row:[]},this.failed=!0,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getAttachment()}ngOnDestroy(){this.subsAttachmentGet?.unsubscribe(),this.subsAttachmentReUpload?.unsubscribe(),this.subsDialog?.unsubscribe()}getAttachment(){this.bs.busy(),this.subsAttachmentGet&&(this.subsAttachmentGet.unsubscribe(),this.bs.idle()),this.subsAttachmentGet=this.dls.getAttachmentNotUploaded(this.q,this.page,this.row,this.sort,this.order,this.failed).subscribe({next:e=>{this.gs.log("[LAMPIRAN_PENDING_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({foto:i.user_?.image_url||i.parent_attachment_?.user_?.image_url||`${z.N.baseUrl}/assets/img/favicon.png`,pending:i.pending,"Nama Lampiran":i.name,Ext:i.ext,Size:i.size,Mime:i.mime,Tanggal:i.created_at,Pemilik:i.user_?.username||i.parent_attachment_?.user_?.username||"SYSTEM",Aksi:i.pending||i.discord||i.google_drive||i.aws_s3?[]:[{type:"button",icon:"cloud_upload",name:"ReUpload",row:i}]});this.attachmentData.row=a,this.bs.idle()},error:e=>{this.gs.log("[LAMPIRAN_PENDING_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[LAMPIRAN_LIST_CLICK_AKSI]",e),"ReUpload"===e.name&&this.reUpload(e.row)}reUpload(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_REUPLOAD]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog("Upload Ulang ?",`\n Id: ${e.id}
\n Filename: ${e.name}.${e.ext}
\n Size: ${e.size} Bytes
\n Mime: ${e.mime}
\n Pemilik: ${e.user_.username}\n `)).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsAttachmentReUpload=a.dls.reUpload({id:e.id}).subscribe({next:r=>{a.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_REUPLOAD_SUCCESS]",r),a.bs.idle(),a.getAttachment()},error:r=>{a.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_REUPLOAD_ERROR]",r,"error"),a.bs.idle(),a.getAttachment()}})):!1===i&&a.getAttachment(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getAttachment()}onServerSideFilter(e){this.gs.log("[LAMPIRAN_PENDING_LIST_ENTER_FILTER]",e),this.q=e,this.getAttachment()}onServerSideOrder(e){this.gs.log("[LAMPIRAN_PENDING_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getAttachment()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(ka.v),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-ddl"]],decls:15,vars:5,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row","my-4"],[1,"col-12","text-end","text-success"],["labelPosition","before",3,"ngModel","ngModelChange","change"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"mat-slide-toggle",5),t.NdJ("ngModelChange",function(s){return i.failed=s})("change",function(){return i.getAttachment()}),t._uU(7," Tampilkan Yang Tidak Selesai Saja "),t.qZA()()(),t.TgZ(8,"div",6)(9,"div",7)(10,"h2",8)(11,"b",9),t._uU(12,"Kelola Berkas DDL"),t.qZA()()(),t.TgZ(13,"div",10)(14,"app-material-table",11),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)}),t.qZA()()()()()()),2&a&&(t.xp6(6),t.Q6J("ngModel",i.failed),t.xp6(8),t.Q6J("tableDataColumn",i.attachmentData.column)("tableDataRow",i.attachmentData.row)("count",i.count)("serverSide",!0))},dependencies:[He.iZ,I.I,k.t,l.JJ,l.On]})}return n})();var D=c(1741),Sa=c(1140);let Ia=(()=>{class n{constructor(e,a,i,r,s,d,_,C){this.router=e,this.bs=a,this.ds=i,this.as=r,this.gs=s,this.ss=d,this.adm=_,this.user=C,this.subsUserGet=null,this.subsUserDelete=null,this.subsPromote=null,this.subsDialog=null,this.subsBannedGet=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.userData={column:["Id","Role","Image","Username","Nama Lengkap","Email","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getUser()}ngOnDestroy(){this.subsUserGet?.unsubscribe(),this.subsUserDelete?.unsubscribe(),this.subsPromote?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsBannedGet?.unsubscribe()}getUser(){this.bs.busy(),this.subsUserGet&&(this.subsUserGet.unsubscribe(),this.bs.idle()),this.subsUserGet=this.user.getAllUser(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[USER_LIST_SUCCESS]",e),this.count=e.count,this.userData.row=[],this.bs.busy(),e.results.length>0&&(this.subsBannedGet=this.adm.getBanned({username:e.results.map(a=>a.username)}).subscribe({next:a=>{this.gs.log("[BANNED_LIST_SUCCESS]",e);const i=[];let r=[];r=this.as.currentUserSubject?.value?.role===D.yS.ADMIN?[D.yS.ADMIN]:[D.yS.ADMIN,D.yS.MODERATOR];for(const s of e.results)i.push({Id:s.id,Role:s.role,Image:s.image_url,Username:s.username,Email:s._email,"Nama Lengkap":s.kartu_tanda_penduduk_.nama,banned:Object.keys(a.results[s.username]).length>0,Aksi:[{type:"button",icon:"mail_outline",name:"MAIL",row:s},...Object.keys(a.results[s.username]).length>0||s.username===this.as.currentUserSubject?.value?.username||this.gs.includesOneOf(s.role,r)?[]:[{type:"button",icon:"lock",name:"BAN",row:s},{type:"button",icon:"handyman",name:D.yS.ADMIN,row:s},{type:"button",icon:"security",name:D.yS.MODERATOR,row:s},{type:"button",icon:"rate_review",name:D.yS.FANSUBBER,row:s},{type:"button",icon:"person",name:D.yS.USER,row:s}]]});this.userData.row=i,this.bs.idle()},error:a=>{this.gs.log("[BANNED_LIST_ERROR]",a,"error"),this.bs.idle()}})),this.bs.idle()},error:e=>{this.gs.log("[USER_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[USER_LIST_CLICK_AKSI]",e),"BAN"===e.name?this.ban(e.row):"MAIL"===e.name?this.router.navigate(["/create/mailbox"],{queryParams:{to:`${e.row.username}@${z.N.domain}`,cc:e.row._email}}):this.proDemote(e.row,e.name)}ban(e){this.gs.log("[USER_LIST_CLICK_BAN]",e),this.subsDialog=this.ds.openInputDialog({data:{title:`BAN Akun -- '${e.username}'`,input:{reason:{inputLabel:"Alasan",inputPlaceholder:`Manually Banned By ${this.as.currentUserSubject?.value?.role}`,inputValue:null,inputRequired:!0}},confirmText:"Ya, BAN Akun",cancelText:"Tidak, Batal"},disableClose:!1}).afterClosed().subscribe({next:a=>{this.gs.log("[INPUT_DIALOG_CLOSED]",a),a?(this.bs.busy(),this.subsUserDelete=this.adm.ban({id:e.id,email:e.email,username:e.username,reason:a.reason}).subscribe({next:i=>{this.gs.log("[USER_LIST_CLICK_BAN_SUCCESS]",i),this.bs.idle(),this.getUser(),this.ss.socketEmitVolatile("force-logout",{username:e.username,reason:a.reason})},error:i=>{this.gs.log("[USER_LIST_CLICK_BAN_ERROR]",i,"error"),this.bs.idle(),this.getUser()}})):this.getUser(),this.subsDialog.unsubscribe()}})}proDemote(e,a){var i=this;return(0,S.Z)(function*(){i.gs.log("[USER_LIST_CLICK_PROMOTE]",e),i.subsDialog=(yield i.ds.openKonfirmasiDialog(`Pro/Demosikan Akun -- '${e.username}'`,`Apakah Yakin Ingin Menjadikannya Sebagai ${a} ?`)).afterClosed().subscribe({next:r=>{i.gs.log("[INFO_DIALOG_CLOSED]",r),!0===r?(i.bs.busy(),i.subsPromote=i.adm.proDemote({id:e.id,role:a}).subscribe({next:s=>{i.gs.log("[USER_LIST_CLICK_PROMOTE_SUCCESS]",s),i.bs.idle(),i.getUser()},error:s=>{i.gs.log("[USER_LIST_CLICK_PROMOTE_ERROR]",s,"error"),i.bs.idle(),i.getUser()}})):!1===r&&i.getUser(),i.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[USER_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getUser()}onServerSideFilter(e){this.gs.log("[USER_LIST_ENTER_FILTER]",e),this.q=e,this.getUser()}onServerSideOrder(e){this.gs.log("[USER_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getUser()}openUser(e){this.gs.log("[USER_LIST_CLICK_USER]",e),this.router.navigateByUrl(`/user/${e.Username}`)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(X.F0),t.Y36(y.z),t.Y36(M.x),t.Y36(Ce.e),t.Y36(A.U),t.Y36(Ke.R),t.Y36(Q.l),t.Y36(Sa.K))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-user"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Kelola Seluruh Member"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openUser(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.userData.column)("tableDataRow",i.userData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})();var g=c(3659),wa=c(7245),Na=c(3719),xe=c(9818),Ea=c(7443);function Ra(n,o){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function Oa(n,o){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageErrorText)}}function La(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",2)(1,"button",34),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.submitImage())}),t._UZ(2,"mat-icon",35),t._uU(3," Unggah "),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Fa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Nama Tidak Boleh Kosong"),t.qZA())}function Pa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Nama Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Za(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Deskripsi Tidak Boleh Kosong"),t.qZA())}function Va(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Deskripsi Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ya(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",10),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSubmit())}),t.TgZ(1,"div",11)(2,"h2",6)(3,"b",7),t._uU(4,"Buat Tipe Jenis Proyek Baru"),t.qZA()()(),t.TgZ(5,"div",2)(6,"div",3)(7,"div",12)(8,"div",3)(9,"div",2),t._UZ(10,"img",13),t.TgZ(11,"mat-form-field",14)(12,"mat-label"),t._uU(13,"Gambar"),t.qZA(),t.TgZ(14,"ngx-mat-file-input",15,16),t.NdJ("change",function(i){t.CHM(e);const r=t.MAs(15),s=t.oxw();return t.KtG(s.uploadImage(i,r))}),t.qZA(),t._UZ(16,"mat-icon",17),t.qZA(),t.TgZ(17,"mat-error",18)(18,"small"),t.YNc(19,Ra,3,3,"div",19),t.YNc(20,Oa,2,1,"div",19),t.qZA()()(),t.YNc(21,La,4,1,"div",20),t.qZA()(),t.TgZ(22,"div",21)(23,"div",3)(24,"mat-form-field",22)(25,"mat-label"),t._uU(26,"Nama"),t.qZA(),t._UZ(27,"input",23)(28,"mat-icon",24),t.TgZ(29,"mat-hint",25),t._uU(30,"Untuk Jenis Berkas"),t.qZA(),t.TgZ(31,"mat-error"),t.YNc(32,Fa,2,0,"div",19),t.YNc(33,Pa,2,0,"div",19),t.qZA()(),t.TgZ(34,"mat-form-field",22)(35,"mat-label"),t._uU(36,"Deskripsi"),t.qZA(),t._UZ(37,"input",26)(38,"mat-icon",27),t.TgZ(39,"mat-error"),t.YNc(40,Za,2,0,"div",19),t.YNc(41,Va,2,0,"div",19),t.qZA()()()(),t.TgZ(42,"div",8)(43,"div",28)(44,"div",2)(45,"div",29),t._UZ(46,"div",30),t.TgZ(47,"div",31)(48,"button",32),t._uU(49," Simpan "),t._UZ(50,"mat-icon",33),t.qZA()()()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(10),t.Q6J("src",e.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",e.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imageErrorText),t.xp6(1),t.Q6J("ngIf",e.image&&!e.fg.value.image),t.xp6(3),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",e.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("description").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("description").hasError("pattern")),t.xp6(7),t.Q6J("disabled",e.submitted||e.fg.invalid)}}let Ua=(()=>{class n{constructor(e,a,i,r,s,d){this.fb=e,this.bs=a,this.gs=i,this.ds=r,this.imgbb=s,this.project=d,this.submitted=!1,this.subsProjectGet=null,this.subsProjectCreate=null,this.subsProjectDelete=null,this.subsImgbb=null,this.subsDialog=null,this.gambar=null,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.projectData={column:["Nama","Image","Deskripsi","Berkas","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.getProject())}ngOnDestroy(){this.subsProjectCreate?.unsubscribe(),this.subsProjectGet?.unsubscribe(),this.subsProjectDelete?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsDialog?.unsubscribe()}initForm(){this.fg=this.fb.group({name:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],description:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],image:[null,l.kI.compose([l.kI.pattern(g.t.regexUrl)])]})}getProject(){this.bs.busy(),this.subsProjectGet&&(this.subsProjectGet.unsubscribe(),this.bs.idle()),this.subsProjectGet=this.project.getProject().subscribe({next:e=>{this.gs.log("[PROJECT_LIST_SUCCESS]",e);const a=[];for(const i of e.results)a.push({Nama:i.name,Image:i.image_url,Deskripsi:i.description,Berkas:i.total_berkas,Aksi:i.total_berkas>0?[]:[{type:"button",icon:"delete_forever",name:"Hapus",row:i}]});this.projectData.row=a,this.bs.idle()},error:e=>{this.gs.log("[PROJECT_LIST_ERROR]",e,"error"),this.bs.idle()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsProjectCreate=this.project.createProject({name:this.fg.value.name,description:this.fg.value.description,image:this.fg.value.image}).subscribe({next:e=>{this.gs.log("[PROJECT_CREATE_SUCCESS]",e),this.submitted=!1,this.bs.idle();for(const a in this.fg.controls)this.fg.controls[a]&&(this.fg.controls[a].patchValue(null),this.fg.controls[a].updateValueAndValidity(),this.fg.controls[a].setErrors(null),this.fg.controls[a].markAsUntouched(),this.fg.controls[a].markAsPristine());this.getProject()},error:e=>{this.gs.log("[PROJECT_CREATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle(),this.getProject()}})}action(e){this.gs.log("[PROJECT_LIST_CLICK_AKSI]",e),"Hapus"===e.name&&this.deleteProject(e.row)}deleteProject(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[PROJECT_LIST_CLICK_DELETE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Hapus Proyek -- '${e.id}' :: '${e.nama}'`,"Menghapus Dapat Membuat Error / Menghapus Berkas Yang Menunjuk Ke Tipe Ini !")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsProjectDelete=a.project.deleteProject(e.id).subscribe({next:r=>{a.gs.log("[PROJECT_LIST_CLICK_DELETE_SUCCESS]",r),a.bs.idle(),a.getProject()},error:r=>{a.gs.log("[PROJECT_LIST_CLICK_DELETE_ERROR]",r,"error"),a.bs.idle(),a.getProject()}})):!1===i&&a.getProject(),a.subsDialog.unsubscribe()}})})()}uploadImage(e,a){this.gambar=a,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const i=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(i),r.onload=s=>{if(this.gs.log("[IMAGE_SELECTED]",s),i.size<=g.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=i,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=g.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.imageErrorText=e.result?.message||e.info,this.submitted=!1}})}openProject(e){this.gs.log("[PROJECT_LIST_CLICK_PROJECT]",e)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(l.QS),t.Y36(y.z),t.Y36(A.U),t.Y36(M.x),t.Y36(wa.X),t.Y36(Na.Y))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-project-type"]],decls:13,vars:3,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[3,"formGroup","submit",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","rowClicked","buttonClicked"],[3,"formGroup","submit"],[1,"col-12","sticky-top","bg-bifeldy","pb-1"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","**_BD","required",""],["fontIcon","short_text","matSuffix",""],["align","end"],["matInput","","formControlName","description","placeholder","Edisi Terbatas","required",""],["fontIcon","wysiwyg","matSuffix",""],[1,"row","mt-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,Ya,51,15,"form",4),t.qZA(),t.TgZ(6,"div",3)(7,"div",5)(8,"h2",6)(9,"b",7),t._uU(10,"Hapus Jenis Proyek Yang Ada"),t.qZA()()(),t.TgZ(11,"div",8)(12,"app-material-table",9),t.NdJ("rowClicked",function(s){return i.openProject(s)})("buttonClicked",function(s){return i.action(s)}),t.qZA()()()()()()),2&a&&(t.xp6(5),t.Q6J("ngIf",i.fg),t.xp6(7),t.Q6J("tableDataColumn",i.projectData.column)("tableDataRow",i.projectData.row))},dependencies:[h.O5,xe.eB,Y.Hw,f.nI,f.v_,f.pH,f.$V,f.nX,re.k0,I.I,k.t,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.sg,l.u,Be.Yh,Ea.$]})}return n})();var qe=c(4363),Ba=c(9602),Ge=c(6289);const Ka=["kalender"];function Ja(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Tidak Boleh Kosong"),t.qZA())}function Ha(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function qa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Isi Tidak Boleh Kosong"),t.qZA())}function Ga(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Isi Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ja(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function Qa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tipe Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function $a(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function za(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Dismissible Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Xa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Timeout Hanya Boleh Angka"),t.qZA())}function Wa(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Tidak Valid"),t.qZA())}function ei(n,o){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij("Paling Lama ",e.maxNotificationDays," Hari Mendatang")}}function ti(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Paling Cepat Detik Ini Sekarang"),t.qZA())}function ai(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ii(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",10),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSubmit())}),t.TgZ(1,"div",11)(2,"h2",6)(3,"b",7),t._uU(4,"Buat Push Notifikasi"),t.qZA()()(),t.TgZ(5,"div",2)(6,"div",3)(7,"mat-form-field",12)(8,"mat-label"),t._uU(9,"Judul"),t.qZA(),t._UZ(10,"input",13)(11,"mat-icon",14),t.TgZ(12,"mat-hint",15),t._uU(13,"Teks Tebal Di Kiri"),t.qZA(),t.TgZ(14,"mat-error"),t.YNc(15,Ja,2,0,"div",16),t.YNc(16,Ha,2,0,"div",16),t.qZA()(),t.TgZ(17,"mat-form-field",17)(18,"mat-label"),t._uU(19,"Konten / Isi"),t.qZA(),t._UZ(20,"input",18)(21,"mat-icon",19),t.TgZ(22,"mat-error"),t.YNc(23,qa,2,0,"div",16),t.YNc(24,Ga,2,0,"div",16),t.qZA()(),t.TgZ(25,"mat-form-field",20)(26,"mat-label"),t._uU(27,"Jenis Warna"),t.qZA(),t.TgZ(28,"mat-select",21)(29,"mat-option",22),t._uU(30,"Merah"),t.qZA(),t.TgZ(31,"mat-option",23),t._uU(32,"Kuning"),t.qZA(),t.TgZ(33,"mat-option",24),t._uU(34,"Hijau"),t.qZA(),t.TgZ(35,"mat-option",25),t._uU(36,"Putih"),t.qZA(),t.TgZ(37,"mat-option",26),t._uU(38,"Hitam"),t.qZA(),t.TgZ(39,"mat-option",27),t._uU(40,"Abu Abu"),t.qZA(),t.TgZ(41,"mat-option",28),t._uU(42,"Biru Tua"),t.qZA(),t.TgZ(43,"mat-option",29),t._uU(44,"Biru Muda"),t.qZA()(),t.TgZ(45,"mat-error"),t.YNc(46,ja,2,0,"div",16),t.YNc(47,Qa,2,0,"div",16),t.qZA()(),t.TgZ(48,"mat-form-field",20)(49,"mat-label"),t._uU(50,"Dapat Ditutup"),t.qZA(),t.TgZ(51,"mat-select",30)(52,"mat-option",31),t._uU(53,"Ya"),t.qZA(),t.TgZ(54,"mat-option",32),t._uU(55,"Tidak"),t.qZA()(),t.TgZ(56,"mat-hint",15),t._uU(57,"Tombol X Di Kanan"),t.qZA(),t.TgZ(58,"mat-error"),t.YNc(59,$a,2,0,"div",16),t.YNc(60,za,2,0,"div",16),t.qZA()(),t.TgZ(61,"mat-form-field",20)(62,"mat-label"),t._uU(63,"Timeout"),t.qZA(),t._UZ(64,"input",33)(65,"mat-icon",34),t.TgZ(66,"mat-hint",15),t._uU(67,"Dalam Mili-Detik"),t.qZA(),t.TgZ(68,"mat-error"),t.YNc(69,Xa,2,0,"div",16),t.qZA()(),t.TgZ(70,"mat-form-field",20)(71,"mat-label"),t._uU(72,"Deadline"),t.qZA(),t.TgZ(73,"input",35),t.NdJ("focus",function(){t.CHM(e);const i=t.MAs(77);return t.KtG(i.open())}),t.ALo(74,"date"),t.qZA(),t._UZ(75,"mat-datepicker-toggle",36),t.TgZ(76,"ngx-mat-datetime-picker",37,38)(78,"ngx-mat-datepicker-actions")(79,"button",39),t._uU(80,"Batal"),t.qZA(),t.TgZ(81,"button",40),t._uU(82,"Simpan"),t.qZA()()(),t.TgZ(83,"mat-hint",15),t._uU(84,"Muncul Setiap Halaman Di Refresh"),t.qZA(),t.TgZ(85,"mat-error"),t.YNc(86,Wa,2,0,"div",16),t.YNc(87,ei,2,1,"div",16),t.YNc(88,ti,2,0,"div",16),t.YNc(89,ai,2,0,"div",16),t.qZA()()(),t.TgZ(90,"div",41)(91,"div",2)(92,"div",42),t._UZ(93,"div",43),t.TgZ(94,"div",44)(95,"button",45),t._uU(96," Simpan "),t._UZ(97,"mat-icon",46),t.qZA()()()()()()()}if(2&n){const e=t.MAs(77),a=t.oxw();t.Q6J("formGroup",a.fg),t.xp6(7),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",a.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("title").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",a.fg.get("content").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("content").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(21),t.Q6J("ngIf",a.fg.get("type").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("type").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",a.fg.get("dismissible").hasError("required")),t.xp6(1),t.Q6J("ngIf",a.fg.get("dismissible").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",a.fg.get("timeout").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.s9C("placeholder",t.xi3(74,31,a.currentDateTime,"d MMMM y, HH:mm:ss")),t.Q6J("ngxMatDatetimePicker",e)("min",a.currentDateTime)("max",a.maxDateTime),t.xp6(2),t.Q6J("for",a.dateTimePicker),t.xp6(1),t.Q6J("showSpinners",!0)("showSeconds",!0)("enableMeridian",!0),t.xp6(3),t.Q6J("color","warn"),t.xp6(2),t.Q6J("color","primary"),t.xp6(5),t.Q6J("ngIf",a.fg.get("deadline").hasError("matDatetimePickerParse")),t.xp6(1),t.Q6J("ngIf",a.fg.get("deadline").hasError("matDatetimePickerMax")),t.xp6(1),t.Q6J("ngIf",a.fg.get("deadline").hasError("matDatetimePickerMin")),t.xp6(1),t.Q6J("ngIf",a.fg.get("deadline").hasError("pattern")),t.xp6(6),t.Q6J("disabled",a.submitted||a.fg.invalid)}}let ni=(()=>{class n{constructor(e,a,i,r,s){this.fb=e,this.bs=a,this.ds=i,this.gs=r,this.adm=s,this.submitted=!1,this.subsNotifGet=null,this.subsNotifCreate=null,this.subsNotifDelete=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.notifData={column:["Deadline","Judul","Konten","Pemilik","Aksi"],row:[]},this.currentDateTime=new Date,this.maxDateTime=new Date(Date.now()+g.t.timeMaxDaysNotification),this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.getNotif())}get maxNotificationDays(){return g.t.timeMaxDaysNotification/24/60/60/1e3}ngOnDestroy(){this.subsNotifCreate?.unsubscribe(),this.subsNotifGet?.unsubscribe(),this.subsNotifDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}initForm(){this.fg=this.fb.group({title:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],content:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],type:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],dismissible:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],timeout:[null,l.kI.compose([l.kI.pattern(/^[0-9]+$/)])],deadline:[null,l.kI.compose([l.kI.pattern(g.t.regexEnglishKeyboardKeys)])]})}get dateTimePicker(){return this.kalender}getNotif(){this.bs.busy(),this.subsNotifGet&&(this.subsNotifGet.unsubscribe(),this.bs.idle()),this.subsNotifGet=this.adm.getAllNotif(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[NOTIFICATION_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({foto:i.user_.image_url,deleted:new Date(i.deadline).getTime()===new Date(0).getTime(),Deadline:i.deadline,Judul:i.title,Konten:i.content,Pemilik:i.user_.username,Aksi:(new Date).getTime()>new Date(i.deadline).getTime()?[]:[{type:"button",icon:"close",name:"Hapus",row:i}]});this.notifData.row=a,this.bs.idle()},error:e=>{this.gs.log("[NOTIFICATION_LIST_ERROR]",e,"error"),this.bs.idle()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNotifCreate=this.adm.createNotif({type:this.fg.value.type,title:this.fg.value.title,content:this.fg.value.content,dismissible:"1"===this.fg.value.dismissible,timeout:this.fg.value.timeout,deadline:this.fg.value.deadline}).subscribe({next:e=>{this.gs.log("[NOTIFICATION_CREATE_SUCCESS]",e),this.submitted=!1,this.bs.idle();for(const a in this.fg.controls)this.fg.controls[a]&&(this.fg.controls[a].patchValue(null),this.fg.controls[a].updateValueAndValidity(),this.fg.controls[a].setErrors(null),this.fg.controls[a].markAsUntouched(),this.fg.controls[a].markAsPristine());this.getNotif()},error:e=>{this.gs.log("[NOTIFICATION_CREATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle(),this.getNotif()}})}action(e){this.gs.log("[NOTIFICATION_LIST_CLICK_AKSI]",e),"Hapus"===e.name&&this.deleteNotif(e.row)}deleteNotif(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[NOTIFICATION_LIST_CLICK_DELETE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Hapus Notif -- '${e.id}' :: '${e.title}'`,"Yakin Akan Menghapus Notifikasi Ini ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsNotifDelete=a.adm.deleteNotif(e.id).subscribe({next:r=>{a.gs.log("[NOTIFICATION_LIST_CLICK_DELETE_SUCCESS]",r),a.bs.idle(),a.getNotif()},error:r=>{a.gs.log("[NOTIFICATION_LIST_CLICK_DELETE_ERROR]",r,"error"),a.bs.idle(),a.getNotif()}})):!1===i&&a.getNotif(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[NOTIFICATION_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getNotif()}onServerSideFilter(e){this.gs.log("[NOTIFICATION_LIST_ENTER_FILTER]",e),this.q=e,this.getNotif()}onServerSideOrder(e){this.gs.log("[NOTIFICATION_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getNotif()}openNotif(e){this.gs.log("[NOTIFICATION_LIST_CLICK_NOTIFICATION]",e)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(l.QS),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(Q.l))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-push-notification"]],viewQuery:function(a,i){if(1&a&&t.Gf(Ka,7),2&a){let r;t.iGM(r=t.CRH())&&(i.kalender=r.first)}},decls:13,vars:5,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[3,"formGroup","submit",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"],[3,"formGroup","submit"],[1,"col-12","sticky-top","bg-bifeldy","pb-1"],["appearance","outline",1,"p-3","col-12","col-md-4",3,"color"],["matInput","","formControlName","title","placeholder","Perhatian!","required",""],["fontIcon","short_text","matSuffix",""],["align","end"],[4,"ngIf"],["appearance","outline",1,"p-3","col-12","col-md-8",3,"color"],["matInput","","formControlName","content","placeholder","Akan Diadakan Maintenance Pada ...","required",""],["fontIcon","wysiwyg","matSuffix",""],["appearance","outline",1,"p-3","col-12","col-md-3",3,"color"],["formControlName","type","placeholder","Class Warna Bootstrap","required",""],["value","danger"],["value","warning"],["value","success"],["value","light"],["value","dark"],["value","secondary"],["value","primary"],["value","info"],["formControlName","dismissible","placeholder","Ya / Tidak","required",""],["value","1"],["value","0"],["type","number","matInput","","formControlName","timeout","placeholder","10000"],["fontIcon","123","matSuffix",""],["matInput","","formControlName","deadline",3,"ngxMatDatetimePicker","placeholder","min","max","focus"],["matSuffix","",3,"for"],[3,"showSpinners","showSeconds","enableMeridian"],["kalender",""],["mat-stroked-button","","ngxMatDatepickerCancel","",3,"color"],["mat-flat-button","","ngxMatDatepickerApply","",3,"color"],[1,"row","mt-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,ii,98,34,"form",4),t.qZA(),t.TgZ(6,"div",3)(7,"div",5)(8,"h2",6)(9,"b",7),t._uU(10,"Deadline Notifikasi"),t.qZA()()(),t.TgZ(11,"div",8)(12,"app-material-table",9),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openNotif(s)}),t.qZA()()()()()()),2&a&&(t.xp6(5),t.Q6J("ngIf",i.fg),t.xp6(7),t.Q6J("tableDataColumn",i.notifData.column)("tableDataRow",i.notifData.row)("count",i.count)("serverSide",!0))},dependencies:[h.O5,qe.CK,xe.eB,Ba.nW,Y.Hw,f.nI,f.v_,f.pH,f.$V,f.nX,re.k0,Ge.x8,I.I,k.t,l._Y,l.Fj,l.wV,l.JJ,l.JL,l.Q7,l.sg,l.u,sa,De,da,la,oa,h.uU]})}return n})();var ri=c(3842);let si=(()=>{class n{constructor(e,a,i,r){this.bs=e,this.ds=a,this.fansub=i,this.gs=r,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.memberData={column:["Id","Fansub","Anggota","Keterangan","Aksi"],row:[]},this.subsMemberGet=null,this.subsMemberPut=null,this.subsMemberDelete=null,this.subsDialog=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getFansubMember()}ngOnDestroy(){this.subsMemberGet?.unsubscribe(),this.subsMemberPut?.unsubscribe(),this.subsMemberDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}getFansubMember(){this.bs.busy(),this.subsMemberGet&&(this.subsMemberGet.unsubscribe(),this.bs.idle()),this.subsMemberGet=this.fansub.getAllFansubMember(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[FANSUB_MEMBER_LIST_SUCCESS]",e);const a=[];this.count=e.count;for(const i of e.results)a.push({foto_fansub:i.fansub_.image_url,foto_anggota:i.user_.image_url,Id:i.id,Fansub:i.fansub_.slug,Anggota:i.user_.username,Keterangan:i.keterangan,Aksi:i.approved?[{type:"button",icon:"no_meeting_room",name:"KICK",row:i}]:[{type:"button",icon:"done",name:"ACCEPT",row:i},{type:"button",icon:"close",name:"REJECT",row:i}]});this.memberData.row=a,this.bs.idle()},error:e=>{this.gs.log("[FANSUB_MEMBER_LIST_ERROR]",e,"error"),this.bs.idle()}})}onPaginatorClicked(e){this.gs.log("[FANSUB_MEMBER_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getFansubMember()}onServerSideFilter(e){this.gs.log("[FANSUB_MEMBER_LIST_ENTER_FILTER]",e),this.q=e,this.getFansubMember()}onServerSideOrder(e){this.gs.log("[FANSUB_MEMBER_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getFansubMember()}action(e){this.gs.log("[FANSUB_MEMBER_LIST_CLICK_AKSI]",e),"KICK"===e.name?this.kickMember(e.row):"ACCEPT"===e.name?this.approveOrRejectFansubMember(e.row,!0):"REJECT"===e.name&&this.approveOrRejectFansubMember(e.row,!1)}approveOrRejectFansubMember(e,a){this.subsDialog=this.ds.openInputDialog({data:{title:`Keterangan ${a?"Approve":"Reject"} '${e.user_.username}' :: '${e.fansub_.slug}'`,input:{keterangan:{inputLabel:"Keterangan",inputPlaceholder:"Pemilik, Translator, Timer, QA / QC, TypeSetter, dll.",inputValue:null,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Max. 10 Huruf"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INPUT_DIALOG_CLOSED]",i),i?(this.bs.busy(),this.subsMemberPut=this.fansub.approveRejectFansubMember(e.id,{approved:a,keterangan:i.keterangan?.substring(0,10)}).subscribe({next:r=>{this.gs.log("[FANSUB_MEMBER_APPROVE_REJECT_SUCCESS]",r),this.getFansubMember(),this.bs.idle()},error:r=>{this.gs.log("[FANSUB_MEMBER_APPROVE_REJECT_ERROR]",r,"error"),this.getFansubMember(),this.bs.idle()}})):!1===i&&this.getFansubMember(),this.subsDialog.unsubscribe()}})}kickMember(e){var a=this;return(0,S.Z)(function*(){a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Kick Member -- '${e.user_.username}' :: '${e.fansub_.slug}'`,"Apakah Yakin Dan Akun Telah Direview Sebelum Dikeluarkan ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsMemberDelete=a.fansub.leaveFansubMember(e.id).subscribe({next:r=>{a.gs.log("[FANSUB_MEMBER_KICK_SUCCESS]",r),a.getFansubMember(),a.bs.idle()},error:r=>{a.gs.log("[FANSUB_MEMBER_KICK_ERROR]",r,"error"),a.getFansubMember(),a.bs.idle()}})):!1===i&&a.getFansubMember(),a.subsDialog.unsubscribe()}})})()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(M.x),t.Y36(ri.T),t.Y36(A.U))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-fansub-member"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Atur Keanggotaan Fansub"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.memberData.column)("tableDataRow",i.memberData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})(),oi=(()=>{class n{constructor(e,a,i,r,s,d){this.router=e,this.adm=a,this.bs=i,this.ds=r,this.gs=s,this.as=d,this.subsBannedGet=null,this.subsBannedDelete=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.bannedData={column:["Id","Korban","Alasan","Pelaku","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getBan()}ngOnDestroy(){this.subsBannedGet?.unsubscribe(),this.subsBannedDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}getBan(){this.bs.busy(),this.subsBannedGet&&(this.subsBannedGet.unsubscribe(),this.bs.idle()),this.subsBannedGet=this.adm.getAllBanned(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[BANNED_LIST_SUCCESS]",e),this.count=e.count;const a=[];let i=[];i=this.as.currentUserSubject?.value?.role===D.yS.ADMIN?[D.yS.ADMIN]:[D.yS.ADMIN,D.yS.MODERATOR];for(const r of e.results)a.push({Id:r.id,foto_korban:r.user_.image_url,foto_pelaku:r.banned_by_?.image_url||`${z.N.baseUrl}/assets/img/favicon.png`,Korban:r.user_.username,Pelaku:r.banned_by_?.username||"AUTO_BANNED",Alasan:r.reason,Aksi:[...this.gs.includesOneOf(r.user_.role,i)?[]:[{type:"button",icon:"lock_open",name:"UnBAN",row:r}]]});this.bannedData.row=a,this.bs.idle()},error:e=>{this.gs.log("[BANNED_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[BANNED_LIST_CLICK_AKSI]",e),"UnBAN"===e.name&&this.unBan(e.row)}unBan(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[BANNED_LIST_CLICK_UNBAN]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`UnBAN Akun -- '${e.user_.username}'`,"Apakah Yakin Dan Akun Telah Direview Sebelum UnBAN ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsBannedDelete=a.adm.unBan(e.id).subscribe({next:r=>{a.gs.log("[BANNED_LIST_CLICK_UNBAN_SUCCESS]",r),a.bs.idle(),a.getBan()},error:r=>{a.gs.log("[BANNED_LIST_CLICK_UNBAN_ERROR]",r,"error"),a.bs.idle(),a.getBan()}})):!1===i&&a.getBan(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[BANNED_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getBan()}onServerSideFilter(e){this.gs.log("[BANNED_LIST_ENTER_FILTER]",e),this.q=e,this.getBan()}onServerSideOrder(e){this.gs.log("[BANNED_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getBan()}openBan(e){this.gs.log("[BANNED_LIST_CLICK_BANNED]",e),this.router.navigateByUrl(`/user/${e.Korban}`)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(X.F0),t.Y36(Q.l),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(Ce.e))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-banned"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"User Yang Terkena BAN"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openBan(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.bannedData.column)("tableDataRow",i.bannedData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})(),li=(()=>{class n{constructor(e,a,i,r){this.bs=e,this.ds=a,this.gs=i,this.adm=r,this.subsCorsGet=null,this.subsCorsDelete=null,this.subsDialog=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.corsData={column:["Id","Nama Api","IP Domain","Api Key","Pemilik","Aksi"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getCors()}ngOnDestroy(){this.subsCorsGet?.unsubscribe(),this.subsCorsDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}getCors(){this.bs.busy(),this.subsCorsGet&&(this.subsCorsGet.unsubscribe(),this.bs.idle()),this.subsCorsGet=this.adm.getAllCors(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[CORS_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({Id:i.id,"Nama Api":i.name,"IP Domain":i.ip_domain,"Api Key":i.api_key,foto:i.user_?.image_url||`${z.N.baseUrl}/assets/img/favicon.png`,Pemilik:i.user_?.username||"SYSTEM",Aksi:[{type:"button",icon:"layers_clear",name:"Revoke",row:i}]});this.corsData.row=a,this.bs.idle()},error:e=>{this.gs.log("[CORS_LIST_ERROR]",e,"error"),this.bs.idle()}})}action(e){this.gs.log("[CORS_LIST_CLICK_AKSI]",e),"Revoke"===e.name&&this.revokeCors(e.row)}revokeCors(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[CORS_LIST_CLICK_REVOKE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Revoke Kunci -- '${e.id}' :: '${e.ip_domain}'`,"Apakah Yakin Untuk Menonaktifkan Kunci Ini ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsCorsDelete=a.adm.revokeCors(e.id).subscribe({next:r=>{a.gs.log("[CORS_LIST_CLICK_REVOKE_SUCCESS]",r),a.bs.idle(),a.getCors()},error:r=>{a.gs.log("[CORS_LIST_CLICK_REVOKE_ERROR]",r,"error"),a.bs.idle(),a.getCors()}})):!1===i&&a.getCors(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[CORS_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getCors()}onServerSideFilter(e){this.gs.log("[CORS_LIST_ENTER_FILTER]",e),this.q=e,this.getCors()}onServerSideOrder(e){this.gs.log("[CORS_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getCors()}openCors(e){this.gs.log("[CORS_LIST_CLICK_CORS]",e)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(Q.l))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-cors"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Kelola API Key"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.openCors(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.corsData.column)("tableDataRow",i.corsData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})();var di=c(1092);function ci(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Kode Tidak Boleh Kosong"),t.qZA())}function ui(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Kode Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function hi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Tidak Boleh Kosong"),t.qZA())}function pi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function mi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tombol OK Tidak Boleh Kosong"),t.qZA())}function gi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Tombol OK Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function _i(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Tidak Boleh Kosong"),t.qZA())}function fi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Judul Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function bi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function vi(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Di(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function Ci(n,o){1&n&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ai(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",10),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onSubmit())}),t.TgZ(1,"div",11)(2,"h2",6)(3,"b",7),t._uU(4,"Tambah / Ubah Informasi Dialog Pop-Up!"),t.qZA()()(),t.TgZ(5,"div",2)(6,"div",3)(7,"mat-form-field",12)(8,"mat-label"),t._uU(9,"Kode ID"),t.qZA(),t._UZ(10,"input",13)(11,"mat-icon",14),t.TgZ(12,"mat-hint",15),t._uU(13,"ID Untuk Request API"),t.qZA(),t.TgZ(14,"mat-error"),t.YNc(15,ci,2,0,"div",16),t.YNc(16,ui,2,0,"div",16),t.qZA()(),t.TgZ(17,"mat-form-field",17)(18,"mat-label"),t._uU(19,"Judul Dialog"),t.qZA(),t._UZ(20,"input",18)(21,"mat-icon",14),t.TgZ(22,"mat-error"),t.YNc(23,hi,2,0,"div",16),t.YNc(24,pi,2,0,"div",16),t.qZA()()(),t.TgZ(25,"div",3)(26,"div",19)(27,"div",3)(28,"mat-form-field",20)(29,"mat-label"),t._uU(30,"Tombol OK"),t.qZA(),t._UZ(31,"input",21)(32,"mat-icon",14),t.TgZ(33,"mat-error"),t.YNc(34,mi,2,0,"div",16),t.YNc(35,gi,2,0,"div",16),t.qZA()(),t.TgZ(36,"mat-form-field",20)(37,"mat-label"),t._uU(38,"Tombol Cancel"),t.qZA(),t._UZ(39,"input",22)(40,"mat-icon",14),t.TgZ(41,"mat-error"),t.YNc(42,_i,2,0,"div",16),t.YNc(43,fi,2,0,"div",16),t.qZA()(),t.TgZ(44,"mat-form-field",20)(45,"mat-label"),t._uU(46,"Cegah Klik Tutup Dimana Saja"),t.qZA(),t.TgZ(47,"mat-select",23)(48,"mat-option",24),t._uU(49,"Tidak"),t.qZA(),t.TgZ(50,"mat-option",25),t._uU(51,"Ya"),t.qZA()(),t.TgZ(52,"mat-hint",15),t._uU(53,"Antisipasi Kesalahan Klik"),t.qZA(),t.TgZ(54,"mat-error"),t.YNc(55,bi,2,0,"div",16),t.YNc(56,vi,2,0,"div",16),t.qZA()(),t.TgZ(57,"mat-form-field",20)(58,"mat-label"),t._uU(59,"Langsung Disiarkan Saja"),t.qZA(),t.TgZ(60,"mat-select",26)(61,"mat-option",24),t._uU(62,"Tidak"),t.qZA(),t.TgZ(63,"mat-option",25),t._uU(64,"Ya"),t.qZA()(),t.TgZ(65,"mat-hint",15),t._uU(66,"Live Popup Message Tidak Disimpan"),t.qZA(),t.TgZ(67,"mat-error"),t.YNc(68,Di,2,0,"div",16),t.YNc(69,Ci,2,0,"div",16),t.qZA()()()(),t.TgZ(70,"div",27)(71,"div",3),t._UZ(72,"angular-editor",28),t.qZA()()(),t.TgZ(73,"div",29)(74,"div",2)(75,"div",30),t._UZ(76,"div",31),t.TgZ(77,"div",32)(78,"button",33),t._uU(79," Simpan "),t._UZ(80,"mat-icon",34),t.qZA()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(7),t.Q6J("color","accent"),t.xp6(8),t.Q6J("ngIf",e.fg.get("id").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("id").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("title").hasError("pattern")),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("confirm").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("confirm").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("cancel").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("cancel").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",e.fg.get("close").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("close").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",e.fg.get("broadcast").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("broadcast").hasError("pattern")),t.xp6(3),t.Q6J("config",e.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",e.submitted||e.fg.invalid)}}let xi=(()=>{class n{constructor(e,a,i,r,s){this.fb=e,this.bs=a,this.ds=i,this.gs=r,this.info=s,this.submitted=!1,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.infoData={column:["Id","Judul","Pemilik","Aksi"],row:[]},this.subsInfoGet=null,this.subsInfoCreateOrUpdate=null,this.subsInfoDelete=null,this.subsDialog=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.getInfo())}ngOnDestroy(){this.subsInfoGet?.unsubscribe(),this.subsInfoCreateOrUpdate?.unsubscribe(),this.subsInfoDelete?.unsubscribe(),this.subsDialog?.unsubscribe()}get GS(){return this.gs}initForm(){this.fg=this.fb.group({id:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],title:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],content:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],confirm:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],cancel:[null,l.kI.compose([l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],close:[null,l.kI.compose([l.kI.required,l.kI.pattern(g.t.regexEnglishKeyboardKeys)])],broadcast:[null,l.kI.compose([l.kI.pattern(g.t.regexEnglishKeyboardKeys)])]})}getInfo(){this.bs.busy(),this.subsInfoGet&&(this.subsInfoGet.unsubscribe(),this.bs.idle()),this.subsInfoGet=this.info.getAllInfo(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[INFORMATION_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({content:i.content,confirm:i.confirm,cancel:i.cancel,close:i.close,foto:i.user_.image_url,Id:i.id,Judul:i.title,Pemilik:i.user_.username,Aksi:[{type:"button",icon:"close",name:"Hapus",row:i}]});this.infoData.row=a,this.bs.idle()},error:e=>{this.gs.log("[INFORMATION_LIST_ERROR]",e,"error"),this.bs.idle()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsInfoCreateOrUpdate=this.info.createUpdateInfo({id:this.fg.value.id,title:this.fg.value.title,content:this.fg.value.content,confirm:this.fg.value.confirm,cancel:this.fg.value.cancel,close:"1"===this.fg.value.close,broadcast:"1"===this.fg.value.broadcast}).subscribe({next:e=>{this.gs.log("[INFORMATION_CREATE_UPDATE_SUCCESS]",e),this.submitted=!1,this.bs.idle();for(const a in this.fg.controls)this.fg.controls[a]&&(this.fg.controls[a].patchValue(null),this.fg.controls[a].updateValueAndValidity(),this.fg.controls[a].setErrors(null),this.fg.controls[a].markAsUntouched(),this.fg.controls[a].markAsPristine());this.getInfo()},error:e=>{this.gs.log("[INFORMATION_CREATE_UPDATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle(),this.getInfo()}})}action(e){this.gs.log("[INFORMMATION_LIST_CLICK_AKSI]",e),"Hapus"===e.name&&this.deleteInfo(e.row)}deleteInfo(e){var a=this;return(0,S.Z)(function*(){a.gs.log("[INFORMATION_LIST_CLICK_DELETE]",e),a.subsDialog=(yield a.ds.openKonfirmasiDialog(`Hapus Info -- '${e.id}' :: '${e.title}'`,"Yakin Akan Menghapus Informasi Ini ?")).afterClosed().subscribe({next:i=>{a.gs.log("[INFO_DIALOG_CLOSED]",i),!0===i?(a.bs.busy(),a.subsInfoDelete=a.info.deleteInfo(e.id).subscribe({next:r=>{a.gs.log("[INFORMATION_LIST_CLICK_DELETE_SUCCESS]",r),a.bs.idle(),a.getInfo()},error:r=>{a.gs.log("[INFORMATION_LIST_CLICK_DELETE_ERROR]",r,"error"),a.bs.idle(),a.getInfo()}})):!1===i&&a.getInfo(),a.subsDialog.unsubscribe()}})})()}onPaginatorClicked(e){this.gs.log("[INFORMATION_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getInfo()}onServerSideFilter(e){this.gs.log("[INFORMATION_LIST_ENTER_FILTER]",e),this.q=e,this.getInfo()}onServerSideOrder(e){this.gs.log("[INFORMATION_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getInfo()}editInfo(e){this.gs.log("[INFORMATION_LIST_CLICK_INFORMATION]",e),this.fg.controls.id.patchValue(e.Id),this.fg.controls.title.patchValue(e.Judul),this.fg.controls.content.patchValue(e.content),this.fg.controls.confirm.patchValue(e.confirm),this.fg.controls.cancel.patchValue(e.cancel),this.fg.controls.close.patchValue(""+ +e?.close),this.fg.controls.broadcast.patchValue(""+ +e?.broadcast)}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(l.QS),t.Y36(y.z),t.Y36(M.x),t.Y36(A.U),t.Y36(di.O))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-information-dialog"]],decls:13,vars:5,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[3,"formGroup","submit",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","buttonClicked","paginatorClicked","serverSideOrder","rowClicked"],[3,"formGroup","submit"],[1,"col-12","sticky-top","bg-bifeldy","pb-1"],["appearance","outline",1,"p-3","col-12","col-md-4",3,"color"],["matInput","","formControlName","id","placeholder","ID_DIALOG","required",""],["fontIcon","short_text","matSuffix",""],["align","end"],[4,"ngIf"],["appearance","outline",1,"p-3","col-12","col-md-8",3,"color"],["matInput","","formControlName","title","placeholder","Judul Dialog","required",""],[1,"col-12","col-md-5","col-xl-4","p-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","confirm","placeholder","OK!","required",""],["matInput","","formControlName","cancel","placeholder","Batal!"],["formControlName","close","placeholder","Ya / Tidak","required",""],["value","0"],["value","1"],["formControlName","broadcast","placeholder","Ya / Tidak","required",""],[1,"col-12","col-md-7","col-xl-8","p-3"],["formControlName","content","required","",1,"p-3","w-100",3,"config"],[1,"row","mt-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,Ai,81,21,"form",4),t.qZA(),t.TgZ(6,"div",3)(7,"div",5)(8,"h2",6)(9,"b",7),t._uU(10,"Informasi Dialog Pop-Up Tersimpan"),t.qZA()()(),t.TgZ(11,"div",8)(12,"app-material-table",9),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("buttonClicked",function(s){return i.action(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)})("rowClicked",function(s){return i.editInfo(s)}),t.qZA()()()()()()),2&a&&(t.xp6(5),t.Q6J("ngIf",i.fg),t.xp6(7),t.Q6J("tableDataColumn",i.infoData.column)("tableDataRow",i.infoData.row)("count",i.count)("serverSide",!0))},dependencies:[h.O5,qe.CK,xe.eB,Y.Hw,f.nI,f.v_,f.pH,f.$V,f.nX,re.k0,Ge.x8,I.I,k.t,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.sg,l.u,Ue.s6]})}return n})();var yi=c(217);const Mi=[{path:"",pathMatch:"full",component:Ma},{path:"banned-list",component:oi,data:{title:"Admin - List All Banned User",description:"Kelola Banned User",keywords:"Kelola Banned User"}},{path:"cors-list",component:li,data:{title:"CORS - List All Api Key",description:"Kelola Api Key",keywords:"Kelola Api Key"}},{path:"ddl-list",component:Ta,data:{title:"Admin - List All Berkas DDL",description:"Kelola Berkas DDL",keywords:"Kelola Berkas DDL"}},{path:"user-list",component:Ia,data:{title:"Admin - List All Users",description:"Atur Seluruh Member",keywords:"BAN & UN-BAN User"}},{path:"project-type",component:Ua,data:{title:"Admin - List All Project Type",description:"Atur Kategori Garapan",keywords:"Jenis Proyek Berkas"}},{path:"fansub-member",component:si,data:{title:"Admin - List All Fansub Member",description:"Atur Keanggotaan Fansub",keywords:"Keanggotaan Fansub"}},{path:"push-notification",component:ni,data:{title:"Admin - Push Notification",description:"Buat Pengumuman Dadakan",keywords:"Push Notification"}},{path:"information",component:xi,data:{title:"Admin - List All Information",description:"Atur Informasi Dialog",keywords:"Informations"}},{path:"email",component:(()=>{class n{constructor(e,a,i,r){this.bs=e,this.gs=a,this.ms=i,this.ds=r,this.subsAllMail=null,this.subsDialog=null,this.subsMail=null,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.mailData={column:["Tanggal","Pengirim","Penerima","Topik","Lampiran"],row:[]},this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnInit(){this.gs.isBrowser&&this.getAllMail()}ngOnDestroy(){this.subsAllMail?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsMail?.unsubscribe()}filterAddress(e){let a="";if(e)for(const i of e.split(","))a&&(a+=", "),i.includes("<")&&i.includes(">")?a+=i.split("<")[1].split(">")[0].trim():a+=i.trim();return a}filterLampiran(e){let a="";if(e)for(const i of e)a&&(a+=", "),a+=`\n \n ${i.name}.${i.ext} (${i.size} Bytes)\n \n `;return a}getAllMail(){this.bs.busy(),this.subsMail&&(this.subsMail.unsubscribe(),this.bs.idle()),this.subsAllMail=this.ms.getAllMail(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[MAIL_LIST_SUCCESS]",e),this.count=e.count;const a=[];for(const i of e.results)a.push({id:i.id,Tanggal:i.date,Pengirim:this.filterAddress(i.from),Penerima:this.filterAddress(i.to),Topik:i.subject,Lampiran:`${i.attachment_count} Berkas`});this.mailData.row=a,this.bs.idle()},error:e=>{this.gs.log("[MAIL_LIST_ERROR]",e,"error"),this.bs.idle()}})}getMail(e){this.subsMail=this.ms.getMail(e).subscribe({next:a=>{this.gs.log("[MAIL_DETAIL_SUCCESS]",a),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:a.result.subject,htmlMessage:`\n From: ${this.filterAddress(a.result.from)}\n
\n To: ${this.filterAddress(a.result.to)}\n
\n Cc: ${this.filterAddress(a.result.cc)}\n
\n Bcc: ${this.filterAddress(a.result.bcc)}\n

\n Date: ${new Date(a.result.date)}\n
\n Lampiran: ${this.filterLampiran(a.result.attachment_)}\n
\n
\n
\n
\n ${a.result.html||a.result.text}\n
\n `,confirmText:"Tutup",infoText:a.result.id},disableClose:!1}).afterClosed().subscribe({next:i=>{this.gs.log("[INFO_DIALOG_CLOSED]",i),this.getAllMail(),this.subsDialog.unsubscribe()}})},error:a=>{this.gs.log("[MAIL_DETAIL_ERROR]",a,"error"),this.bs.idle(),this.getAllMail()}})}onRowClicked(e){this.gs.log("[MAIL_LIST_CLICK_EMAIL]",e),this.getMail(e.id)}onPaginatorClicked(e){this.gs.log("[MAIL_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getAllMail()}onServerSideFilter(e){this.gs.log("[MAIL_LIST_ENTER_FILTER]",e),this.q=e,this.getAllMail()}onServerSideOrder(e){this.gs.log("[MAIL_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,"created_at"===this.sort?this.sort="date":"title"===this.sort&&(this.sort="subject"),this.order=e.direction,this.getAllMail()}static#e=this.\u0275fac=function(a){return new(a||n)(t.Y36(y.z),t.Y36(A.U),t.Y36(yi.Y),t.Y36(M.x))};static#t=this.\u0275cmp=t.Xpm({type:n,selectors:[["app-admin-list-email"]],decls:11,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-12"],[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","p-3"],[3,"tableDataColumn","tableDataRow","count","serverSide","serverSideFilter","rowClicked","paginatorClicked","serverSideOrder"]],template:function(a,i){1&a&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"h2",5)(7,"b",6),t._uU(8,"Semua Email Pengguna"),t.qZA()()(),t.TgZ(9,"div",7)(10,"app-material-table",8),t.NdJ("serverSideFilter",function(s){return i.onServerSideFilter(s)})("rowClicked",function(s){return i.onRowClicked(s)})("paginatorClicked",function(s){return i.onPaginatorClicked(s)})("serverSideOrder",function(s){return i.onServerSideOrder(s)}),t.qZA()()()()()()),2&a&&(t.xp6(10),t.Q6J("tableDataColumn",i.mailData.column)("tableDataRow",i.mailData.row)("count",i.count)("serverSide",!0))},dependencies:[I.I,k.t]})}return n})(),data:{title:"Admin - List All Email",description:"Email Inbox & Outbox",keywords:"Surat Elektronik"}}];let ki=(()=>{class n{static#e=this.\u0275fac=function(a){return new(a||n)};static#t=this.\u0275mod=t.oAB({type:n});static#a=this.\u0275inj=t.cJS({imports:[h.ez,X.Bz.forChild(Mi),pa.m,ga.H,_a.F,l.u5,l.UX,Kt,ha,Ye,Be.Ad,Ue.UM,ma.T]})}return n})()}}]); \ No newline at end of file diff --git a/dist/main-site/browser/526.9f52acb066a76a1d.js b/dist/main-site/browser/526.6308e06d4cee1214.js similarity index 89% rename from dist/main-site/browser/526.9f52acb066a76a1d.js rename to dist/main-site/browser/526.6308e06d4cee1214.js index 10669679..db7766c4 100644 --- a/dist/main-site/browser/526.9f52acb066a76a1d.js +++ b/dist/main-site/browser/526.6308e06d4cee1214.js @@ -1 +1 @@ -(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[526],{1526:(je,Ie,H)=>{"use strict";H.r(Ie),H.d(Ie,{BerkasModule:()=>O0});var X=H(6895),_e=H(1390),B=H(4006),we=H(7375),ve=H(5128),$=H(3659),Ce=H(1741),Ee=H(2314),Te=H(9736),pe=H(6319),u=H(4650);let oe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=u.oAB({type:s});static#i=this.\u0275inj=u.cJS({imports:[X.ez]})}return s})();var Fe=H(4529),He=H(8866),it=H(3811),yt=H(5816),se=H(5861),Le=H(529),me=H(8505),Oe=H(7272),Ge=H(4674),ke=H(9816),Ue=H(3322),Ve=H(5141),rt=H(1428),w=H(5312),D=H(80),V=H(4327),ee=H(2693),Q=H(8925);let de=(()=>{class s{constructor(t,i,e){this.gs=t,this.toast=i,this.dls=e,this.attachmentsDownload={}}getAttachmentDownloadFile(t){return this.attachmentsDownload[t.id]||(this.attachmentsDownload[t.id]={},this.attachmentsDownload[t.id].name=t.name,this.attachmentsDownload[t.id].orig=t.orig,this.attachmentsDownload[t.id].size=t.size,this.attachmentsDownload[t.id].ext=t.ext,this.attachmentsDownload[t.id].download_count=t.download_count,this.attachmentsDownload[t.id].google_drive=t.google_drive,this.attachmentsDownload[t.id].aws_s3=t.aws_s3,this.attachmentsDownload[t.id].discord=t.discord,this.attachmentsDownload[t.id].mode="indeterminate",this.attachmentsDownload[t.id].isDownloading=!1,this.attachmentsDownload[t.id].isCompleted=!1,this.attachmentsDownload[t.id].data=null,this.attachmentsDownload[t.id].handler=null,this.attachmentsDownload[t.id].toast=null,this.attachmentsDownload[t.id].totals=0,this.attachmentsDownload[t.id].percentage=0,this.attachmentsDownload[t.id].speed=0,this.attachmentsDownload[t.id].loaded=0),this.attachmentsDownload[t.id]}stopFail(t){t.isDownloading=!1,t.isCompleted=!1,t.toast&&this.toast.remove(t.toast.toastId)}onProgress(t,i){if(i.loaded){this.gs.log("[DOWNLOAD_PROGRESS]",i),t.mode="determinate";const e=i.loaded-t.loaded;t.totals+=e,t.speed=e/1e3,t.percentage=Math.round(t.totals/t.size*100),t.loaded=i.loaded,t.toast.toastRef.componentInstance.message=`${t.percentage}% @ ${t.speed} KB/s`}}startDownload(t,i=!0){var e=this;const r=this.attachmentsDownload[t];var a;r.toast=this.toast.warning(`${r.percentage}% @ ${r.speed} KB/s`,"Mengunduh ...",{closeButton:!1,timeOut:0,disableTimeOut:"extendedTimeOut",tapToDismiss:!1}),r.isCompleted?this.saveFileAs(t):(r.isDownloading=!0,r.discord?this.dls.getListDdl(t).subscribe({next:(a=(0,se.Z)(function*(o){e.gs.log("[DOWNLOAD_LIST_DDL]",o);const l=o.results.sort((v,g)=>v.chunk_idx-g.chunk_idx),d=[];for(const v of l){let g=null;g=i&&v.url?e.dls.downloadDdlDirect(v.url):e.dls.downloadDdlProxy(v.id),d.push(g)}const f=[];var v;r.handler=(0,Oe.z)(...d).subscribe({next:(v=(0,se.Z)(function*(g){if(g.type===Le.dt.DownloadProgress&&e.onProgress(r,g),g.type===Le.dt.Response){r.loaded=0;const E=yield g.body.arrayBuffer(),x=new Uint8Array(E);e.gs.log("[DOWNLOAD_CHUNK_APPEND]",E.byteLength),f.push(x)}if(g.type===Le.dt.Response&&f.length===l.length){e.gs.log("[DOWNLOAD_CHUNK_COMPLETED]",f);const T=new Blob(f);r.mode="determinate",r.isDownloading=!1,r.isCompleted=!0,r.data=T,e.toast.remove(r.toast.toastId),e.saveFileAs(t)}}),function(T){return v.apply(this,arguments)}),error:v=>{e.gs.log("[DOWNLOAD_CHUNK_ERROR]",v,"error"),e.stopFail(r)}})}),function(l){return a.apply(this,arguments)}),error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(r)}}):r.handler=this.dls.downloadLampiran(t).subscribe({next:a=>{a.type===Le.dt.DownloadProgress&&this.onProgress(r,a),a.type===Le.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",a),r.mode="determinate",r.isDownloading=!1,r.isCompleted=!0,r.data=a.body,this.toast.remove(r.toast.toastId),this.saveFileAs(t))},error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(r)}}))}cancelDownload(t){const i=this.attachmentsDownload[t];i.mode="indeterminate",i.percentage=0,i.speed=0,i.totals=0,i.loaded=0,i.isDownloading=!1,i.isCompleted=!1,i.handler&&i.handler.unsubscribe(),i.toast&&this.toast.remove(i.toast.toastId)}saveFileAs(t){this.gs.log("[SAVE_FILE]",t);const i=this.attachmentsDownload[t];(0,V.saveAs)(i.data,`${i.orig||i.name+"."+i.ext}`)}static#e=this.\u0275fac=function(i){return new(i||s)(u.LFG(ke.U),u.LFG(ee.k),u.LFG(Q.v))};static#t=this.\u0275prov=u.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var le=H(8151),xe=H(7396),te=H(4363),ue=H(9818),J=H(7392),ie=H(8455),Ae=H(9982),Ze=H(1256),We=H(6289),qe=H(7462),Me=H(4758),Pt=H(9226),P=H.n(Pt),St=H(1421),z=H.n(St);function gt(){return gt=Object.assign?Object.assign.bind():function(s){for(var n=1;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(e,r,a){var o=[null];o.push.apply(o,r);var d=new(Function.bind.apply(e,o));return a&<(d,a.prototype),d}).apply(null,arguments)}var rn=H(3871),xr=H.n(rn),Sr="http://example.com";const Ji=function(n,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(n)&&(n=P().location&&P().location.href||"");var i="function"==typeof P().URL,e=/^\/\//.test(n),r=!P().location&&!/\/\//i.test(n);if(i?n=new(P().URL)(n,P().location||Sr):/\/\//i.test(n)||(n=xr().buildAbsoluteURL(P().location&&P().location.href||"",n)),i){var a=new URL(t,n);return r?a.href.slice(Sr.length):e?a.href.slice(a.protocol.length):a.href}return xr().buildAbsoluteURL(n,t)};var Cr=function(){function s(){this.listeners={}}var n=s.prototype;return n.on=function(i,e){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(e)},n.off=function(i,e){if(!this.listeners[i])return!1;var r=this.listeners[i].indexOf(e);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(r,1),r>-1},n.trigger=function(i){var e=this.listeners[i];if(e)if(2===arguments.length)for(var r=e.length,a=0;a-1;r=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,r)),this.buffer=this.buffer.substring(r+1)},n}(Cr),Bn=String.fromCharCode(9),kr=function(n){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(n||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},Ft=function(n){for(var r,t=n.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},e=t.length;e--;)""!==t[e]&&((r=/([^=]*)=(.*)/.exec(t[e]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i},Vi=function(s){function n(){var i;return(i=s.call(this)||this).customParsers=[],i.tagMappers=[],i}re(n,s);var t=n.prototype;return t.push=function(e){var a,o,r=this;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(d,f){var v=f(e);return v===e?d:d.concat([v])},[e]).forEach(function(d){for(var f=0;f0&&(a.duration=S.duration),0===S.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){if(S.attributes)if("NONE"!==S.attributes.METHOD)if(S.attributes.URI){if("com.apple.streamingkeydelivery"===S.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:S.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===S.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(S.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===S.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==S.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):S.attributes.KEYID&&"0x"===S.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:S.attributes.KEYFORMAT,keyId:S.attributes.KEYID.substring(2)},pssh:er(S.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));S.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:S.attributes.METHOD||"AES-128",uri:S.attributes.URI},typeof S.attributes.IV<"u"&&(l.iv=S.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else l=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(S.number)?this.manifest.mediaSequence=S.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+S.number})},"discontinuity-sequence":function(){isFinite(S.number)?(this.manifest.discontinuitySequence=S.number,T=S.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+S.number})},"playlist-type":function(){/VOD|EVENT/.test(S.playlistType)?this.manifest.playlistType=S.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+S.playlist})},map:function(){o={},S.uri&&(o.uri=S.uri),S.byterange&&(o.byterange=S.byterange),l&&(o.key=l)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes?(a.attributes||(a.attributes={}),gt(a.attributes,S.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes&&S.attributes.TYPE&&S.attributes["GROUP-ID"]&&S.attributes.NAME){var q=this.manifest.mediaGroups[S.attributes.TYPE];q[S.attributes["GROUP-ID"]]=q[S.attributes["GROUP-ID"]]||{},N=q[S.attributes["GROUP-ID"]],(F={default:/yes/i.test(S.attributes.DEFAULT)}).autoselect=!!F.default||/yes/i.test(S.attributes.AUTOSELECT),S.attributes.LANGUAGE&&(F.language=S.attributes.LANGUAGE),S.attributes.URI&&(F.uri=S.attributes.URI),S.attributes["INSTREAM-ID"]&&(F.instreamId=S.attributes["INSTREAM-ID"]),S.attributes.CHARACTERISTICS&&(F.characteristics=S.attributes.CHARACTERISTICS),S.attributes.FORCED&&(F.forced=/yes/i.test(S.attributes.FORCED)),N[S.attributes.NAME]=F}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){T+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=S.dateTimeString,this.manifest.dateTimeObject=S.dateTimeObject),a.dateTimeString=S.dateTimeString,a.dateTimeObject=S.dateTimeObject},targetduration:function(){!isFinite(S.duration)||S.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+S.duration}):(this.manifest.targetDuration=S.duration,Ar.call(this,this.manifest))},start:function(){S.attributes&&!isNaN(S.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:S.attributes["TIME-OFFSET"],precise:S.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=S.data},"cue-out-cont":function(){a.cueOutCont=S.data},"cue-in":function(){a.cueIn=S.data},skip:function(){this.manifest.skip=_i(S.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",S.attributes,["SKIPPED-SEGMENTS"])},part:function(){var q=this;d=!0;var ne=this.manifest.segments.length,he=_i(S.attributes);a.parts=a.parts||[],a.parts.push(he),he.byterange&&(he.byterange.hasOwnProperty("offset")||(he.byterange.offset=x),x=he.byterange.offset+he.byterange.length),this.warnOnMissingAttributes_("#EXT-X-PART #"+(a.parts.length-1)+" for segment #"+ne,S.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(ye,ge){ye.hasOwnProperty("lastPart")||q.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+ge+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var q=this.manifest.serverControl=_i(S.attributes);q.hasOwnProperty("canBlockReload")||(q.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ar.call(this,this.manifest),q.canSkipDateranges&&!q.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var q=this.manifest.segments.length,ne=_i(S.attributes),he=ne.type&&"PART"===ne.type;a.preloadHints=a.preloadHints||[],a.preloadHints.push(ne),ne.byterange&&(ne.byterange.hasOwnProperty("offset")||(ne.byterange.offset=he?x:0,he&&(x=ne.byterange.offset+ne.byterange.length)));var K=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+K+" for segment #"+q,S.attributes,["TYPE","URI"]),ne.type)for(var ye=0;yei.timeline?1:-1})},lu=function(n){var t=[];return function(n,t,i){t.forEach(function(e){for(var r in n.mediaGroups[e])for(var a in n.mediaGroups[e][r])i(n.mediaGroups[e][r][a])})}(n,lf,function(i,e,r,a){t=t.concat(i.playlists||[])}),t},du=function(n){var t=n.playlist;t.mediaSequence=n.mediaSequence,t.segments.forEach(function(e,r){e.number=t.mediaSequence+r})},Gn=function(n){return n&&n.uri+"-"+function(n){var t;return t="bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1,n.offset+"-"+t}(n.byterange)},os=function(n){return nu(n.reduce(function(i,e){var a,r=e.attributes.id+(e.attributes.lang||"");i[r]?(e.segments&&(e.segments[0]&&(e.segments[0].discontinuity=!0),(a=i[r].segments).push.apply(a,e.segments)),e.attributes.contentProtection&&(i[r].attributes.contentProtection=e.attributes.contentProtection)):(i[r]=e,i[r].attributes.timelineStarts=[]);return i[r].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),i},{})).map(function(i){return i.discontinuityStarts=function(n,t){return n.reduce(function(i,e,r){return e.discontinuity&&i.push(r),i},[])}(i.segments||[]),i})},us=function(n,t){var i=Gn(n.sidx),e=i&&t[i]&&t[i].sidx;return e&&ss(n,e,n.sidx.resolvedUri),n},pf=function(n,t){if(void 0===t&&(t={}),!Object.keys(t).length)return n;for(var i in n)n[i]=us(n[i],t);return n},Tf=function(n){var t,i=n.attributes,e=n.segments,r=n.sidx,a=n.discontinuityStarts,o={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:a,timelineStarts:i.timelineStarts,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),r&&(o.sidx=r),o},bf=function(n){var t=n.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},xf=function(n){var t=n.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},Sf=function(n){var t=n.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},cu=function(n){return n?Object.keys(n).reduce(function(t,i){return t.concat(n[i].playlists)},[]):[]},Cf=function(n){var t,i=n.dashPlaylists,e=n.locations,r=n.sidxMapping,a=void 0===r?{}:r,o=n.previousManifest;if(!i.length)return{};var l=i[0].attributes,d=l.sourceDuration,f=l.type,v=l.suggestedPresentationDelay,g=l.minimumUpdatePeriod,T=os(i.filter(bf)).map(Tf),E=os(i.filter(xf)),x=os(i.filter(Sf)),S=i.map(function(he){return he.attributes.captionServices}).filter(Boolean),N={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:d,playlists:pf(T,a)};g>=0&&(N.minimumUpdatePeriod=1e3*g),e&&(N.locations=e),"dynamic"===f&&(N.suggestedPresentationDelay=v);var j=E.length?function(n,t,i){void 0===t&&(t={}),void 0===i&&(i=!1);var e,r=n.reduce(function(o,l){var d=l.attributes.role&&l.attributes.role.value||"",f=l.attributes.lang||"",v=l.attributes.label||"main";f&&!l.attributes.label&&(v=l.attributes.lang+(d?" ("+d+")":"")),o[v]||(o[v]={language:f,autoselect:!0,default:"main"===d,playlists:[],uri:""});var T=us(function(n,t){var i,e=n.attributes,r=n.segments,a=n.sidx,o=n.mediaSequence,l=n.discontinuitySequence,d=n.discontinuityStarts,f={attributes:(i={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:l,discontinuityStarts:d,timelineStarts:e.timelineStarts,mediaSequence:o,segments:r};return e.contentProtection&&(f.contentProtection=e.contentProtection),a&&(f.sidx=a),t&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs"),f}(l,i),t);return o[v].playlists.push(T),typeof e>"u"&&"main"===d&&((e=l).default=!0),o},{});return e||(r[Object.keys(r)[0]].default=!0),r}(E,a,0===N.playlists.length):null,G=x.length?function(n,t){return void 0===t&&(t={}),n.reduce(function(i,e){var r=e.attributes.lang||"text";return i[r]||(i[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),i[r].playlists.push(us(function(n){var t,i=n.attributes,e=n.segments,r=n.mediaSequence,a=n.discontinuityStarts,o=n.discontinuitySequence;typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var l=((t={NAME:i.id,BANDWIDTH:i.bandwidth})["PROGRAM-ID"]=1,t);return i.codecs&&(l.CODECS=i.codecs),{attributes:l,uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:r,segments:e}}(e),t)),i},{})}(x,a):null,q=T.concat(cu(j),cu(G)),ne=q.map(function(he){return he.timelineStarts});return N.timelineStarts=uu(ne),function(n,t){n.forEach(function(i){i.mediaSequence=0,i.discontinuitySequence=ns(t,function(e){return e.timeline===i.timeline}),i.segments&&i.segments.forEach(function(e,r){e.number=r})})}(q,N.timelineStarts),j&&(N.mediaGroups.AUDIO.audio=j),G&&(N.mediaGroups.SUBTITLES.subs=G),S.length&&(N.mediaGroups["CLOSED-CAPTIONS"].cc=function(n){return n.reduce(function(t,i){return i&&i.forEach(function(e){var a=e.language;t[a]={autoselect:!1,default:!1,instreamId:e.channel,language:a},e.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(t[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(t[a]["3D"]=e["3D"])}),t},{})}(S)),o?function(n){var t=n.oldManifest,i=n.newManifest,e=t.playlists.concat(lu(t)),r=i.playlists.concat(lu(i));return i.timelineStarts=uu([t.timelineStarts,i.timelineStarts]),function(n){var t=n.oldPlaylists,e=n.timelineStarts;n.newPlaylists.forEach(function(r){r.discontinuitySequence=ns(e,function(f){return f.timeline===r.timeline});var a=function(n,t){for(var i=0;ia.timeline||a.segments.length&&r.timeline>a.segments[a.segments.length-1].timeline)&&r.discontinuitySequence--);a.segments[l].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),du({playlist:r,mediaSequence:a.segments[l].number})}})}({oldPlaylists:e,newPlaylists:r,timelineStarts:i.timelineStarts}),i}({oldManifest:o,newManifest:N}):N},kf=function(n,t,i){var o=n.timescale,d=n.periodStart,v=n.minimumUpdatePeriod;return Math.ceil((((n.NOW+n.clientOffset)/1e3+(void 0===v?0:v)-(n.availabilityStartTime+(void 0===d?0:d)))*(void 0===o?1:o)-t)/i)},fu=function(n,t){for(var i=n.type,e=n.minimumUpdatePeriod,r=void 0===e?0:e,a=n.media,o=void 0===a?"":a,l=n.sourceDuration,d=n.timescale,f=void 0===d?1:d,v=n.startNumber,g=void 0===v?1:v,T=n.periodStart,E=[],x=-1,S=0;Sx&&(x=G);var q=void 0;if(j<0){var ne=S+1;q=ne===t.length?"dynamic"===i&&r>0&&o.indexOf("$Number$")>0?kf(n,x,F):(l*f-x)/F:(t[ne].t-x)/F}else q=j+1;for(var he=g+E.length+q,K=g+E.length;K"u")return t;var a=""+n[i];return"RepresentationID"===i||(r=e?parseInt(r,10):1,a.length>=r)?a:""+new Array(r-a.length+1).join("0")+a}}(t))},Df=function(n,t){var i={RepresentationID:n.id,Bandwidth:n.bandwidth||0},e=n.initialization,r=void 0===e?{sourceURL:"",range:""}:e,a=on({baseUrl:n.baseUrl,source:hu(r.sourceURL,i),range:r.range}),o=function(n,t){return n.duration||t?n.duration?as(n):fu(n,t):[{number:n.startNumber||1,duration:n.sourceDuration,time:0,timeline:n.periodStart}]}(n,t);return o.map(function(l){i.Number=l.number,i.Time=l.time;var d=hu(n.media||"",i),g=n.periodStart+(l.time-(n.presentationTimeOffset||0))/(n.timescale||1);return{uri:d,timeline:l.timeline,duration:l.duration,resolvedUri:Ji(n.baseUrl||"",d),map:a,number:l.number,presentationTime:g}})},Of=function(n,t){var i=n.duration,e=n.segmentUrls,r=void 0===e?[]:e,a=n.periodStart;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var l,o=r.map(function(f){return function(n,t){var i=n.baseUrl,e=n.initialization,r=void 0===e?{}:e,a=on({baseUrl:i,source:r.sourceURL,range:r.range}),o=on({baseUrl:i,source:t.media,range:t.mediaRange});return o.map=a,o}(n,f)});return i&&(l=as(n)),t&&(l=fu(n,t)),l.map(function(f,v){if(o[v]){var g=o[v],T=n.timescale||1,E=n.presentationTimeOffset||0;return g.timeline=f.timeline,g.duration=f.duration,g.number=f.number,g.presentationTime=a+(f.time-E)/T,g}}).filter(function(f){return f})},Lf=function(n){var e,r,t=n.attributes,i=n.segmentInfo;i.template?(r=Df,e=Bt(t,i.template)):i.base?(r=ou,e=Bt(t,i.base)):i.list&&(r=Of,e=Bt(t,i.list));var a={attributes:t};if(!r)return a;var o=r(e,i.segmentTimeline);if(e.duration){var f=e.timescale;e.duration=e.duration/(void 0===f?1:f)}else e.duration=o.length?o.reduce(function(g,T){return Math.max(g,Math.ceil(T.duration))},0):0;return a.attributes=e,a.segments=o,i.base&&e.indexRange&&(a.sidx=o[0],a.segments=[]),a},Tt=function(n,t){return au(n.childNodes).filter(function(i){return i.tagName===t})},ls=function(n){return n.textContent.trim()},Ir=function(n){var l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(n);if(!l)return 0;var d=l.slice(1),v=d[1],g=d[2],T=d[3],E=d[4],x=d[5];return 31536e3*parseFloat(d[0]||0)+2592e3*parseFloat(v||0)+86400*parseFloat(g||0)+3600*parseFloat(T||0)+60*parseFloat(E||0)+parseFloat(x||0)},pu={mediaPresentationDuration:function(n){return Ir(n)},availabilityStartTime:function(n){return function(n){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(n)&&(n+="Z"),Date.parse(n)}(n)/1e3},minimumUpdatePeriod:function(n){return Ir(n)},suggestedPresentationDelay:function(n){return Ir(n)},type:function(n){return n},timeShiftBufferDepth:function(n){return Ir(n)},start:function(n){return Ir(n)},width:function(n){return parseInt(n,10)},height:function(n){return parseInt(n,10)},bandwidth:function(n){return parseInt(n,10)},startNumber:function(n){return parseInt(n,10)},timescale:function(n){return parseInt(n,10)},presentationTimeOffset:function(n){return parseInt(n,10)},duration:function(n){var t=parseInt(n,10);return isNaN(t)?Ir(n):t},d:function(n){return parseInt(n,10)},t:function(n){return parseInt(n,10)},r:function(n){return parseInt(n,10)},DEFAULT:function(n){return n}},Mt=function(n){return n&&n.attributes?au(n.attributes).reduce(function(t,i){return t[i.name]=(pu[i.name]||pu.DEFAULT)(i.value),t},{}):{}},Uf={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Wn=function(n,t){return t.length?qn(n.map(function(i){return t.map(function(e){return Ji(i,ls(e))})})):n},ds=function(n){var t=Tt(n,"SegmentTemplate")[0],i=Tt(n,"SegmentList")[0],e=i&&Tt(i,"SegmentURL").map(function(g){return Bt({tag:"SegmentURL"},Mt(g))}),r=Tt(n,"SegmentBase")[0],a=i||t,o=a&&Tt(a,"SegmentTimeline")[0],l=i||r||t,d=l&&Tt(l,"Initialization")[0],f=t&&Mt(t);f&&d?f.initialization=d&&Mt(d):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});var v={template:f,segmentTimeline:o&&Tt(o,"S").map(function(g){return Mt(g)}),list:i&&Bt(Mt(i),{segmentUrls:e,initialization:Mt(d)}),base:r&&Bt(Mt(r),{initialization:Mt(d)})};return Object.keys(v).forEach(function(g){v[g]||delete v[g]}),v},Hf=function(n,t){return function(i,e){var r=Wn(t,Tt(i.node,"BaseURL")),a=Bt(n,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(a.periodDuration=i.attributes.duration);var o=Tt(i.node,"AdaptationSet"),l=ds(i.node);return qn(o.map(function(n,t,i){return function(e){var r=Mt(e),a=Wn(t,Tt(e,"BaseURL")),o=Tt(e,"Role")[0],l={role:Mt(o)},d=Bt(n,r,l),f=Tt(e,"Accessibility")[0],v=function(n){return"urn:scte:dash:cc:cea-608:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var r,a;if(a=e,/^CC\d=/.test(e)){var o=e.split("=");r=o[0],a=o[1]}else/^CC\d$/.test(e)&&(r=e);return{channel:r,language:a}}):"urn:scte:dash:cc:cea-708:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var a=e.split("="),l=a[1],d=void 0===l?"":l;r.channel=a[0],r.language=e,d.split(",").forEach(function(f){var v=f.split(":"),g=v[0],T=v[1];"lang"===g?r.language=T:"er"===g?r.easyReader=Number(T):"war"===g?r.aspectRatio=Number(T):"3D"===g&&(r["3D"]=Number(T))})}else r.language=e;return r.channel&&(r.channel="SERVICE"+r.channel),r}):void 0}(Mt(f));v&&(d=Bt(d,{captionServices:v}));var g=Tt(e,"Label")[0];if(g&&g.childNodes.length){var T=g.childNodes[0].nodeValue.trim();d=Bt(d,{label:T})}var E=function(n){return n.reduce(function(t,i){var e=Mt(i),r=Uf[e.schemeIdUri];if(r){t[r]={attributes:e};var a=Tt(i,"cenc:pssh")[0];if(a){var o=ls(a),l=o&&er(o);t[r].pssh=l}}return t},{})}(Tt(e,"ContentProtection"));Object.keys(E).length&&(d=Bt(d,{contentProtection:E}));var x=ds(e),S=Tt(e,"Representation"),N=Bt(i,x);return qn(S.map(function(n,t,i){return function(e){var r=Tt(e,"BaseURL"),a=Wn(t,r),o=Bt(n,Mt(e)),l=ds(e);return a.map(function(d){return{segmentInfo:Bt(i,l),attributes:Bt(o,{baseUrl:d})}})}}(d,a,N)))}}(a,r,l)))}},mu=function(n){if(""===n)throw new Error("DASH_EMPTY_MANIFEST");var i,e,t=new Vn.DOMParser;try{e=(i=t.parseFromString(n,"application/xml"))&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch{}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return e},Kf=H(7459),zf=H.n(Kf),Re=function(n){return n instanceof Uint8Array?n:(!Array.isArray(n)&&!function(n){return function(n){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer}(n)}(n)&&!(n instanceof ArrayBuffer)&&(n="number"!=typeof n||"number"==typeof n&&n!=n?0:[n]),new Uint8Array(n&&n.buffer||n,n&&n.byteOffset||0,n&&n.byteLength||0))},Ot=P().BigInt||Number,cs=[Ot("0x1"),Ot("0x100"),Ot("0x10000"),Ot("0x1000000"),Ot("0x100000000"),Ot("0x10000000000"),Ot("0x1000000000000"),Ot("0x100000000000000"),Ot("0x10000000000000000")],eh=(s=new Uint16Array([65484]),new Uint8Array(s.buffer,s.byteOffset,s.byteLength),function(n,t){var i=void 0===t?{}:t,e=i.signed,r=void 0!==e&&e,a=i.le,o=void 0!==a&&a;n=Re(n);var l=o?"reduce":"reduceRight",f=(n[l]?n[l]:Array.prototype[l]).call(n,function(g,T,E){var x=o?E:Math.abs(E+1-n.length);return g+Ot(T)*cs[x]},Ot(0));if(r){var v=cs[n.length]/Ot(2)-Ot(1);(f=Ot(f))>v&&(f-=v,f-=v,f-=Ot(2))}return Number(f)}),_u=function(n,t){if("string"!=typeof n&&n&&"function"==typeof n.toString&&(n=n.toString()),"string"!=typeof n)return new Uint8Array;t||(n=unescape(encodeURIComponent(n)));for(var i=new Uint8Array(n.length),e=0;e=t.length&&(t.every?t.every:Array.prototype.every).call(t,function(f,v){return f===(l[v]?l[v]&n[a+v]:n[a+v])})},nh=Re([73,68,51]),un=function s(n,t){return void 0===t&&(t=0),(n=Re(n)).length-t<10||!ht(n,nh,{offset:t})?t:(t+=function(n,t){void 0===t&&(t=0);var e=(n=Re(n))[t+6]<<21|n[t+7]<<14|n[t+8]<<7|n[t+9];return(16&n[t+5])>>4?e+20:e+10}(n,t),s(n,t))},fs=(new Uint8Array([79,112,117,115,72,101,97,100]),function(n){return"string"==typeof n?_u(n):n}),ps=function(n){n=Re(n);for(var t=[],i=0;n.length>i;){var e=n[i],r=0,a=0,o=n[++a];for(a++;128&o;)r=(127&o)<<7,o=n[a],a++;r+=127&o;for(var l=0;l>>0,o=n.subarray(r+4,r+8);if(0===a)break;var l=r+a;if(l>n.length){if(i)break;l=n.length}var d=n.subarray(r+8,l);ht(o,t[0])&&(1===t.length?e.push(d):e.push.apply(e,s(d,t.slice(1),i))),r=l}return e},dt={EBML:Re([26,69,223,163]),DocType:Re([66,130]),Segment:Re([24,83,128,103]),SegmentInfo:Re([21,73,169,102]),Tracks:Re([22,84,174,107]),Track:Re([174]),TrackNumber:Re([215]),DefaultDuration:Re([35,227,131]),TrackEntry:Re([174]),TrackType:Re([131]),FlagDefault:Re([136]),CodecID:Re([134]),CodecPrivate:Re([99,162]),VideoTrack:Re([224]),AudioTrack:Re([225]),Cluster:Re([31,67,182,117]),Timestamp:Re([231]),TimestampScale:Re([42,215,177]),BlockGroup:Re([160]),BlockDuration:Re([155]),Block:Re([161]),SimpleBlock:Re([163])},ms=[128,64,32,16,8,4,2,1],rr=function(n,t,i,e){void 0===i&&(i=!0),void 0===e&&(e=!1);var r=function(n){for(var t=1,i=0;i=t.length)return t.length;var e=rr(t,i,!1);if(ht(n.bytes,e.bytes))return i;var r=rr(t,i+e.length);return s(n,t,i+r.length+r.value+e.length)},pt=function s(n,t){t=function(n){return Array.isArray(n)?n.map(function(t){return yu(t)}):[yu(n)]}(t),n=Re(n);var i=[];if(!t.length)return i;for(var e=0;en.length?n.length:o+a.value);ht(t[0],r.bytes)&&(1===t.length?i.push(d):i=i.concat(s(d,t.slice(1)))),e+=r.length+a.length+d.length}return i},mh=Re([0,0,0,1]),gh=Re([0,0,1]),vh=Re([0,0,3]),_h=function(n){for(var t=[],i=1;i>1&63),-1!==i.indexOf(d)&&(a=r+l),r+=l+("h264"===t?1:2)}else r++}return n.subarray(0,0)},jt={webm:Re([119,101,98,109]),matroska:Re([109,97,116,114,111,115,107,97]),flac:Re([102,76,97,67]),ogg:Re([79,103,103,83]),ac3:Re([11,119]),riff:Re([82,73,70,70]),avi:Re([65,86,73]),wav:Re([87,65,86,69]),"3gp":Re([102,116,121,112,51,103]),mp4:Re([102,116,121,112]),fmp4:Re([115,116,121,112]),mov:Re([102,116,121,112,113,116]),moov:Re([109,111,111,118]),moof:Re([109,111,111,102])},Pr={aac:function(n){var t=un(n);return ht(n,[255,16],{offset:t,mask:[255,22]})},mp3:function(n){var t=un(n);return ht(n,[255,2],{offset:t,mask:[255,6]})},webm:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,jt.webm)},mkv:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,jt.matroska)},mp4:function(n){return!Pr["3gp"](n)&&!Pr.mov(n)&&(!!(ht(n,jt.mp4,{offset:4})||ht(n,jt.fmp4,{offset:4})||ht(n,jt.moof,{offset:4})||ht(n,jt.moov,{offset:4}))||void 0)},mov:function(n){return ht(n,jt.mov,{offset:4})},"3gp":function(n){return ht(n,jt["3gp"],{offset:4})},ac3:function(n){var t=un(n);return ht(n,jt.ac3,{offset:t})},ts:function(n){if(n.length<189&&n.length>=1)return 71===n[0];for(var t=0;t+1880?l:0)}if(P().console){var d=P().console[i];!d&&"debug"===i&&(d=P().console.info||P().console.log),d&&a&&o.test(i)&&d[Array.isArray(r)?"apply":"call"](P().console,r)}}}(s,i),i.createLogger=function(e){return Eu(s+": "+e)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(i.history=function(){return zt?[].concat(zt):[]}).filter=function(e){return(zt||[]).filter(function(r){return new RegExp(".*"+e+".*").test(r[0])})},i.history.clear=function(){zt&&(zt.length=0)},i.history.disable=function(){null!==zt&&(zt.length=0,zt=null)},i.history.enable=function(){null===zt&&(zt=[])},i.error=function(){for(var e=arguments.length,r=new Array(e),a=0;a1?n-1:0),i=1;i=0)throw new Error("class has illegal whitespace characters")}function Rr(){return z()===P().document}function Mr(s){return Ii(s)&&1===s.nodeType}function Mu(){try{return P().parent!==P().self}catch{return!0}}function Uu(s){return function(n,t){if(!Lu(n))return z()[s](null);Lu(t)&&(t=z().querySelector(t));var i=Mr(t)?t:z();return i[s]&&i[s](n)}}function Ye(s,n,t,i){void 0===s&&(s="div"),void 0===n&&(n={}),void 0===t&&(t={});var e=z().createElement(s);return Object.getOwnPropertyNames(n).forEach(function(r){var a=n[r];-1!==r.indexOf("aria-")||"role"===r||"type"===r?(Ke.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+r+" to "+a+"."),e.setAttribute(r,a)):"textContent"===r?nr(e,a):(e[r]!==a||"tabIndex"===r)&&(e[r]=a)}),Object.getOwnPropertyNames(t).forEach(function(r){e.setAttribute(r,t[r])}),i&&Es(e,i),e}function nr(s,n){return typeof s.textContent>"u"?s.innerText=n:s.textContent=n,s}function xs(s,n){n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s)}function ar(s,n){return Ru(n),s.classList?s.classList.contains(n):function Ph(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}(n).test(s.className)}function Oi(s,n){return s.classList?s.classList.add(n):ar(s,n)||(s.className=(s.className+" "+n).trim()),s}function mn(s,n){return s?(s.classList?s.classList.remove(n):(Ru(n),s.className=s.className.split(/\s+/).filter(function(t){return t!==n}).join(" ")),s):(Ke.warn("removeClass was called with an element that doesn't exist"),null)}function Nu(s,n,t){var i=ar(s,n);if("function"==typeof t&&(t=t(s,n)),"boolean"!=typeof t&&(t=!i),t!==i)return t?Oi(s,n):mn(s,n),s}function Fu(s,n){Object.getOwnPropertyNames(n).forEach(function(t){var i=n[t];null===i||typeof i>"u"||!1===i?s.removeAttribute(t):s.setAttribute(t,!0===i?"":i)})}function Li(s){var n={};if(s&&s.attributes&&s.attributes.length>0)for(var i=s.attributes,e=i.length-1;e>=0;e--){var r=i[e].name,a=i[e].value;("boolean"==typeof s[r]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+","))&&(a=null!==a),n[r]=a}return n}function Bu(s,n){return s.getAttribute(n)}function Ur(s,n,t){s.setAttribute(n,t)}function Xn(s,n){s.removeAttribute(n)}function ju(){z().body.focus(),z().onselectstart=function(){return!1}}function Hu(){z().onselectstart=function(){return!0}}function Nr(s){if(s&&s.getBoundingClientRect&&s.parentNode){var n=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(i){void 0!==n[i]&&(t[i]=n[i])}),t.height||(t.height=parseFloat(fn(s,"height"))),t.width||(t.width=parseFloat(fn(s,"width"))),t}}function gn(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var n=s.offsetWidth,t=s.offsetHeight,i=0,e=0;s.offsetParent&&s!==z()[Kn.fullscreenElement];)i+=s.offsetLeft,e+=s.offsetTop,s=s.offsetParent;return{left:i,top:e,width:n,height:t}}function Jn(s,n){var t={x:0,y:0};if(Ht)for(var i=s;i&&"html"!==i.nodeName.toLowerCase();){var e=fn(i,"transform");if(/^matrix/.test(e)){var r=e.slice(7,-1).split(/,\s/).map(Number);t.x+=r[4],t.y+=r[5]}else if(/^matrix3d/.test(e)){var a=e.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}i=i.parentNode}var o={},l=gn(n.target),d=gn(s),f=d.width,g=n.offsetY-(d.top-l.top),T=n.offsetX-(d.left-l.left);return n.changedTouches&&(T=n.changedTouches[0].pageX-d.left,g=n.changedTouches[0].pageY+d.top,Ht&&(T-=t.x,g-=t.y)),o.y=1-Math.max(0,Math.min(1,g/d.height)),o.x=Math.max(0,Math.min(1,T/f)),o}function Vu(s){return Ii(s)&&3===s.nodeType}function Ss(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function qu(s){return"function"==typeof s&&(s=s()),(Array.isArray(s)?s:[s]).map(function(n){return"function"==typeof n&&(n=n()),Mr(n)||Vu(n)?n:"string"==typeof n&&/\S/.test(n)?z().createTextNode(n):void 0}).filter(function(n){return n})}function Es(s,n){return qu(n).forEach(function(t){return s.appendChild(t)}),s}function Gu(s,n){return Es(Ss(s),n)}function vn(s){return void 0===s.button&&void 0===s.buttons||0===s.button&&void 0===s.buttons||"mouseup"===s.type&&0===s.button&&0===s.buttons||!(0!==s.button||1!==s.buttons)}var Cs,Wi=Uu("querySelector"),Wu=Uu("querySelectorAll"),Zu=Object.freeze({__proto__:null,isReal:Rr,isEl:Mr,isInFrame:Mu,createEl:Ye,textContent:nr,prependTo:xs,hasClass:ar,addClass:Oi,removeClass:mn,toggleClass:Nu,setAttributes:Fu,getAttributes:Li,getAttribute:Bu,setAttribute:Ur,removeAttribute:Xn,blockTextSelection:ju,unblockTextSelection:Hu,getBoundingClientRect:Nr,findPosition:gn,getPointerPosition:Jn,isTextNode:Vu,emptyEl:Ss,normalizeContent:qu,appendContent:Es,insertContent:Gu,isSingleLeftClick:vn,$:Wi,$$:Wu}),Ku=!1,Oh=function(){if(!1!==Cs.options.autoSetup){var n=Array.prototype.slice.call(z().getElementsByTagName("video")),t=Array.prototype.slice.call(z().getElementsByTagName("audio")),i=Array.prototype.slice.call(z().getElementsByTagName("video-js")),e=n.concat(t,i);if(e&&e.length>0)for(var r=0,a=e.length;r-1&&(e={passive:!0}),s.addEventListener(n,i.dispatcher,e)}else s.attachEvent&&s.attachEvent("on"+n,i.dispatcher)}function Ut(s,n,t){if(Vt.has(s)){var i=Vt.get(s);if(i.handlers){if(Array.isArray(n))return ws(Ut,s,n,t);var e=function(d,f){i.handlers[f]=[],Qu(d,f)};if(void 0===n){for(var r in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},r)&&e(s,r);return}var a=i.handlers[n];if(a){if(!t)return void e(s,n);if(t.guid)for(var o=0;o=t&&(n.apply(void 0,arguments),i=a)}},Fh=function(n,t,i,e){void 0===e&&(e=P());var r,o=function(){var d=this,f=arguments,v=function(){r=null,v=null,i||n.apply(d,f)};!r&&i&&n.apply(d,f),e.clearTimeout(r),r=e.setTimeout(v,t)};return o.cancel=function(){e.clearTimeout(r),r=null},o},It=function(){};It.prototype.allowedEvents_={},It.prototype.on=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Xt(this,s,n),this.addEventListener=t},It.prototype.addEventListener=It.prototype.on,It.prototype.off=function(s,n){Ut(this,s,n)},It.prototype.removeEventListener=It.prototype.off,It.prototype.one=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},ia(this,s,n),this.addEventListener=t},It.prototype.any=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Xu(this,s,n),this.addEventListener=t},It.prototype.trigger=function(s){var n=s.type||s;"string"==typeof s&&(s={type:n}),s=ea(s),this.allowedEvents_[n]&&this["on"+n]&&this["on"+n](s),Fr(this,s)},It.prototype.dispatchEvent=It.prototype.trigger,It.prototype.queueTrigger=function(s){var n=this;_n||(_n=new Map);var t=s.type||s,i=_n.get(this);i||_n.set(this,i=new Map);var e=i.get(t);i.delete(t),P().clearTimeout(e);var r=P().setTimeout(function(){0===i.size&&(i=null,_n.delete(n)),n.trigger(s)},0);i.set(t,r)};var ra=function(n){return"function"==typeof n.name?n.name():"string"==typeof n.name?n.name:n.name_?n.name_:n.constructor&&n.constructor.name?n.constructor.name:typeof n},Mi=function(n){return n instanceof It||!!n.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof n[t]})},Is=function(n){return"string"==typeof n&&/\S/.test(n)||Array.isArray(n)&&!!n.length},na=function(n,t,i){if(!n||!n.nodeName&&!Mi(n))throw new Error("Invalid target for "+ra(t)+"#"+i+"; must be a DOM node or evented object.")},Ju=function(n,t,i){if(!Is(n))throw new Error("Invalid event type for "+ra(t)+"#"+i+"; must be a non-empty string or array.")},el=function(n,t,i){if("function"!=typeof n)throw new Error("Invalid listener for "+ra(t)+"#"+i+"; must be a function.")},Ds=function(n,t,i){var r,a,o,e=t.length<3||t[0]===n||t[0]===n.eventBusEl_;return e?(r=n.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(r=t[0],a=t[1],o=t[2]),na(r,n,i),Ju(a,n,i),el(o,n,i),{isTargetingSelf:e,target:r,type:a,listener:o=at(n,o)}},sr=function(n,t,i,e){na(n,n,t),n.nodeName?Nh[t](n,i,e):n[t](i,e)},jh={on:function(){for(var n=this,t=arguments.length,i=new Array(t),e=0;e=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},n.isDisposed=function(){return Boolean(this.isDisposed_)},n.player=function(){return this.player_},n.options=function(i){return i?(this.options_=ct(this.options_,i),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(i,e,r){return Ye(i,e,r)},n.localize=function(i,e,r){void 0===r&&(r=i);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],d=a&&a.split("-")[0],f=o&&o[d],v=r;return l&&l[i]?v=l[i]:f&&f[i]&&(v=f[i]),e&&(v=v.replace(/\{(\d+)\}/g,function(g,T){var E=e[T-1],x=E;return typeof E>"u"&&(x=g),x})),v},n.handleLanguagechange=function(){},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(i){return this.childIndex_[i]},n.getChild=function(i){if(i)return this.childNameIndex_[i]},n.getDescendant=function(){for(var i=arguments.length,e=new Array(i),r=0;r=0;r--)if(this.children_[r]===i){e=!0,this.children_.splice(r,1);break}if(e){i.parentComponent_=null,this.childIndex_[i.id()]=null,this.childNameIndex_[bt(i.name())]=null,this.childNameIndex_[aa(i.name())]=null;var a=i.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(i.el())}}},n.initChildren=function(){var i=this,e=this.options_.children;if(e){var o,r=this.options_,l=s.getComponent("Tech");(o=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(d){return!o.some(function(f){return"string"==typeof f?d===f:d===f.name})})).map(function(d){var f,v;return"string"==typeof d?v=e[f=d]||i.options_[f]||{}:(f=d.name,v=d),{name:f,opts:v}}).filter(function(d){var f=s.getComponent(d.opts.componentClass||bt(d.name));return f&&!l.isTech(f)}).forEach(function(f){var v=f.name,g=f.opts;if(void 0!==r[v]&&(g=r[v]),!1!==g){!0===g&&(g={}),g.playerOptions=i.options_.playerOptions;var T=i.addChild(v,g);T&&(i[v]=T)}})}},n.buildCSSClass=function(){return""},n.ready=function(i,e){if(void 0===e&&(e=!1),i){if(!this.isReady_)return this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(i);e?i.call(this):this.setTimeout(i,1)}},n.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var i=this.readyQueue_;this.readyQueue_=[],i&&i.length>0&&i.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},n.$=function(i,e){return Wi(i,e||this.contentEl())},n.$$=function(i,e){return Wu(i,e||this.contentEl())},n.hasClass=function(i){return ar(this.el_,i)},n.addClass=function(i){Oi(this.el_,i)},n.removeClass=function(i){mn(this.el_,i)},n.toggleClass=function(i,e){Nu(this.el_,i,e)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(i){return Bu(this.el_,i)},n.setAttribute=function(i,e){Ur(this.el_,i,e)},n.removeAttribute=function(i){Xn(this.el_,i)},n.width=function(i,e){return this.dimension("width",i,e)},n.height=function(i,e){return this.dimension("height",i,e)},n.dimensions=function(i,e){this.width(i,!0),this.height(e)},n.dimension=function(i,e,r){if(void 0!==e)return(null===e||e!=e)&&(e=0),this.el_.style[i]=-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?e:"auto"===e?"":e+"px",void(r||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[i],o=a.indexOf("px");return parseInt(-1!==o?a.slice(0,o):this.el_["offset"+bt(i)],10)},n.currentDimension=function(i){var e=0;if("width"!==i&&"height"!==i)throw new Error("currentDimension only accepts width or height value");if(e=fn(this.el_,i),0===(e=parseFloat(e))||isNaN(e)){var r="offset"+bt(i);e=this.el_[r]}return e},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(i){this.player_&&(De().isEventKey(i,"Tab")||i.stopPropagation(),this.player_.handleKeyDown(i))},n.handleKeyPress=function(i){this.handleKeyDown(i)},n.emitTapEvents=function(){var o,i=0,e=null;this.on("touchstart",function(d){1===d.touches.length&&(e={pageX:d.touches[0].pageX,pageY:d.touches[0].pageY},i=P().performance.now(),o=!0)}),this.on("touchmove",function(d){if(d.touches.length>1)o=!1;else if(e){var f=d.touches[0].pageX-e.pageX,v=d.touches[0].pageY-e.pageY;Math.sqrt(f*f+v*v)>10&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(d){e=null,!0===o&&P().performance.now()-i<200&&(d.preventDefault(),this.trigger("tap"))})},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,i=at(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){i(),this.clearInterval(e),e=this.setInterval(i,250)});var r=function(o){i(),this.clearInterval(e)};this.on("touchmove",i),this.on("touchend",r),this.on("touchcancel",r)}},n.setTimeout=function(i,e){var a,r=this;return i=at(this,i),this.clearTimersOnDispose_(),a=P().setTimeout(function(){r.setTimeoutIds_.has(a)&&r.setTimeoutIds_.delete(a),i()},e),this.setTimeoutIds_.add(a),a},n.clearTimeout=function(i){return this.setTimeoutIds_.has(i)&&(this.setTimeoutIds_.delete(i),P().clearTimeout(i)),i},n.setInterval=function(i,e){i=at(this,i),this.clearTimersOnDispose_();var r=P().setInterval(i,e);return this.setIntervalIds_.add(r),r},n.clearInterval=function(i){return this.setIntervalIds_.has(i)&&(this.setIntervalIds_.delete(i),P().clearInterval(i)),i},n.requestAnimationFrame=function(i){var r,e=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),i=at(this,i),r=P().requestAnimationFrame(function(){e.rafIds_.has(r)&&e.rafIds_.delete(r),i()}),this.rafIds_.add(r),r):this.setTimeout(i,1e3/60)},n.requestNamedAnimationFrame=function(i,e){var r=this;if(!this.namedRafs_.has(i)){this.clearTimersOnDispose_(),e=at(this,e);var a=this.requestAnimationFrame(function(){e(),r.namedRafs_.has(i)&&r.namedRafs_.delete(i)});return this.namedRafs_.set(i,a),i}},n.cancelNamedAnimationFrame=function(i){this.namedRafs_.has(i)&&(this.cancelAnimationFrame(this.namedRafs_.get(i)),this.namedRafs_.delete(i))},n.cancelAnimationFrame=function(i){return this.supportsRaf_?(this.rafIds_.has(i)&&(this.rafIds_.delete(i),P().cancelAnimationFrame(i)),i):this.clearTimeout(i)},n.clearTimersOnDispose_=function(){var i=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var a=e[1];i[e[0]].forEach(function(o,l){return i[a](l)})}),i.clearingTimersOnDispose_=!1}))},s.registerComponent=function(i,e){if("string"!=typeof i||!i)throw new Error('Illegal component name, "'+i+'"; must be a non-empty string.');var r=s.getComponent("Tech"),a=r&&r.isTech(e),o=s===e||s.prototype.isPrototypeOf(e.prototype);if(a||!o)throw new Error('Illegal component, "'+i+'"; '+(a?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");i=bt(i),s.components_||(s.components_={});var d=s.getComponent("Player");if("Player"===i&&d&&d.players){var f=d.players,v=Object.keys(f);if(f&&v.length>0&&v.map(function(g){return f[g]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[i]=e,s.components_[aa(i)]=e,e},s.getComponent=function(i){if(i&&s.components_)return s.components_[i]},s}();function il(s,n,t,i){return function Zh(s,n,t){if("number"!=typeof n||n<0||n>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+n+") is non-numeric or out of bounds (0-"+t+").")}(s,i,t.length-1),t[i][n]}function Ls(s){var n;return n=void 0===s||0===s.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:il.bind(null,"start",0,s),end:il.bind(null,"end",1,s)},P().Symbol&&P().Symbol.iterator&&(n[P().Symbol.iterator]=function(){return(s||[]).values()}),n}function or(s,n){return Array.isArray(s)?Ls(s):void 0===s||void 0===n?Ls():Ls([[s,n]])}function rl(s,n){var i,e,t=0;if(!n)return 0;(!s||!s.length)&&(s=or(0,0));for(var r=0;rn&&(e=n),t+=e-i;return t/n}function qt(s){if(s instanceof qt)return s;"number"==typeof s?this.code=s:"string"==typeof s?this.message=s:Ii(s)&&("number"==typeof s.code&&(this.code=s.code),_t(this,s)),this.message||(this.message=qt.defaultMessages[this.code]||"")}Y.prototype.supportsRaf_="function"==typeof P().requestAnimationFrame&&"function"==typeof P().cancelAnimationFrame,Y.registerComponent("Component",Y),qt.prototype.code=0,qt.prototype.message="",qt.prototype.status=null,qt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],qt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Br=0;Br=0;r--)if(i[r].enabled){Us(i,i[r]);break}return(e=s.call(this,i)||this).changing_=!1,e}re(n,s);var t=n.prototype;return t.addTrack=function(e){var r=this;e.enabled&&Us(this,e),s.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){r.changing_||(r.changing_=!0,Us(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},n}(Hr),Ns=function(n,t){for(var i=0;i=0;r--)if(i[r].selected){Ns(i,i[r]);break}return(e=s.call(this,i)||this).changing_=!1,Object.defineProperty(Ne(e),"selectedIndex",{get:function(){for(var o=0;o0&&(P().console&&P().console.groupCollapsed&&P().console.groupCollapsed("Text Track parsing errors for "+t.src),e.forEach(function(r){return Ke.error(r)}),P().console&&P().console.groupEnd&&P().console.groupEnd()),i.flush()},dl=function(n,t){var i={uri:n},e=sa(n);e&&(i.cors=e);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),ki()(i,at(this,function(a,o,l){if(a)return Ke.error(a,o);t.loaded_=!0,"function"!=typeof P().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(d){if("vttjserror"!==d.type)return ll(l,t);Ke.error("vttjs failed to load, stopping trying to process "+t.src)}):ll(l,t)}))},Tn=function(s){function n(i){var e;if(void 0===i&&(i={}),!i.tech)throw new Error("A tech was not provided.");var r=ct(i,{kind:tp[i.kind]||"subtitles",language:i.language||i.srclang||""}),a=ol[r.mode]||"disabled",o=r.default;("metadata"===r.kind||"chapters"===r.kind)&&(a="hidden"),(e=s.call(this,r)||this).tech_=r.tech,e.cues_=[],e.activeCues_=[],e.preload_=!1!==e.tech_.preloadTextTracks;var l=new sl(e.cues_),d=new sl(e.activeCues_),f=!1,v=at(Ne(e),function(){!this.tech_.isReady_||this.tech_.isDisposed()||(this.activeCues=this.activeCues,f&&(this.trigger("cuechange"),f=!1))});return e.tech_.one("dispose",function(){e.tech_.off("timeupdate",v)}),"disabled"!==a&&e.tech_.on("timeupdate",v),Object.defineProperties(Ne(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(E){ol[E]&&a!==E&&(a=E,!this.preload_&&"disabled"!==a&&0===this.cues.length&&dl(this.src,this),this.tech_.off("timeupdate",v),"disabled"!==a&&this.tech_.on("timeupdate",v),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var E=this.tech_.currentTime(),x=[],S=0,N=this.cues.length;S=E||F.startTime===F.endTime&&F.startTime<=E&&F.startTime+.5>=E)&&x.push(F)}if(f=!1,x.length!==this.activeCues_.length)f=!0;else for(var j=0;j0)return void this.trigger("vttjsloaded");var r=z().createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){e.trigger("vttjsloaded")},r.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){r.onload=null,r.onerror=null}),P().WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var e=this,r=this.textTracks(),a=this.remoteTextTracks(),o=function(g){return r.addTrack(g.track)},l=function(g){return r.removeTrack(g.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var d=function(){return e.trigger("texttrackchange")},f=function(){d();for(var g=0;g=0;e--){var r=s[e];r[n]&&r[n](i,t)}}(s,t,o,a),o}var cp={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},fp={setCurrentTime:1,setMuted:1,setVolume:1},gl={play:1,pause:1};function Vs(s){return function(n,t){return n===oa?oa:t[s]?t[s](n):n}}function lr(s,n,t,i,e,r){void 0===s&&(s={}),void 0===n&&(n=[]),void 0===e&&(e=[]),void 0===r&&(r=!1);var o=n[0],l=n.slice(1);if("string"==typeof o)lr(s,ur[o],t,i,e,r);else if(o){var d=function mp(s,n){var t=Hs[s.id()],i=null;if(null==t)return i=n(s),Hs[s.id()]=[[n,i]],i;for(var e=0;e0;this.player_.tech(!0)&&!((pn||hn)&&r)&&this.player_.tech(!0).focus(),this.player_.paused()?yi(this.player_.play()):this.player_.pause()}},n}(la);Y.registerComponent("PosterImage",Tp);var ni="#222",bp={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function qs(s,n){var t;if(4===s.length)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(7!==s.length)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+n+")"}function Gs(s,n,t){try{s.style[n]=t}catch{return}}var xp=function(s){function n(i,e,r){var a;a=s.call(this,i,e,r)||this;var o=function(d){return a.updateDisplay(d)};return i.on("loadstart",function(l){return a.toggleDisplay(l)}),i.on("texttrackchange",o),i.on("loadedmetadata",function(l){return a.preselectTrack(l)}),i.ready(at(Ne(a),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),P().addEventListener("orientationchange",o),i.on("dispose",function(){return P().removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],d=0;d0;return yi(r),void(this.player_.tech(!0)&&(!pn&&!hn||!a)&&this.player_.tech(!0).focus())}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(l){var d=function(){return l.focus()};yn(r)?r.then(d,function(){}):this.setTimeout(d,1)}else this.player_.tech(!0).focus()},t.handleKeyDown=function(e){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,e)},t.handleMouseDown=function(e){this.mouseused_=!0},n}(hi);yl.prototype.controlText_="Play Video",Y.registerComponent("BigPlayButton",yl);var Ep=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).controlText(e&&e.controlText||r.localize("Close")),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(e){De().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,e)},n}(hi);Y.registerComponent("CloseButton",Ep);var Tl=function(s){function n(i,e){var r;return void 0===e&&(e={}),r=s.call(this,i,e)||this,e.replay=void 0===e.replay||e.replay,r.on(i,"play",function(a){return r.handlePlay(a)}),r.on(i,"pause",function(a){return r.handlePause(a)}),e.replay&&r.on(i,"ended",function(a){return r.handleEnded(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.player_.paused()?yi(this.player_.play()):this.player_.pause()},t.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(e){var r=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return r.handleSeeked(a)})},n}(hi);Tl.prototype.controlText_="Play",Y.registerComponent("PlayToggle",Tl);var bl=function(n,t){n=n<0?0:n;var i=Math.floor(n%60),e=Math.floor(n/60%60),r=Math.floor(n/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(n)||n===1/0)&&(r=e=i="-"),(r=r>0||o>0?r+":":"")+(e=((r||a>=10)&&e<10?"0"+e:e)+":")+(i<10?"0"+i:i)},Ws=bl;function Gr(s,n){return void 0===n&&(n=s),Ws(s,n)}var Wr=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,["timeupdate","ended"],function(a){return r.updateContent(a)}),r.updateTextNode_(),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=this.buildCSSClass(),r=s.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=Ye("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return r.appendChild(a),this.contentEl_=Ye("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),r.appendChild(this.contentEl_),r},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(e){var r=this;void 0===e&&(e=0),e=Gr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(r.contentEl_){var a=r.textNode_;a&&r.contentEl_.firstChild!==a&&(a=null,Ke.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),r.textNode_=z().createTextNode(r.formattedTime_),r.textNode_&&(a?r.contentEl_.replaceChild(r.textNode_,a):r.contentEl_.appendChild(r.textNode_))}}))},t.updateContent=function(e){},n}(Y);Wr.prototype.labelText_="Time",Wr.prototype.controlText_="Time",Y.registerComponent("TimeDisplay",Wr);var Zs=function(s){function n(){return s.apply(this,arguments)||this}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(e){var r;r=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(r)},n}(Wr);Zs.prototype.labelText_="Current Time",Zs.prototype.controlText_="Current Time",Y.registerComponent("CurrentTimeDisplay",Zs);var Ks=function(s){function n(i,e){var r,a=function(l){return r.updateContent(l)};return(r=s.call(this,i,e)||this).on(i,"durationchange",a),r.on(i,"loadstart",a),r.on(i,"loadedmetadata",a),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var r=this.player_.duration();this.updateTextNode_(r)},n}(Wr);Ks.prototype.labelText_="Duration",Ks.prototype.controlText_="Duration",Y.registerComponent("DurationDisplay",Ks);var Ap=function(s){function n(){return s.apply(this,arguments)||this}return re(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),r=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return r.appendChild(a),e.appendChild(r),e},n}(Y);Y.registerComponent("TimeDivider",Ap);var zs=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,"durationchange",function(a){return r.updateContent(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=s.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&e.insertBefore(Ye("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){var r;"number"==typeof this.player_.duration()&&(r=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(r))},n}(Wr);zs.prototype.labelText_="Remaining Time",zs.prototype.controlText_="Remaining Time",Y.registerComponent("RemainingTimeDisplay",zs);var wp=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).updateShowing(),r.on(r.player(),"durationchange",function(a){return r.updateShowing(a)}),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ye("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Ye("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(z().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},n}(Y);Y.registerComponent("LiveDisplay",wp);var xl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).updateLiveEdgeStatus(),r.player_.liveTracker&&(r.updateLiveEdgeStatusHandler_=function(a){return r.updateLiveEdgeStatus(a)},r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatusHandler_)),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Ye("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},n}(hi);xl.prototype.controlText_="Seek to live, currently playing live",Y.registerComponent("SeekToLive",xl);var da=function(n,t,i){return n=Number(n),Math.min(i,Math.max(t,isNaN(n)?t:n))},Ys=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).handleMouseDown_=function(a){return r.handleMouseDown(a)},r.handleMouseUp_=function(a){return r.handleMouseUp(a)},r.handleKeyDown_=function(a){return r.handleKeyDown(a)},r.handleClick_=function(a){return r.handleClick(a)},r.handleMouseMove_=function(a){return r.handleMouseMove(a)},r.update_=function(a){return r.update(a)},r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}re(n,s);var t=n.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(e,r,a){return void 0===r&&(r={}),void 0===a&&(a={}),r.className=r.className+" vjs-slider",r=_t({tabIndex:0},r),a=_t({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,e,r,a)},t.handleMouseDown=function(e){var r=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"===e.type&&!Pi&&e.preventDefault(),ju(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(r,"mousemove",this.handleMouseMove_),this.on(r,"mouseup",this.handleMouseUp_),this.on(r,"touchmove",this.handleMouseMove_),this.on(r,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},t.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Hu(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var e=this;if(this.el_&&this.bar){var r=this.getProgress();return r===this.progress_||(this.progress_=r,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*r).toFixed(2)+"%"})),r}},t.getProgress=function(){return Number(da(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(e){var r=Jn(this.el_,e);return this.vertical()?r.y:r.x},t.handleKeyDown=function(e){De().isEventKey(e,"Left")||De().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):De().isEventKey(e,"Right")||De().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.addClass(this.vertical_?"vjs-slider-vertical":"vjs-slider-horizontal")},n}(Y);Y.registerComponent("Slider",Ys);var $s=function(n,t){return da(n/t*100,0,100).toFixed(2)+"%"},Ip=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).partEls_=[],r.on(i,"progress",function(a){return r.update(a)}),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),r=Ye("span",{className:"vjs-control-text"}),a=Ye("span",{textContent:this.localize("Loaded")}),o=z().createTextNode(": ");return this.percentageEl_=Ye("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(r),r.appendChild(a),r.appendChild(o),r.appendChild(this.percentageEl_),e},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(e){var r=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=r.player_.liveTracker,o=r.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():r.player_.duration(),d=r.player_.bufferedEnd(),f=r.partEls_,v=$s(d,l);r.percent_!==v&&(r.el_.style.width=v,nr(r.percentageEl_,v),r.percent_=v);for(var g=0;go.length;S--)r.el_.removeChild(f[S-1]);f.length=o.length})},n}(Y);Y.registerComponent("LoadProgressBar",Ip);var Dp=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,r,a){var o=gn(this.el_),l=Nr(this.player_.el()),d=e.width*r;if(l&&o){var f=e.left-l.left+d,v=e.width-d+(l.right-e.right),g=o.width/2;fo.width&&(g=o.width),g=Math.round(g),this.el_.style.right="-"+g+"px",this.write(a)}},t.write=function(e){nr(this.el_,e)},t.updateTime=function(e,r,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var d,f=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var v=l.player_.liveTracker.liveWindow(),g=v-r*v;d=(g<1?"":"-")+Gr(g,v)}else d=Gr(a,f);l.update(e,r,d),o&&o()})},n}(Y);Y.registerComponent("TimeTooltip",Dp);var Qs=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,r){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,r,o)}},n}(Y);Qs.prototype.options_={children:[]},!Ht&&!Di&&Qs.prototype.options_.children.push("timeTooltip"),Y.registerComponent("PlayProgressBar",Qs);var Sl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,r){var a=this,o=r*this.player_.duration();this.getChild("timeTooltip").updateTime(e,r,o,function(){a.el_.style.left=e.width*r+"px"})},n}(Y);Sl.prototype.options_={children:["timeTooltip"]},Y.registerComponent("MouseTimeDisplay",Sl);var Xs=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).setEventHandlers_(),r}re(n,s);var t=n.prototype;return t.setEventHandlers_=function(){var e=this;this.update_=at(this,this.update),this.update=Ri(this.update_,fi),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(r){return e.enableInterval_(r)},this.disableIntervalHandler_=function(r){return e.disableInterval_(r)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in z()&&"visibilityState"in z()&&this.on(z(),"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){"hidden"===z().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,fi))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var r=this;if("hidden"!==z().visibilityState){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=r.player_.ended()?r.player_.duration():r.getCurrentTime_(),l=r.player_.liveTracker,d=r.player_.duration();l&&l.isLive()&&(d=r.player_.liveTracker.liveCurrentTime()),r.percent_!==a&&(r.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),r.percent_=a),(r.currentTime_!==o||r.duration_!==d)&&(r.el_.setAttribute("aria-valuetext",r.localize("progress bar timing: currentTime={1} duration={2}",[Gr(o,d),Gr(d,d)],"{1} of {2}")),r.currentTime_=o,r.duration_=d),r.bar&&r.bar.update(Nr(r.el()),r.getProgress())}),a}},t.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var r,e=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(r=(e-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(r=1)):r=e/this.player_.duration(),r},t.handleMouseDown=function(e){vn(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e,r){if(void 0===r&&(r=!1),vn(e)){!r&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(e),l=this.player_.liveTracker;if(l&&l.isLive()){if(o>=.99)return void l.seekToLiveEdge();var d=l.seekableStart(),f=l.liveCurrentTime();if((a=d+o*l.liveWindow())>=f&&(a=f),a<=d&&(a=d+.1),a===1/0)return}else(a=o*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},t.disable=function(){s.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},t.handleMouseUp=function(e){s.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?yi(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){var r=this.player_.liveTracker;if(De().isEventKey(e,"Space")||De().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(De().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(De().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),r&&r.isLive()?this.userSeek_(r.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(De()(e))){e.preventDefault(),e.stopPropagation();var a=10*(De().codes[De()(e)]-De().codes[0])/100;r&&r.isLive()?this.userSeek_(r.seekableStart()+r.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else De().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):De().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):s.prototype.handleKeyDown.call(this,e)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in z()&&"visibilityState"in z()&&this.off(z(),"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},n}(Ys);Xs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},!Ht&&!Di&&Xs.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Y.registerComponent("SeekBar",Xs);var Cl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).handleMouseMove=Ri(at(Ne(r),r.handleMouseMove),fi),r.throttledHandleMouseSeek=Ri(at(Ne(r),r.handleMouseSeek),fi),r.handleMouseUpHandler_=function(a){return r.handleMouseUp(a)},r.handleMouseDownHandler_=function(a){return r.handleMouseDown(a)},r.enable(),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var r=this.getChild("seekBar");if(r){var a=r.getChild("playProgressBar"),o=r.getChild("mouseTimeDisplay");if(a||o){var l=r.el(),d=gn(l),f=Jn(l,e).x;f=da(f,0,1),o&&o.update(d,f),a&&a.update(d,r.getProgress())}}},t.handleMouseSeek=function(e){var r=this.getChild("seekBar");r&&r.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(r){return r.disable&&r.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&yi(this.player_.play())}},t.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(e){var r=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(r,"mousemove",this.throttledHandleMouseSeek),this.on(r,"touchmove",this.throttledHandleMouseSeek),this.on(r,"mouseup",this.handleMouseUpHandler_),this.on(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var r=this.getChild("seekBar");r&&r.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},n}(Y);Cl.prototype.options_={children:["seekBar"]},Y.registerComponent("ProgressControl",Cl);var kl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,["enterpictureinpicture","leavepictureinpicture"],function(a){return r.handlePictureInPictureChange(a)}),r.on(i,["disablepictureinpicturechanged","loadedmetadata"],function(a){return r.handlePictureInPictureEnabledChange(a)}),r.disable(),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){z().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},t.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},n}(hi);kl.prototype.controlText_="Picture-in-Picture",Y.registerComponent("PictureInPictureToggle",kl);var Al=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,"fullscreenchange",function(a){return r.handleFullscreenChange(a)}),!1===z()[i.fsApi_.fullscreenEnabled]&&r.disable(),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},n}(hi);Al.prototype.controlText_="Fullscreen",Y.registerComponent("FullscreenToggle",Al);var Pp=function(n,t){t.tech_&&!t.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})},Op=function(s){function n(){return s.apply(this,arguments)||this}return re(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},n}(Y);Y.registerComponent("VolumeLevel",Op);var Lp=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(e,r,a,o){if(!a){var l=Nr(this.el_),d=Nr(this.player_.el()),f=e.width*r;if(!d||!l)return;var v=e.left-d.left+f,g=e.width-f+(d.right-e.right),T=l.width/2;vl.width&&(T=l.width),this.el_.style.right="-"+T+"px"}this.write(o+"%")},t.write=function(e){nr(this.el_,e)},t.updateVolume=function(e,r,a,o,l){var d=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){d.update(e,r,a,o.toFixed(0)),l&&l()})},n}(Y);Y.registerComponent("VolumeLevelTooltip",Lp);var wl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,r,a){var o=this,l=100*r;this.getChild("volumeLevelTooltip").updateVolume(e,r,a,l,function(){a?o.el_.style.bottom=e.height*r+"px":o.el_.style.left=e.width*r+"px"})},n}(Y);wl.prototype.options_={children:["volumeLevelTooltip"]},Y.registerComponent("MouseVolumeLevelDisplay",wl);var fa=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on("slideractive",function(a){return r.updateLastVolume_(a)}),r.on(i,"volumechange",function(a){return r.updateARIAAttributes(a)}),i.ready(function(){return r.updateARIAAttributes()}),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){vn(e)&&s.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){var r=this.getChild("mouseVolumeLevelDisplay");if(r){var a=this.el(),o=Nr(a),l=this.vertical(),d=Jn(a,e);d=da(d=l?d.y:d.x,0,1),r.update(o,d,l)}vn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var r=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",r),this.el_.setAttribute("aria-valuetext",r+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,r=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(r)})},n}(Ys);fa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!Ht&&!Di&&fa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),fa.prototype.playerEvent="volumechange",Y.registerComponent("VolumeBar",fa);var Il=function(s){function n(i,e){var r;return void 0===e&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar>"u"||cn(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),r=s.call(this,i,e)||this,Pp(Ne(r),i),r.throttledHandleMouseMove=Ri(at(Ne(r),r.handleMouseMove),fi),r.handleMouseUpHandler_=function(a){return r.handleMouseUp(a)},r.on("mousedown",function(a){return r.handleMouseDown(a)}),r.on("touchstart",function(a){return r.handleMouseDown(a)}),r.on("mousemove",function(a){return r.handleMouseMove(a)}),r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")}),r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")}),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var r=this.el_.ownerDocument;this.on(r,"mousemove",this.throttledHandleMouseMove),this.on(r,"touchmove",this.throttledHandleMouseMove),this.on(r,"mouseup",this.handleMouseUpHandler_),this.on(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var r=this.el_.ownerDocument;this.off(r,"mousemove",this.throttledHandleMouseMove),this.off(r,"touchmove",this.throttledHandleMouseMove),this.off(r,"mouseup",this.handleMouseUpHandler_),this.off(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},n}(Y);Il.prototype.options_={children:["volumeBar"]},Y.registerComponent("VolumeControl",Il);var Rp=function(n,t){t.tech_&&!t.tech_.featuresMuteControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresMuteControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})},Dl=function(s){function n(i,e){var r;return r=s.call(this,i,e)||this,Rp(Ne(r),i),r.on(i,["loadstart","volumechange"],function(a){return r.update(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var r=this.player_.volume(),a=this.player_.lastVolume_();0===r?(this.player_.volume(a<.1?.1:a),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),r=3;Ht&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?r=0:e<.33?r=1:e<.67&&(r=2);for(var a=0;a<4;a++)mn(this.el_,"vjs-vol-"+a);Oi(this.el_,"vjs-vol-"+r)},t.updateControlText_=function(){var r=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==r&&this.controlText(r)},n}(hi);Dl.prototype.controlText_="Mute",Y.registerComponent("MuteToggle",Dl);var Pl=function(s){function n(i,e){var r;return void 0===e&&(e={}),e.inline=!(typeof e.inline<"u")||e.inline,(typeof e.volumeControl>"u"||cn(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),(r=s.call(this,i,e)||this).handleKeyPressHandler_=function(a){return r.handleKeyPress(a)},r.on(i,["loadstart"],function(a){return r.volumePanelState_(a)}),r.on(r.muteToggle,"keyup",function(a){return r.handleKeyPress(a)}),r.on(r.volumeControl,"keyup",function(a){return r.handleVolumeControlKeyUp(a)}),r.on("keydown",function(a){return r.handleKeyPress(a)}),r.on("mouseover",function(a){return r.handleMouseOver(a)}),r.on("mouseout",function(a){return r.handleMouseOut(a)}),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}re(n,s);var t=n.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(e){De().isEventKey(e,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(e){this.addClass("vjs-hover"),Xt(z(),"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(e){this.removeClass("vjs-hover"),Ut(z(),"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(e){De().isEventKey(e,"Esc")&&this.handleMouseOut()},n}(Y);Pl.prototype.options_={children:["muteToggle","volumeControl"]},Y.registerComponent("VolumePanel",Pl);var Ol=function(s){function n(i,e){var r;return r=s.call(this,i,e)||this,e&&(r.menuButton_=e.menuButton),r.focusedChild_=-1,r.on("keydown",function(a){return r.handleKeyDown(a)}),r.boundHandleBlur_=function(a){return r.handleBlur(a)},r.boundHandleTapClick_=function(a){return r.handleTapClick(a)},r}re(n,s);var t=n.prototype;return t.addEventListenerForItem=function(e){e instanceof Y&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof Y&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),s.prototype.removeChild.call(this,e)},t.addItem=function(e){var r=this.addChild(e);r&&this.addEventListenerForItem(r)},t.createEl=function(){this.contentEl_=Ye(this.options_.contentElType||"ul",{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),Xt(r,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),r},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(e){var r=e.relatedTarget||z().activeElement;if(!this.children().some(function(o){return o.el()===r})){var a=this.menuButton_;a&&a.buttonPressed_&&r!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var r=this.children();if(!Array.isArray(r))return;var a=r.filter(function(o){return o.el()===e.target})[0];if(!a)return;"CaptionSettingsMenuItem"!==a.name()&&this.menuButton_.focus()}},t.handleKeyDown=function(e){De().isEventKey(e,"Left")||De().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(De().isEventKey(e,"Right")||De().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var r=this.children().slice();r.length&&r[0].hasClass("vjs-menu-title")&&r.shift(),r.length>0&&(e<0?e=0:e>=r.length&&(e=r.length-1),this.focusedChild_=e,r[e].el_.focus())},n}(Y);Y.registerComponent("Menu",Ol);var Js=function(s){function n(i,e){var r;void 0===e&&(e={}),(r=s.call(this,i,e)||this).menuButton_=new hi(i,e),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var a=hi.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+a,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0;var o=function(d){return r.handleClick(d)};return r.handleMenuKeyUp_=function(l){return r.handleMenuKeyUp(l)},r.on(r.menuButton_,"tap",o),r.on(r.menuButton_,"click",o),r.on(r.menuButton_,"keydown",function(l){return r.handleKeyDown(l)}),r.on(r.menuButton_,"mouseenter",function(){r.addClass("vjs-hover"),r.menu.show(),Xt(z(),"keyup",r.handleMenuKeyUp_)}),r.on("mouseleave",function(l){return r.handleMouseLeave(l)}),r.on("keydown",function(l){return r.handleSubmenuKeyDown(l)}),r}re(n,s);var t=n.prototype;return t.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.createMenu=function(){var e=new Ol(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var r=Ye("li",{className:"vjs-menu-title",textContent:bt(this.options_.title),tabIndex:-1}),a=new Y(this.player_,{el:r});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o-1&&"showing"===d.mode){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(e){for(var r=this.player().textTracks(),a=!0,o=0,l=r.length;o-1&&"showing"===d.mode){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},n}(xn);Y.registerComponent("OffTextTrackMenuItem",Ll);var Zr=function(s){function n(i,e){return void 0===e&&(e={}),e.tracks=i.textTracks(),s.call(this,i,e)||this}return re(n,s),n.prototype.createItems=function(e,r){var a;void 0===e&&(e=[]),void 0===r&&(r=xn),this.label_&&(a=this.label_+" off"),e.push(new Ll(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l-1){var f=new r(this.player_,{track:d,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});f.addClass("vjs-"+d.kind+"-menu-item"),e.push(f)}}return e},n}(eo);Y.registerComponent("TextTrackButton",Zr);var Rl=function(s){function n(i,e){var r,a=e.track,o=e.cue,l=i.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=l&&l=0;r--){var a=e[r];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(bt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var e=[];if(!this.track_)return e;var r=this.track_.cues;if(!r)return e;for(var a=0,o=r.length;a-1&&(r.label_="captions"),r.menuButton_.controlText(bt(r.label_)),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new no(this.player_,{kind:this.label_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,e,Ml)},n}(Zr);so.prototype.kinds_=["captions","subtitles"],so.prototype.controlText_="Subtitles",Y.registerComponent("SubsCapsButton",so);var Ul=function(s){function n(i,e){var r,a=e.track,o=i.audioTracks();e.label=a.label||a.language||"Unknown",e.selected=a.enabled,(r=s.call(this,i,e)||this).track=a,r.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var f=arguments.length,v=new Array(f),g=0;g=0;a--)r.push(new oo(this.player(),{rate:e[a]+"x"}));return r},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(e){var r=this.player().playbackRate(),a=this.playbackRates(),l=(a.indexOf(r)+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(e){this.update()},t.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},n}(Js);Fl.prototype.controlText_="Playback Rate",Y.registerComponent("PlaybackRateMenuButton",Fl);var Bl=function(s){function n(){return s.apply(this,arguments)||this}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(e,r,a){return void 0===e&&(e="div"),void 0===r&&(r={}),void 0===a&&(a={}),r.className||(r.className=this.buildCSSClass()),s.prototype.createEl.call(this,e,r,a)},n}(Y);Y.registerComponent("Spacer",Bl);var Up=function(s){function n(){return s.apply(this,arguments)||this}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xa0"})},n}(Bl);Y.registerComponent("CustomControlSpacer",Up);var ha=function(s){function n(){return s.apply(this,arguments)||this}return re(n,s),n.prototype.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},n}(Y);ha.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in z()&&ha.prototype.options_.children.splice(ha.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Y.registerComponent("ControlBar",ha);var jl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,"error",function(a){return r.open(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var e=this.player().error();return e?this.localize(e.message):""},n}(jr);jl.prototype.options_=gt({},jr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Y.registerComponent("ErrorDisplay",jl);var uo="vjs-text-track-settings",Hl=["#000","Black"],Vl=["#00F","Blue"],ql=["#0FF","Cyan"],Gl=["#0F0","Green"],Wl=["#F0F","Magenta"],Zl=["#F00","Red"],Kl=["#FFF","White"],zl=["#FF0","Yellow"],lo=["1","Opaque"],co=["0.5","Semi-Transparent"],Yl=["0","Transparent"],dr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Hl,Kl,Zl,Gl,Vl,zl,Wl,ql]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[lo,co,Yl]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kl,Hl,Zl,Gl,Vl,zl,Wl,ql]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(n){return"1.00"===n?null:Number(n)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[lo,co]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Yl,co,lo]}};function $l(s,n){if(n&&(s=n(s)),s&&"none"!==s)return s}dr.windowColor.options=dr.backgroundColor.options;var Bp=function(s){function n(i,e){var r;return e.temporary=!1,(r=s.call(this,i,e)||this).updateDisplay=r.updateDisplay.bind(Ne(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=Ye("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===e.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",function(){r.saveSettings(),r.close()}),r.on(r.$(".vjs-default-button"),"click",function(){r.setDefaults(),r.updateDisplay()}),Or(dr,function(a){r.on(r.$(a.selector),"change",r.updateDisplay)}),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}re(n,s);var t=n.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(e,r,a){var o=this;void 0===r&&(r=""),void 0===a&&(a="label");var l=dr[e],d=l.id.replace("%s",this.id_),f=[r,d].join(" ").trim();return["<"+a+' id="'+d+'" class="'+("label"===a?"vjs-label":"")+'">',this.localize(l.label),"",'").join("")},t.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},t.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},t.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},t.createElColors_=function(){return Ye("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return Ye("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},t.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Ye("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var e=this;return function Ah(s,n,t){return void 0===t&&(t=0),ku(s).reduce(function(i,e){return n(i,s[e],e)},t)}(dr,function(r,a,o){var l=function Np(s,n){return $l(s.options[s.options.selectedIndex].value,n)}(e.$(a.selector),a.parser);return void 0!==l&&(r[o]=l),r},{})},t.setValues=function(e){var r=this;Or(dr,function(a,o){!function Fp(s,n,t){if(n)for(var i=0;ithis.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(d=!1),d!==this.behindLiveEdge_&&(this.behindLiveEdge_=d,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,fi),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var e=this.player_.seekable(),r=[],a=e?e.length:0;a--;)r.push(e.end(a));return r.length?r.sort()[r.length-1]:1/0},t.seekableStart=function(){for(var e=this.player_.seekable(),r=[],a=e?e.length:0;a--;)r.push(e.start(a));return r.length?r.sort()[0]:0},t.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return"number"==typeof this.trackingInterval_},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(z(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},n}(Y);Y.registerComponent("LiveTracker",Vp);var pa,fo=function(n){var t=n.el();if(t.hasAttribute("src"))return n.triggerSourceset(t.src),!0;var i=n.$$("source"),e=[],r="";if(!i.length)return!1;for(var a=0;a=2&&l.push("loadeddata"),e.readyState>=3&&l.push("canplay"),e.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(d){this.trigger(d)},this)})}},t.setScrubbing=function(e){this.isScrubbing_=e},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Qn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(r){Ke(r,"Video is not ready. (Video.js)")}},t.duration=function(){var e=this;return this.el_.duration===1/0&&Di&&Pi&&0===this.el_.currentTime?(this.on("timeupdate",function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))}),NaN):this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var r=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",r),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",r)})}},t.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=P().navigator&&P().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)yi(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(r){this.trigger("fullscreenerror",r)}},0);else try{e.webkitEnterFullScreen()}catch(r){this.trigger("fullscreenerror",r)}},t.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.reset=function(){n.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(e){this.el_.controls=!!e},t.addTextTrack=function(e,r,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,r,a):s.prototype.addTextTrack.call(this,e,r,a)},t.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,e);var r=z().createElement("track");return e.kind&&(r.kind=e.kind),e.label&&(r.label=e.label),(e.language||e.srclang)&&(r.srclang=e.language||e.srclang),e.default&&(r.default=e.default),e.id&&(r.id=e.id),e.src&&(r.src=e.src),r},t.addRemoteTextTrack=function(e,r){var a=s.prototype.addRemoteTextTrack.call(this,e,r);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(e){if(s.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var r=this.$$("track"),a=r.length;a--;)(e===r[a]||e===r[a].track)&&this.el().removeChild(r[a])},t.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),P().performance&&"function"==typeof P().performance.now?e.creationTime=P().performance.now():P().performance&&P().performance.timing&&"number"==typeof P().performance.timing.navigationStart&&(e.creationTime=P().Date.now()-P().performance.timing.navigationStart),e},n}(st);ho(be,"TEST_VID",function(){if(Rr()){var s=z().createElement("video"),n=z().createElement("track");return n.kind="captions",n.srclang="en",n.label="English",s.appendChild(n),s}}),be.isSupported=function(){try{be.TEST_VID.volume=.5}catch{return!1}return!(!be.TEST_VID||!be.TEST_VID.canPlayType)},be.canPlayType=function(s){return be.TEST_VID.canPlayType(s)},be.canPlaySource=function(s,n){return be.canPlayType(s.type)},be.canControlVolume=function(){try{var s=be.TEST_VID.volume;be.TEST_VID.volume=s/2+.1;var n=s!==be.TEST_VID.volume;return n&&Ht?(P().setTimeout(function(){be&&be.prototype&&(be.prototype.featuresVolumeControl=s!==be.TEST_VID.volume)}),!1):n}catch{return!1}},be.canMuteVolume=function(){try{var s=be.TEST_VID.muted;return be.TEST_VID.muted=!s,be.TEST_VID.muted?Ur(be.TEST_VID,"muted","muted"):Xn(be.TEST_VID,"muted"),s!==be.TEST_VID.muted}catch{return!1}},be.canControlPlaybackRate=function(){if(Di&&Pi&&Pu<58)return!1;try{var s=be.TEST_VID.playbackRate;return be.TEST_VID.playbackRate=s/2+.1,s!==be.TEST_VID.playbackRate}catch{return!1}},be.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(z().createElement("video"),"src",{get:s,set:s}),Object.defineProperty(z().createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(z().createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(z().createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0},be.supportsNativeTextTracks=function(){return Qn||Ht&&Pi},be.supportsNativeVideoTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.videoTracks)},be.supportsNativeAudioTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.audioTracks)},be.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var t=s[1];ho(be.prototype,s[0],function(){return be[t]()},!0)}),be.prototype.featuresVolumeControl=be.canControlVolume(),be.prototype.movingMediaElementInDOM=!Ht,be.prototype.featuresFullscreenResize=!0,be.prototype.featuresProgressEvents=!0,be.prototype.featuresTimeupdateEvents=!0,be.patchCanPlayType=function(){_s>=4&&!Du&&!Pi&&(pa=be.TEST_VID&&be.TEST_VID.constructor.prototype.canPlayType,be.TEST_VID.constructor.prototype.canPlayType=function(s){return s&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(s)?"maybe":pa.call(this,s)})},be.unpatchCanPlayType=function(){var s=be.TEST_VID.constructor.prototype.canPlayType;return pa&&(be.TEST_VID.constructor.prototype.canPlayType=pa),s},be.patchCanPlayType(),be.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch{}}()}},be.resetMediaElement=function(s){if(s){for(var n=s.querySelectorAll("source"),t=n.length;t--;)s.removeChild(n[t]);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch{}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n,n?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n}}),["pause","load","play"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]()}}),st.withSourceHandlers(be),be.nativeSourceHandler={},be.nativeSourceHandler.canPlayType=function(s){try{return be.TEST_VID.canPlayType(s)}catch{return""}},be.nativeSourceHandler.canHandleSource=function(s,n){if(s.type)return be.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=js(s.src);return be.nativeSourceHandler.canPlayType("video/"+t)}return""},be.nativeSourceHandler.handleSource=function(s,n,t){n.setSrc(s.src)},be.nativeSourceHandler.dispose=function(){},be.registerSourceHandler(be.nativeSourceHandler),st.registerTech("Html5",be);var Jl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],po={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},mo=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};mo.forEach(function(s){var n="x"===s.charAt(0)?"x-"+s.substring(1):s;ma[s]="vjs-layout-"+n});var zp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Et=function(s){function n(i,e,r){var a;if(i.id=i.id||e.id||"vjs_video_"+Zi(),(e=_t(n.getTagSettings(i),e)).initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if("function"==typeof i.closest){var o=i.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var l=i;l&&1===l.nodeType;){if(Li(l).hasOwnProperty("lang")){e.language=l.getAttribute("lang");break}l=l.parentNode}if((a=s.call(this,null,e,r)||this).boundDocumentFullscreenChange_=function(g){return a.documentFullscreenChange_(g)},a.boundFullWindowOnEscKey_=function(g){return a.fullWindowOnEscKey(g)},a.boundUpdateStyleEl_=function(g){return a.updateStyleEl_(g)},a.boundApplyInitTime_=function(g){return a.applyInitTime_(g)},a.boundUpdateCurrentBreakpoint_=function(g){return a.updateCurrentBreakpoint_(g)},a.boundHandleTechClick_=function(g){return a.handleTechClick_(g)},a.boundHandleTechDoubleClick_=function(g){return a.handleTechDoubleClick_(g)},a.boundHandleTechTouchStart_=function(g){return a.handleTechTouchStart_(g)},a.boundHandleTechTouchMove_=function(g){return a.handleTechTouchMove_(g)},a.boundHandleTechTouchEnd_=function(g){return a.handleTechTouchEnd_(g)},a.boundHandleTechTap_=function(g){return a.handleTechTap_(g)},a.isFullscreen_=!1,a.log=Cu(a.id_),a.fsApi_=Kn,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&Li(i),a.language(a.options_.language),e.languages){var d={};Object.getOwnPropertyNames(e.languages).forEach(function(g){d[g.toLowerCase()]=e.languages[g]}),a.languages_=d}else a.languages_=n.prototype.options_.languages;a.resetCache_(),a.poster_=e.poster||"",a.controls_=!!e.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(g){if("function"!=typeof a[g])throw new Error('plugin "'+g+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),Ps(Ne(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Xt(z(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var f=ct(a.options_);e.plugins&&Object.keys(e.plugins).forEach(function(g){a[g](e.plugins[g])}),e.debug&&a.debug(!0),a.options_.playerOptions=f,a.middleware_=[],a.playbackRates(e.playbackRates),a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Lr&&a.addClass("vjs-touch-enabled"),Ht||a.addClass("vjs-workinghover"),n.players[a.id_]=Ne(a);var v=bu.split(".")[0];return a.addClass("vjs-v"+v),a.userActive(!0),a.reportUserActivity(),a.one("play",function(g){return a.listenForUserActivity_(g)}),a.on("stageclick",function(g){return a.handleStageClick_(g)}),a.on("keydown",function(g){return a.handleKeyDown(g)}),a.on("languagechange",function(g){return a.handleLanguagechange(g)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}re(n,s);var t=n.prototype;return t.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Ut(z(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ut(z(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),n.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),function pp(s){Hs[s.id()]=null}(this),Gt.names.forEach(function(r){var o=e[Gt[r].getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this)},t.createEl=function(){var r,e=this.tag,a=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();a?r=this.el_=e.parentNode:o||(r=this.el_=s.prototype.createEl.call(this,"div"));var l=Li(e);if(o){for(r=this.el_=e,e=this.tag=z().createElement("video");r.children.length;)e.appendChild(r.firstChild);ar(r,"video-js")||Oi(r,"video-js"),r.appendChild(e),a=this.playerElIngest_=r,Object.keys(r).forEach(function(E){try{e[E]=r[E]}catch{}})}if(e.setAttribute("tabindex","-1"),l.tabindex="-1",(pn||Pi&&Ou)&&(e.setAttribute("role","application"),l.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(E){o&&"class"===E||r.setAttribute(E,l[E]),o&&e.setAttribute(E,l[E])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=r.player=this,this.addClass("vjs-paused"),!0!==P().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=zu("vjs-styles-dimensions");var d=Wi(".vjs-styles-defaults"),f=Wi("head");f.insertBefore(this.styleEl_,d?d.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var v=e.getElementsByTagName("a"),g=0;g0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),g=v[1]/v[0];o=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/g:this.videoWidth()||300,l=void 0!==this.height_?this.height_:o*g,f=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(f),Yu(this.styleEl_,"\n ."+f+" {\n width: "+o+"px;\n height: "+l+"px;\n }\n\n ."+f+".vjs-fluid {\n padding-top: "+100*g+"%;\n }\n ")}else{var e="number"==typeof this.width_?this.width_:this.options_.width,r="number"==typeof this.height_?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(e>=0&&(a.width=e),r>=0&&(a.height=r))}},t.loadTech_=function(e,r){var a=this;this.tech_&&this.unloadTech_();var o=bt(e),l=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==o&&this.tag&&(st.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var d=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(d=!1);var f={source:r,autoplay:d,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Gt.names.forEach(function(g){var T=Gt[g];f[T.getterName]=a[T.privateName]}),_t(f,this.options_[o]),_t(f,this.options_[l]),_t(f,this.options_[e.toLowerCase()]),this.tag&&(f.tag=this.tag),r&&r.src===this.cache_.src&&this.cache_.currentTime>0&&(f.startTime=this.cache_.currentTime);var v=st.getTech(e);if(!v)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new v(f),this.tech_.ready(at(this,this.handleTechReady_),!0),function(n,t){n.forEach(function(i){var e=t.addRemoteTextTrack(i).track;!i.src&&i.cues&&i.cues.forEach(function(r){return e.addCue(r)})}),t.textTracks()}(this.textTracksJson_||[],this.tech_),Jl.forEach(function(g){a.on(a.tech_,g,function(T){return a["handleTech"+bt(g)+"_"](T)})}),Object.keys(po).forEach(function(g){a.on(a.tech_,g,function(T){0===a.tech_.playbackRate()&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+po[g]+"_"].bind(a),event:T}):a["handleTech"+po[g]+"_"](T)})}),this.on(this.tech_,"loadstart",function(g){return a.handleTechLoadStart_(g)}),this.on(this.tech_,"sourceset",function(g){return a.handleTechSourceset_(g)}),this.on(this.tech_,"waiting",function(g){return a.handleTechWaiting_(g)}),this.on(this.tech_,"ended",function(g){return a.handleTechEnded_(g)}),this.on(this.tech_,"seeking",function(g){return a.handleTechSeeking_(g)}),this.on(this.tech_,"play",function(g){return a.handleTechPlay_(g)}),this.on(this.tech_,"firstplay",function(g){return a.handleTechFirstPlay_(g)}),this.on(this.tech_,"pause",function(g){return a.handleTechPause_(g)}),this.on(this.tech_,"durationchange",function(g){return a.handleTechDurationChange_(g)}),this.on(this.tech_,"fullscreenchange",function(g,T){return a.handleTechFullscreenChange_(g,T)}),this.on(this.tech_,"fullscreenerror",function(g,T){return a.handleTechFullscreenError_(g,T)}),this.on(this.tech_,"enterpictureinpicture",function(g){return a.handleTechEnterPictureInPicture_(g)}),this.on(this.tech_,"leavepictureinpicture",function(g){return a.handleTechLeavePictureInPicture_(g)}),this.on(this.tech_,"error",function(g){return a.handleTechError_(g)}),this.on(this.tech_,"posterchange",function(g){return a.handleTechPosterChange_(g)}),this.on(this.tech_,"textdata",function(g){return a.handleTechTextData_(g)}),this.on(this.tech_,"ratechange",function(g){return a.handleTechRateChange_(g)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&("Html5"!==o||!this.tag)&&xs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var e=this;Gt.names.forEach(function(r){var a=Gt[r];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=function(n){var t=n.$$("track"),i=Array.prototype.map.call(t,function(r){return r.track});return Array.prototype.map.call(t,function(r){var a=Rs(r.track);return r.src&&(a.src=r.src),a}).concat(Array.prototype.filter.call(n.textTracks(),function(r){return-1===i.indexOf(r)}).map(Rs))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(e){return void 0===e&&Ke.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(e){var r=this;if(this.tech_&&"string"==typeof e){var o,a=function(){var d=r.muted();r.muted(!0);var f=function(){r.muted(d)};r.playTerminatedQueue_.push(f);var v=r.play();if(yn(v))return v.catch(function(g){throw f(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(g||""))})};if("any"!==e||this.muted()?o="muted"!==e||this.muted()?this.play():a():yn(o=this.play())&&(o=o.catch(a)),yn(o))return o.then(function(){r.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){r.trigger({type:"autoplay-failure",autoplay:e})})}},t.updateSourceCaches_=function(e){void 0===e&&(e="");var r=e,a="";"string"!=typeof r&&(r=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],r&&!a&&(a=function(n,t){if(!t)return"";if(n.cache_.source.src===t&&n.cache_.source.type)return n.cache_.source.type;var i=n.cache_.sources.filter(function(o){return o.src===t});if(i.length)return i[0].type;for(var e=n.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var r=this.currentTime();this.on("timeupdate",function o(){r!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))})},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(Ke.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?yi(this.play()):this.pause())},t.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(e.target)})||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.doubleClick||!1!==this.options_.userActions.doubleClick)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(e){var r=e.target.player;if(!r||r===this){var a=this.el(),o=z()[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(e,r){var a=this;r&&(r.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(r.isFullscreen))},t.handleTechFullscreenError_=function(e,r){this.trigger("fullscreenerror",r)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(e,r){this.ready(function(){if(e in fp)return function dp(s,n,t,i){return n[t](s.reduce(Vs(t),i))}(this.middleware_,this.tech_,e,r);if(e in gl)return ml(this.middleware_,this.tech_,e,r);try{this.tech_&&this.tech_[e](r)}catch(a){throw Ke(a),a}},!0)},t.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in cp)return function lp(s,n,t){return s.reduceRight(Vs(t),n[t]())}(this.middleware_,this.tech_,e);if(e in gl)return ml(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(r){throw void 0===this.tech_[e]?(Ke("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",r),r):"TypeError"===r.name?(Ke("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",r),this.tech_.isReady_=!1,r):(Ke(r),r)}}},t.play=function(){var e=this,r=this.options_.Promise||P().Promise;return r?new r(function(a){e.play_(a)}):this.play_()},t.play_=function(e){var r=this;void 0===e&&(e=yi),this.playCallbacks_.push(e);var a=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(l){r.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&(Qn||Ht)&&this.load());var o=this.techGet_("play");null===o?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},t.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(r){r()})},t.runPlayCallbacks_=function(e){var r=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],r.forEach(function(a){a(e)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return!1!==this.techGet_("paused")},t.played=function(){return this.techGet_("played")||or(0,0)},t.scrubbing=function(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(e){return typeof e<"u"?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=or(0,0)),e},t.bufferedPercent=function(){return rl(this.buffered(),this.duration())},t.bufferedEnd=function(){var e=this.buffered(),r=this.duration(),a=e.end(e.length-1);return a>r&&(a=r),a},t.volume=function(e){var r;return void 0!==e?(r=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=r,this.techCall_("setVolume",r),void(r>0&&this.lastVolume_(r))):(r=parseFloat(this.techGet_("volume")),isNaN(r)?1:r)},t.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(e){if(void 0!==e){var r=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==r&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},t.requestFullscreen=function(e){var r=this.options_.Promise||P().Promise;if(r){var a=this;return new r(function(o,l){function d(){a.off("fullscreenerror",v),a.off("fullscreenchange",f)}function f(){d(),o()}function v(T,E){d(),l(E)}a.one("fullscreenchange",f),a.one("fullscreenerror",v);var g=a.requestFullscreenHelper_(e);g&&(g.then(d,d),g.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(e){var a,r=this;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(a=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return r.isFullscreen(!0)},function(){return r.isFullscreen(!1)}),o}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var e=this.options_.Promise||P().Promise;if(e){var r=this;return new e(function(a,o){function l(){r.off("fullscreenerror",f),r.off("fullscreenchange",d)}function d(){l(),a()}function f(g,T){l(),o(T)}r.one("fullscreenchange",d),r.one("fullscreenerror",f);var v=r.exitFullscreenHelper_();v&&(v.then(l,l),v.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var r=z()[this.fsApi_.exitFullscreen]();return r&&yi(r.then(function(){return e.isFullscreen(!1)})),r}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=z().documentElement.style.overflow,Xt(z(),"keydown",this.boundFullWindowOnEscKey_),z().documentElement.style.overflow="hidden",Oi(z().body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(e){De().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ut(z(),"keydown",this.boundFullWindowOnEscKey_),z().documentElement.style.overflow=this.docOrigOverflow,mn(z().body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in z()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in z())return z().exitPictureInPicture()},t.handleKeyDown=function(e){var l,d,r=this.options_.userActions;r&&r.hotkeys&&(d=(l=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),l.isContentEditable||("input"===d?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(l.type):-1!==["textarea"].indexOf(d))||("function"==typeof r.hotkeys?r.hotkeys.call(this,e):this.handleHotkeys(e)))},t.handleHotkeys=function(e){var r=this.options_.userActions?this.options_.userActions.hotkeys:{},a=r.fullscreenKey,l=r.muteKey,d=void 0===l?function(x){return De().isEventKey(x,"m")}:l,f=r.playPauseKey,v=void 0===f?function(x){return De().isEventKey(x,"k")||De().isEventKey(x,"Space")}:f;if((void 0===a?function(x){return De().isEventKey(x,"f")}:a).call(this,e)){e.preventDefault(),e.stopPropagation();var g=Y.getComponent("FullscreenToggle");!1!==z()[this.fsApi_.fullscreenEnabled]&&g.prototype.handleClick.call(this,e)}else d.call(this,e)?(e.preventDefault(),e.stopPropagation(),Y.getComponent("MuteToggle").prototype.handleClick.call(this,e)):v.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Y.getComponent("PlayToggle").prototype.handleClick.call(this,e))},t.canPlayType=function(e){for(var r,a=0,o=this.options_.techOrder;a"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=_p(e);if(o.length){if(this.changingSrc_=!0,r||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),op(this,o[0],function(f,v){if(a.middleware_=v,r||(a.cache_.sources=o),a.updateSourceCaches_(f),a.src_(f))return o.length>1?a.handleSrc_(o.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void a.triggerReady());!function up(s,n){s.forEach(function(t){return t.setTech&&t.setTech(n)})}(v,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},d=function(){a.off("error",l)};this.one("error",l),this.one("playing",d),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",d)}}}else this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},t.src=function(e){return this.handleSrc_(e,!1)},t.src_=function(e){var r=this,a=this.selectSource([e]);return!a||(function(n,t){return bt(n)===bt(t)}(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){r.changingSrc_=!1}),!1))},t.load=function(){this.techCall_("load")},t.reset=function(){var e=this,r=this.options_.Promise||P().Promise;this.paused()||!r?this.doReset_():yi(this.play().then(function(){return e.doReset_()}))},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Mi(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,r=e.durationDisplay,a=e.remainingTimeDisplay;r&&r.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var e=this.currentSource(),r=[];return 0!==Object.keys(e).length&&r.push(e),this.cache_.sources||r},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var r;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),r=!1):this.options_.autoplay=!!e,r=typeof r>"u"?this.options_.autoplay:r,this.tech_&&this.techCall_("setAutoplay",r)},t.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(e){var r=this;if(void 0===e)return this.error_||null;if(Gi("beforeerror").forEach(function(o){var l=o(r,e);Ii(l)&&!Array.isArray(l)||"string"==typeof l||"number"==typeof l||null===l?e=l:r.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){var a=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new qt(e),this.addClass("vjs-error"),Ke.error("(CODE:"+this.error_.code+" "+qt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Gi("error").forEach(function(o){return o(r,r.error_)})},t.reportUserActivity=function(e){this.userActivity_=!0},t.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(r){r.stopPropagation(),r.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var e,r,a,o=at(this,this.reportUserActivity),f=function(E){o(),this.clearInterval(e)};this.on("mousedown",function(){o(),this.clearInterval(e),e=this.setInterval(o,250)}),this.on("mousemove",function(E){(E.screenX!==r||E.screenY!==a)&&(r=E.screenX,a=E.screenY,o())}),this.on("mouseup",f),this.on("mouseleave",f);var g,v=this.getChild("controlBar");v&&!Ht&&!Di&&(v.on("mouseenter",function(T){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),v.on("mouseleave",function(T){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);var T=this.options_.inactivityTimeout;T<=0||(g=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},T))}},250)},t.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.addTextTrack=function(e,r,a){if(this.tech_)return this.tech_.addTextTrack(e,r,a)},t.addRemoteTextTrack=function(e,r){if(this.tech_)return this.tech_.addRemoteTextTrack(e,r)},t.removeRemoteTextTrack=function(e){void 0===e&&(e={});var a=e.track;if(a||(a=e),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Mi(this)&&this.trigger("languagechange"))},t.languages=function(){return ct(n.prototype.options_.languages,this.languages_)},t.toJSON=function(){var e=ct(this.options_),r=e.tracks;e.tracks=[];for(var a=0;a"):function(){}},Ki=1/30,bi=.1,rd=function(n,t){var e,i=[];if(n&&n.length)for(e=0;e=t})},xa=function(n,t){return rd(n,function(i){return i-Ki>=t})},nd=function(n){var t=[];if(!n||!n.length)return"";for(var i=0;i "+n.end(i));return t.join(", ")},cr=function(n){for(var t=[],i=0;ia)){if(t>r&&t<=a){i+=a-t;continue}i+=a-r}}return i},sd=U.createTimeRange,_o=function(n,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(e){"PART"===e.type&&(i+=n.partTargetDuration)}),i},yo=function(n){return(n.segments||[]).reduce(function(t,i,e){return i.parts?i.parts.forEach(function(r,a){t.push({duration:r.duration,segmentIndex:e,partIndex:a,part:r,segment:i})}):t.push({duration:i.duration,segmentIndex:e,partIndex:null,segment:i,part:null}),t},[])},od=function(n){var t=n.segments&&n.segments.length&&n.segments[n.segments.length-1];return t&&t.parts||[]},ud=function(n){var t=n.preloadSegment;if(t){var i=t.parts;return(t.preloadHints||[]).reduce(function(a,o){return a+("PART"===o.type?1:0)},0)+(i&&i.length?i.length:0)}},ld=function(n,t){if(t.endList)return 0;if(n&&n.suggestedPresentationDelay)return n.suggestedPresentationDelay;var i=od(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},dd=function(n,t,i){if(typeof t>"u"&&(t=n.mediaSequence+n.segments.length),t"u"){if(n.totalDuration)return n.totalDuration;if(!n.endList)return P()[1/0]}return dd(n,t,i)},En=function(n){var t=n.defaultDuration,i=n.durationList,e=n.startIndex,r=n.endIndex,a=0;if(e>r){var o=[r,e];e=o[0],r=o[1]}if(e<0){for(var l=e;lDate.now()},To=function(n){return n.excludeUntil&&n.excludeUntil===1/0},Sa=function(n){var t=hd(n);return!n.disabled&&!t},pd=function(n,t){return t.attributes&&t.attributes[n]},bo=function(n,t){if(1===n.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===n.playlists.filter(function(e){return!!Sa(e)&&(e.attributes.BANDWIDTH||0)0)for(var T=f-1;T>=0;T--){var E=d[T];if(l+=E.duration,o){if(l<0)continue}else if(l+Ki<=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a-En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:T})}}return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:i}}if(f<0){for(var x=f;x<0;x++)if((l-=t.targetDuration)<0)return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:i};f=0}for(var S=f;S0)continue}else if(l-Ki>=0)continue;return{partIndex:N.partIndex,segmentIndex:N.segmentIndex,startTime:a+En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:S})}}return{segmentIndex:d[d.length-1].segmentIndex,partIndex:d[d.length-1].partIndex,startTime:i}},isEnabled:Sa,isDisabled:function(n){return n.disabled},isBlacklisted:hd,isIncompatible:To,playlistEnd:fd,isAes:function(n){for(var t=0;t-1&&o!==a.length-1&&(i._HLS_part=o),(o>-1||a.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var l=new(P().URL)(n);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(d){i.hasOwnProperty(d)&&l.searchParams.set(d,i[d])}),n=l.toString()}return n}(a,r)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},t.playlistRequestError=function(e,r,a){var o=r.uri,l=r.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(e){var r=this,a=e.url;return function(n){var t=n.onwarn,i=n.oninfo,e=n.manifestString,r=n.customTagParsers,a=void 0===r?[]:r,o=n.customTagMappers,l=void 0===o?[]:o,d=n.experimentalLLHLS,f=new tf;t&&f.on("warn",t),i&&f.on("info",i),a.forEach(function(x){return f.addParser(x)}),l.forEach(function(x){return f.addTagMapper(x)}),f.push(e),f.end();var v=f.manifest;if(d||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(x){v.hasOwnProperty(x)&&delete v[x]}),v.segments&&v.segments.forEach(function(x){["parts","preloadHints"].forEach(function(S){x.hasOwnProperty(S)&&delete x[S]})})),!v.targetDuration){var g=10;v.segments&&v.segments.length&&(g=v.segments.reduce(function(x,S){return Math.max(x,S.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+g),v.targetDuration=g}var T=od(v);if(T.length&&!v.partTargetDuration){var E=T.reduce(function(x,S){return Math.max(x,S.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+E),gd.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),v.partTargetDuration=E}return v}({onwarn:function(d){return r.logger_("m3u8-parser warn for "+a+": "+d.message)},oninfo:function(d){return r.logger_("m3u8-parser info for "+a+": "+d.message)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(e){var r=e.playlistString,a=e.playlistObject,o=e.url,l=e.id;this.request=null,this.state="HAVE_METADATA";var d=a||this.parseManifest_({url:o,manifestString:r});d.lastRequest=Date.now(),vd({playlist:d,uri:o,id:l});var f=Eo(this.master,d);this.targetDuration=d.partTargetDuration||d.targetDuration,this.pendingMedia_=null,f?(this.master=f,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!f)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),P().clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e,r){var a=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(P().clearTimeout(this.finalRenditionTimeout),r){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=P().setTimeout(this.media.bind(this,e,!1),o)}else{var l=this.state,d=!this.media_||e.id!==this.media_.id,f=this.master.playlists[e.id];if(f&&f.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(d&&(this.trigger("mediachanging"),this.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),d){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(v,g){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=ba(a.handleManifestRedirects,e.resolvedUri,g),v)return a.playlistRequestError(a.request,e,l);a.haveMetadata({playlistString:g.responseText,url:e.uri,id:e.id}),a.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")}})}}},t.pause=function(){this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},t.load=function(e){var r=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){r.mediaUpdateTimeout=null,r.load()},o)}else this.started?this.trigger(a&&!a.endList?"mediaupdatetimeout":"loadedplaylist"):this.start()},t.updateMediaUpdateTimeout_=function(e){var r=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=P().setTimeout(function(){r.mediaUpdateTimeout=null,r.trigger("mediaupdatetimeout"),r.updateMediaUpdateTimeout_(e)},e))},t.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=P().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(r,a){if(e.request){if(e.request=null,r)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=ba(e.handleManifestRedirects,e.src,a);var o=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(o)}})},t.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},t.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,_d(this.master,this.srcUri()),e.playlists.forEach(function(a){a.segments=Td(a),a.segments.forEach(function(o){yd(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var r=this.srcUri()||P().location.href;this.master=function(n,t){var i=So(0,t),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:P().location.href,resolvedUri:P().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return e.playlists[i]=e.playlists[0],e.playlists[t]=e.playlists[0],e}(0,r),this.haveMetadata({playlistObject:e,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},n}(U.EventTarget),gm=U.xhr,vm=U.mergeOptions,ko=function(n,t,i,e){var r="arraybuffer"===n.responseType?n.response:n.responseText;!t&&r&&(n.responseTime=Date.now(),n.roundTripTime=n.responseTime-n.requestTime,n.bytesReceived=r.byteLength||r.length,n.bandwidth||(n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3))),i.headers&&(n.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(n.timedout=!0),!t&&!n.aborted&&200!==i.statusCode&&206!==i.statusCode&&0!==i.statusCode&&(t=new Error("XHR Failed with a response of: "+(n&&(r||n.responseText)))),e(t,n)},xd=function(){var n=function t(i,e){i=vm({timeout:45e3},i);var r=t.beforeRequest||U.Vhs.xhr.beforeRequest;if(r&&"function"==typeof r){var a=r(i);a&&(i=a)}var l=(!0===U.Vhs.xhr.original?gm:U.Vhs.xhr)(i,function(f,v){return ko(l,f,v,e)}),d=l.abort;return l.abort=function(){return l.aborted=!0,d.apply(l,arguments)},l.uri=i.uri,l.requestTime=Date.now(),l};return n.original=!0,n},Ao=function(n){var t={};return n.byterange&&(t.Range=function(n){return"bytes="+n.offset+"-"+("bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1)}(n.byterange)),t},ym=function(n,t){return n.start(t)+"-"+n.end(t)},Tm=function(n,t){var i=n.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},bm=function(n){return n>=32&&n<126?String.fromCharCode(n):"."},Sd=function(n){var t={};return Object.keys(n).forEach(function(i){var e=n[i];t[i]=ArrayBuffer.isView(e)?{bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:e}),t},Ca=function(n){var t=n.byterange||{length:1/0,offset:0};return[t.length,t.offset,n.resolvedUri].join(",")},Ed=function(n){return n.resolvedUri},Cd=function(n){for(var t=Array.prototype.slice.call(n),i=16,e="",o=0;o"u"||!i||!a)return f({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!d.hasStarted_)return f({message:"player must be playing a live stream to start buffering"});if(!function(n){if(!n.segments||0===n.segments.length)return!1;for(var t=0;tnew Date(l.getTime()+1e3*d)?null:(i>l&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:Yt.duration(t,t.mediaSequence+t.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})}(t,i);if(!v)return f({message:t+" was not found in the stream"});var g=v.segment,T=function(n,t){var i,e;try{i=new Date(n),e=new Date(t)}catch{}var r=i.getTime();return(e.getTime()-r)/1e3}(g.dateTimeObject,t);if("estimate"===v.type)return 0===r?f({message:t+" is not buffered yet. Try again"}):(a(v.estimatedStart+T),void d.one("seeked",function(){s({programTime:t,playlist:i,retryCount:r-1,seekTo:a,pauseAfterSeek:l,tech:d,callback:f})}));var E=g.start+T;d.one("seeked",function(){return f(null,d.currentTime())}),l&&d.pause(),a(E)},wo=function(n,t){if(4===n.readyState)return t()},Ad=U.mergeOptions,wd=function(n,t){if(!bd(n,t)||n.sidx&&t.sidx&&(n.sidx.offset!==t.sidx.offset||n.sidx.length!==t.sidx.length))return!1;if(!n.sidx&&t.sidx||n.sidx&&!t.sidx||n.segments&&!t.segments||!n.segments&&t.segments)return!1;if(!n.segments&&!t.segments)return!0;for(var i=0;i=N+S)return f(v,{response:E.subarray(S,S+N),status:g.status,uri:g.uri});o.request=o.vhs_.xhr({uri:d,responseType:"arraybuffer",headers:Ao({byterange:e.sidx.byterange})},f)})}else this.mediaRequest_=P().setTimeout(function(){return a(!1)},0)},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},P().clearTimeout(this.minimumUpdatePeriodTimeout_),P().clearTimeout(this.mediaRequest_),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e){var r=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var o=!this.media_||e.id!==this.media_.id;if(o&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(o&&(this.trigger("mediachanging"),this.trigger("mediachange")));o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,a,function(l){r.haveMetadata({startingState:a,playlist:e})}))},t.haveMetadata=function(e){var r=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),this.trigger("HAVE_MASTER"===r?"loadedmetadata":"mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(P().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},t.load=function(e){var r=this;P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){return r.load()},o)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},t.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(r,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=P().setTimeout(function(){return e.haveMaster_()},0)},t.requestMaster_=function(e){var r=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(!r.requestErrored_(a,o)){var l=o.responseText!==r.masterPlaylistLoader_.masterXml_;return r.masterPlaylistLoader_.masterXml_=o.responseText,r.masterLoaded_=o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):Date.now(),r.masterPlaylistLoader_.srcUrl=ba(r.handleManifestRedirects,r.masterPlaylistLoader_.srcUrl,o),l?(r.handleMaster_(),void r.syncClientServerClock_(function(){return e(o,l)})):e(o,l)}"HAVE_NOTHING"===r.state&&(r.started=!1)})},t.syncClientServerClock_=function(e){var r=this,a=function(n){return function(n){var t=Tt(n,"UTCTiming")[0];if(!t)return null;var i=Mt(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i}(mu(n))}(this.masterPlaylistLoader_.masterXml_);return null===a?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===a.method?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:pi(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(r.request){if(o)return r.masterPlaylistLoader_.clientOffset_=r.masterLoaded_-Date.now(),e();var d;d="HEAD"===a.method?l.responseHeaders&&l.responseHeaders.date?Date.parse(l.responseHeaders.date):r.masterLoaded_:Date.parse(l.responseText),r.masterPlaylistLoader_.clientOffset_=d-Date.now(),e()}}))},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,r=function(n){var i=n.srcUrl,o=function(n,t){void 0===t&&(t={});var i=function(n,t){void 0===t&&(t={});var i=t,e=i.manifestUri,r=void 0===e?"":e,a=i.NOW,o=void 0===a?Date.now():a,l=i.clientOffset,d=void 0===l?0:l,f=Tt(n,"Period");if(!f.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var v=Tt(n,"Location"),g=Mt(n),T=Wn([r],Tt(n,"BaseURL"));g.type=g.type||"static",g.sourceDuration=g.mediaPresentationDuration||0,g.NOW=o,g.clientOffset=d,v.length&&(g.locations=v.map(ls));var E=[];return f.forEach(function(x,S){var N=Mt(x),F=E[S-1];N.start=function(n){var t=n.attributes,i=n.priorPeriodAttributes;return"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==n.mpdType?null:0}({attributes:N,priorPeriodAttributes:F?F.attributes:null,mpdType:g.type}),E.push({node:x,attributes:N})}),{locations:g.locations,representationInfo:qn(E.map(Hf(g,T)))}}(mu(n),t),e=function(n){return n.map(Lf)}(i.representationInfo);return Cf({dashPlaylists:e,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}(n.masterXml,{manifestUri:i,clientOffset:n.clientOffset,sidxMapping:n.sidxMapping,previousManifest:n.previousManifest});return _d(o,i),o}({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(r=function(n,t,i){for(var e=!0,r=Ad(n,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a-1)},this.trigger=function(p){var h,m,_,y;if(h=c[p])if(2===arguments.length)for(_=h.length,m=0;m<_;++m)h[m].call(this,arguments[1]);else{for(y=[],m=arguments.length,m=1;m"u")){for(b in Pe)Pe.hasOwnProperty(b)&&(Pe[b]=[b.charCodeAt(0),b.charCodeAt(1),b.charCodeAt(2),b.charCodeAt(3)]);ot=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),Je=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Nt=new Uint8Array([0,0,0,1]),fr=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ai=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),si={video:fr,audio:ai},hr=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Fi=new Uint8Array([0,0,0,0,0,0,0,0]),Bi=new Uint8Array([0,0,0,0,0,0,0,0]),pr=Bi,mr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),gc=Bi,Ei=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(c){var m,_,p=[],h=0;for(m=1;m>>1,c.samplingfrequencyindex<<7|c.channelcount<<3,6,1,2]))},d=function(){return a(Pe.ftyp,ot,Nt,ot,Je)},q=function(c){return a(Pe.hdlr,si[c])},f=function(c){return a(Pe.mdat,c)},G=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,c.duration>>>24&255,c.duration>>>16&255,c.duration>>>8&255,255&c.duration,85,196,0,0]);return c.samplerate&&(p[12]=c.samplerate>>>24&255,p[13]=c.samplerate>>>16&255,p[14]=c.samplerate>>>8&255,p[15]=255&c.samplerate),a(Pe.mdhd,p)},j=function(c){return a(Pe.mdia,G(c),q(c.type),g(c))},v=function(c){return a(Pe.mfhd,new Uint8Array([0,0,0,0,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c]))},g=function(c){return a(Pe.minf,"video"===c.type?a(Pe.vmhd,Ei):a(Pe.smhd,Fi),o(),he(c))},T=function(c,p){for(var h=[],m=p.length;m--;)h[m]=ye(p[m]);return a.apply(null,[Pe.moof,v(c)].concat(h))},E=function(c){for(var p=c.length,h=[];p--;)h[p]=N(c[p]);return a.apply(null,[Pe.moov,S(4294967295)].concat(h).concat(x(c)))},x=function(c){for(var p=c.length,h=[];p--;)h[p]=ge(c[p]);return a.apply(null,[Pe.mvex].concat(h))},S=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(Pe.mvhd,p)},ne=function(c){var m,_,p=c.samples||[],h=new Uint8Array(4+p.length);for(_=0;_>>8),y.push(255&m[I].byteLength),y=y.concat(Array.prototype.slice.call(m[I]));for(I=0;I<_.length;I++)k.push((65280&_[I].byteLength)>>>8),k.push(255&_[I].byteLength),k=k.concat(Array.prototype.slice.call(_[I]));if(L=[Pe.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&h.width)>>8,255&h.width,(65280&h.height)>>8,255&h.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(Pe.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([m.length],y,[_.length],k))),a(Pe.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var O=h.sarRatio[0],M=h.sarRatio[1];L.push(a(Pe.pasp,new Uint8Array([(4278190080&O)>>24,(16711680&O)>>16,(65280&O)>>8,255&O,(4278190080&M)>>24,(16711680&M)>>16,(65280&M)>>8,255&M])))}return a.apply(null,L)},c=function(h){return a(Pe.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&h.channelcount)>>8,255&h.channelcount,(65280&h.samplesize)>>8,255&h.samplesize,0,0,0,0,(65280&h.samplerate)>>8,255&h.samplerate,0,0]),l(h))},F=function(c){var p=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,0,(4278190080&c.duration)>>24,(16711680&c.duration)>>16,(65280&c.duration)>>8,255&c.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&c.width)>>8,255&c.width,0,0,(65280&c.height)>>8,255&c.height,0,0]);return a(Pe.tkhd,p)},ye=function(c){var p,h,m,_,k,I;return p=a(Pe.tfhd,new Uint8Array([0,0,0,58,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),k=Math.floor(c.baseMediaDecodeTime/r),I=Math.floor(c.baseMediaDecodeTime%r),h=a(Pe.tfdt,new Uint8Array([1,0,0,0,k>>>24&255,k>>>16&255,k>>>8&255,255&k,I>>>24&255,I>>>16&255,I>>>8&255,255&I])),"audio"===c.type?(m=$e(c,92),a(Pe.traf,p,h,m)):(_=ne(c),m=$e(c,_.length+92),a(Pe.traf,p,h,m,_))},N=function(c){return c.duration=c.duration||4294967295,a(Pe.trak,F(c),j(c))},ge=function(c){var p=new Uint8Array([0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==c.type&&(p[p.length-1]=0),a(Pe.trex,p)},function(){var b,c,p;p=function(m,_){var y=0,k=0,I=0,L=0;return m.length&&(void 0!==m[0].duration&&(y=1),void 0!==m[0].size&&(k=2),void 0!==m[0].flags&&(I=4),void 0!==m[0].compositionTimeOffset&&(L=8)),[0,0,y|k|I|L,1,(4278190080&m.length)>>>24,(16711680&m.length)>>>16,(65280&m.length)>>>8,255&m.length,(4278190080&_)>>>24,(16711680&_)>>>16,(65280&_)>>>8,255&_]},c=function(m,_){var y,k,I,L,O,M;for(I=p(L=m.samples||[],_+=20+16*L.length),(k=new Uint8Array(I.length+16*L.length)).set(I),y=I.length,M=0;M>>24,k[y++]=(16711680&O.duration)>>>16,k[y++]=(65280&O.duration)>>>8,k[y++]=255&O.duration,k[y++]=(4278190080&O.size)>>>24,k[y++]=(16711680&O.size)>>>16,k[y++]=(65280&O.size)>>>8,k[y++]=255&O.size,k[y++]=O.flags.isLeading<<2|O.flags.dependsOn,k[y++]=O.flags.isDependedOn<<6|O.flags.hasRedundancy<<4|O.flags.paddingValue<<1|O.flags.isNonSyncSample,k[y++]=61440&O.flags.degradationPriority,k[y++]=15&O.flags.degradationPriority,k[y++]=(4278190080&O.compositionTimeOffset)>>>24,k[y++]=(16711680&O.compositionTimeOffset)>>>16,k[y++]=(65280&O.compositionTimeOffset)>>>8,k[y++]=255&O.compositionTimeOffset;return a(Pe.trun,k)},b=function(m,_){var y,k,I,L,O,M;for(I=p(L=m.samples||[],_+=20+8*L.length),(y=new Uint8Array(I.length+8*L.length)).set(I),k=I.length,M=0;M>>24,y[k++]=(16711680&O.duration)>>>16,y[k++]=(65280&O.duration)>>>8,y[k++]=255&O.duration,y[k++]=(4278190080&O.size)>>>24,y[k++]=(16711680&O.size)>>>16,y[k++]=(65280&O.size)>>>8,y[k++]=255&O.size;return a(Pe.trun,y)},$e=function(m,_){return"audio"===m.type?b(m,_):c(m,_)}}();var Vo,Go,Wo,Na,Zo,_c,yc,Tc,Dn_mdat=f,Dn_moof=T,vc=function(c,p){var h={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return h.dataOffset=p,h.compositionTimeOffset=c.pts-c.dts,h.duration=c.duration,h.size=4*c.length,h.size+=c.byteLength,c.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},zi=[33,16,5,32,164,27],Ho=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],et=function(c){for(var p=[];c--;)p.push(0);return p};Go=function(c){return 9e4*c},Wo=function(c,p){return c*p},Na=function(c){return c/9e4},Zo=function(c,p){return c/p},_c=function(c,p){return Go(Zo(c,p))},yc=function(c,p){return Wo(Na(c),p)},Tc=function(c,p,h){return Na(h?c:c-p)};var Qe_secondsToVideoTs=Go,Qe_videoTsToSeconds=Na,Qe_audioTsToVideoTs=_c,Qe_videoTsToAudioTs=yc,Qe_metadataTsToSeconds=Tc,Fa_prefixWithSilence=function(c,p,h,m){var _,O,M,W,y=0,k=0,I=0,L=0;if(p.length&&(_=Qe_audioTsToVideoTs(c.baseMediaDecodeTime,c.samplerate),y=Math.ceil(9e4/(c.samplerate/1024)),h&&m&&(k=_-Math.max(h,m),L=(I=Math.floor(k/y))*y),!(I<1||L>45e3))){for((O=function(){if(!Vo){var c={96e3:[zi,[227,64],et(154),[56]],88200:[zi,[231],et(170),[56]],64e3:[zi,[248,192],et(240),[56]],48e3:[zi,[255,192],et(268),[55,148,128],et(54),[112]],44100:[zi,[255,192],et(268),[55,163,128],et(84),[112]],32e3:[zi,[255,192],et(268),[55,234],et(226),[112]],24e3:[zi,[255,192],et(268),[55,255,128],et(268),[111,112],et(126),[224]],16e3:[zi,[255,192],et(268),[55,255,128],et(268),[111,255],et(269),[223,108],et(195),[1,192]],12e3:[Ho,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,253,128],et(259),[56]],11025:[Ho,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,255,192],et(268),[55,175,128],et(108),[112]],8e3:[Ho,et(268),[3,121,16],et(47),[7]]};Vo=function(c){return Object.keys(c).reduce(function(p,h){return p[h]=new Uint8Array(c[h].reduce(function(m,_){return m.concat(_)},[])),p},{})}(c)}return Vo}()[c.samplerate])||(O=p[0].data),M=0;M=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(b),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ji.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ji.prototype.addText=function(b){this.rows[this.rowIdx]+=b},ji.prototype.backspace=function(){if(!this.isEmpty()){var b=this.rows[this.rowIdx];this.rows[this.rowIdx]=b.substr(0,b.length-1)}};var ja=function(c,p,h){this.serviceNum=c,this.text="",this.currentWindow=new ji(-1),this.windows=[],this.stream=h,"string"==typeof p&&this.createTextDecoder(p)};ja.prototype.init=function(b,c){this.startPts=b;for(var p=0;p<8;p++)this.windows[p]=new ji(p),"function"==typeof c&&(this.windows[p].beforeRowOverflow=c)},ja.prototype.setCurrentWindow=function(b){this.currentWindow=this.windows[b]},ja.prototype.createTextDecoder=function(b){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(b)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+b+" encoding. "+c})}};var ut=function b(c){c=c||{},b.prototype.init.call(this);var _,p=this,h=c.captionServices||{},m={};Object.keys(h).forEach(function(y){_=h[y],/^SERVICE/.test(y)&&(m[y]=_.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(y){3===y.type?(p.new708Packet(),p.add708Bytes(y)):(null===p.current708Packet&&p.new708Packet(),p.add708Bytes(y))}};ut.prototype=new n,ut.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ut.prototype.add708Bytes=function(b){var c=b.ccData,p=c>>>8,h=255&c;this.current708Packet.ptsVals.push(b.pts),this.current708Packet.data.push(p),this.current708Packet.data.push(h)},ut.prototype.push708Packet=function(){var b=this.current708Packet,c=b.data,p=null,h=null,m=0,_=c[m++];for(b.seq=_>>6,b.sizeCode=63&_;m>5)&&h>0&&(p=_=c[m++]),this.pushServiceBlock(p,m,h),h>0&&(m+=h-1)},ut.prototype.pushServiceBlock=function(b,c,p){var h,m=c,_=this.current708Packet.data,y=this.services[b];for(y||(y=this.initService(b,m));m>5,_.rowLock=(16&h)>>4,_.columnLock=(8&h)>>3,_.priority=7&h,h=p[++b],_.relativePositioning=(128&h)>>7,_.anchorVertical=127&h,h=p[++b],_.anchorHorizontal=h,h=p[++b],_.anchorPoint=(240&h)>>4,_.rowCount=15&h,h=p[++b],_.columnCount=63&h,h=p[++b],_.windowStyle=(56&h)>>3,_.penStyle=7&h,_.virtualRowCount=_.rowCount+1,b},ut.prototype.setWindowAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.winAttr;return h=p[++b],m.fillOpacity=(192&h)>>6,m.fillRed=(48&h)>>4,m.fillGreen=(12&h)>>2,m.fillBlue=3&h,h=p[++b],m.borderType=(192&h)>>6,m.borderRed=(48&h)>>4,m.borderGreen=(12&h)>>2,m.borderBlue=3&h,h=p[++b],m.borderType+=(128&h)>>5,m.wordWrap=(64&h)>>6,m.printDirection=(48&h)>>4,m.scrollDirection=(12&h)>>2,m.justify=3&h,h=p[++b],m.effectSpeed=(240&h)>>4,m.effectDirection=(12&h)>>2,m.displayEffect=3&h,b},ut.prototype.flushDisplayed=function(b,c){for(var p=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&p.push(c.windows[h].getText());c.endPts=b,c.text=p.join("\n\n"),this.pushCaption(c),c.startPts=b},ut.prototype.pushCaption=function(b){""!==b.text&&(this.trigger("data",{startPts:b.startPts,endPts:b.endPts,text:b.text,stream:"cc708_"+b.serviceNum}),b.text="",b.startPts=b.endPts)},ut.prototype.displayWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=1);return b},ut.prototype.hideWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=0);return b},ut.prototype.toggleWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible^=1);return b},ut.prototype.clearWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].clearText();return b},ut.prototype.deleteWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].reset();return b},ut.prototype.setPenAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penAttr;return h=p[++b],m.textTag=(240&h)>>4,m.offset=(12&h)>>2,m.penSize=3&h,h=p[++b],m.italics=(128&h)>>7,m.underline=(64&h)>>6,m.edgeType=(56&h)>>3,m.fontStyle=7&h,b},ut.prototype.setPenColor=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penColor;return h=p[++b],m.fgOpacity=(192&h)>>6,m.fgRed=(48&h)>>4,m.fgGreen=(12&h)>>2,m.fgBlue=3&h,h=p[++b],m.bgOpacity=(192&h)>>6,m.bgRed=(48&h)>>4,m.bgGreen=(12&h)>>2,m.bgBlue=3&h,h=p[++b],m.edgeRed=(48&h)>>4,m.edgeGreen=(12&h)>>2,m.edgeBlue=3&h,b},ut.prototype.setPenLocation=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=p[++b],m.row=15&h,h=p[++b],m.column=63&h,b},ut.prototype.reset=function(b,c){var p=this.getPts(b);return this.flushDisplayed(p,c),this.initService(c.serviceNum,b)};var ay={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ha=function(c){return null===c?"":(c=ay[c]||c,String.fromCharCode(c))},sy=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],gr=function(){for(var c=[],p=15;p--;)c.push("");return c},mt=function b(c,p){b.prototype.init.call(this),this.field_=c||0,this.dataChannel_=p||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(h){var m,_,y,k,I;if((m=32639&h.ccData)!==this.lastControlCode_){if(4096==(61440&m)?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),y=m>>>8,k=255&m,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),_=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=_,this.startPts_=h.pts;else if(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(m===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=gr();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=gr();else if(m===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(h.pts),this.displayed_=gr()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(y,k))I=Ha((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isExtCharacter(y,k))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),I=Ha((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isMidRowCode(y,k))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,14==(14&k)&&this.addFormatting(h.pts,["i"]),1==(1&k)&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(y,k))this.column_+=3&k;else if(this.isPAC(y,k)){var L=sy.indexOf(7968&m);"rollUp"===this.mode_&&(L-this.rollUpRows_+1<0&&(L=this.rollUpRows_-1),this.setRollUp(h.pts,L)),L!==this.row_&&(this.clearFormatting(h.pts),this.row_=L),1&k&&-1===this.formatting_.indexOf("u")&&this.addFormatting(h.pts,["u"]),16==(16&m)&&(this.column_=4*((14&m)>>1)),this.isColorPAC(k)&&14==(14&k)&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(y)&&(0===k&&(k=null),I=Ha(y),I+=Ha(k),this[this.mode_](h.pts,I),this.column_+=I.length)}else this.lastControlCode_=null}};mt.prototype=new n,mt.prototype.flushDisplayed=function(b){var c=this.displayed_.map(function(p,h){try{return p.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");c.length&&this.trigger("data",{startPts:this.startPts_,endPts:b,text:c,stream:this.name_})},mt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=gr(),this.nonDisplayed_=gr(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},mt.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},mt.prototype.isSpecialCharacter=function(b,c){return b===this.EXT_&&c>=48&&c<=63},mt.prototype.isExtCharacter=function(b,c){return(b===this.EXT_+1||b===this.EXT_+2)&&c>=32&&c<=63},mt.prototype.isMidRowCode=function(b,c){return b===this.EXT_&&c>=32&&c<=47},mt.prototype.isOffsetControlCode=function(b,c){return b===this.OFFSET_&&c>=33&&c<=35},mt.prototype.isPAC=function(b,c){return b>=this.BASE_&&b=64&&c<=127},mt.prototype.isColorPAC=function(b){return b>=64&&b<=79||b>=96&&b<=127},mt.prototype.isNormalChar=function(b){return b>=32&&b<=127},mt.prototype.setRollUp=function(b,c){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(b),this.nonDisplayed_=gr(),this.displayed_=gr()),void 0!==c&&c!==this.row_)for(var p=0;p"},"");this[this.mode_](b,p)},mt.prototype.clearFormatting=function(b){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(p,h){return p+""},"");this.formatting_=[],this[this.mode_](b,c)}},mt.prototype.popOn=function(b,c){var p=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=p+=c},mt.prototype.rollUp=function(b,c){var p=this.displayed_[this.row_];this.displayed_[this.row_]=p+=c},mt.prototype.shiftRowsUp_=function(){var b;for(b=0;bp&&(h=-1);Math.abs(p-c)>4294967296;)c+=8589934592*h;return c},Sc=function b(c){var p,h;b.prototype.init.call(this),this.type_=c||"shared",this.push=function(m){"shared"!==this.type_&&m.type!==this.type_||(void 0===h&&(h=m.dts),m.dts=Ko(m.dts,h),m.pts=Ko(m.pts,h),p=m.dts,this.trigger("data",m))},this.flush=function(){h=p,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,p=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Sc.prototype=new n;var Za,Ec_TimestampRolloverStream=Sc,Ec_handleRollover=Ko,Cc=function(c,p,h){var m,_="";for(m=p;m>>2;ae*=4,M.timeStamp=ae+=3&Se[7],void 0===I.pts&&void 0===I.dts&&(I.pts=M.timeStamp,I.dts=M.timeStamp),this.trigger("timestamp",M)}I.frames.push(M),L+=10,L+=O}while(L>>4>1&&(k+=_[k]+1),0===y.pid)y.type="pat",c(_.subarray(k),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",c(_.subarray(k),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([_,k,y]):this.processPes_(_,k,y)},this.processPes_=function(_,y,k){k.streamType=k.pid===this.programMapTable.video?Rt.H264_STREAM_TYPE:k.pid===this.programMapTable.audio?Rt.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][k.pid],k.type="pes",k.data=_.subarray(y),this.trigger("data",k)}},Ln.prototype=new n,Ln.STREAM_TYPES={h264:27,adts:15},za=function(){var y,c=this,p=!1,h={data:[],size:0},m={data:[],size:0},_={data:[],size:0},I=function(O,M,W){var Zt,fe=new Uint8Array(O.size),Se={type:M},ae=0,Be=0,kt=!1;if(O.data.length&&!(O.size<9)){for(Se.trackId=O.data[0].pid,ae=0;ae>>3,M.pts*=4,M.pts+=(6&O[13])>>>1,M.dts=M.pts,64&W&&(M.dts=(14&O[14])<<27|(255&O[15])<<20|(254&O[16])<<12|(255&O[17])<<5|(254&O[18])>>>3,M.dts*=4,M.dts+=(6&O[18])>>>1)),M.data=O.subarray(9+O[8]))})(fe,Se),kt="video"===M||Se.packetLength<=O.size,(W||kt)&&(O.size=0,O.data.length=0),kt&&c.trigger("data",Se)}};za.prototype.init.call(this),this.push=function(L){({pat:function(){},pes:function(){var M,W;switch(L.streamType){case Rt.H264_STREAM_TYPE:M=h,W="video";break;case Rt.ADTS_STREAM_TYPE:M=m,W="audio";break;case Rt.METADATA_STREAM_TYPE:M=_,W="timed-metadata";break;default:return}L.payloadUnitStartIndicator&&I(M,W,!0),M.data.push(L),M.size+=L.data.byteLength},pmt:function(){var M={type:"metadata",tracks:[]};null!==(y=L.programMapTable).video&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),p=!0,c.trigger("data",M)}})[L.type]()},this.reset=function(){h.size=0,h.data.length=0,m.size=0,m.data.length=0,this.trigger("reset")},this.flushStreams_=function(){I(h,"video"),I(m,"audio"),I(_,"timed-metadata")},this.flush=function(){if(!p&&y){var L={type:"metadata",tracks:[]};null!==y.video&&L.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&L.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),c.trigger("data",L)}p=!1,this.flushStreams_(),this.trigger("done")}},za.prototype=new n;var Ac={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ka,TransportParseStream:Ln,ElementaryStream:za,TimestampRolloverStream:cy,CaptionStream:qa.CaptionStream,Cea608Stream:qa.Cea608Stream,Cea708Stream:qa.Cea708Stream,MetadataStream:dy};for(var Yo in Rt)Rt.hasOwnProperty(Yo)&&(Ac[Yo]=Rt[Yo]);var Ya,Hi=Ac,wc=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ya=function(c){var p,h=0;Ya.prototype.init.call(this),this.skipWarn_=function(m,_){this.trigger("log",{level:"warn",message:"adts skiping bytes "+m+" to "+_+" in frame "+h+" outside syncword"})},this.push=function(m){var y,k,I,L,O,_=0;if(c||(h=0),"audio"===m.type){p&&p.length?(I=p,(p=new Uint8Array(I.byteLength+m.data.byteLength)).set(I),p.set(m.data,I.byteLength)):p=m.data;for(var M;_+7>>2],p.byteLength-_<(y=(3&p[_+3])<<11|p[_+4]<<3|(224&p[_+5])>>5))break;this.trigger("data",{pts:m.pts+h*O,dts:m.dts+h*O,sampleCount:L,audioobjecttype:1+(p[_+2]>>>6&3),channelcount:(1&p[_+2])<<2|(192&p[_+3])>>>6,samplerate:wc[(60&p[_+2])>>>2],samplingfrequencyindex:(60&p[_+2])>>>2,samplesize:16,data:p.subarray(_+7+k,_+y)}),h++,_+=y}else"number"!=typeof M&&(M=_),_++;"number"==typeof M&&(this.skipWarn_(M,_),M=null),p=p.subarray(_)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){p=void 0,this.trigger("reset")},this.endTimeline=function(){p=void 0,this.trigger("endedtimeline")}},Ya.prototype=new n;var Dc,Ic=Ya;Dc=function(c){var p=c.byteLength,h=0,m=0;this.length=function(){return 8*p},this.bitsAvailable=function(){return 8*p+m},this.loadWord=function(){var _=c.byteLength-p,y=new Uint8Array(4),k=Math.min(4,p);if(0===k)throw new Error("no bytes available");y.set(c.subarray(_,_+k)),h=new DataView(y.buffer).getUint32(0),m=8*k,p-=k},this.skipBits=function(_){var y;m>_?(h<<=_,m-=_):(_-=m,_-=8*(y=Math.floor(_/8)),p-=y,this.loadWord(),h<<=_,m-=_)},this.readBits=function(_){var y=Math.min(m,_),k=h>>>32-y;return(m-=y)>0?h<<=y:p>0&&this.loadWord(),(y=_-y)>0?k<>>_)return h<<=_,m-=_,_;return this.loadWord(),_+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var _=this.skipLeadingZeros();return this.readBits(_+1)-1},this.readExpGolomb=function(){var _=this.readUnsignedExpGolomb();return 1&_?1+_>>>1:-1*(_>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var $a,Rn,Pc,hy=Dc;Rn=function(){var p,h,c=0;Rn.prototype.init.call(this),this.push=function(m){var _;h?((_=new Uint8Array(h.byteLength+m.data.byteLength)).set(h),_.set(m.data,h.byteLength),h=_):h=m.data;for(var y=h.byteLength;c3&&this.trigger("data",h.subarray(c+3)),h=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Rn.prototype=new n,Pc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},$a=function(){var p,h,m,_,y,k,I,c=new Rn;$a.prototype.init.call(this),p=this,this.push=function(L){"video"===L.type&&(h=L.trackId,m=L.pts,_=L.dts,c.push(L))},c.on("data",function(L){var O={trackId:h,pts:m,dts:_,data:L,nalUnitTypeCode:31&L[0]};switch(O.nalUnitTypeCode){case 5:O.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:O.nalUnitType="sei_rbsp",O.escapedRBSP=y(L.subarray(1));break;case 7:O.nalUnitType="seq_parameter_set_rbsp",O.escapedRBSP=y(L.subarray(1)),O.config=k(O.escapedRBSP);break;case 8:O.nalUnitType="pic_parameter_set_rbsp";break;case 9:O.nalUnitType="access_unit_delimiter_rbsp"}p.trigger("data",O)}),c.on("done",function(){p.trigger("done")}),c.on("partialdone",function(){p.trigger("partialdone")}),c.on("reset",function(){p.trigger("reset")}),c.on("endedtimeline",function(){p.trigger("endedtimeline")}),this.flush=function(){c.flush()},this.partialFlush=function(){c.partialFlush()},this.reset=function(){c.reset()},this.endTimeline=function(){c.endTimeline()},I=function(O,M){var Se,W=8,fe=8;for(Se=0;Se=0?h:0,(16&c[p+5])>>4?h+20:h+10},gy=function b(c,p){return c.length-p<10||c[p]!=="I".charCodeAt(0)||c[p+1]!=="D".charCodeAt(0)||c[p+2]!=="3".charCodeAt(0)?p:b(c,p+=Oc(c,p))},Lc=function(c){return c[0]<<21|c[1]<<14|c[2]<<7|c[3]},yy=function(c,p,h){return unescape(function(c,p,h){var m,_="";for(m=p;m=p+2&&255==(255&c[p])&&240==(240&c[p+1])&&16==(22&c[p+1])},parseId3TagSize:Oc,parseAdtsSize:function(c,p){return 6144&c[p+3]|c[p+4]<<3|(224&c[p+5])>>5},parseType:function(c,p){return c[p]==="I".charCodeAt(0)&&c[p+1]==="D".charCodeAt(0)&&c[p+2]==="3".charCodeAt(0)?"timed-metadata":!0&c[p]&&240==(240&c[p+1])?"audio":null},parseSampleRate:function(c){for(var p=0;p+5>>2];p++}return null},parseAacTimestamp:function(c){var p,h,m;p=10,64&c[5]&&(p+=4,p+=Lc(c.subarray(10,14)));do{if((h=Lc(c.subarray(p+4,p+8)))<1)return null;if("PRIV"===String.fromCharCode(c[p],c[p+1],c[p+2],c[p+3])){m=c.subarray(p+10,p+h+10);for(var y=0;y>>2;return(L*=4)+(3&I[7])}break}}p+=10,p+=h}while(p=3;)if(c[_]!=="I".charCodeAt(0)||c[_+1]!=="D".charCodeAt(0)||c[_+2]!=="3".charCodeAt(0))if(255!=(255&c[_])||240!=(240&c[_+1]))_++;else{if(c.length-_<7||_+(m=Qa.parseAdtsSize(c,_))>c.length)break;I={type:"audio",data:c.subarray(_,_+m),pts:p,dts:p},this.trigger("data",I),_+=m}else{if(c.length-_<10||_+(m=Qa.parseId3TagSize(c,_))>c.length)break;k={type:"timed-metadata",data:c.subarray(_,_+m)},this.trigger("data",k),_+=m}c=c.length-_>0?c.subarray(_):new Uint8Array},this.reset=function(){c=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){c=new Uint8Array,this.trigger("endedtimeline")}},Xa.prototype=new n;var Mn,en,Ja,vr,Ey=Xa,$o=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Qo=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ay=py.H264Stream,wy=Qa.isLikelyAacData,Dy=function(c,p){p.stream=c,this.trigger("log",p)},Rc=function(c,p){for(var h=Object.keys(p),m=0;m=h?c:(p.minSegmentDts=1/0,c.filter(function(m){return m.dts>=h&&(p.minSegmentDts=Math.min(p.minSegmentDts,m.dts),p.minSegmentPts=p.minSegmentDts,!0)}))}(h,c,_),c.baseMediaDecodeTime=gi_calculateTrackBaseMediaDecodeTime(c,p.keepOriginalTimestamps),Se=Fa_prefixWithSilence(c,I,y,k),c.samples=function(c){var p,m=[];for(p=0;p1&&(p=c.shift(),c.byteLength-=p.byteLength,c.nalCount-=p.nalCount,c[0][0].dts=p.dts,c[0][0].pts=p.pts,c[0][0].duration+=p.duration),c}(O)),_.length){var kt;if(!(kt=p.alignGopsAtEnd?this.alignGopsAtEnd_(O):this.alignGopsAtStart_(O)))return this.gopCache_.unshift({gop:O.pop(),pps:c.pps,sps:c.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),m=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");gi_clearDtsInfo(c),O=kt}gi_collectDtsInfo(c,O),c.samples=function(c,p){var h,m,_,y,I=p||0,L=[];for(h=0;h=-1e4&&W<=45e3&&(!fe||M>W)&&(fe=ae,M=W));return fe?fe.gop:null},this.alignGopsAtStart_=function(I){var L,O,M,W,fe,Se,ae,Be;for(fe=I.byteLength,Se=I.nalCount,ae=I.duration,L=O=0;L<_.length&&OM.pts?L++:(O++,fe-=W.byteLength,Se-=W.nalCount,ae-=W.duration);return 0===O?I:O===I.length?null:((Be=I.slice(O)).byteLength=fe,Be.duration=ae,Be.nalCount=Se,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be)},this.alignGopsAtEnd_=function(I){var L,O,M,W,fe,Se,ae;for(L=_.length-1,O=I.length-1,fe=null,Se=!1;L>=0&&O>=0;){if((M=_[L]).pts===(W=I[O]).pts){Se=!0;break}M.pts>W.pts?L--:(L===_.length-1&&(fe=O),O--)}if(!Se&&null===fe)return null;if(0===(ae=Se?O:fe))return I;var Be=I.slice(ae),kt=Be.reduce(function(Zt,Tr){return Zt.byteLength+=Tr.byteLength,Zt.duration+=Tr.duration,Zt.nalCount+=Tr.nalCount,Zt},{byteLength:0,duration:0,nalCount:0});return Be.byteLength=kt.byteLength,Be.duration=kt.duration,Be.nalCount=kt.nalCount,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be},this.alignGopsWith=function(I){_=I}},Mn.prototype=new n,vr=function(c,p){this.numberOfTracks=0,this.metadataStream=p,this.remuxTracks=!(typeof(c=c||{}).remux<"u"&&!c.remux),this.keepOriginalTimestamps="boolean"==typeof c.keepOriginalTimestamps&&c.keepOriginalTimestamps,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vr.prototype.init.call(this),this.push=function(h){return h.text?this.pendingCaptions.push(h):h.frames?this.pendingMetadata.push(h):(this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,"video"===h.track.type&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),void("audio"===h.track.type&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))))}},vr.prototype=new n,vr.prototype.flush=function(b){var h,m,_,k,c=0,p={captions:[],captionStreams:{},metadata:[],info:{}},y=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,Qo.forEach(function(I){p.info[I]=this.videoTrack[I]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,$o.forEach(function(I){p.info[I]=this.audioTrack[I]},this)),this.videoTrack||this.audioTrack){for(p.type=1===this.pendingTracks.length?this.pendingTracks[0].type:"combined",this.emittedTracks+=this.pendingTracks.length,_=function(c){var m,p=d(),h=E(c);return(m=new Uint8Array(p.byteLength+h.byteLength)).set(p),m.set(h,p.byteLength),m}(this.pendingTracks),p.initSegment=new Uint8Array(_.byteLength),p.initSegment.set(_),p.data=new Uint8Array(this.pendingBytes),k=0;k=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vr.prototype.setRemux=function(b){this.remuxTracks=b},Ja=function(c){var m,_,p=this,h=!0;Ja.prototype.init.call(this),this.baseMediaDecodeTime=(c=c||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new Hi.MetadataStream,y.aacStream=new Ey,y.audioTimestampRolloverStream=new Hi.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new Hi.TimestampRolloverStream("timed-metadata"),y.adtsStream=new Ic,y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(k){y.aacStream.setTimestamp(k.timeStamp)}),y.aacStream.on("data",function(k){"timed-metadata"!==k.type&&"audio"!==k.type||y.audioSegmentStream||(_=_||{timelineStartInfo:{baseMediaDecodeTime:p.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Rc(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new Hi.MetadataStream,y.packetStream=new Hi.TransportPacketStream,y.parseStream=new Hi.TransportParseStream,y.elementaryStream=new Hi.ElementaryStream,y.timestampRolloverStream=new Hi.TimestampRolloverStream,y.adtsStream=new Ic,y.h264Stream=new Ay,y.captionStream=new Hi.CaptionStream(c),y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(k){var I;if("metadata"===k.type){for(I=k.tracks.length;I--;)m||"video"!==k.tracks[I].type?!_&&"audio"===k.tracks[I].type&&((_=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime):(m=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime;m&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new Mn(m,c),y.videoSegmentStream.on("log",p.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(L){_&&!c.keepOriginalTimestamps&&(_.timelineStartInfo=L,y.audioSegmentStream.setEarliestDts(L.dts-p.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",p.trigger.bind(p,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(L){_&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(L)}),y.videoSegmentStream.on("timingInfo",p.trigger.bind(p,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),_&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(k){k.dispatchType=y.metadataStream.dispatchType,p.trigger("id3Frame",k)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Rc(this,y)},this.setBaseMediaDecodeTime=function(y){var k=this.transmuxPipeline_;c.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),_&&(_.timelineStartInfo.dts=void 0,_.timelineStartInfo.pts=void 0,gi_clearDtsInfo(_),k.audioTimestampRolloverStream&&k.audioTimestampRolloverStream.discontinuity()),m&&(k.videoSegmentStream&&(k.videoSegmentStream.gopCache_=[]),m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,gi_clearDtsInfo(m),k.captionStream.reset()),k.timestampRolloverStream&&k.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){_&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var k=this.transmuxPipeline_;c.remux=y,k&&k.coalesceStream&&k.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){m&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var k=this;return function(I){I.stream=y,k.trigger("log",I)}},this.push=function(y){if(h){var k=wy(y);k&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():!k&&"ts"!==this.transmuxPipeline_.type&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ja.prototype=new n;var Vc,Wc,Jo,Py={Transmuxer:Ja,VideoSegmentStream:Mn,AudioSegmentStream:en,AUDIO_PROPERTIES:$o,VIDEO_PROPERTIES:Qo,generateSegmentTimingInfo:Xo},es_toUnsigned=function(c){return c>>>0},_r=function(c){var p="";return p+=String.fromCharCode(c[0]),p+=String.fromCharCode(c[1]),(p+=String.fromCharCode(c[2]))+String.fromCharCode(c[3])},My=es_toUnsigned,ft=function b(c,p){var m,_,y,k,I,h=[];if(!p.length)return null;for(m=0;m1?m+_:c.byteLength,y===p[0]&&(1===p.length?h.push(c.subarray(m+8,k)):(I=b(c.subarray(m+8,k),p.slice(1))).length&&(h=h.concat(I))),m=k;return h},Ny=es_toUnsigned,Fy=e.getUint64,Nc=function(c){return{isLeading:(12&c[0])>>>2,dependsOn:3&c[0],isDependedOn:(192&c[1])>>>6,hasRedundancy:(48&c[1])>>>4,paddingValue:(14&c[1])>>>1,isNonSyncSample:1&c[1],degradationPriority:c[2]<<8|c[3]}},jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nn=typeof window<"u"?window:typeof jc<"u"?jc:typeof self<"u"?self:{},qy=function(c){for(var _,y,p=c.byteLength,h=[],m=1;m0?function(c){var p={version:c[0],flags:new Uint8Array(c.subarray(1,4))};return p.baseMediaDecodeTime=1===p.version?Fy(c.subarray(4)):Ny(c[4]<<24|c[5]<<16|c[6]<<8|c[7]),p}(fe[0]).baseMediaDecodeTime:0,ae=ft(L,["trun"]);p===W&&ae.length>0&&(Be=function(c,p,h){var m=p,_=h.defaultSampleDuration||0,y=h.defaultSampleSize||0,k=h.trackId,I=[];return c.forEach(function(L){var M=function(c){var W,p={version:c[0],flags:new Uint8Array(c.subarray(1,4)),samples:[]},h=new DataView(c.buffer,c.byteOffset,c.byteLength),m=1&p.flags[2],_=4&p.flags[2],y=1&p.flags[1],k=2&p.flags[1],I=4&p.flags[1],L=8&p.flags[1],O=h.getUint32(4),M=8;for(m&&(p.dataOffset=h.getInt32(M),M+=4),_&&O&&(W={flags:Nc(c.subarray(M,M+4))},M+=4,y&&(W.duration=h.getUint32(M),M+=4),k&&(W.size=h.getUint32(M),M+=4),L&&(W.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(W),O--);O--;)W={},y&&(W.duration=h.getUint32(M),M+=4),k&&(W.size=h.getUint32(M),M+=4),I&&(W.flags=Nc(c.subarray(M,M+4)),M+=4),L&&(W.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(W);return p}(L).samples;M.forEach(function(W){void 0===W.duration&&(W.duration=_),void 0===W.size&&(W.size=y),W.trackId=k,W.dts=m,void 0===W.compositionTimeOffset&&(W.compositionTimeOffset=0),"bigint"==typeof m?(W.pts=m+Nn.BigInt(W.compositionTimeOffset),m+=Nn.BigInt(W.duration)):(W.pts=m+W.compositionTimeOffset,m+=W.duration)}),I=I.concat(M)}),I}(ae,Se,M),kt=function(c,p,h){var y,k,I,L,m=new DataView(c.buffer,c.byteOffset,c.byteLength),_={logs:[],seiNals:[]};for(k=0;k+40;){var W=h.shift();this.parse(W,L,O)}return M=function(c,p,h){if(null===p)return null;var _=zy(c,p)[p]||{};return{seiNals:_.seiNals,logs:_.logs,timescale:h}}(I,m,_),M&&M.logs&&(y.logs=y.logs.concat(M.logs)),null!==M&&M.seiNals?(this.pushNals(M.seiNals),this.flushStream(),y):y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(I){if(!this.isInitialized()||!I||0===I.length)return null;I.forEach(function(L){p.push(L)})},this.flushStream=function(){if(!this.isInitialized())return null;k?p.partialFlush():p.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;p.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],m=null,_=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},ts=es_toUnsigned,Fn=function(c){return("00"+c.toString(16)).slice(-2)},Xy=e.getUint64;Vc=function(c,p){var m=ft(p,["moof","traf"]).reduce(function(_,y){var W,fe,k=ft(y,["tfhd"])[0],I=ts(k[4]<<24|k[5]<<16|k[6]<<8|k[7]),L=c[I]||9e4,O=ft(y,["tfdt"])[0],M=new DataView(O.buffer,O.byteOffset,O.byteLength);return"bigint"==typeof(W=1===O[0]?Xy(O.subarray(4,12)):M.getUint32(4))?fe=W/Nn.BigInt(L):"number"==typeof W&&!isNaN(W)&&(fe=W/L),fe11?(_.codec+=".",_.codec+=Fn(Se[9]),_.codec+=Fn(Se[10]),_.codec+=Fn(Se[11])):_.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(_.codec)?(Se=fe.subarray(28),"esds"===_r(Se.subarray(4,8))&&Se.length>20&&0!==Se[19]?(_.codec+="."+Fn(Se[19]),_.codec+="."+Fn(Se[20]>>>2&63).replace(/^0/,"")):_.codec="mp4a.40.2"):_.codec=_.codec.toLowerCase())}var Be=ft(m,["mdia","mdhd"])[0];Be&&(_.timescale=Jo(Be)),h.push(_)}),h};var Zc_startTime=Vc,Zc_tracks=Wc,Kc=function(c){var p=31&c[1];return(p<<=8)|c[2]},is=function(c){return!!(64&c[1])},rs=function(c){var p=0;return(48&c[3])>>>4>1&&(p+=c[4]+1),p},eu=function(c){switch(c){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},aT={parseType:function(c,p){var h=Kc(c);return 0===h?"pat":h===p?"pmt":p?"pes":null},parsePat:function(c){var p=is(c),h=4+rs(c);return p&&(h+=c[h]+1),(31&c[h+10])<<8|c[h+11]},parsePmt:function(c){var p={},h=is(c),m=4+rs(c);if(h&&(m+=c[m]+1),1&c[m+5]){var y;y=3+((15&c[m+1])<<8|c[m+2])-4;for(var I=12+((15&c[m+10])<<8|c[m+11]);I=c.byteLength)return null;var _,m=null;return 192&(_=c[h+7])&&((m={}).pts=(14&c[h+9])<<27|(255&c[h+10])<<20|(254&c[h+11])<<12|(255&c[h+12])<<5|(254&c[h+13])>>>3,m.pts*=4,m.pts+=(6&c[h+13])>>>1,m.dts=m.pts,64&_&&(m.dts=(14&c[h+14])<<27|(255&c[h+15])<<20|(254&c[h+16])<<12|(255&c[h+17])<<5|(254&c[h+18])>>>3,m.dts*=4,m.dts+=(6&c[h+18])>>>1)),m},videoPacketContainsKeyFrame:function(c){for(var p=4+rs(c),h=c.subarray(p),m=0,_=0,y=!1;_3&&"slice_layer_without_partitioning_rbsp_idr"===eu(31&h[_+3])&&(y=!0),y}},tn=Ec_handleRollover,tt={};tt.ts=aT,tt.aac=Qa;var yr=9e4,Wt=188,zc=function(c,p,h){for(var y,I,L,O,m=0,_=Wt,M=!1;_<=c.byteLength;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m++,_++;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),L=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&L&&(O=tt.ts.parsePesTime(y))&&(O.type="audio",h.audio.push(O),M=!0)),M)break;m+=Wt,_+=Wt}for(m=(_=c.byteLength)-Wt,M=!1;m>=0;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),L=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&L&&(O=tt.ts.parsePesTime(y))&&(O.type="audio",h.audio.push(O),M=!0)),M)break;m-=Wt,_-=Wt}},oT=function(c,p,h){for(var y,I,L,O,M,W,fe,m=0,_=Wt,Se=!1,ae={data:[],size:0};_=0;)if(71!==c[m]||71!==c[_])m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),L=tt.ts.parsePayloadUnitStartIndicator(y),"video"===I&&L&&(O=tt.ts.parsePesTime(y))&&(O.type="video",h.video.push(O),Se=!0)),Se)break;m-=Wt,_-=Wt}},fT_inspect=function(c,p){var m;return m=tt.aac.isLikelyAacData(c)?function(c){for(var I,p=!1,h=0,m=null,_=null,y=0,k=0;c.length-k>=3;){switch(tt.aac.parseType(c,k)){case"timed-metadata":if(c.length-k<10){p=!0;break}if((y=tt.aac.parseId3TagSize(c,k))>c.length){p=!0;break}null===_&&(I=c.subarray(k,k+y),_=tt.aac.parseAacTimestamp(I)),k+=y;break;case"audio":if(c.length-k<7){p=!0;break}if((y=tt.aac.parseAdtsSize(c,k))>c.length){p=!0;break}null===m&&(I=c.subarray(k,k+y),m=tt.aac.parseSampleRate(I)),h++,k+=y;break;default:k++}if(p)return null}if(null===m||null===_)return null;var O=yr/m;return{audio:[{type:"audio",dts:_,pts:_},{type:"audio",dts:_+1024*h*O,pts:_+1024*h*O}]}}(c):function(c){var p={pid:null,table:null},h={};for(var m in function(c,p){for(var _,h=0,m=Wt;m"u"||isNaN(h))&&(h=c.audio[0].dts),c.audio.forEach(function(y){y.dts=tn(y.dts,h),y.pts=tn(y.pts,h),y.dtsTime=y.dts/yr,y.ptsTime=y.pts/yr})}if(c.video&&c.video.length){var m=p;if((typeof m>"u"||isNaN(m))&&(m=c.video[0].dts),c.video.forEach(function(y){y.dts=tn(y.dts,m),y.pts=tn(y.pts,m),y.dtsTime=y.dts/yr,y.ptsTime=y.pts/yr}),c.firstKeyFrame){var _=c.firstKeyFrame;_.dts=tn(_.dts,m),_.pts=tn(_.pts,m),_.dtsTime=_.dts/yr,_.ptsTime=_.pts/yr}}}(m,p),m):null},Yc=function(){function b(p,h){this.options=h||{},this.self=p,this.init()}var c=b.prototype;return c.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Py.Transmuxer(this.options),function(c,p){p.on("data",function(h){var m=h.initSegment;h.initSegment={data:m.buffer,byteOffset:m.byteOffset,byteLength:m.byteLength};var _=h.data;h.data=_.buffer,c.postMessage({action:"data",segment:h,byteOffset:_.byteOffset,byteLength:_.byteLength},[h.data])}),p.on("done",function(h){c.postMessage({action:"done"})}),p.on("gopInfo",function(h){c.postMessage({action:"gopInfo",gopInfo:h})}),p.on("videoSegmentTimingInfo",function(h){var m={start:{decode:Qe_videoTsToSeconds(h.start.dts),presentation:Qe_videoTsToSeconds(h.start.pts)},end:{decode:Qe_videoTsToSeconds(h.end.dts),presentation:Qe_videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Qe_videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(m.prependedContentDuration=Qe_videoTsToSeconds(h.prependedContentDuration)),c.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:m})}),p.on("audioSegmentTimingInfo",function(h){var m={start:{decode:Qe_videoTsToSeconds(h.start.dts),presentation:Qe_videoTsToSeconds(h.start.pts)},end:{decode:Qe_videoTsToSeconds(h.end.dts),presentation:Qe_videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Qe_videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(m.prependedContentDuration=Qe_videoTsToSeconds(h.prependedContentDuration)),c.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:m})}),p.on("id3Frame",function(h){c.postMessage({action:"id3Frame",id3Frame:h})}),p.on("caption",function(h){c.postMessage({action:"caption",caption:h})}),p.on("trackinfo",function(h){c.postMessage({action:"trackinfo",trackInfo:h})}),p.on("audioTimingInfo",function(h){c.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Qe_videoTsToSeconds(h.start),end:Qe_videoTsToSeconds(h.end)}})}),p.on("videoTimingInfo",function(h){c.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Qe_videoTsToSeconds(h.start),end:Qe_videoTsToSeconds(h.end)}})}),p.on("log",function(h){c.postMessage({action:"log",log:h})})}(this.self,this.transmuxer)},c.pushMp4Captions=function(h){this.captionParser||(this.captionParser=new Qy,this.captionParser.init());var m=new Uint8Array(h.data,h.byteOffset,h.byteLength),_=this.captionParser.parse(m,h.trackIds,h.timescales);this.self.postMessage({action:"mp4Captions",captions:_&&_.captions||[],logs:_&&_.logs||[],data:m.buffer},[m.buffer])},c.probeMp4StartTime=function(h){var _=h.data,y=Zc_startTime(h.timescales,_);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:_},[_.buffer])},c.probeMp4Tracks=function(h){var m=h.data,_=Zc_tracks(m);this.self.postMessage({action:"probeMp4Tracks",tracks:_,data:m},[m.buffer])},c.probeTs=function(h){var m=h.data,_=h.baseStartTime,y="number"!=typeof _||isNaN(_)?void 0:9e4*_,k=fT_inspect(m,y),I=null;k&&((I={hasVideo:k.video&&2===k.video.length||!1,hasAudio:k.audio&&2===k.audio.length||!1}).hasVideo&&(I.videoStart=k.video[0].ptsTime),I.hasAudio&&(I.audioStart=k.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:I,data:m},[m.buffer])},c.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},c.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},c.push=function(h){var m=new Uint8Array(h.data,h.byteOffset,h.byteLength);this.transmuxer.push(m)},c.reset=function(){this.transmuxer.reset()},c.setTimestampOffset=function(h){this.transmuxer.setBaseMediaDecodeTime(Math.round(Qe_secondsToVideoTs(h.timestampOffset||0)))},c.setAudioAppendStart=function(h){this.transmuxer.setAudioAppendStart(Math.ceil(Qe_secondsToVideoTs(h.appendStart)))},c.setRemux=function(h){this.transmuxer.setRemux(h.remux)},c.flush=function(h){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},c.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},c.alignGopsWith=function(h){this.transmuxer.alignGopsWith(h.gopsToAlignWith.slice())},b}();self.onmessage=function(b){"init"===b.data.action&&b.data.options?this.messageHandlers=new Yc(self,b.data.options):(this.messageHandlers||(this.messageHandlers=new Yc(self)),b.data&&b.data.action&&"init"!==b.data.action&&this.messageHandlers[b.data.action]&&this.messageHandlers[b.data.action](b.data))}})),Vm=Pd(Hm),Rd=function(n){var t=n.transmuxer,i=n.bytes,e=n.audioAppendStart,r=n.gopsToAlignWith,a=n.remux,o=n.onData,l=n.onTrackInfo,d=n.onAudioTimingInfo,f=n.onVideoTimingInfo,v=n.onVideoSegmentTimingInfo,g=n.onAudioSegmentTimingInfo,T=n.onId3,E=n.onCaptions,x=n.onDone,S=n.onEndedTimeline,N=n.onTransmuxerLog,F=n.isEndOfTimeline,j={buffer:[]},G=F;if(t.onmessage=function(ye){t.currentTransmux===n&&("data"===ye.data.action&&function(n,t,i){var e=n.data.segment,r=e.type,a=e.initSegment,f=e.videoFrameDtsTime,v=e.videoFramePtsTime;t.buffer.push({captions:e.captions,captionStreams:e.captionStreams,metadata:e.metadata});var g=n.data.segment.boxes||{data:n.data.segment.data},T={type:r,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof f<"u"&&(T.videoFrameDtsTime=f),typeof v<"u"&&(T.videoFramePtsTime=v),i(T)}(ye,j,o),"trackinfo"===ye.data.action&&l(ye.data.trackInfo),"gopInfo"===ye.data.action&&function(n,t){t.gopInfo=n.data.gopInfo}(ye,j),"audioTimingInfo"===ye.data.action&&d(ye.data.audioTimingInfo),"videoTimingInfo"===ye.data.action&&f(ye.data.videoTimingInfo),"videoSegmentTimingInfo"===ye.data.action&&v(ye.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===ye.data.action&&g(ye.data.audioSegmentTimingInfo),"id3Frame"===ye.data.action&&T([ye.data.id3Frame],ye.data.id3Frame.dispatchType),"caption"===ye.data.action&&E(ye.data.caption),"endedtimeline"===ye.data.action&&(G=!1,S()),"log"===ye.data.action&&N(ye.data.log),"transmuxed"===ye.data.type&&(G||(t.onmessage=null,function(n){var t=n.transmuxedData,i=n.callback;t.buffer=[],i(t)}({transmuxedData:j,callback:x}),Md(t))))},e&&t.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof a<"u"&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var ne=i instanceof ArrayBuffer?i:i.buffer,he=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:ne,byteOffset:he,byteLength:i.byteLength},[ne])}F&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Md=function(n){n.currentTransmux=null,n.transmuxQueue.length&&(n.currentTransmux=n.transmuxQueue.shift(),"function"==typeof n.currentTransmux?n.currentTransmux():Rd(n.currentTransmux))},Ud=function(n,t){n.postMessage({action:t}),Md(n)},Do_reset=function(n){!function(n,t){if(!t.currentTransmux)return t.currentTransmux=n,void Ud(t,n);t.transmuxQueue.push(Ud.bind(null,t,n))}("reset",n)},ka=function(n){var t=n.transmuxer,i=n.endAction||n.action,e=n.callback,r=gt({},n,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function d(f){f.data.action===i&&(t.removeEventListener("message",d),f.data.data&&(f.data.data=new Uint8Array(f.data.data,n.byteOffset||0,n.byteLength||f.data.data.byteLength),n.data&&(n.data=f.data.data)),e(f.data))}),n.data){var o=n.data instanceof ArrayBuffer;r.byteOffset=o?0:n.data.byteOffset,r.byteLength=n.data.byteLength,t.postMessage(r,[o?n.data:n.data.buffer])}else t.postMessage(r)},Po=function(n){n.forEach(function(t){t.abort()})},Oo=function(n,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:-101,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:-102,xhr:t}:n?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null},Bd=function(n,t,i){return function(e,r){var a=r.response,o=Oo(e,r);if(o)return i(o,n);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:2,xhr:r},n);for(var l=new DataView(a),d=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),f=0;f0}(x)){t.isFmp4=!0;var S=t.map.tracks,N={isFmp4:!0,hasVideo:!!S.video,hasAudio:!!S.audio};S.audio&&S.audio.codec&&"enca"!==S.audio.codec&&(N.audioCodec=S.audio.codec),S.video&&S.video.codec&&"encv"!==S.video.codec&&(N.videoCodec=S.video.codec),S.video&&S.audio&&(N.isMuxed=!0),e(t,N);var F=function(G){g(t,{data:x,type:N.hasAudio&&!N.isMuxed?"audio":"video"}),G&&G.length&&d(t,G),T(null,t,{})};ka({action:"probeMp4StartTime",timescales:t.map.timescales,data:x,transmuxer:t.transmuxer,callback:function(G){var q=G.data,ne=G.startTime;i=q.buffer,t.bytes=x=q,N.hasAudio&&!N.isMuxed&&r(t,"audio","start",ne),N.hasVideo&&r(t,"video","start",ne),S.video&&q.byteLength&&t.transmuxer?ka({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:x,timescales:t.map.timescales,trackIds:[S.video.id],callback:function(K){i=K.data.buffer,t.bytes=x=K.data,K.logs.forEach(function(ye){E(U.mergeOptions(ye,{stream:"mp4CaptionParser"}))}),F(K.captions)}}):F()}})}else{if(t.transmuxer)return typeof t.container>"u"&&(t.container=vs(x)),"ts"!==t.container&&"aac"!==t.container?(e(t,{hasAudio:!1,hasVideo:!1}),void T(null,t,{})):void Jm({segment:t,bytes:i,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});T(null,t,{})}},Vd=function(n,t){var l,i=n.id,e=n.key,r=n.encryptedBytes,a=n.decryptionWorker;a.addEventListener("message",function d(f){if(f.data.source===i){a.removeEventListener("message",d);var v=f.data.decrypted;t(new Uint8Array(v.bytes,v.byteOffset,v.byteLength))}}),l=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),a.postMessage(Sd({source:i,encrypted:r,key:l,iv:e.iv}),[r.buffer,l.buffer])},ng=function(n){var t=n.xhr,i=n.xhrOptions,r=n.segment,a=n.abortFn,o=n.progressFn,l=n.trackInfoFn,d=n.timingInfoFn,f=n.videoSegmentTimingInfoFn,v=n.audioSegmentTimingInfoFn,g=n.id3Fn,T=n.captionsFn,E=n.isEndOfTimeline,x=n.endedTimelineFn,S=n.dataFn,j=[],G=function(n){var t=n.activeXhrs,i=n.decryptionWorker,e=n.trackInfoFn,r=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog,x=0,S=!1;return function(N,F){if(!S){if(N)return S=!0,Po(t),T(N,F);if((x+=1)===t.length){var j=function(){if(F.encryptedBytes)return function(n){var i=n.segment,e=n.trackInfoFn,r=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog;Vd({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:n.decryptionWorker},function(x){i.bytes=x,Hd({segment:i,bytes:i.bytes,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})})}({decryptionWorker:i,segment:F,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});Hd({segment:F,bytes:F.bytes,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})};if(F.endOfAllRequests=Date.now(),F.map&&F.map.encryptedBytes&&!F.map.bytes)return Vd({decryptionWorker:i,id:F.requestId+"-init",encryptedBytes:F.map.encryptedBytes,key:F.map.key},function(G){F.map.bytes=G,jd(F,function(q){if(q)return Po(t),T(q,F);j()})});j()}}}}({activeXhrs:j,decryptionWorker:n.decryptionWorker,trackInfoFn:l,timingInfoFn:d,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:v,id3Fn:g,captionsFn:T,isEndOfTimeline:E,endedTimelineFn:x,dataFn:S,doneFn:n.doneFn,onTransmuxerLog:n.onTransmuxerLog});if(r.key&&!r.key.bytes){var q=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&q.push(r.map.key);var K=t(U.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),Bd(r,q,G));j.push(K)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var Pe=t(U.mergeOptions(i,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),Bd(r,[r.map.key],G));j.push(Pe)}var ot=U.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Ao(r.map)}),Nt=function(n){var t=n.segment,i=n.finishProcessingFn;return function(e,r){var a=Oo(e,r);if(a)return i(a,t);var o=new Uint8Array(r.response);if(t.map.key)return t.map.encryptedBytes=o,i(null,t);t.map.bytes=o,jd(t,function(l){if(l)return l.xhr=r,l.status=r.status,i(l,t);i(null,t)})}}({segment:r,finishProcessingFn:G}),Je=t(ot,Nt);j.push(Je)}var fr=U.mergeOptions(i,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Ao(r)}),si=t(fr,function(n){var t=n.segment,i=n.finishProcessingFn,e=n.responseType;return function(r,a){var o=Oo(r,a);if(o)return i(o,t);var l="arraybuffer"!==e&&a.responseText?function(n){for(var t=new Uint8Array(new ArrayBuffer(n.length)),i=0;i1)return ag("multiple "+i+" codecs found as attributes: "+t[i].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[i]=null);t[i]=t[i][0]}),t},Gd=function(n){var t=0;return n.audio&&t++,n.video&&t++,t},An=function(n,t){var i=t.attributes||{},e=Aa(function(n){var t=n.attributes||{};if(t.CODECS)return Xe(t.CODECS)}(t)||[]);if(qd(n,t)&&!e.audio&&!function(n,t){if(!qd(n,t))return!0;var e=n.mediaGroups.AUDIO[(t.attributes||{}).AUDIO];for(var r in e)if(!e[r].uri&&!e[r].playlists)return!0;return!1}(n,t)){var r=Aa(function(n,t){if(!n.mediaGroups.AUDIO||!t)return null;var i=n.mediaGroups.AUDIO[t];if(!i)return null;for(var e in i){var r=i[e];if(r.default&&r.playlists)return Xe(r.playlists[0].attributes.CODECS)}return null}(n,i.AUDIO)||[]);r.audio&&(e.audio=r.audio)}return e},wa=mi("PlaylistSelector"),Wd=function(n){if(n&&n.playlist){var t=n.playlist;return JSON.stringify({id:t.id,bandwidth:n.bandwidth,width:n.width,height:n.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Ia=function(n,t){if(!n)return"";var i=P().getComputedStyle(n);return i?i[t]:""},Qr=function(n,t){var i=n.slice();n.sort(function(e,r){var a=t(e,r);return 0===a?i.indexOf(e)-i.indexOf(r):a})},Lo=function(n,t){var i,e;return n.attributes.BANDWIDTH&&(i=n.attributes.BANDWIDTH),i=i||P().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(e=t.attributes.BANDWIDTH),i-(e||P().Number.MAX_VALUE)},Zd=function(n,t,i,e,r,a){if(n){var o={bandwidth:t,width:i,height:e,limitRenditionByPlayerDimensions:r},l=n.playlists;Yt.isAudioOnly(n)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var d=l.map(function(ge){var Pe=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.width,ot=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.height;return{bandwidth:ge.attributes&&ge.attributes.BANDWIDTH||P().Number.MAX_VALUE,width:Pe,height:ot,playlist:ge}});Qr(d,function(ge,$e){return ge.bandwidth-$e.bandwidth});var f=(d=d.filter(function(ge){return!Yt.isIncompatible(ge.playlist)})).filter(function(ge){return Yt.isEnabled(ge.playlist)});f.length||(f=d.filter(function(ge){return!Yt.isDisabled(ge.playlist)}));var v=f.filter(function(ge){return ge.bandwidth*Dt.BANDWIDTH_VARIANCEi||ge.height>e})).filter(function(ge){return ge.width===j[0].width&&ge.height===j[0].height}),g=G[G.length-1],q=G.filter(function(ge){return ge.bandwidth===g.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var he=S.map(function(ge){return ge.pixelDiff=Math.abs(ge.width-i)+Math.abs(ge.height-e),ge});Qr(he,function(ge,$e){return ge.pixelDiff===$e.pixelDiff?$e.bandwidth-ge.bandwidth:ge.pixelDiff-$e.pixelDiff}),ne=he[0]}var K=ne||q||F||T||f[0]||d[0];if(K&&K.playlist){var ye="sortedPlaylistReps";return ne?ye="leastPixelDiffRep":q?ye="resolutionPlusOneRep":F?ye="resolutionBestRep":T?ye="bandwidthBestRep":f[0]&&(ye="enabledPlaylistReps"),wa("choosing "+Wd(K)+" using "+ye+" with options",o),K.playlist}return wa("could not choose a playlist with options",o),null}},Kd=function(){var n=this.useDevicePixelRatio&&P().devicePixelRatio||1;return Zd(this.playlists.master,this.systemBandwidth,parseInt(Ia(this.tech_.el(),"width"),10)*n,parseInt(Ia(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},wn=function(n,t,i){var e,r;if(i&&i.cues)for(e=i.cues.length;e--;)(r=i.cues[e]).startTime>=n&&r.endTime<=t&&i.removeCue(r)},Yd=function(n){return"number"==typeof n&&isFinite(n)},Da=1/60,Xr=function(n){var t=n.startOfSegment,i=n.duration,e=n.segment,r=n.part,a=n.playlist,o=a.mediaSequence,l=a.id,d=a.segments,v=n.mediaIndex,g=n.partIndex,T=n.timeline,E=(void 0===d?[]:d).length-1,x="mediaIndex/partIndex increment";n.getMediaInfoForTime?x="getMediaInfoForTime ("+n.getMediaInfoForTime+")":n.isSyncRequest&&(x="getSyncSegmentCandidate (isSyncRequest)"),n.independent&&(x+=" with independent "+n.independent);var S="number"==typeof g,N=n.segment.uri?"segment":"pre-segment",F=S?ud({preloadSegment:e})-1:0;return N+" ["+(o+v)+"/"+(o+E)+"]"+(S?" part ["+g+"/"+F+"]":"")+" segment start/end ["+e.start+" => "+e.end+"]"+(S?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+T+"] selected by ["+x+"] playlist ["+l+"]"},$d=function(n){return n+"TimingInfo"},Qd=function(n){var t=n.timelineChangeController,e=n.segmentTimeline,r=n.loaderType,a=n.audioDisabled;if(n.currentTimeline===e)return!1;if("audio"===r){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==e}if("main"===r&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===e)}return!1},Xd=function(n){var t=n.segmentDuration,i=n.maxDuration;return!!t&&Math.round(t)>i+Ki},Ro=function(s){function n(i,e){var r;if(r=s.call(this)||this,!i)throw new TypeError("Initialization settings are required");if("function"!=typeof i.currentTime)throw new TypeError("No currentTime getter specified");if(!i.mediaSource)throw new TypeError("No MediaSource specified");return r.bandwidth=i.bandwidth,r.throughput={rate:0,count:0},r.roundTrip=NaN,r.resetStats_(),r.mediaIndex=null,r.partIndex=null,r.hasPlayed_=i.hasPlayed,r.currentTime_=i.currentTime,r.seekable_=i.seekable,r.seeking_=i.seeking,r.duration_=i.duration,r.mediaSource_=i.mediaSource,r.vhs_=i.vhs,r.loaderType_=i.loaderType,r.currentMediaInfo_=void 0,r.startingMediaInfo_=void 0,r.segmentMetadataTrack_=i.segmentMetadataTrack,r.goalBufferLength_=i.goalBufferLength,r.sourceType_=i.sourceType,r.sourceUpdater_=i.sourceUpdater,r.inbandTextTracks_=i.inbandTextTracks,r.state_="INIT",r.timelineChangeController_=i.timelineChangeController,r.shouldSaveSegmentTimingInfo_=!0,r.parse708captions_=i.parse708captions,r.captionServices_=i.captionServices,r.experimentalExactManifestTimings=i.experimentalExactManifestTimings,r.checkBufferTimeout_=null,r.error_=void 0,r.currentTimeline_=-1,r.pendingSegment_=null,r.xhrOptions_=null,r.pendingSegments_=[],r.audioDisabled_=!1,r.isPendingTimestampOffset_=!1,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=U.browser.IE_VERSION>=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=i.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=i.decrypter,r.syncController_=i.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",function(){r.isEndOfStream_()||(r.ended_=!1)}),r.fetchAtBuffer_=!1,r.logger_=mi("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty(Ne(r),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),"main"===r.loaderType_&&r.timelineChangeController_.on("pendingtimelinechange",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),"audio"===r.loaderType_&&r.timelineChangeController_.on("timelinechange",function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r}re(n,s);var t=n.prototype;return t.createTransmuxer_=function(){return function(n){var t=new Vm;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:n}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},t.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,P().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},t.error=function(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Do_reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return U.createTimeRanges();if("main"===this.loaderType_){var a=e.hasVideo;if(a&&e.hasAudio&&!this.audioDisabled_&&!e.isMuxed)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(e,r){if(void 0===r&&(r=!1),!e)return null;var a=Ca(e),o=this.initSegments_[a];return r&&!o&&e.bytes&&(this.initSegments_[a]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},t.segmentKey=function(e,r){if(void 0===r&&(r=!1),!e)return null;var a=Ed(e),o=this.keyCache_[a];this.cacheEncryptionKeys_&&r&&!o&&e.bytes&&(this.keyCache_[a]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var l={resolvedUri:(o||e).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(e,r){if(void 0===r&&(r={}),e){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=r,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var d=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+d+"]"),null!==this.mediaIndex)if(this.mediaIndex-=d,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var f=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!f.parts||!f.parts.length||!f.parts[this.partIndex])){var v=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=v}}o&&(o.mediaIndex-=d,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}},t.pause=function(){this.checkBufferTimeout_&&(P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return null===this.checkBufferTimeout_},t.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&Do_reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(e,r,a,o){if(void 0===a&&(a=function(){}),void 0===o&&(o=!1),r===1/0&&(r=this.duration_()),r<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var l=1,d=function(){0==--l&&a()};for(var f in(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,r,d)),(o||"main"===this.loaderType_)&&(this.gopBuffer_=function(n,t,i,e){for(var r=Math.ceil((t-e)*Zn.ONE_SECOND_IN_TS),a=Math.ceil((i-e)*Zn.ONE_SECOND_IN_TS),o=n.slice(),l=n.length;l--&&!(n[l].pts<=a););if(-1===l)return o;for(var d=l+1;d--&&!(n[d].pts<=r););return d=Math.max(d,0),o.splice(d,l-d+1),o}(this.gopBuffer_,e,r,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,r,d)),this.inbandTextTracks_)wn(e,r,this.inbandTextTracks_[f]);wn(e,r,this.segmentMetadataTrack_),d()}else this.logger_("skipping remove because no source updater or starting media info")},t.monitorBuffer_=function(){this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),500)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},t.isEndOfStream_=function(e,r,a){if(void 0===e&&(e=this.mediaIndex),void 0===r&&(r=this.playlist_),void 0===a&&(a=this.partIndex),!r||!this.mediaSource_)return!1;var o="number"==typeof e&&r.segments[e];return r.endList&&"open"===this.mediaSource_.readyState&&e+1===r.segments.length&&(!o||!o.parts||a+1===o.parts.length)},t.chooseNextRequest_=function(){var e=this.buffered_(),r=ad(e)||0,a=vo(e,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),d=this.playlist_.segments;if(!d.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var f={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(f.isSyncRequest)f.mediaIndex=function(n,t,i){t=t||[];for(var e=[],r=0,a=0;ai))return a}return 0===e.length?0:e[e.length-1]}(this.currentTimeline_,d,r);else if(null!==this.mediaIndex){var v=d[this.mediaIndex],g="number"==typeof this.partIndex?this.partIndex:-1;f.startOfSegment=v.end?v.end:r,v.parts&&v.parts[g+1]?(f.mediaIndex=this.mediaIndex,f.partIndex=g+1):f.mediaIndex=this.mediaIndex+1}else{var T=Yt.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?r:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),E=T.segmentIndex,x=T.startTime,S=T.partIndex;f.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+r:"currentTime "+this.currentTime_(),f.mediaIndex=E,f.startOfSegment=x,f.partIndex=S}var N=d[f.mediaIndex],F=N&&"number"==typeof f.partIndex&&N.parts&&N.parts[f.partIndex];if(!N||"number"==typeof f.partIndex&&!F)return null;if("number"!=typeof f.partIndex&&N.parts&&(f.partIndex=0,F=N.parts[0]),!a&&F&&!F.independent)if(0===f.partIndex){var j=d[f.mediaIndex-1],G=j.parts&&j.parts.length&&j.parts[j.parts.length-1];G&&G.independent&&(f.mediaIndex-=1,f.partIndex=j.parts.length-1,f.independent="previous segment")}else N.parts[f.partIndex-1].independent&&(f.partIndex-=1,f.independent="previous part");return f.mediaIndex>=d.length-1&&this.mediaSource_&&"ended"===this.mediaSource_.readyState&&!this.seeking_()?null:this.generateSegmentInfo_(f)},t.generateSegmentInfo_=function(e){var r=e.independent,a=e.playlist,o=e.mediaIndex,l=e.startOfSegment,d=e.isSyncRequest,f=e.partIndex,v=e.forceTimestampOffset,g=e.getMediaInfoForTime,T=a.segments[o],E="number"==typeof f&&T.parts[f],x={requestId:"segment-loader-"+Math.random(),uri:E&&E.resolvedUri||T.resolvedUri,mediaIndex:o,partIndex:E?f:null,isSyncRequest:d,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:T.timeline,duration:E&&E.duration||T.duration,segment:T,part:E,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:g,independent:r},S=typeof v<"u"?v:this.isPendingTimestampOffset_;x.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:T.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:S});var N=ad(this.sourceUpdater_.audioBuffered());return"number"==typeof N&&(x.audioAppendStart=N-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(x.gopsToAlignWith=function(n,t,i){if(typeof t>"u"||null===t||!n.length)return[];var r,e=Math.ceil((t-i+3)*Zn.ONE_SECOND_IN_TS);for(r=0;re);r++);return n.slice(r)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),x},t.timestampOffsetForSegment_=function(e){return function(n){var t=n.segmentTimeline,i=n.currentTimeline,e=n.startOfSegment,r=n.buffered;return n.overrideCheck||t!==i?t "+T+" for "+f),function(n,t,i){if(!n[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var e=i;/^cc708_/.test(i)&&(e="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(e);if(r)n[i]=r;else{var o=i,l=i,d=!1,f=(t.options_.vhs&&t.options_.vhs.captionServices||{})[e];f&&(o=f.label,l=f.language,d=f.default),n[i]=t.addRemoteTextTrack({kind:"captions",id:e,default:d,label:o,language:l},!1).track}}}(x,a.vhs_.tech_,f),wn(g,T,x[f]),function(n){var t=n.inbandTextTracks,i=n.captionArray,e=n.timestampOffset;if(i){var r=P().WebKitDataCue||P().VTTCue;i.forEach(function(a){t[a.stream].addCue(new r(a.startTime+e,a.endTime+e,a.text))})}}({captionArray:E,inbandTextTracks:x,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(e,r,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,r,a));var l=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();(function(n,t,i){n.metadataTrack_||(n.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,n.metadataTrack_.inBandMetadataTrackDispatchType=t)})(this.inbandTextTracks_,a,this.vhs_.tech_),function(n){var t=n.inbandTextTracks,i=n.metadataArray,e=n.timestampOffset,r=n.videoDuration;if(i){var a=P().WebKitDataCue||P().VTTCue,o=t.metadataTrack_;if(o&&(i.forEach(function(T){var E=T.cueTime+e;"number"!=typeof E||P().isNaN(E)||E<0||!(E<1/0)||T.frames.forEach(function(x){var S=new a(E,E,x.value||x.url||x.data||"");S.frame=x,S.value=x,function(n){Object.defineProperties(n.frame,{id:{get:function(){return U.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get:function(){return U.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get:function(){return U.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),n.value.data}}})}(S),o.addCue(S)})}),o.cues&&o.cues.length)){for(var l=o.cues,d=[],f=0;f1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+cr(f).join(", ")),v.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+cr(v).join(", "));var g=f.length?f.start(0):0,T=f.length?f.end(f.length-1):0,E=v.length?v.start(0):0,x=v.length?v.end(v.length-1):0;if(T-g<=1&&x-E<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+d.byteLength+", audio buffer: "+cr(f).join(", ")+", video buffer: "+cr(v).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:d}));var N=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+N),this.remove(0,N,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=P().setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3)},!0)},t.handleAppendError_=function(e,r){var a=e.segmentInfo,o=e.type,l=e.bytes;if(r){if(22===r.code)return void this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(o+" append of "+l.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(e){var r=e.segmentInfo,a=e.type,o=e.initSegment,l=e.data,d=e.bytes;if(!d){var f=[l],v=l.byteLength;o&&(f.unshift(o),v+=o.byteLength),d=function(n){var i,t=0;return n.bytes&&(i=new Uint8Array(n.bytes),n.segments.forEach(function(e){i.set(e,t),t+=e.byteLength})),i}({bytes:v,segments:f})}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:d},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:d}))},t.handleSegmentTimingInfo_=function(e,r,a){if(this.pendingSegment_&&r===this.pendingSegment_.requestId){var o=this.pendingSegment_.segment,l=e+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(e,r){var a=r.type,o=r.data;if(o&&o.byteLength&&("audio"!==a||!this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:r.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:l,data:o})}},t.loadSegment_=function(e){var r=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var a=gt({},e,{forceTimestampOffset:!0});gt(e,r.generateSegmentInfo_(a)),r.isPendingTimestampOffset_=!1,r.updateTransmuxerAndRequestSegment_(e)})},t.updateTransmuxerAndRequestSegment_=function(e){var r=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var a=this.createSimplifiedSegmentObj_(e),f=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)||null!==this.mediaIndex&&e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_("Requesting "+Xr(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=ng({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:f,endedTimelineFn:function(){r.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(g){var T=g.message,E=g.level,x=g.stream;r.logger_(Xr(e)+" logged from transmuxer stream "+x+" as a "+E+": "+T)}})},t.trimBackBuffer_=function(e){var r=function(n,t,i){var e=t-Dt.BACK_BUFFER_LENGTH;return n.length&&(e=Math.max(e,n.start(0))),Math.min(t-i,e)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);r>0&&this.remove(0,r)},t.createSimplifiedSegmentObj_=function(e){var r=e.segment,a=e.part,o={resolvedUri:a?a.resolvedUri:r.resolvedUri,byterange:a?a.byterange:r.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===r.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),r.key){var d=r.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(r.key),o.key.iv=d}return r.map&&(o.map=this.initSegmentForMap(r.map)),o},t.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},t.saveBandwidthRelatedStats_=function(e,r){this.pendingSegment_.byteLength=r.bytesReceived,e=e);r++);return n.slice(0,r).concat(t)}(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(e){var r=this.syncController_.mappingForTimeline(e);null!==r&&(this.timeMapping_=r)},t.updateMediaSecondsLoaded_=function(e){this.mediaSecondsLoaded+="number"==typeof e.start&&"number"==typeof e.end?e.end-e.start:e.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},t.trueSegmentStart_=function(e){var r=e.currentStart,o=e.mediaIndex,l=e.firstVideoFrameTimeForData;if(typeof r<"u")return r;if(!e.useVideoTimingInfo)return e.audioTimingInfo.start;var T=e.playlist.segments[o-1];return 0===o||!T||typeof T.start>"u"||T.end!==l+e.currentVideoTimestampOffset?l:e.videoTimingInfo.start},t.waitForAppendsToComplete_=function(e){var r=this.getCurrentMediaInfo_(e);if(!r)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var d="main"===this.loaderType_&&r.hasVideo,f=!this.audioDisabled_&&r.hasAudio&&!r.isMuxed;if(e.waitingOnAppends=0,!e.hasAppendedData_)return!e.timingInfo&&"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);d&&e.waitingOnAppends++,f&&e.waitingOnAppends++,d&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),f&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},t.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(e){var r=function(n,t,i){return"main"===n&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!r&&(this.error({message:r,blacklistDuration:1/0}),this.trigger("error"),!0)},t.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var r=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),r=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),r=!0),r&&this.trigger("timestampoffset")}},t.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var r=this.getMediaInfo_(),o="main"===this.loaderType_&&r&&r.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end="number"==typeof o.end?o.end:o.start+e.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var r=function(n,t){if("hls"!==t)return null;var i=function(n){var t=0;return["video","audio"].forEach(function(i){var e=n[i+"TimingInfo"];if(e){var o,r=e.start,a=e.end;"bigint"==typeof r||"bigint"==typeof a?o=P().BigInt(a)-P().BigInt(r):"number"==typeof r&&"number"==typeof a&&(o=a-r),typeof o<"u"&&o>t&&(t=o)}}),"bigint"==typeof t&&t3*e.playlist.targetDuration,d=o&&o.end&&this.currentTime_()-o.end>3*e.playlist.partTargetDuration;if(l||d)return this.logger_("bad "+(l?"segment":"part")+" "+Xr(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Xr(e))},t.recordThroughput_=function(e){if(e.duration"u"||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},t.remove=function(e,r){wn(e,r,this.subtitlesTrack_)},t.fillBuffer_=function(){var e=this,r=this.chooseNextRequest_();if(r){if(null===this.syncController_.timestampOffsetForTimeline(r.timeline))return this.syncController_.one("timestampoffset",function(){e.state="READY",e.paused()||e.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(r)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},t.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(e,r,a){var o=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(r.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return-101===e.code&&this.handleTimeout_(),-102===e.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,r.stats),this.state="APPENDING",this.trigger("appending");var d=l.segment;if(d.map&&(d.map.bytes=r.map.bytes),l.bytes=r.bytes,"function"!=typeof P().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var f,v=function(){o.subtitlesTrack_.tech_.off("vttjsloaded",f),o.stopForError({message:"Error loading vtt.js"})};return f=function(){o.subtitlesTrack_.tech_.off("vttjserror",v),o.segmentRequestFinished_(e,r,a)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",f),void this.subtitlesTrack_.tech_.one("vttjserror",v)}d.requested=!0;try{this.parseVTTCues_(l)}catch(g){return void this.stopForError({message:g.message})}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.timingInfo=l.cues.length?{start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:{start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=d.duration,l.cues.forEach(function(g){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new(P().VTTCue)(g.startTime,g.endTime,g.text):g)}),function(n){var t=n.cues;if(t)for(var i=0;i1&&e.push(t[a]);e.length&&e.forEach(function(o){return n.removeCue(o)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(e){var r,a=!1;"function"==typeof P().TextDecoder?r=new(P().TextDecoder)("utf8"):(r=P().WebVTT.StringDecoder(),a=!0);var o=new(P().WebVTT.Parser)(P(),P().vttjs,r);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(f){e.timestampmap=f},o.onparsingerror=function(f){U.log.warn("Error encountered when parsing cues: "+f.message)},e.segment.map){var l=e.segment.map.bytes;a&&(l=rc(l)),o.parse(l)}var d=e.bytes;a&&(d=rc(d)),o.parse(d),o.flush()},t.updateTimeMapping_=function(e,r,a){var o=e.segment;if(r){if(!e.cues.length)return void(o.empty=!0);var l=e.timestampmap,d=l.MPEGTS/Zn.ONE_SECOND_IN_TS-l.LOCAL+r.mapping;e.cues.forEach(function(g){g.startTime+=d,g.endTime+=d}),a.syncInfo||(a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(e.cues[0].startTime,e.cues[e.cues.length-1].startTime-o.duration)})}},n}(Ro),Lg=function(n,t){for(var i=n.cues,e=0;e=r.adStartTime&&t<=r.adEndTime)return r}return null},ac=[{name:"VOD",run:function(n,t,i,e,r){return i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(n,t,i,e,r){if(!Object.keys(n.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=yo(t);r=r||0;for(var d=0;d=E)&&(o=E,a={time:T,segmentIndex:v.segmentIndex,partIndex:v.partIndex})}}return a}},{name:"Discontinuity",run:function(n,t,i,e,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l=g)&&(o=g,a={time:v.time,segmentIndex:d,partIndex:null})}}return a}},{name:"Playlist",run:function(n,t,i,e,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Ug=function(s){function n(i){var e;return(e=s.call(this)||this).timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=mi("SyncController"),e}re(n,s);var t=n.prototype;return t.getSyncPoint=function(e,r,a,o){var l=this.runStrategies_(e,r,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(e,r){if(!e||!e.segments)return null;var a=this.runStrategies_(e,r,e.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+En({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(e,r,a,o){for(var l=[],d=0;d86400)U.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var o=a-1;o>=0;o--){var l=e.segments[o];if(l&&typeof l.start<"u"){r.syncInfo={mediaSequence:e.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+r.syncInfo.time+", mediaSequence: "+r.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var r=e.segments[0],a=r.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[r.timeline]=-a}},t.saveSegmentTimingInfo=function(e){var r=e.segmentInfo,a=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(r,r.timingInfo,a),l=r.segment;o&&(this.saveDiscontinuitySyncInfo_(r),r.playlist.syncInfo||(r.playlist.syncInfo={mediaSequence:r.playlist.mediaSequence+r.mediaIndex,time:l.start}));var d=l.dateTimeObject;l.discontinuity&&a&&d&&(this.timelineToDatetimeMappings[l.timeline]=-d.getTime()/1e3)},t.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time},t.mappingForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping},t.calculateSegmentTimeMapping_=function(e,r,a){var f,v,o=e.segment,l=e.part,d=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)d={time:e.startOfSegment,mapping:e.startOfSegment-r.start},a&&(this.timelines[e.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),f=e.startOfSegment,v=r.end+d.mapping;else{if(!d)return!1;f=r.start+d.mapping,v=r.end+d.mapping}return l&&(l.start=f,l.end=v),(!o.start||fv){var g;g=f<0?a.start-En({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:e.mediaIndex,endIndex:l}):a.end+En({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[d]={time:g,accuracy:v}}}},t.dispose=function(){this.trigger("dispose"),this.off()},n}(U.EventTarget),Ng=function(s){function n(){var i;return(i=s.call(this)||this).pendingTimelineChanges_={},i.lastTimelineChanges_={},i}re(n,s);var t=n.prototype;return t.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(e){var r=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.pendingTimelineChanges_[r]={type:r,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[r]},t.lastTimelineChange=function(e){var r=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.lastTimelineChanges_[r]={type:r,from:a,to:o},delete this.pendingTimelineChanges_[r],this.trigger("timelinechange")),this.lastTimelineChanges_[r]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},n}(U.EventTarget),Fg=Od(Ld(function(){function s(x,S,N){return x(N={path:S,exports:{},require:function(j,G){return function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},N.exports),N.exports}var t=s(function(x){function S(F,j){for(var G=0;G-1},S.trigger=function(F){var j=this.listeners[F];if(j)if(2===arguments.length)for(var G=j.length,q=0;q>7))^q]=q;for(ne=he=0;!j[ne];ne^=ge||1,he=ye[he]||1)for(j[ne]=ot=(ot=he^he<<1^he<<2^he<<3^he<<4)>>8^255&ot^99,G[ot]=ne,Je=16843009*K[$e=K[ge=K[ne]]]^65537*$e^257*ge^16843008*ne,Nt=257*K[ot]^16843008*ot,q=0;q<4;q++)N[q][ne]=Nt=Nt<<24^Nt>>>8,F[q][ot]=Je=Je<<24^Je>>>8;for(q=0;q<5;q++)N[q]=N[q].slice(0),F[q]=F[q].slice(0);return S},l=null,d=function(){function x(N){l||(l=o()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var F,j,G,q=this._tables[0][4],ne=this._tables[1],he=N.length,K=1;if(4!==he&&6!==he&&8!==he)throw new Error("Invalid aes key size");var ye=N.slice(0),ge=[];for(this._key=[ye,ge],F=he;F<4*he+28;F++)G=ye[F-1],(F%he==0||8===he&&F%he==4)&&(G=q[G>>>24]<<24^q[G>>16&255]<<16^q[G>>8&255]<<8^q[255&G],F%he==0&&(G=G<<8^G>>>24^K<<24,K=K<<1^283*(K>>7))),ye[F]=ye[F-he]^G;for(j=0;F;j++,F--)G=ye[3&j?F:F-4],ge[j]=F<=4||j<4?G:ne[0][q[G>>>24]]^ne[1][q[G>>16&255]]^ne[2][q[G>>8&255]]^ne[3][q[255&G]]}return x.prototype.decrypt=function(F,j,G,q,ne,he){var ot,Nt,Je,ai,K=this._key[1],ye=F^K[0],ge=q^K[1],$e=G^K[2],Pe=j^K[3],fr=K.length/4-2,si=4,Ei=this._tables[1],Fi=Ei[0],hr=Ei[1],Bi=Ei[2],pr=Ei[3],mr=Ei[4];for(ai=0;ai>>24]^hr[ge>>16&255]^Bi[$e>>8&255]^pr[255&Pe]^K[si],Nt=Fi[ge>>>24]^hr[$e>>16&255]^Bi[Pe>>8&255]^pr[255&ye]^K[si+1],Je=Fi[$e>>>24]^hr[Pe>>16&255]^Bi[ye>>8&255]^pr[255&ge]^K[si+2],Pe=Fi[Pe>>>24]^hr[ye>>16&255]^Bi[ge>>8&255]^pr[255&$e]^K[si+3],si+=4,ye=ot,ge=Nt,$e=Je;for(ai=0;ai<4;ai++)ne[(3&-ai)+he]=mr[ye>>>24]<<24^mr[ge>>16&255]<<16^mr[$e>>8&255]<<8^mr[255&Pe]^K[si++],ot=ye,ye=ge,ge=$e,$e=Pe,Pe=ot},x}(),f=function(x){function S(){var F;return(F=x.call(this,r)||this).jobs=[],F.delay=1,F.timeout_=null,F}e(S,x);var N=S.prototype;return N.processJob_=function(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null},N.push=function(j){this.jobs.push(j),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},S}(r),v=function(S){return S<<24|(65280&S)<<8|(16711680&S)>>8|S>>>24},T=function(){function x(N,F,j,G){var q=x.STEP,ne=new Int32Array(N.buffer),he=new Uint8Array(N.byteLength),K=0;for(this.asyncStream_=new f,this.asyncStream_.push(this.decryptChunk_(ne.subarray(K,K+q),F,j,he)),K=q;K>2),G=new d(Array.prototype.slice.call(N)),q=new Uint8Array(S.byteLength),ne=new Int32Array(q.buffer);for(he=F[0],K=F[1],ye=F[2],ge=F[3],Je=0;Je=0&&(t="main-desc"),t},Pa=function(n,t){n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},No=function(n,t){t.activePlaylistLoader=n,n.load()},Oa={AUDIO:function(n,t){return function(){var e=t.mediaTypes[n],r=t.blacklistCurrentPlaylist;Pa(t.segmentLoaders[n],e);var a=e.activeTrack(),o=e.activeGroup(),l=(o.filter(function(v){return v.default})[0]||o[0]).id,d=e.tracks[l];if(a!==d){for(var f in U.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[f].enabled=e.tracks[f]===d;e.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(n,t){return function(){var i=t.segmentLoaders[n],e=t.mediaTypes[n];U.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Pa(i,e);var r=e.activeTrack();r&&(r.mode="disabled"),e.onTrackChanged()}}},sc={AUDIO:function(n,t,i){if(t){var e=i.tech,r=i.requestOptions,a=i.segmentLoaders[n];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,r),(!e.paused()||o.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),e.paused()||a.load()}),t.on("error",Oa[n](n,i))}},SUBTITLES:function(n,t,i){var e=i.tech,r=i.requestOptions,a=i.segmentLoaders[n],o=i.mediaTypes[n];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,r),a.track(o.activeTrack()),(!e.paused()||l.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),e.paused()||a.load()}),t.on("error",Oa[n](n,i))}},Gg={AUDIO:function(n,t){var i=t.vhs,e=t.sourceType,r=t.segmentLoaders[n],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[n],d=l.groups,f=l.tracks,v=l.logger_,g=t.masterPlaylistLoader,T=Cn(g.master);for(var E in(!o[n]||0===Object.keys(o[n]).length)&&(o[n]={main:{default:{default:!0}}},T&&(o[n].main.default.playlists=g.master.playlists)),o[n])for(var x in d[E]||(d[E]=[]),o[n][E]){var S=o[n][E][x],N=void 0;if(T?(v("AUDIO group '"+E+"' label '"+x+"' is a master playlist"),S.isMasterPlaylist=!0,N=null):N="vhs-json"===e&&S.playlists?new $r(S.playlists[0],i,a):S.resolvedUri?new $r(S.resolvedUri,i,a):S.playlists&&"dash"===e?new Io(S.playlists[0],i,a,g):null,S=U.mergeOptions({id:x,playlistLoader:N},S),sc[n](n,S.playlistLoader,t),d[E].push(S),typeof f[x]>"u"){var F=new U.AudioTrack({id:x,kind:jg(S),enabled:!1,language:S.language,default:S.default,label:x});f[x]=F}}r.on("error",Oa[n](n,t))},SUBTITLES:function(n,t){var i=t.tech,e=t.vhs,r=t.sourceType,a=t.segmentLoaders[n],o=t.requestOptions,l=t.master.mediaGroups,d=t.mediaTypes[n],f=d.groups,v=d.tracks,g=t.masterPlaylistLoader;for(var T in l[n])for(var E in f[T]||(f[T]=[]),l[n][T])if(!l[n][T][E].forced){var x=l[n][T][E],S=void 0;if("hls"===r)S=new $r(x.resolvedUri,e,o);else if("dash"===r){if(!x.playlists.filter(function(j){return j.excludeUntil!==1/0}).length)return;S=new Io(x.playlists[0],e,o,g)}else"vhs-json"===r&&(S=new $r(x.playlists?x.playlists[0]:x.resolvedUri,e,o));if(x=U.mergeOptions({id:E,playlistLoader:S},x),sc[n](n,x.playlistLoader,t),f[T].push(x),typeof v[E]>"u"){var F=i.addRemoteTextTrack({id:E,kind:"subtitles",default:x.default&&x.autoselect,language:x.language,label:E},!1).track;v[E]=F}}a.on("error",Oa[n](n,t))},"CLOSED-CAPTIONS":function(n,t){var i=t.tech,e=t.master.mediaGroups,r=t.mediaTypes[n],a=r.groups,o=r.tracks;for(var l in e[n])for(var d in a[l]||(a[l]=[]),e[n][l]){var f=e[n][l][d];if(/^(?:CC|SERVICE)/.test(f.instreamId)){var v=i.options_.vhs&&i.options_.vhs.captionServices||{},g={label:d,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(v[g.instreamId]&&(g=U.mergeOptions(g,v[g.instreamId])),void 0===g.default&&delete g.default,a[l].push(U.mergeOptions({id:d},f)),typeof o[d]>"u"){var T=i.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;o[d]=T}}}}},Wg=function s(n,t){for(var i=0;i"u")&&(j=1/0),Ni=f,e.experimentalBufferBasedABR=Boolean(S),e.experimentalLeastPixelDiffSelector=Boolean(N),e.withCredentials=o,e.tech_=l,e.vhs_=l.vhs,e.sourceType_=E,e.useCueTags_=v,e.blacklistDuration=g,e.maxPlaylistRetries=j,e.enableLowInitialPlaylist=T,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:j,timeout:null},e.on("error",e.pauseLoading),e.mediaTypes_=$g(),e.mediaSource=new(P().MediaSource),e.handleDurationChange_=e.handleDurationChange_.bind(Ne(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(Ne(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(Ne(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=U.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new Ug(i),e.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new Bg,e.sourceUpdater_=new ic(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new Ng;var G={vhs:e.vhs_,parse708captions:i.parse708captions,captionServices:F,mediaSource:e.mediaSource,currentTime:e.tech_.currentTime.bind(e.tech_),seekable:function(){return e.seekable()},seeking:function(){return e.tech_.seeking()},duration:function(){return e.duration()},hasPlayed:function(){return e.hasPlayed_},goalBufferLength:function(){return e.goalBufferLength()},bandwidth:d,syncController:e.syncController_,decrypter:e.decrypter_,sourceType:e.sourceType_,inbandTextTracks:e.inbandTextTracks_,cacheEncryptionKeys:x,sourceUpdater:e.sourceUpdater_,timelineChangeController:e.timelineChangeController_,experimentalExactManifestTimings:i.experimentalExactManifestTimings};e.masterPlaylistLoader_="dash"===e.sourceType_?new Io(r,e.vhs_,e.requestOptions_):new $r(r,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Ro(U.mergeOptions(G,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),i),e.audioSegmentLoader_=new Ro(U.mergeOptions(G,{loaderType:"audio"}),i),e.subtitleSegmentLoader_=new Og(U.mergeOptions(G,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks}),i),e.setupSegmentLoaderListeners_(),e.experimentalBufferBasedABR&&(e.masterPlaylistLoader_.one("loadedplaylist",function(){return e.startABRTimer_()}),e.tech_.on("pause",function(){return e.stopABRTimer_()}),e.tech_.on("play",function(){return e.startABRTimer_()})),Xg.forEach(function(ne){e[ne+"_"]=Jg.bind(Ne(e),ne)}),e.logger_=mi("MPC"),e.triggeredFmp4Usage=!1,"none"===e.tech_.preload()?(e.loadOnPlay_=function(){e.loadOnPlay_=null,e.masterPlaylistLoader_.load()},e.tech_.one("play",e.loadOnPlay_)):e.masterPlaylistLoader_.load(),e.timeToLoadedData__=-1,e.mainAppendsToLoadedData__=-1,e.audioAppendsToLoadedData__=-1;var q="none"===e.tech_.preload()?"play":"loadstart";return e.tech_.one(q,function(){var ne=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-ne,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}re(n,s);var t=n.prototype;return t.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},t.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},t.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),r=this.audioAppendsToLoadedData_();return-1===e||-1===r?-1:e+r},t.timeToLoadedData_=function(){return this.timeToLoadedData__},t.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},t.switchMedia_=function(e,r,a){var o=this.media(),l=o&&(o.id||o.uri),d=e.id||e.uri;l&&l!==d&&(this.logger_("switch media "+l+" -> "+d+" from "+r),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+r})),this.masterPlaylistLoader_.media(e,a)},t.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=P().setInterval(function(){return e.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(P().clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var e=this.master(),r=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return r;var l,a=e.mediaGroups.AUDIO,o=Object.keys(a);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var d=a.main||o.length&&a[o[0]];for(var f in d)if(d[f].default){l={label:f};break}}if(!l)return r;var v=[];for(var g in a)if(a[g][l.label]){var T=a[g][l.label];if(T.playlists&&T.playlists.length)v.push.apply(v,T.playlists);else if(T.uri)v.push(T);else if(e.playlists.length)for(var E=0;E1&&Cn(t.master))for(var d=0;d"u"?o:null!==i&&o&&o.filter(function(v){return v.id===i.id})[0]||null}}(E,n),t[E].activeTrack=Kg[E](E,n),t[E].onGroupChanged=function(n,t){return function(){var i=t.segmentLoaders,e=i[n],r=i.main,a=t.mediaTypes[n],o=a.activeTrack(),l=a.getActiveGroup(),d=a.activePlaylistLoader,f=a.lastGroup_;if((!l||!f||l.id!==f.id)&&(a.lastGroup_=l,a.lastTrack_=o,Pa(e,a),l&&!l.isMasterPlaylist)){if(!l.playlistLoader)return void(d&&r.resetEverything());e.resyncLoader(),No(l.playlistLoader,a)}}}(E,n),t[E].onGroupChanging=function(n,t){return function(){var i=t.segmentLoaders[n];t.mediaTypes[n].lastGroup_=null,i.abort(),i.pause()}}(E,n),t[E].onTrackChanged=function(n,t){return function(){var i=t.masterPlaylistLoader,e=t.segmentLoaders,r=e[n],a=e.main,o=t.mediaTypes[n],l=o.activeTrack(),d=o.getActiveGroup(),f=o.activePlaylistLoader,v=o.lastTrack_;if((!v||!l||v.id!==l.id)&&(o.lastGroup_=d,o.lastTrack_=l,Pa(r,o),d)){if(d.isMasterPlaylist){if(!l||!v||l.id===v.id)return;var g=t.vhs.masterPlaylistController_,T=g.selectPlaylist();if(g.media()===T)return;return o.logger_("track change. Switching master audio from "+v.id+" to "+l.id),i.pause(),a.resetEverything(),void g.fastQualityChange_(T)}if("AUDIO"===n){if(!d.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}if(f===d.playlistLoader)return void No(d.playlistLoader,o);r.track&&r.track(l),r.resetEverything(),No(d.playlistLoader,o)}}}(E,n),t[E].getActiveGroup=function(n,t){var i=t.mediaTypes;return function(){var e=i[n].activeTrack();return e?i[n].activeGroup(e):null}}(E,n)});var d=t.AUDIO.activeGroup();if(d){var f=(d.filter(function(E){return E.default})[0]||d[0]).id;t.AUDIO.tracks[f].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}i.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(E){return t[E].onGroupChanged()})}),i.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(E){return t[E].onGroupChanging()})});var g=function(){t.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};for(var T in e.audioTracks().addEventListener("change",g),e.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",function(){e.audioTracks().removeEventListener("change",g),e.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),e.clearTracks("audio"),t.AUDIO.tracks)e.audioTracks().addTrack(t.AUDIO.tracks[T])}({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),r),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var r=e.masterPlaylistLoader_.media();if(!r){var a;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(a=e.selectInitialPlaylist()),a||(a=e.selectPlaylist()),!a||!e.shouldSwitchToMedia_(a))return;if(e.initialMedia_=a,e.switchMedia_(e.initialMedia_,"initial"),"vhs-json"!==e.sourceType_||!e.initialMedia_.segments)return;r=e.initialMedia_}e.handleUpdatedMediaPlaylist(r)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var r=e.masterPlaylistLoader_.media(),a=1.5*r.targetDuration*1e3;e.requestOptions_.timeout=bo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?0:a,e.mainSegmentLoader_.playlist(r,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var r=e.masterPlaylistLoader_.media();"playlist-unchanged"!==r.lastExcludeReason_&&e.stuckAtPlaylistEnd_(r)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},t.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},t.triggerPresenceUsage_=function(e,r){var a=e.mediaGroups||{},o=!0,l=Object.keys(a.AUDIO);for(var d in a.AUDIO)for(var f in a.AUDIO[d])a.AUDIO[d][f].uri||(o=!1);o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Ni.Playlist.isAes(r)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(e){var r=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine();return function(n){var t=n.currentPlaylist,i=n.buffered,e=n.currentTime,r=n.nextPlaylist,a=n.bufferLowWaterLine,o=n.bufferHighWaterLine,l=n.duration,d=n.experimentalBufferBasedABR,f=n.log;if(!r)return U.log.warn("We received no playlist to switch to. Please check your stream."),!1;var v="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return f(v+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var g=Boolean(Yr(i,e).length);if(!t.endList)return g||"number"!=typeof t.partTargetDuration?(f(v+" as current playlist is live"),!0):(f("not "+v+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var T=vo(i,e),E=d?Dt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Dt.MAX_BUFFER_LOW_WATER_LINE;if(lS)&&T>=a){var F=v+" as forwardBuffer >= bufferLowWaterLine ("+T+" >= "+a+")";return d&&(F+=" and next bandwidth > current bandwidth ("+x+" > "+S+")"),f(F),!0}return f("not "+v+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:a,currentPlaylist:r,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var a=e.selectPlaylist();e.shouldSwitchToMedia_(a)&&e.switchMedia_(a,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var r=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();o&&e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",r),this.audioSegmentLoader_.on("trackinfo",r),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},t.fastQualityChange_=function(e){var r=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){r.tech_.setCurrentTime(U.browser.IE_VERSION||U.browser.IS_EDGE?r.tech_.currentTime()+.04:r.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*r,a.excludeUntil=v,e.reason&&(a.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var g=this.selectPlaylist();if(!g)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");(e.internal?this.logger_:U.log.warn)((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(e.message?" "+e.message:"")+" Switching to playlist "+g.id+"."),g.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),g.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var x=g.targetDuration/2*1e3||5e3,S="number"==typeof g.lastRequest&&Date.now()-g.lastRequest<=x;return this.switchMedia_(g,"exclude",d||S)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(e,r){var a=this,o=[],l="all"===e;(l||"main"===e)&&o.push(this.masterPlaylistLoader_);var d=[];(l||"audio"===e)&&d.push("AUDIO"),(l||"subtitle"===e)&&(d.push("CLOSED-CAPTIONS"),d.push("SUBTITLES")),d.forEach(function(f){var v=a.mediaTypes_[f]&&a.mediaTypes_[f].activePlaylistLoader;v&&o.push(v)}),["main","audio","subtitle"].forEach(function(f){var v=a[f+"SegmentLoader_"];v&&(e===f||"all"===e)&&o.push(v)}),o.forEach(function(f){return r.forEach(function(v){"function"==typeof f[v]&&f[v]()})})},t.setCurrentTime=function(e){var r=Yr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?r&&r.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Ni.Playlist.duration(e):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var r=this.masterPlaylistLoader_.media();if(r){var a=this.syncController_.getExpiredTime(r,this.duration());if(null!==a){var d,f,o=this.masterPlaylistLoader_.master,l=Ni.Playlist.seekable(r,a,Ni.Playlist.liveEdgeDelay(o,r));0===l.length||this.mediaTypes_.AUDIO.activePlaylistLoader&&(r=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(a=this.syncController_.getExpiredTime(r,this.duration()))||0===(e=Ni.Playlist.seekable(r,a,Ni.Playlist.liveEdgeDelay(o,r))).length)||(this.seekable_&&this.seekable_.length&&(d=this.seekable_.end(0),f=this.seekable_.start(0)),this.seekable_=e?e.start(0)>l.end(0)||l.start(0)>e.end(0)?l:U.createTimeRanges([[e.start(0)>l.start(0)?e.start(0):l.start(0),e.end(0)0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)}},t.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(r){var a=e.mediaTypes_[r].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,r=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!r||!a)},t.getCodecsOrExclude_=function(){var e=this,r={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};r.video=r.main;var a=An(this.master(),this.media()),o={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(r.main.hasVideo&&(o.video=a.video||r.main.videoCodec||"avc1.4d400d"),r.main.isMuxed&&(o.video+=","+(a.audio||r.main.audioCodec||Qt)),(r.main.hasAudio&&!r.main.isMuxed||r.audio.hasAudio||l)&&(o.audio=a.audio||r.main.audioCodec||r.audio.audioCodec||Qt,r.audio.isFmp4=r.main.hasAudio&&!r.main.isMuxed?r.main.isFmp4:r.audio.isFmp4),o.audio||o.video){var v,f={};if(["video","audio"].forEach(function(x){if(o.hasOwnProperty(x)&&!function(S,N){return S?ii(N):ci(N)}(r[x].isFmp4,o[x])){var S=r[x].isFmp4?"browser":"muxer";f[S]=f[S]||[],f[S].push(o[x]),"audio"===x&&(v=S)}}),l&&v&&this.media().attributes.AUDIO){var g=this.media().attributes.AUDIO;this.master().playlists.forEach(function(x){(x.attributes&&x.attributes.AUDIO)===g&&x!==e.media()&&(x.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+v+' does not support codec(s): "'+o.audio+'"')}if(!Object.keys(f).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var E=[];if(["video","audio"].forEach(function(x){var S=(Xe(e.sourceUpdater_.codecs[x]||"")[0]||{}).type,N=(Xe(o[x]||"")[0]||{}).type;S&&N&&S.toLowerCase()!==N.toLowerCase()&&E.push('"'+e.sourceUpdater_.codecs[x]+'" -> "'+o[x]+'"')}),E.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+E.join(", ")+".",blacklistDuration:1/0,internal:!0})}return o}var T=Object.keys(f).reduce(function(x,S){return x&&(x+=", "),x+(S+' does not support codec(s): "')+f[S].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:T,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},t.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var r=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(r)}}},t.excludeUnsupportedVariants_=function(){var e=this,r=this.master().playlists,a=[];Object.keys(r).forEach(function(o){var l=r[o];if(-1===a.indexOf(l.id)){a.push(l.id);var d=An(e.master,l),f=[];d.audio&&!ci(d.audio)&&!ii(d.audio)&&f.push("audio codec "+d.audio),d.video&&!ci(d.video)&&!ii(d.video)&&f.push("video codec "+d.video),d.text&&"stpp.ttml.im1t"===d.text&&f.push("text codec "+d.text),f.length&&(l.excludeUntil=1/0,e.logger_("excluding "+l.id+" for unsupported: "+f.join(", ")))}})},t.excludeIncompatibleVariants_=function(e){var r=this,a=[],o=this.master().playlists,l=Aa(Xe(e)),d=Gd(l),f=l.video&&Xe(l.video)[0]||null,v=l.audio&&Xe(l.audio)[0]||null;Object.keys(o).forEach(function(g){var T=o[g];if(-1===a.indexOf(T.id)&&T.excludeUntil!==1/0){a.push(T.id);var E=[],x=An(r.masterPlaylistLoader_.master,T),S=Gd(x);if(x.audio||x.video){if(S!==d&&E.push('codec count "'+S+'" !== "'+d+'"'),!r.sourceUpdater_.canChangeType()){var N=x.video&&Xe(x.video)[0]||null,F=x.audio&&Xe(x.audio)[0]||null;N&&f&&N.type.toLowerCase()!==f.type.toLowerCase()&&E.push('video codec "'+N.type+'" !== "'+f.type+'"'),F&&v&&F.type.toLowerCase()!==v.type.toLowerCase()&&E.push('audio codec "'+F.type+'" !== "'+v.type+'"')}E.length&&(T.excludeUntil=1/0,r.logger_("blacklisting "+T.id+": "+E.join(" && ")))}}})},t.updateAdCues_=function(e){var r=0,a=this.seekable();a.length&&(r=a.start(0)),function(n,t,i){if(void 0===i&&(i=0),n.segments)for(var r,e=i,a=0;a"u"?o:(e?delete r.disabled:r.disabled=!0,e!==o&&!a&&(i(),n.trigger(e?"renditionenabled":"renditiondisabled")),e)}}(n.playlists,t.id,o)},oc=["seeking","seeked","pause","playing","error"],av=function(){function s(t){var i=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=mi("PlaybackWatcher"),this.logger_("initialize");var e=function(){return i.monitorCurrentTime_()},r=function(){return i.monitorCurrentTime_()},a=function(){return i.techWaiting_()},o=function(){return i.cancelTimer_()},l=this.masterPlaylistController_,d=["main","subtitle","audio"],f={};d.forEach(function(g){f[g]={reset:function(){return i.resetSegmentDownloads_(g)},updateend:function(){return i.checkSegmentDownloads_(g)}},l[g+"SegmentLoader_"].on("appendsdone",f[g].updateend),l[g+"SegmentLoader_"].on("playlistupdate",f[g].reset),i.tech_.on(["seeked","seeking"],f[g].reset)});var v=function(T){["main","audio"].forEach(function(E){l[E+"SegmentLoader_"][T]("appended",i.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){i.fixesBadSeeks_()&&(i.consecutiveUpdates=0,i.lastRecordedTime=i.tech_.currentTime(),v("off"))},this.clearSeekingAppendCheck_=function(){return v("off")},this.watchForBadSeeking_=function(){i.clearSeekingAppendCheck_(),v("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(oc,o),this.tech_.on("canplay",r),this.tech_.one("play",e),this.dispose=function(){i.clearSeekingAppendCheck_(),i.logger_("dispose"),i.tech_.off("waiting",a),i.tech_.off(oc,o),i.tech_.off("canplay",r),i.tech_.off("play",e),i.tech_.off("seeking",i.watchForBadSeeking_),i.tech_.off("seeked",i.clearSeekingAppendCheck_),d.forEach(function(g){l[g+"SegmentLoader_"].off("appendsdone",f[g].updateend),l[g+"SegmentLoader_"].off("playlistupdate",f[g].reset),i.tech_.off(["seeked","seeking"],f[g].reset)}),i.checkCurrentTimeTimeout_&&P().clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var n=s.prototype;return n.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&P().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=P().setTimeout(this.monitorCurrentTime_.bind(this),250)},n.resetSegmentDownloads_=function(i){var e=this.masterPlaylistController_[i+"SegmentLoader_"];this[i+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+i+" loader"),this[i+"StalledDownloads_"]=0,this[i+"Buffered_"]=e.buffered_()},n.checkSegmentDownloads_=function(i){var e=this.masterPlaylistController_,r=e[i+"SegmentLoader_"],a=r.buffered_(),o=function(n,t){if(n===t)return!1;if(!n&&t||!t&&n||n.length!==t.length)return!0;for(var i=0;i=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&i===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):i===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=i)}},n.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},n.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var o,e=this.seekable(),r=this.tech_.currentTime();if(this.afterSeekableWindow_(e,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(o=e.end(e.length-1)),this.beforeSeekableWindow_(e,r)){var d=e.start(0);o=d+(d===e.end(0)?0:bi)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+r+" with seekable range "+nd(e)+". Seeking to "+o+"."),this.tech_.setCurrentTime(o),!0;for(var f=this.masterPlaylistController_.sourceUpdater_,v=this.tech_.buffered(),g=f.audioBuffer?f.audioBuffered():null,T=f.videoBuffer?f.videoBuffered():null,E=this.media(),x=E.partTargetDuration?E.partTargetDuration:2*(E.targetDuration-Ki),S=[g,T],N=0;N "+r.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}},n.techWaiting_=function(){var i=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(i,e)){var r=i.end(i.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+r),this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var d=xa(o,e);if(d.length>0){var f=d.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+f+", seeking to "+d.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*f,e),!0}return!1},n.afterSeekableWindow_=function(i,e,r,a){if(void 0===a&&(a=!1),!i.length)return!1;var o=i.end(i.length-1)+bi;return!r.endList&&a&&(o=i.end(i.length-1)+3*r.targetDuration),e>o},n.beforeSeekableWindow_=function(i,e){return!!(i.length&&i.start(0)>0&&e2)return{start:o,end:l}}return null},s}(),sv={errorInterval:30,getSource:function(n){return n(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ov=function s(n,t){var i=0,e=0,r=U.mergeOptions(sv,t);n.ready(function(){n.trigger({type:"usage",name:"vhs-error-reload-initialized"}),n.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){e&&n.currentTime(e)},o=function(g){null!=g&&(e=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",a),n.src(g),n.trigger({type:"usage",name:"vhs-error-reload"}),n.trigger({type:"usage",name:"hls-error-reload"}),n.play())},l=function(){return Date.now()-i<1e3*r.errorInterval?(n.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void n.trigger({type:"usage",name:"hls-error-reload-canceled"})):r.getSource&&"function"==typeof r.getSource?(i=Date.now(),r.getSource.call(n,o)):void U.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},d=function v(){n.off("loadedmetadata",a),n.off("error",l),n.off("dispose",v)};n.on("error",l),n.on("dispose",d),n.reloadSourceOnError=function(g){d(),s(n,g)}},Lt={PlaylistLoader:$r,Playlist:Yt,utils:Em,STANDARD_PLAYLIST_SELECTOR:Kd,INITIAL_PLAYLIST_SELECTOR:function(){var n=this,t=this.playlists.master.playlists.filter(Yt.isEnabled);return Qr(t,function(e,r){return Lo(e,r)}),t.filter(function(e){return!!An(n.playlists.master,e).video})[0]||null},lastBandwidthSelector:Kd,movingAverageBandwidthSelector:function(n){var t=-1,i=-1;if(n<0||n>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&P().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=n*this.systemBandwidth+(1-n)*t,i=this.systemBandwidth),Zd(this.playlists.master,t,parseInt(Ia(this.tech_.el(),"width"),10)*e,parseInt(Ia(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Lo,comparePlaylistResolution:function(n,t){var i,e;return n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(i=n.attributes.RESOLUTION.width),i=i||P().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(e=t.attributes.RESOLUTION.width),i===(e=e||P().Number.MAX_VALUE)&&n.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?n.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-e},xhr:xd()};Object.keys(Dt).forEach(function(s){Object.defineProperty(Lt,s,{get:function(){return U.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Dt[s]},set:function(t){U.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?U.log.warn("value of Vhs."+s+" must be greater than or equal to 0"):Dt[s]=t}})});var lc="videojs-vhs",dc=function(n,t){for(var i=t.media(),e=-1,r=0;r=g&&f>=g?Math.max(f,T):T}return f},set:function(f){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=f,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set:function(){U.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return cr(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return cr(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&function(n){if(!P().localStorage)return!1;var t=cc();t=t?U.mergeOptions(t,n):n;try{P().localStorage.setItem(lc,JSON.stringify(t))}catch{return!1}}({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n){n.representations=function(){var t=n.masterPlaylistController_.master(),i=Cn(t)?n.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!To(e)}).map(function(e,r){return new rv(n,e,e.id)}):[]}}(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=P().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var e=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(n){var t=n.player,i=n.sourceKeySystems,e=n.audioMedia,r=n.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var o=function(n,t){return n.reduce(function(i,e){if(!e.contentProtection)return i;var r=t.reduce(function(a,o){var l=e.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(r).length&&i.push(r),i},[])}(e?r.concat([e]):r,Object.keys(i)),l=[],d=[];return o.forEach(function(f){d.push(new Promise(function(v,g){t.tech_.one("keysessioncreated",v)})),l.push(new Promise(function(v,g){t.eme.initializeMediaKeys({keySystems:f},function(T){T?g(T):v()})}))}),Promise.race([Promise.all(l),Promise.race(d)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:r&&r.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var e=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=function(n){var t=n.player,a=function(n,t,i){if(!n)return n;var e={};t&&t.attributes&&t.attributes.CODECS&&(e=Aa(Xe(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(e.audio=i.attributes.CODECS);var r=$t(e.video),a=$t(e.audio),o={};for(var l in n)o[l]={},a&&(o[l].audioContentType=a),r&&(o[l].videoContentType=r),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),"string"==typeof n[l]&&(o[l].url=n[l]);return U.mergeOptions(n,o)}(n.sourceKeySystems,n.media,n.audioMedia);return!(!a||(t.currentSource().keySystems=a,a&&!t.eme&&(U.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))}({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:r&&r.media()});this.player_.tech_.on("keystatuschange",function(o){"output-restricted"===o.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+o.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==U.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},t.setupQualityLevels_=function(){var e=this,r=U.players[this.tech_.options_.playerId];!r||!r.qualityLevels||this.qualityLevels_||(this.qualityLevels_=r.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n,t){t.representations().forEach(function(i){n.addQualityLevel(i)}),dc(n,t.playlists)}(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){dc(e.qualityLevels_,e.playlists)}))},n.version=function(){return{"@videojs/http-streaming":"2.13.1","mux.js":"6.0.1","mpd-parser":"0.21.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return ic.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&P().URL.revokeObjectURL&&(P().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(e,r){return function(n){var t=n.playlist,i=n.time,e=void 0===i?void 0:i,r=n.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===e)return r({message:"getProgramTime: playlist and time must be provided"});var a=function(n,t){if(!t||!t.segments||0===t.segments.length)return null;for(var e,i=0,r=0;ri){if(n>i+.25*a.duration)return null;e=a}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:i-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}}(e,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:e},l=function(n,t){if(!t.dateTimeObject)return null;var a=n-(t.videoTimingInfo.transmuxedPresentationStart+t.videoTimingInfo.transmuxerPrependedSeconds);return new Date(t.dateTimeObject.getTime()+1e3*a)}(e,a.segment);return l&&(o.programDateTime=l.toISOString()),r(null,o)}({playlist:this.masterPlaylistController_.media(),time:e,callback:r})},t.seekToProgramTime=function(e,r,a,o){return void 0===a&&(a=!0),void 0===o&&(o=2),Om({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:r})},n}(U.getComponent("Component")),La={name:"videojs-http-streaming",VERSION:"2.13.1",canHandleSource:function(n,t){void 0===t&&(t={});var i=U.mergeOptions(U.options,t);return La.canPlayType(n.type,i)},handleSource:function(n,t,i){void 0===i&&(i={});var e=U.mergeOptions(U.options,i);return t.vhs=new Fo(n,t,e),U.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return U.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=xd(),t.vhs.src(n.src,n.type),t.vhs},canPlayType:function(n,t){void 0===t&&(t={});var i=U.mergeOptions(U.options,t),e=i.vhs,r=(e=void 0===e?{}:e).overrideNative,a=void 0===r?!U.browser.IS_ANY_SAFARI:r,o=i.hls,l=(o=void 0===o?{}:o).overrideNative,d=void 0!==l&&l,f=sn(n);return f&&(!Lt.supportsTypeNatively(f)||d||a)?"maybe":""}};ii("avc1.4d400d,mp4a.40.2")&&U.getTech("Html5").registerSourceHandler(La,0),U.VhsHandler=Fo,Object.defineProperty(U,"HlsHandler",{get:function(){return U.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Fo},configurable:!0}),U.VhsSourceHandler=La,Object.defineProperty(U,"HlsSourceHandler",{get:function(){return U.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),La},configurable:!0}),U.Vhs=Lt,Object.defineProperty(U,"Hls",{get:function(){return U.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Lt},configurable:!0}),U.use||(U.registerComponent("Hls",Lt),U.registerComponent("Vhs",Lt)),U.options.vhs=U.options.vhs||{},U.options.hls=U.options.hls||{},U.getPlugin&&U.getPlugin("reloadSourceOnError")||(U.registerPlugin||U.plugin)("reloadSourceOnError",function(n){ov(this,n)});const Sv=U,Ev=["target"];let Cv=(()=>{class s{constructor(t){this.gs=t,this.subtitlesOctopus=null,this.videoUrl=null,this.videoThumb=null,this.subtitleUrl=null,this.subtitleFonts=[]}ngOnInit(){this.gs.isBrowser&&this.target&&this.videoUrl&&(this.gs.log("[VIDEO-JS_INIT_URL]",this.videoUrl),this.player=Sv(this.target.nativeElement,{autoplay:!1,controls:!0,fluid:!0,muted:!1,sources:[{src:this.videoUrl,type:"video/mp4"}],poster:this.videoThumb},()=>{this.gs.log("[VIDEO-JS_READY]",this.player),this.initSubtitle()}))}ngOnDestroy(){this.subtitlesOctopus?.dispose(),this.player?.dispose()}ngOnChanges(){this.subtitlesOctopus?this.subtitleUrl&&this.subtitlesOctopus.setTrackByUrl(this.subtitleUrl):this.initSubtitle()}initSubtitle(){this.subtitleUrl&&(this.subtitlesOctopus=new SubtitlesOctopus({video:this.target.nativeElement,subUrl:this.subtitleUrl,fonts:this.subtitleFonts,workerUrl:"/assets/lib/subtitles-octopus-worker.js",legacyWorkerUrl:"/assets/lib/subtitles-octopus-worker-legacy.js"}),this.gs.log("[SUBTITLE_INIT]",this.subtitlesOctopus))}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(ke.U))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-vjs-player"]],viewQuery:function(i,e){if(1&i&&u.Gf(Ev,7),2&i){let r;u.iGM(r=u.CRH())&&(e.target=r.first)}},inputs:{videoUrl:"videoUrl",videoThumb:"videoThumb",subtitleUrl:"subtitleUrl",subtitleFonts:"subtitleFonts"},features:[u.TTD],decls:2,vars:0,consts:[["controls","","muted","","playsinline","","preload","none",1,"video-js","w-100"],["target",""]],template:function(i,e){1&i&&u._UZ(0,"video",0,1)}})}return s})();var kv=H(8124),Av=H(3710),fc=H(7443);function wv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",23),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.hYB("routerLink","/anime/",t.berkasData.anime_.id,"-",t.animeName,""),u.xp6(1),u.s9C("src",t.berkasData.anime_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.anime_.name)}}function Iv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",23),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.MGl("routerLink","/dorama/",t.berkasData.dorama_.slug,""),u.xp6(1),u.s9C("src",t.berkasData.dorama_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.dorama_.name)}}function Dv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option"),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(1),u.MGl("src","",t.ENV.baseUrl,"/assets/img/favicon.png",u.LSH),u.xp6(2),u.Oqu(t.berkasData.sn_code)}}function Pv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",23),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=n.$implicit;u.MGl("routerLink","/fansub/",t.slug,""),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.Oqu(t.name)}}function Ov(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return u.KtG(e.ddl(e.berkasData.attachment_.id))}),u._UZ(1,"mat-icon",41),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.orig||t.lampiran.name+"."+t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.lampiran.orig?null:t.lampiran.orig.split(".")[0])||t.lampiran.name,0,5),".....",t.lampiran.ext," (",u.lcZ(4,9,t.lampiran.size),") ")}}function Lv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",42),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return u.KtG(e.cancel_dl(e.berkasData.attachment_.id))}),u._UZ(1,"mat-icon",43),u._uU(2," Batal Unduh "),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.orig||t.lampiran.name+"."+t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan")}}function Rv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return u.KtG(e.saveFileAs(e.berkasData.attachment_.id))}),u._UZ(1,"mat-icon",44),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.orig||t.lampiran.name+"."+t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.lampiran.orig?null:t.lampiran.orig.split(".")[0])||t.lampiran.name,0,5),".....",t.lampiran.ext," (",u.lcZ(4,9,t.lampiran.size),") ")}}function Mv(s,n){if(1&s&&(u.TgZ(0,"div",33),u._uU(1),u._UZ(2,"br"),u._uU(3),u._UZ(4,"br")(5,"mat-progress-bar",45),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.AsE(" ",t.lampiran.percentage>=100?"Selesai Mengunduh ... ":"Sedang Mengunduh ... "," ",t.lampiran.totals," Bytes "),u.xp6(2),u.AsE(" ",t.lampiran.percentage,"% @ ",t.lampiran.speed," KB/s "),u.xp6(2),u.Q6J("mode",t.lampiran.mode)("value",t.lampiran.percentage)}}function Uv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",47),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(5);return u.KtG(e.standardDdlVideo(e.berkasData.attachment_.id))}),u._uU(1," Unduhan Macet? "),u.TgZ(2,"i")(3,"u"),u._uU(4,"Coba Gunakan Unduhan Biasa~"),u.qZA()()()}}function Nv(s,n){if(1&s&&(u.TgZ(0,"div",18),u.YNc(1,Uv,5,0,"div",46),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Q6J("ngIf",t.lampiran.isDownloading)}}function Fv(s,n){1&s&&(u.TgZ(0,"div",48),u._UZ(1,"hr",49),u.qZA())}function Bv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",42),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.standardDdlSubsFont(r.id))}),u._UZ(1,"mat-icon",50),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.hYB("matTooltip","",t.orig||t.name+"."+t.ext," :: ",t.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.orig?null:t.orig.split(".")[0])||t.name,0,5),".....",t.ext," (",u.lcZ(4,9,t.size),") ")}}function jv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",42),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.standardDdlSubsFont(r.id))}),u._UZ(1,"mat-icon",51),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.hYB("matTooltip","",t.orig||t.name+"."+t.ext," :: ",t.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.orig?null:t.orig.split(".")[0])||t.name,0,5),".....",t.ext," (",u.lcZ(4,9,t.size),") ")}}function Hv(s,n){if(1&s&&(u.TgZ(0,"div",32)(1,"div",33),u.YNc(2,Ov,5,11,"button",34),u.YNc(3,Lv,3,2,"button",35),u.YNc(4,Rv,5,11,"button",34),u.TgZ(5,"div",13),u.YNc(6,Mv,6,6,"div",36),u.qZA(),u.YNc(7,Nv,2,1,"div",37),u.YNc(8,Fv,2,0,"div",38),u.YNc(9,Bv,5,11,"button",39),u.YNc(10,jv,5,11,"button",39),u.qZA()()),2&s){const t=u.oxw(3);u.xp6(2),u.Q6J("ngIf",!t.lampiran.data&&!t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",!t.lampiran.data&&t.lampiran.isDownloading),u.xp6(1),u.Q6J("ngIf",t.lampiran.data),u.xp6(2),u.Q6J("ngIf",t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.isDiscord),u.xp6(1),u.Q6J("ngIf",(null==t.berkasData.attachment_||null==t.berkasData.attachment_.subtitles_?null:t.berkasData.attachment_.subtitles_.length)>0||(null==t.berkasData.attachment_||null==t.berkasData.attachment_.fonts_?null:t.berkasData.attachment_.fonts_.length)>0),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.subtitles_),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.fonts_)}}function Vv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",32)(1,"div",33)(2,"button",52),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.verify())}),u._UZ(3,"mat-icon",53),u._uU(4),u.qZA()()()}if(2&s){const t=u.oxw(3);u.xp6(4),u.hij(" ",t.berkasData.attachment_," ")}}function qv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17)(4,"i"),u._uU(5,"Direct Download"),u.qZA()()()(),u.YNc(6,Hv,11,8,"div",31),u.YNc(7,Vv,5,1,"div",31),u.qZA()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("ngIf",t.isHaveDDL),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function Gv(s,n){if(1&s&&(u.TgZ(0,"a",55),u._UZ(1,"img",56),u._uU(2),u.qZA()),2&s){const t=n.$implicit,i=u.oxw(4);u.s9C("href",t.url,u.LSH),u.xp6(1),u.s9C("src",i.getIconFromUrl(t.url),u.LSH),u.xp6(1),u.hij(" ",t.name," ")}}function Wv(s,n){if(1&s&&(u.TgZ(0,"div",32),u.YNc(1,Gv,3,3,"a",54),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.berkasData.download_url)}}function Zv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",32)(1,"button",57),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.login())}),u._UZ(2,"mat-icon",58),u._uU(3," Klik Untuk Login "),u.qZA()()}}function Kv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4," Tautan Unduhan "),u.TgZ(5,"i"),u._uU(6),u.qZA()()()(),u.YNc(7,Wv,2,1,"div",31),u.YNc(8,Zv,4,0,"div",31),u.qZA()),2&s){const t=u.oxw(2);u.xp6(6),u.Oqu(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value?"External":""),u.xp6(1),u.Q6J("ngIf",null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value))}}function zv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Deskripsi & Informasi"),u.qZA()()(),u.TgZ(5,"div",18),u._UZ(6,"div",59),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("innerHTML",t.berkasData.description,u.oJD)}}function Yv(s,n){if(1&s&&(u.TgZ(0,"mat-option",71),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.url),u.xp6(1),u.Oqu(t.name)}}function $v(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",68)(1,"mat-label"),u._uU(2,"Pilih Subtitle / Takarir (.ASS Saja)"),u.qZA(),u.TgZ(3,"mat-select",69),u.NdJ("valueChange",function(e){u.CHM(t);const r=u.oxw(3);return u.KtG(r.selectedSubsUrl=e)}),u.YNc(4,Yv,2,2,"mat-option",70),u.qZA()()}if(2&s){const t=u.oxw(3);u.Q6J("color","accent"),u.xp6(3),u.Q6J("value",t.selectedSubsUrl),u.xp6(1),u.Q6J("ngForOf",t.subtitles)}}function Qv(s,n){1&s&&u._UZ(0,"mat-progress-bar",72)}function Xv(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1,"Mulai Streaming Video"),u.qZA())}function Jv(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1," Loading ... "),u.qZA())}function e_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",73),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.watchDdl())}),u._UZ(1,"mat-icon",74),u.YNc(2,Xv,2,0,"span",21),u.YNc(3,Jv,2,0,"span",21),u.qZA()}if(2&s){const t=u.oxw(3);u.Q6J("disabled",t.vjsInit),u.xp6(2),u.Q6J("ngIf",!t.vjsInit),u.xp6(1),u.Q6J("ngIf",t.vjsInit)}}function t_(s,n){if(1&s&&u._UZ(0,"app-vjs-player",75),2&s){const t=u.oxw(3);u.Q6J("videoUrl",t.ddlVideo)("videoThumb",t.videoThumb)("subtitleUrl",t.selectedSubsUrl)("subtitleFonts",t.ddlFonts)}}function i_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",76),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.verify())}),u._UZ(1,"mat-icon",53),u._uU(2),u.qZA()}if(2&s){const t=u.oxw(3);u.xp6(2),u.hij(" ",t.berkasData.attachment_," ")}}function r_(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Video Stream (Browser Tertentu T.T)"),u.qZA()()(),u.TgZ(5,"div",18)(6,"div",60),u._uU(7," Dapat digunakan sebagai referensi untuk pratinjau namun kemungkinan jenis huruf tulisan gagal dimuat sehingga nantinya akan muncul huruf dengan gambar \u{1f533} misalnya kanji. Lalu juga memungkinkan terjadinya gerakan patah - patah jika browser tidak kuat untuk render .ASS subtitle dengan efek yang terlalu banyak. "),u.TgZ(8,"span",61)(9,"i"),u._uU(10,"Player"),u.qZA(),u._uU(11," ini mungkin tidak dapat memutar video HEVC-x265 (belum support semua "),u.TgZ(12,"i"),u._uU(13,"web browser"),u.qZA(),u._uU(14,") dan audio AC3 (atau ekstensi lain yang masih memiliki lisensi paten belum "),u.TgZ(15,"i"),u._uU(16,"open source"),u.qZA(),u._uU(17,"). Takarir / "),u.TgZ(18,"i"),u._uU(19,"subtitle"),u.qZA(),u._uU(20," yang dapat ditampilkan jenis .ASS saja, itupun jika tersedia di dalam video internalnya. "),u.qZA(),u.TgZ(21,"a",62),u._uU(22," * Browser Firefox sudah pasti tidak bisa memutar .MKV "),u.qZA()(),u.TgZ(23,"div",33),u.YNc(24,$v,5,3,"mat-form-field",63),u.YNc(25,Qv,1,0,"mat-progress-bar",64),u.YNc(26,e_,4,3,"button",65),u.YNc(27,t_,1,4,"app-vjs-player",66),u.YNc(28,i_,3,1,"button",67),u.qZA()()()),2&s){const t=u.oxw(2);u.xp6(24),u.Q6J("ngIf",t.subtitles.length>0),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&t.vjsReady),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function n_(s,n){1&s&&(u.TgZ(0,"div",14)(1,"div",18),u._UZ(2,"app-report"),u.qZA()())}function a_(s,n){if(1&s&&(u.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"ul",4),u._UZ(4,"li")(5,"li")(6,"li")(7,"li")(8,"li")(9,"li")(10,"li")(11,"li")(12,"li")(13,"li"),u.TgZ(14,"div",5)(15,"h2",6),u._uU(16),u.qZA(),u.TgZ(17,"p",7),u._uU(18),u.qZA(),u.TgZ(19,"p",8),u._uU(20),u.ALo(21,"date"),u.qZA()()()()(),u._UZ(22,"app-notifications"),u.TgZ(23,"div",9)(24,"div",10)(25,"div",11)(26,"div",12)(27,"div",13)(28,"div",14)(29,"div",15)(30,"h2",16)(31,"b",17),u._uU(32,"Rujukan"),u.qZA()()(),u.TgZ(33,"div",18)(34,"mat-selection-list",19),u.YNc(35,wv,4,4,"mat-list-option",20),u.YNc(36,Iv,4,3,"mat-list-option",20),u.YNc(37,Dv,4,2,"mat-list-option",21),u.YNc(38,Pv,4,3,"mat-list-option",22),u.TgZ(39,"mat-list-option",23),u._UZ(40,"img",24),u.TgZ(41,"h4",25),u._uU(42),u.qZA()()()()(),u.YNc(43,qv,8,2,"div",26),u.YNc(44,Kv,9,3,"div",26),u.qZA()()(),u.TgZ(45,"div",27)(46,"div",12)(47,"div",13),u.YNc(48,zv,7,1,"div",26),u.YNc(49,r_,29,5,"div",26),u.YNc(50,n_,3,0,"div",26),u.TgZ(51,"div",14)(52,"div",28)(53,"h2",29)(54,"b",17),u._uU(55,"Komentar"),u.qZA()()(),u.TgZ(56,"div",18)(57,"div",30),u._UZ(58,"app-discussion"),u.qZA()()()()()()()()()),2&s){const t=u.oxw();u.xp6(2),u.Udp("background","url(/assets/img/banner/berkas-detail.png), linear-gradient(to bottom, "+(t.GS.isDarkMode?"#673ab7":"#3f51b5")+" 0%, #ee0dfd 100%)"),u.xp6(14),u.hij(" ",t.berkasData.name," "),u.xp6(2),u.AsE(" ",t.berkasData.view_count,"x Dilihat :: ",t.berkasData.like_count," Orang Suka "),u.xp6(2),u.hij(" ",u.xi3(21,19,t.berkasData.created_at,"d MMMM y, hh:mm:ss a z")," "),u.xp6(14),u.Q6J("multiple",!1),u.xp6(1),u.Q6J("ngIf",t.berkasData.anime_),u.xp6(1),u.Q6J("ngIf",t.berkasData.dorama_),u.xp6(1),u.Q6J("ngIf",t.berkasData.sn_code),u.xp6(1),u.Q6J("ngForOf",t.berkasData.fansub_),u.xp6(1),u.MGl("routerLink","/user/",t.berkasData.user_.username,""),u.xp6(1),u.s9C("src",t.berkasData.user_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.user_.username),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&t.berkasData.attachment_),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value)||(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.berkasData.download_url?null:t.berkasData.download_url.length)>0),u.xp6(4),u.Q6J("ngIf",t.berkasData.description),u.xp6(1),u.Q6J("ngIf",t.berkasData.attachment_&&t.isStreamable),u.xp6(1),u.Q6J("ngIf",null==t.SS.mySocket?null:t.SS.mySocket.id)}}let s_=(()=>{class s{constructor(t,i,e,r,a,o,l,d,f,v,g,T){this.router=t,this.activatedRoute=i,this.gs=e,this.bs=r,this.pi=a,this.berkas=o,this.fs=l,this.as=d,this.dm=f,this.wb=v,this.ss=g,this.dls=T,this.berkasId="",this.berkasData=null,this.subsBerkas=null,this.subsParam=null,this.subsDialog=null,this.subsSubtitlesFonts=null,this.subtitles=[],this.fonts=[],this.selectedSubsUrl=null,this.vjsInit=!1,this.vjsReady=!1,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get ENV(){return Ge.N}get GS(){return this.gs}get AS(){return this.as}get SS(){return this.ss}ngOnDestroy(){this.subsBerkas?.unsubscribe(),this.subsParam?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsSubtitlesFonts?.unsubscribe()}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:t=>{this.berkasId=t.berkasId,this.bs.busy(),this.subsBerkas=this.berkas.getBerkas(this.berkasId).subscribe({next:i=>{this.gs.log("[BERKAS_DETAIL_SUCCESS]",i),this.berkasData=i.result,this.pi.updatePageMetaData(this.berkasData.name,this.berkasData.description,this.berkasData.name,this.berkasData.image_url,this.berkasData.user_.username),this.pi.updatePageHeader(this.berkasData.project_type_.name),this.bs.idle(),this.gs.isBrowser&&this.fs.initializeFab("edit",null,"Ubah Data Berkas",`/berkas/${this.berkasId}/edit`,!1)},error:i=>{this.gs.log("[BERKAS_DETAIL_ERROR]",i,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/berkas"}})}})}})}watchDdl(){this.vjsInit=!0,this.setupVjs()}login(){this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}get animeName(){return this.berkasData.anime_.name.replace(/[^a-zA-Z0-9]/g,"-")}get lampiran(){return this.dm.getAttachmentDownloadFile(this.berkasData.attachment_)}get ddlVideo(){return this.ddlUrlLinkVideo(this.berkasData.attachment_.id)}get videoThumb(){return this.berkasData.image_url}get ddlFonts(){return this.fonts.length>0?this.fonts:[]}get isHaveDDL(){return!(!("attachment_"in this.berkasData)||!this.berkasData.attachment_)&&"string"!=typeof this.berkasData.attachment_}get isDiscord(){return this.isHaveDDL&&this.berkasData.attachment_?.discord}get isStreamable(){return this.isHaveDDL&&this.gs.includesOneOf(this.berkasData.attachment_?.ext,$.t.fileTypeAttachmentStreamable)}ddl(t){var i=this;return(0,se.Z)(function*(){i.isDiscord?i.dm.startDownload(t,!1):i.dm.startDownload(t)})()}cancel_dl(t){this.dm.cancelDownload(t)}saveFileAs(t){this.dm.saveFileAs(t)}standardDdlVideo(t){this.wb.winboxOpenUri(this.ddlUrlLinkVideo(t))}ddlUrlLinkVideo(t){return this.isDiscord?`${Ge.N.apiUrl}/ddl-seek/${t}?ngsw-bypass=true`:`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}standardDdlSubsFont(t){this.wb.winboxOpenUri(this.ddlUrlLinkSubsFont(t))}ddlUrlLinkSubsFont(t){return`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}setupVjs(){if(this.isHaveDDL){const t=[],i=[],e=[];if("subtitles_"in this.berkasData.attachment_&&this.berkasData.attachment_.subtitles_)for(const r of this.berkasData.attachment_.subtitles_){const a=this.dls.downloadLampiran(r.id).pipe((0,me.b)(o=>{o.type===Le.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),i.push({name:r.name,url:URL.createObjectURL(new Blob([o.body]))}))}));t.push(a)}if("fonts_"in this.berkasData.attachment_&&this.berkasData.attachment_.fonts_)for(const r of this.berkasData.attachment_.fonts_){const a=this.dls.downloadLampiran(r.id).pipe((0,me.b)(o=>{o.type===Le.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),e.push(URL.createObjectURL(new Blob([o.body]))))}));t.push(a)}this.subsSubtitlesFonts=(0,Oe.z)(...t).subscribe({next:r=>{r.type===Le.dt.DownloadProgress&&this.gs.log("[DOWNLOAD_PROGRESS]",r),r.type===Le.dt.Response&&this.gs.log("[DOWNLOAD_COMPLETED]",r)},error:r=>{this.gs.log("[DOWNLOAD_ERROR]",r,"error")},complete:()=>{this.subtitles=i,this.fonts=e,this.vjsReady=!0}})}}getIconFromUrl(t){try{return"http://www.google.com/s2/favicons?sz=64&domain="+new URL(t).host}catch{return`${Ge.N.baseUrl}/favicon.ico`}}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(ke.U),u.Y36(Ue.z),u.Y36(Ve.Z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e),u.Y36(de),u.Y36(le.N),u.Y36(xe.R),u.Y36(Q.v))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-detail"]],decls:1,vars:1,consts:[["class","p-0 m-0",4,"ngIf"],[1,"p-0","m-0"],[1,"container-fluid","p-0"],[1,"wrapper"],[1,"bg-bubbles","align-items-center","p-0"],[1,"container","align-items-center","h-100","p-3","text-light",2,"overflow-y","auto"],["_ngcontent-serverapp-c311","",1,"mb-0",2,"line-height","normal"],[1,"mt-3","mb-0"],[1,"mb-0"],[1,"container"],[1,"row"],[1,"col-md-5","col-xl-4","p-3"],[1,"row","sticky-top"],[1,"col"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12"],[3,"multiple"],[3,"routerLink",4,"ngIf"],[4,"ngIf"],[3,"routerLink",4,"ngFor","ngForOf"],[3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],[1,"text-truncate"],["class","row py-3",4,"ngIf"],[1,"col-md-7","col-xl-8","p-3","sticky-top"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"p-3"],["class","col-12 text-center",4,"ngIf"],[1,"col-12","text-center"],[1,"px-3"],["type","button","class","m-1 w-100 shiny","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngIf"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngIf"],["class","px-3",4,"ngIf"],["class","col-12",4,"ngIf"],["class","col-12 m-1",4,"ngIf"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","color","accent",1,"m-1","w-100","shiny",3,"matTooltip","click"],["fontIcon","movie",1,"me-1"],["type","button","mat-stroked-button","","color","accent",1,"m-1","w-100",3,"matTooltip","click"],["fontIcon","close",1,"me-1"],["fontIcon","save",1,"me-1"],["color","accent",3,"mode","value"],["class","px-3 text-danger","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"px-3","text-danger",2,"cursor","pointer",3,"click"],[1,"col-12","m-1"],[1,"my-3","border-bottom-dotted",2,"height","4px","background","url('/assets/img/stripe.png')"],["fontIcon","notes",1,"me-1"],["fontIcon","font_download",1,"me-1"],["type","button","mat-stroked-button","","color","accent","matTooltip","Direct Download Link Berkas",1,"m-1",3,"click"],["fontIcon","enhanced_encryption",1,"me-1"],["class","m-1","target","_blank","mat-stroked-button","","color","accent",3,"href",4,"ngFor","ngForOf"],["target","_blank","mat-stroked-button","","color","accent",1,"m-1",3,"href"],["width","24px","height","24px",1,"me-1",2,"object-fit","cover",3,"src"],["type","button","mat-stroked-button","","color","accent",1,"m-1",3,"click"],["fontIcon","vpn_key",1,"me-1"],[1,"py-2","px-3",2,"white-space","pre-line !important",3,"innerHTML"],[1,"py-2","px-3"],[1,"text-success"],["href","https://bugzilla.mozilla.org/show_bug.cgi?id=1422891",1,"text-warning","text-decoration-none"],["appearance","outline","class","pt-3 col-12",3,"color",4,"ngIf"],["color","warn","mode","buffer","class","mb-3",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","warn",3,"disabled","click",4,"ngIf"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","accent",3,"click",4,"ngIf"],["appearance","outline",1,"pt-3","col-12",3,"color"],["placeholder","Pilih Salah Satu",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["color","warn","mode","buffer",1,"mb-3"],["type","button","mat-stroked-button","","color","warn",1,"w-100",3,"disabled","click"],["fontIcon","play_arrow",1,"me-1"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"]],template:function(i,e){1&i&&u.YNc(0,a_,59,22,"div",0),2&i&&u.Q6J("ngIf",e.berkasData)},dependencies:[X.sg,X.O5,_e.rH,te.CK,ue.eB,ue.Nr,J.Hw,ie.v_,ie.$V,Ae.Wx,Ae.kh,Ae.O$,Ze.eI,We.x8,qe.Kd,Me.t,Cv,kv.S,Av.Y,X.OU,X.uU,fc.$],styles:[".wrapper[_ngcontent-%COMP%]{position:sticky;left:0;width:100%;height:128px;overflow:hidden;background-size:168px,auto!important;background-repeat:no-repeat,repeat!important;background-position-x:100%,0%!important}.bg-bubbles[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:#ffffff26;bottom:-160px;animation:_ngcontent-%COMP%_square 25s infinite;transition-timing-function:linear}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(1){left:10%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:#ffffff40}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(5){left:70%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:#fff3}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:#ffffff4d}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes _ngcontent-%COMP%_square{0%{transform:translateY(0)}to{transform:translateY(-512px) rotate(512deg)}}"]})}return s})();var Ra=H(8372),Ma=H(9094),Bo=H(3900),jo=H(8746),Ua=H(5625),o_=H(6841),u_=H(642),l_=H(3719),d_=H(3842),c_=H(7245),f_=H(6493),hc=H(2970),pc=H(2447),h_=H(4850),p_=H(3238),m_=H(9203),mc=H(7732);function g_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"bytes"),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.hij("Ukuran Upload Melebihi Batas ",u.lcZ(2,1,t.imageLimitExceeded)," !")}}function v_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.Oqu(t.imageErrorText)}}function __(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",50)(1,"button",31),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(2);return u.KtG(e.submitImage())}),u._UZ(2,"mat-icon",51),u._uU(3," Unggah "),u.qZA()()}if(2&s){const t=u.oxw(2);u.xp6(1),u.Q6J("disabled",t.submitted)}}function y_(s,n){1&s&&(u.TgZ(0,"div",20)(1,"mat-slide-toggle",52)(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Akses Hanya Dengan URL "),u.qZA()())}function T_(s,n){if(1&s&&(u.TgZ(0,"mat-option",53),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.Oqu(t.name)}}function b_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Tidak Boleh Kosong"),u.qZA())}function x_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function S_(s,n){1&s&&u.GkF(0)}function E_(s,n){1&s&&(u.TgZ(0,"mat-option",60),u._UZ(1,"mat-progress-bar",61),u.qZA())}function C_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",63),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.filterAnimeSelected(r))}),u._UZ(1,"img",64),u.TgZ(2,"span",65),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.lnq("",t.id," :: ",null==t.media_type?null:t.media_type.toUpperCase()," :: ",t.title,"")}}function k_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,C_,4,5,"mat-option",62),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredAnime)}}function A_(s,n){if(1&s&&(u.TgZ(0,"small",66),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.fg.get("anime_name").value)}}function w_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Tidak Boleh Kosong"),u.qZA())}function I_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Hanya Boleh Angka"),u.qZA())}function D_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",54)(1,"mat-label"),u._uU(2,"Anime Terkait"),u.qZA(),u.TgZ(3,"input",55),u.NdJ("keyup",function(){u.CHM(t);const e=u.oxw(2);return u.KtG(e.resetSelectedAnime())}),u.qZA(),u._UZ(4,"mat-icon",56),u.TgZ(5,"mat-autocomplete",null,57),u.YNc(7,E_,2,0,"mat-option",58),u.YNc(8,k_,2,1,"ng-container",17),u.qZA(),u.YNc(9,A_,2,1,"small",59),u.TgZ(10,"mat-error"),u.YNc(11,w_,2,0,"div",17),u.YNc(12,I_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(6),i=u.oxw(2);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(4),u.Q6J("ngIf",i.isLoading),u.xp6(1),u.Q6J("ngIf",!i.isLoading),u.xp6(1),u.Q6J("ngIf",i.fg.get("anime_name").value),u.xp6(2),u.Q6J("ngIf",i.fg.get("anime_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",i.fg.get("anime_id").hasError("pattern"))}}function P_(s,n){1&s&&u.GkF(0)}function O_(s,n){1&s&&(u.TgZ(0,"mat-option",60),u._UZ(1,"mat-progress-bar",61),u.qZA())}function L_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",63),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(5);return u.KtG(a.filterDoramaSelected(r))}),u._UZ(1,"img",64),u.TgZ(2,"span",65),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.mdl_id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.mdl_id," :: ",t.title,"")}}function R_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,L_,4,4,"mat-option",62),u.BQk()),2&s){const t=u.oxw(4);u.xp6(1),u.Q6J("ngForOf",t.filteredDorama)}}function M_(s,n){if(1&s&&(u.TgZ(0,"small",66),u._uU(1),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Oqu(t.fg.get("dorama_name").value)}}function U_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Tidak Boleh Kosong"),u.qZA())}function N_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Hanya Boleh Angka"),u.qZA())}function F_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",54)(1,"mat-label"),u._uU(2,"Dorama Terkait"),u.qZA(),u.TgZ(3,"input",69),u.NdJ("keyup",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.resetSelectedDorama())}),u.qZA(),u._UZ(4,"mat-icon",56),u.TgZ(5,"mat-autocomplete",null,70),u.YNc(7,O_,2,0,"mat-option",58),u.YNc(8,R_,2,1,"ng-container",17),u.qZA(),u.YNc(9,M_,2,1,"small",59),u.TgZ(10,"mat-error"),u.YNc(11,U_,2,0,"div",17),u.YNc(12,N_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(6),i=u.oxw(3);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(4),u.Q6J("ngIf",i.isLoading),u.xp6(1),u.Q6J("ngIf",!i.isLoading),u.xp6(1),u.Q6J("ngIf",i.fg.get("dorama_name").value),u.xp6(2),u.Q6J("ngIf",i.fg.get("dorama_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",i.fg.get("dorama_id").hasError("pattern"))}}function B_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Kode Serial Tidak Boleh Kosong"),u.qZA())}function j_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Kode Serial Hanya Boleh Huruf Besar, Strip, Dan Angka"),u.qZA())}function H_(s,n){if(1&s&&(u.TgZ(0,"mat-form-field",22)(1,"mat-label"),u._uU(2,"Kode / Serial Number"),u.qZA(),u._UZ(3,"input",73)(4,"mat-icon",74),u.TgZ(5,"mat-error"),u.YNc(6,B_,2,0,"div",17),u.YNc(7,j_,2,0,"div",17),u.qZA()()),2&s){const t=u.oxw(4);u.Q6J("color","accent"),u.xp6(6),u.Q6J("ngIf",t.fg.get("sn_code").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.fg.get("sn_code").hasError("pattern"))}}function V_(s,n){1&s&&(u.TgZ(0,"div",75)(1,"small",76),u._uU(2," * Jika tidak ada kode serial isi saja - strip "),u.qZA()())}function q_(s,n){if(1&s&&(u.YNc(0,H_,8,3,"mat-form-field",71),u.YNc(1,V_,3,0,"div",72)),2&s){const t=u.oxw(3);u.Q6J("ngIf",t.berkasType),u.xp6(1),u.Q6J("ngIf",t.berkasType)}}function G_(s,n){if(1&s&&(u.YNc(0,P_,1,0,"ng-container",25),u.YNc(1,F_,13,7,"ng-template",null,67,u.W1O),u.YNc(3,q_,2,2,"ng-template",null,68,u.W1O)),2&s){const t=u.MAs(2),i=u.MAs(4),e=u.oxw(2);u.Q6J("ngIf",e.berkasType.toLowerCase().includes("dorama_"))("ngIfThen",t)("ngIfElse",i)}}function W_(s,n){1&s&&u._UZ(0,"mat-icon",56)}function Z_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",82),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index,r=u.oxw(2);return u.KtG(r.removeFansub(e))}),u._UZ(1,"mat-icon",83),u.qZA()}}function K_(s,n){1&s&&(u.TgZ(0,"mat-option",60),u._UZ(1,"mat-progress-bar",61),u.qZA())}function z_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",63),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(2).index,o=u.oxw(2);return u.KtG(o.filterFansubSelected(r,a))}),u._UZ(1,"img",84),u.TgZ(2,"span",65),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.slug," :: ",t.name,"")}}function Y_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,z_,4,4,"mat-option",62),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredFansub)}}function $_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Tidak Boleh Kosong"),u.qZA())}function Q_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Hanya Boleh Angka"),u.qZA())}function X_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div")(1,"div",77)(2,"mat-form-field",54)(3,"mat-label"),u._uU(4,"Fansub Terkait"),u.qZA(),u.TgZ(5,"input",78),u.NdJ("keyup",function(){const r=u.CHM(t).index,a=u.oxw(2);return u.KtG(a.resetSelectedFansub(r))}),u.qZA(),u.YNc(6,W_,1,0,"mat-icon",79),u.YNc(7,Z_,2,0,"button",80),u.TgZ(8,"mat-autocomplete",null,81),u.YNc(10,K_,2,0,"mat-option",58),u.YNc(11,Y_,2,1,"ng-container",17),u.qZA(),u.TgZ(12,"small",66),u._uU(13),u.qZA(),u.TgZ(14,"mat-error"),u.YNc(15,$_,2,0,"div",17),u.YNc(16,Q_,2,0,"div",17),u.qZA()()()()}if(2&s){const t=n.$implicit,i=n.index,e=u.MAs(9),r=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",i),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",e),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").value||0===i),u.xp6(1),u.Q6J("ngIf",!t.get("fansub_id").value&&i>0),u.xp6(3),u.Q6J("ngIf",r.isLoading),u.xp6(1),u.Q6J("ngIf",!r.isLoading),u.xp6(2),u.Oqu(t.get("fansub_name").value),u.xp6(2),u.Q6J("ngIf",t.get("fansub_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").hasError("pattern"))}}function J_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Tidak Boleh Kosong"),u.qZA())}function e0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function t0(s,n){1&s&&u.GkF(0)}function i0(s,n){if(1&s&&(u.TgZ(0,"p",89),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.attachmentFontSubtitle.join(", ").toLowerCase())}}function r0(s,n){if(1&s&&(u.TgZ(0,"div",9)(1,"mat-list")(2,"div",85),u._uU(3,"Berkas yang terlampir tidak boleh diubah."),u.qZA(),u.TgZ(4,"mat-list-item"),u._UZ(5,"mat-icon",86),u.TgZ(6,"div",87),u._uU(7),u.qZA(),u.TgZ(8,"div",87),u._uU(9),u.ALo(10,"bytes"),u.qZA()(),u.YNc(11,i0,2,1,"p",88),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(7),u.AsE("",t.attachmentFile.name,".",t.attachmentFile.ext,""),u.xp6(2),u.Oqu(u.lcZ(10,4,t.attachmentFile.size)),u.xp6(2),u.Q6J("ngIf",t.attachmentFontSubtitle.length>0)}}function n0(s,n){1&s&&u.GkF(0)}function a0(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"bytes"),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.hij("Ukuran Upload Melebihi Batas ",u.lcZ(2,1,t.attachmentLimitExceeded)," !")}}function s0(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Oqu(t.attachmentErrorText)}}function o0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",42)(1,"div",99)(2,"div",100),u._uU(3),u.ALo(4,"bytes"),u._UZ(5,"br")(6,"mat-progress-bar",101),u.qZA()(),u.TgZ(7,"div",102)(8,"button",31),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.submitAttachment(r))}),u._UZ(9,"mat-icon",103),u._uU(10," Unggah "),u.qZA()()()}if(2&s){const t=n.$implicit,i=u.oxw(4);u.xp6(3),u.HOy(" ",t.status," :: ",t.progress,"% @ ",u.lcZ(4,7,t.speed),"/s # ",t.remaining," detik "),u.xp6(3),u.Q6J("mode","determinate")("value",t.progress),u.xp6(2),u.Q6J("disabled",i.submitted||"complete"===t.status||"uploading"===t.status)}}function u0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",9)(1,"div",75)(2,"small",76),u._uU(3," * "),u.TgZ(4,"i"),u._uU(5,"Resume-able Upload"),u.qZA(),u._uU(6," :: "),u.TgZ(7,"i"),u._uU(8,"expired"),u.qZA(),u._uU(9),u.TgZ(10,"i"),u._uU(11,"upload"),u.qZA(),u._uU(12),u.qZA()(),u.TgZ(13,"mat-form-field",92)(14,"mat-label"),u._uU(15,"Upload Lampiran Berkas -- DDL"),u.qZA(),u.TgZ(16,"ngx-mat-file-input",93,94),u.NdJ("change",function(e){u.CHM(t);const r=u.MAs(17),a=u.oxw(3);return u.KtG(a.uploadAttachment(e,r))}),u.qZA(),u._UZ(18,"mat-icon",95),u.qZA(),u.TgZ(19,"mat-error",96)(20,"small"),u.YNc(21,a0,3,3,"div",17),u.YNc(22,s0,2,1,"div",17),u.qZA()()(),u.YNc(23,o0,11,9,"div",97),u.ALo(24,"async"),u.TgZ(25,"div",9)(26,"mat-slide-toggle",98),u._uU(27," Otomatis Simpan & Kirim Setelah Selesai Upload DDL "),u.qZA()()}if(2&s){const t=u.oxw(3);u.xp6(9),u.hij(" 3 hari (Tidak wajib, jika sudah ada URL eksternal, misal alamat webmu gdrive mediafire mega dan lain sebagainya). Mohon ditunggu, jika ingin di tinggal dapat menyelesaikan semua isian yang diperlukan dan menyalakan 'Otomatis Simpan & Kirim' dibawah ini, berkas lampiran akan dibatalkan dan dihapus apabila tidak disimpan dalam ",t.CONSTANTS.timeoutDeleteTempAttachmentTime/60/1e3," menit setelah berhasil "),u.xp6(3),u.hij(". Lalu kemudian saat berkas berhasil dibuat, lampiran tidak akan bisa di modifikasi. Tipe file yang diperbolehkan :: ",t.extAttachment," "),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("disabled",null!==t.attachmentSelected)("accept",t.fileTypeAttachmentAllowed),u.xp6(5),u.Q6J("ngIf",t.attachmentLimitExceeded),u.xp6(1),u.Q6J("ngIf",t.attachmentErrorText),u.xp6(1),u.Q6J("ngForOf",u.lcZ(24,9,t.uploads$)),u.xp6(3),u.Q6J("disabled",t.fg.invalid||"uploading"!==(null==t.attachmentSelected?null:t.attachmentSelected.status))}}function l0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",104),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.verify())}),u._UZ(1,"mat-icon",105),u._uU(2," Verifikasi Akun Untuk Upload DDL! "),u.qZA()}}function d0(s,n){if(1&s&&(u.YNc(0,n0,1,0,"ng-container",25),u.YNc(1,u0,28,11,"ng-template",null,90,u.W1O),u.YNc(3,l0,3,0,"ng-template",null,91,u.W1O)),2&s){const t=u.MAs(2),i=u.MAs(4),e=u.oxw(2);u.Q6J("ngIf",null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified)("ngIfThen",t)("ngIfElse",i)}}function c0(s,n){1&s&&(u.TgZ(0,"div",75)(1,"small",76),u._uU(2,"* "),u.TgZ(3,"i"),u._uU(4,"Gunakan tombol (X) untuk menghapus URL Eksternal jika ingin hanya menggunakan lampiran "),u.TgZ(5,"i"),u._uU(6,"upload"),u.qZA(),u._uU(7," DDL saja"),u.qZA()()())}function f0(s,n){1&s&&u._UZ(0,"mat-icon",113)}function h0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",82),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index,r=u.oxw(2);return u.KtG(r.removeDownloadLink(e))}),u._UZ(1,"mat-icon",83),u.qZA()}}function p0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Tidak Boleh Kosong"),u.qZA())}function m0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function g0(s,n){1&s&&u._UZ(0,"mat-icon",114)}function v0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",82),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index,r=u.oxw(2);return u.KtG(r.removeDownloadLink(e))}),u._UZ(1,"mat-icon",83),u.qZA()}}function _0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Tidak Boleh Kosong"),u.qZA())}function y0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Link Tidak Valid"),u.qZA())}function T0(s,n){if(1&s&&(u.ynx(0),u.TgZ(1,"div",106),u.YNc(2,c0,8,0,"div",72),u.TgZ(3,"mat-form-field",107)(4,"mat-label"),u._uU(5,"Nama Website"),u.qZA(),u._UZ(6,"input",108),u.YNc(7,f0,1,0,"mat-icon",109),u.YNc(8,h0,2,0,"button",80),u.TgZ(9,"mat-error"),u.YNc(10,p0,2,0,"div",17),u.YNc(11,m0,2,0,"div",17),u.qZA()(),u.TgZ(12,"mat-form-field",110)(13,"mat-label"),u._uU(14,"Tautan Link"),u.qZA(),u._UZ(15,"input",111),u.YNc(16,g0,1,0,"mat-icon",112),u.YNc(17,v0,2,0,"button",80),u.TgZ(18,"mat-error"),u.YNc(19,_0,2,0,"div",17),u.YNc(20,y0,2,0,"div",17),u.qZA()()(),u.BQk()),2&s){const t=n.$implicit,i=n.index,e=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",i),u.xp6(1),u.Q6J("ngIf",(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified)&&0===i),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("name").value||0===i&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("name").value&&(i>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("name").hasError("pattern")),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("url").value||0===i&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("url").value&&(i>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("url").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("url").hasError("pattern"))}}function b0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"form",4),u.NdJ("submit",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.onSubmit())}),u.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),u._uU(5,"Ubah Berkas"),u.qZA()()(),u.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),u._UZ(11,"img",11),u.TgZ(12,"mat-form-field",12)(13,"mat-label"),u._uU(14,"Gambar Untuk Embed SEO"),u.qZA(),u.TgZ(15,"ngx-mat-file-input",13,14),u.NdJ("change",function(e){u.CHM(t);const r=u.MAs(16),a=u.oxw();return u.KtG(a.uploadImage(e,r))}),u.qZA(),u._UZ(17,"mat-icon",15),u.qZA(),u.TgZ(18,"mat-error",16)(19,"small"),u.YNc(20,g_,3,3,"div",17),u.YNc(21,v_,2,1,"div",17),u.qZA()()(),u.YNc(22,__,4,1,"div",18),u.YNc(23,y_,5,0,"div",19),u.TgZ(24,"div",20)(25,"mat-slide-toggle",21),u._uU(26," R-18+ Konten Eksplisit "),u.qZA()(),u.TgZ(27,"mat-form-field",22)(28,"mat-label"),u._uU(29,"Jenis Proyek"),u.qZA(),u.TgZ(30,"mat-select",23),u.YNc(31,T_,2,2,"mat-option",24),u.qZA(),u.TgZ(32,"mat-error"),u.YNc(33,b_,2,0,"div",17),u.YNc(34,x_,2,0,"div",17),u.qZA()(),u.YNc(35,S_,1,0,"ng-container",25),u.YNc(36,D_,13,7,"ng-template",null,26,u.W1O),u.YNc(38,G_,5,3,"ng-template",null,27,u.W1O),u.TgZ(40,"div",20),u._UZ(41,"mat-divider"),u.qZA(),u.TgZ(42,"div",28),u.YNc(43,X_,17,10,"div",29),u.qZA(),u.TgZ(44,"div",2)(45,"div",9),u._UZ(46,"div",30),u.TgZ(47,"div",30)(48,"button",31),u.NdJ("click",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.addFansub())}),u._UZ(49,"mat-icon",32),u._uU(50," Tambah Fansub "),u.qZA()()()(),u.TgZ(51,"div",20)(52,"a",33),u._uU(53," * Jika pencarian tidak ditemukan, silahkan membuat halaman Fansub baru terlebih dahulu "),u.qZA()()()(),u.TgZ(54,"div",34)(55,"div",9)(56,"mat-form-field",35)(57,"mat-label"),u._uU(58,"Nama Berkas"),u.qZA(),u._UZ(59,"input",36)(60,"mat-icon",37),u.TgZ(61,"mat-error"),u.YNc(62,J_,2,0,"div",17),u.YNc(63,e0,2,0,"div",17),u.qZA()(),u._UZ(64,"angular-editor",38),u.qZA(),u.TgZ(65,"div",9)(66,"div",20),u._UZ(67,"mat-divider"),u.qZA()(),u.YNc(68,t0,1,0,"ng-container",25),u.YNc(69,r0,12,6,"ng-template",null,39,u.W1O),u.YNc(71,d0,5,3,"ng-template",null,40,u.W1O),u.TgZ(73,"div",9)(74,"div",20),u._UZ(75,"mat-divider"),u.qZA()(),u.ynx(76,41),u.YNc(77,T0,21,12,"ng-container",29),u.BQk(),u.TgZ(78,"div",42),u._UZ(79,"div",30)(80,"div",30)(81,"div",30),u.TgZ(82,"div",30)(83,"button",31),u.NdJ("click",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.addDownloadLink())}),u._UZ(84,"mat-icon",32),u._uU(85," Tambah URL Eksternal "),u.qZA()()()()(),u.TgZ(86,"div",9)(87,"div",20)(88,"div",43),u._UZ(89,"div",44),u.TgZ(90,"div",45)(91,"a",46),u._UZ(92,"mat-icon",47),u._uU(93," Batal "),u.qZA()(),u.TgZ(94,"div",45)(95,"button",48),u._uU(96," Simpan "),u._UZ(97,"mat-icon",49),u.qZA()()()()()()()()}if(2&s){const t=u.MAs(37),i=u.MAs(39),e=u.MAs(70),r=u.MAs(72),a=u.oxw();u.Q6J("formGroup",a.fg),u.xp6(11),u.Q6J("src",a.image_url,u.LSH),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("disabled",a.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),u.xp6(5),u.Q6J("ngIf",a.imageLimitExceeded),u.xp6(1),u.Q6J("ngIf",a.imageErrorText),u.xp6(1),u.Q6J("ngIf",a.image&&!a.fg.value.image),u.xp6(1),u.Q6J("ngIf",null==a.AS.currentUserSubject||null==a.AS.currentUserSubject.value?null:a.AS.currentUserSubject.value.verified),u.xp6(4),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngForOf",a.projectList),u.xp6(2),u.Q6J("ngIf",a.fg.get("projectType_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",a.fg.get("projectType_id").hasError("pattern")),u.xp6(1),u.Q6J("ngIf",a.berkasType.toLowerCase().includes("anime_"))("ngIfThen",t)("ngIfElse",i),u.xp6(8),u.Q6J("ngForOf",a.getFansubControl.controls),u.xp6(5),u.Q6J("disabled",a.submitted),u.xp6(8),u.Q6J("color","accent"),u.xp6(6),u.Q6J("ngIf",a.fg.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",a.fg.get("name").hasError("pattern")),u.xp6(1),u.Q6J("config",a.GS.angularEditorConfig),u.xp6(4),u.Q6J("ngIf",a.attachmentFile)("ngIfThen",e)("ngIfElse",r),u.xp6(9),u.Q6J("ngForOf",a.getDownloadUrlControl.controls),u.xp6(6),u.Q6J("disabled",a.submitted),u.xp6(8),u.Q6J("disabled",a.submitted),u.xp6(4),u.Q6J("disabled",a.submitted||a.fg.invalid||!a.fg.dirty||"uploading"===(null==a.attachmentSelected?null:a.attachmentSelected.status))}}let x0=(()=>{class s{constructor(t,i,e,r,a,o,l,d,f,v,g,T,E,x,S){this.router=t,this.activatedRoute=i,this.fb=e,this.bs=r,this.anime=a,this.dorama=o,this.project=l,this.fansub=d,this.berkas=f,this.toast=v,this.imgbb=g,this.gs=T,this.as=E,this.uploadService=x,this.ds=S,this.berkasId="",this.attachmentSelected=null,this.attachmentErrorText=null,this.attachmentLimitExceeded=null,this.timerTimeout1=null,this.timerTimeout2=null,this.submitted=!1,this.projectList=[],this.uploadToast=null,this.gambar=null,this.ddl=null,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.filteredAnime=[],this.filteredDorama=[],this.filteredFansub=[],this.isLoading=!1,this.animeCheckOrAddResponse=null,this.doramaCheckOrAddResponse=null,this.attachmentFile=null,this.attachmentFontSubtitle=[],this.subsProject=null,this.subsFansub=null,this.subsAnimeDetail=null,this.subsDoramaDetail=null,this.subsProjectDetail=null,this.subsFansubDetail=[],this.subsAnimeNew=null,this.subsDoramaNew=null,this.subsImgbb=null,this.subsBerkasDetail=null,this.subsBerkasUpdate=null,this.subsUpload=null,this.subsDialog=null,this.berkasType="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get CONSTANTS(){return $.t}get AS(){return this.as}get GS(){return this.gs}get extAttachment(){return $.t.extAttachment.join(", ")}get fileTypeAttachmentAllowed(){return $.t.fileTypeAttachmentAllowed.join(", ")}ngOnInit(){this.gs.isBrowser&&(this.berkasId=this.activatedRoute.snapshot.paramMap.get("berkasId"),this.bs.busy(),this.subsBerkasDetail=this.berkas.getBerkas(this.berkasId).subscribe({next:t=>{this.gs.log("[BERKAS_DETAIL_SUCCESS]",t),this.bs.idle(),this.as.currentUserSubject?.value?.id!==t.result.user_.id&&(this.toast.warning("Berkas Ini Bukan Milikmu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)),!this.as.currentUserSubject?.value?.verified&&t.result.attachment_?(this.toast.warning("string"==typeof t.result.attachment_?t.result.attachment_:"Harap Verifikasi Akun Terlebih Dahulu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)):(this.loadProjectList(),this.initForm(t.result),this.uploads$=this.uploadService.connect(),this.subsUpload=this.uploadService.events.subscribe({next:i=>{this.gs.log("[UPLOAD_EVENTS]",i),("uploading"===i.status||"complete"===i.status)&&(this.attachmentSelected=i),"complete"===i.status?(this.gs.log("[UPLOAD_COMPLETED]",i.response),this.fg.controls.attachment_id.patchValue(i.response.result.id),this.fg.controls.attachment_id.markAsDirty(),this.uploadToast=this.toast.warning("Segera Kirim Data Berkas!","Lampiran Akan Dihapus ...",{closeButton:!1,timeOut:$.t.timeoutDeleteTempAttachmentTime,disableTimeOut:"extendedTimeOut",tapToDismiss:!1,progressAnimation:"decreasing"},!0),this.timerTimeout1=setTimeout(()=>{this.gs.log("[UPLOAD_TIMEOUT]",$.t.timeoutDeleteTempAttachmentTime),this.failOrCancelUpload({info:"Expired, Silahkan Upload Ulang!"})},$.t.timeoutDeleteTempAttachmentTime),this.fg.value.auto_send&&(this.timerTimeout2=setTimeout(()=>{this.onSubmit()},2500))):"error"===i.status&&(this.gs.log("[UPLOAD_ERROR]",i.response,"error"),this.failOrCancelUpload(i.response))},error:i=>{this.gs.log("[UPLOAD_ERROR]",i,"error"),this.failOrCancelUpload(i)}}))},error:t=>{this.gs.log("[BERKAS_DETAIL_ERROR]",t,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/berkas/${this.berkasId}`}})}}))}ngOnDestroy(){this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.timerTimeout1&&(clearTimeout(this.timerTimeout1),this.timerTimeout1=null),this.timerTimeout2&&(clearTimeout(this.timerTimeout2),this.timerTimeout2=null),this.subsProject?.unsubscribe(),this.subsFansub?.unsubscribe(),this.subsAnimeDetail?.unsubscribe(),this.subsDoramaDetail?.unsubscribe(),this.subsProjectDetail?.unsubscribe();for(const t of this.subsFansubDetail)t?.unsubscribe();this.subsAnimeNew?.unsubscribe(),this.subsDoramaNew?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsBerkasDetail?.unsubscribe(),this.subsBerkasUpdate?.unsubscribe(),this.subsUpload?.unsubscribe(),this.subsDialog?.unsubscribe()}uploadAttachment(t,i){var e=this;return(0,se.Z)(function*(){e.ddl=i;const r=t.target.files[0];e.attachmentLimitExceeded=null,e.attachmentErrorText=null,e.gs.log("[ATTACHMENT_SELECTED]",r),e.fg.controls.attachment_id.patchValue(null),e.uploadService.disconnect();try{r.size<=$.t.fileSizeAttachmentTotalLimit?(e.uploadService.handleFiles(r),e.subsDialog=(yield e.ds.openKonfirmasiDialog("Saran Penamaan Berkas","Apakah Ingin Mengganti Penamaan Berkas Sesuai Dengan Nama Lampiran Yang Di Unggah ?")).afterClosed().subscribe({next:a=>{e.gs.log("[INFO_DIALOG_CLOSED]",a),!0===a&&(e.fg.controls.name.patchValue(r.name),e.fg.controls.name.markAsDirty()),e.subsDialog.unsubscribe()}})):(e.attachmentLimitExceeded=$.t.fileSizeAttachmentTotalLimit,e.ddl.clear(t))}catch{e.ddl.clear(t)}})()}submitAttachment(t){const i=this.uploadService.state().find(e=>e.uploadId===t.uploadId);i&&(this.attachmentSelected=i,t.status="queue")}failOrCancelUpload(t=null){this.attachmentSelected=null,this.attachmentErrorText=t?.result?.message||t?.info||t?.error?.message||"Terjadi Kesalahan, Harap Reload Halaman!",this.uploadService.disconnect(),this.fg.controls.attachment_id.patchValue(null),this.fg.controls.attachment_id.markAsPristine(),this.fg.controls.attachment_id.markAsUntouched(),this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.ddl.clear()}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]},state:{bypassCanDeactivate:!0}})}loadProjectList(){this.bs.busy(),this.subsProject=this.project.getProject().subscribe({next:t=>{this.gs.log("[PROJECT_LOAD_SUCCESS]",t),this.projectList=t.results,this.bs.idle()},error:t=>{this.gs.log("[PROJECT_LOAD_ERROR]",t,"error"),this.bs.idle()}})}hasRequiredField(t,i){return t.get(i).hasValidator(B.kI.required)}animeValueChanged(){this.subsAnimeDetail=this.fg.get("anime_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(t=>this.anime.searchAnime(t).pipe((0,jo.x)(()=>this.isLoading=!1))),(0,Ua.X)(-1)).subscribe({next:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_SUCCESS]",t),this.filteredAnime=t.results},error:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_ERROR]",t,"error"),this.animeValueChanged()}})}doramaValueChanged(){this.subsDoramaDetail=this.fg.get("dorama_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(t=>this.dorama.searchDorama(t).pipe((0,jo.x)(()=>this.isLoading=!1))),(0,Ua.X)(-1)).subscribe({next:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_SUCCESS]",t);for(const i of t.results)i.mdl_id=i.mdl_id.split("-")[1],i.image_url=i.thumb;this.filteredDorama=t.results},error:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_ERROR]",t,"error"),this.doramaValueChanged()}})}projectTypeValueChanged(){this.subsProjectDetail=this.fg.get("projectType_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,Ua.X)(-1)).subscribe({next:t=>{this.gs.log("[BERKAS_CREATE_PROJECT_CHANGED]",t),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null),this.fg.controls.sn_code.patchValue(null),this.fg.controls.anime_id.setErrors(null),this.fg.controls.anime_name.setErrors(null),this.fg.controls.dorama_id.setErrors(null),this.fg.controls.dorama_name.setErrors(null),this.fg.controls.sn_code.setErrors(null),this.fg.controls.anime_id.clearValidators(),this.fg.controls.anime_name.clearValidators(),this.fg.controls.dorama_id.clearValidators(),this.fg.controls.dorama_name.clearValidators(),this.fg.controls.sn_code.clearValidators(),this.fg.controls.anime_id.markAsPristine(),this.fg.controls.anime_name.markAsPristine(),this.fg.controls.dorama_id.markAsPristine(),this.fg.controls.dorama_name.markAsPristine(),this.fg.controls.sn_code.markAsPristine(),this.fg.controls.anime_id.markAsUntouched(),this.fg.controls.anime_name.markAsUntouched(),this.fg.controls.dorama_id.markAsUntouched(),this.fg.controls.dorama_name.markAsUntouched(),this.fg.controls.sn_code.markAsUntouched();const i=this.projectList.find(e=>e.id===t);i&&(this.berkasType=i.name,i.name.toLowerCase().includes("anime_")?(this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required]),this.subsAnimeDetail?.unsubscribe(),this.animeValueChanged()):i.name.toLowerCase().includes("dorama_")?(this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required]),this.subsDoramaDetail?.unsubscribe(),this.doramaValueChanged()):this.fg.controls.sn_code.setValidators([B.kI.required,B.kI.pattern(/^[A-Z0-9\-]+$/)])),this.fg.controls.anime_id.updateValueAndValidity(),this.fg.controls.anime_name.updateValueAndValidity(),this.fg.controls.dorama_id.updateValueAndValidity(),this.fg.controls.dorama_name.updateValueAndValidity(),this.fg.controls.sn_code.updateValueAndValidity()}})}initForm(t){"attachment_"in t&&t.attachment_&&(this.attachmentFile=t.attachment_,t.attachment_.fonts_&&t.attachment_.fonts_.forEach(i=>{this.attachmentFontSubtitle.push(`${i.name}.${i.ext}`)}),t.attachment_.subtitles_&&t.attachment_.subtitles_.forEach(i=>{this.attachmentFontSubtitle.push(`${i.name}.${i.ext}`)})),this.fg=this.fb.group({name:[t.name,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexEnglishKeyboardKeys)])],description:[t.description,B.kI.compose([B.kI.pattern($.t.regexEnglishKeyboardKeys)])],projectType_id:[t.project_type_.id,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexEnglishKeyboardKeys)])],anime_id:[t.anime_?.id||null,B.kI.compose([])],anime_name:[t.anime_?.name||null,B.kI.compose([])],dorama_id:[t.dorama_?.id||null,B.kI.compose([])],dorama_name:[t.dorama_?.name||null,B.kI.compose([])],fansub_list:this.fb.array([]),image:[null,B.kI.compose([B.kI.pattern($.t.regexUrl)])],sn_code:[t.sn_code,B.kI.compose([])],attachment_id:[t.attachment_?.id,B.kI.compose([B.kI.pattern($.t.regexEnglishKeyboardKeys)])],download_url:this.fb.array([]),private:[t.private,B.kI.compose([B.kI.required])],r18:[t.r18,B.kI.compose([B.kI.required])],auto_send:[!1,B.kI.compose([B.kI.required])]}),this.image_url=t.image_url,this.image_url_original=this.image_url,this.berkasType=t.project_type_.name,t.anime_&&(this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required])),t.dorama_&&(this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required]));for(const i of t.download_url)this.addDownloadLink(i);for(const i of t.fansub_)this.addFansub(i);this.projectTypeValueChanged()}get getDownloadUrlControl(){return this.fg.get("download_url")}createDownloadLink(t=null,i=null){return this.fb.group({name:[t,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexEnglishKeyboardKeys)])],url:[i,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexUrl)])]})}addDownloadLink(t=null){this.getDownloadUrlControl.push(t?this.createDownloadLink(t.name,t.url):this.createDownloadLink())}removeDownloadLink(t){this.getDownloadUrlControl.removeAt(t)}get getFansubControl(){return this.fg.get("fansub_list")}createFansub(t=null){const i=this.fb.group({fansub_id:[t?.id||null,B.kI.compose([B.kI.required,B.kI.pattern(/^\d+$/)])],fansub_name:[t?.name||null,B.kI.compose([B.kI.required])]});return this.subsFansubDetail.push(i.get("fansub_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(e=>this.fansub.searchFansub(e).pipe((0,jo.x)(()=>this.isLoading=!1))),(0,Ua.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_EDIT_SEARCH_FANSUB_RESULT]",e),this.filteredFansub=e.results}})),i}removeFansub(t){this.getFansubControl.removeAt(t),this.subsFansubDetail[t]?.unsubscribe(),this.subsFansubDetail.splice(t,1)}addFansub(t=null){this.getFansubControl.push(t?this.createFansub(t):this.createFansub())}resetSelectedAnime(){this.fg.controls.anime_name.patchValue(null)}resetSelectedDorama(){this.fg.controls.dorama_name.patchValue(null)}resetSelectedFansub(t){this.getFansubControl.controls[t].get("fansub_name").patchValue(null)}filterAnimeSelected(t){this.gs.log("[ANIME_FILTER_CLICK]",t),this.submitted=!0,this.subsAnimeNew=this.anime.addNewAnime({id:t.id,name:t.title,image_url:t.image_url,type:t.media_type?.toUpperCase()}).subscribe({next:i=>{this.gs.log("[ANIME_CHECK_ADD_SUCCESS]",i),this.animeCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.anime_id.patchValue(i.result.id),this.fg.controls.anime_name.patchValue(i.result.name)},error:i=>{this.gs.log("[ANIME_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedAnime(),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null)}})}filterDoramaSelected(t){this.gs.log("[DORAMA_FILTER_CLICK]",t),this.submitted=!0,this.subsDoramaNew=this.dorama.addNewDorama({id:parseInt(t.mdl_id,10),slug:t.slug,name:t.title,image_url:t.image_url,type:t.type}).subscribe({next:i=>{this.gs.log("[DORAMA_CHECK_ADD_SUCCESS]",i),this.doramaCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.dorama_id.patchValue(i.result.id),this.fg.controls.dorama_name.patchValue(i.result.name)},error:i=>{this.gs.log("[DORAMA_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedDorama(),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null)}})}filterFansubSelected(t,i){this.gs.log("[FANSUB_FILTER_CLICK]",t),this.getFansubControl.controls[i].get("fansub_id").patchValue(t.id),this.getFansubControl.controls[i].get("fansub_name").patchValue(t.name)}uploadImage(t,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.fg.controls.image.markAsUntouched();const e=t.target.files[0];try{const r=new FileReader;r.readAsDataURL(e),r.onload=a=>{if(this.gs.log("[IMAGE_SELECTED]",a),e.size<=$.t.fileSizeImageLimit){const o=this.gs.document.createElement("img");o.onload=()=>{this.image=e,this.image_url=r.result.toString()},o.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=$.t.fileSizeImageLimit,this.gambar.clear(t)}}catch{this.image=null,this.image_url=this.image_url_original,this.gambar.clear(t)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:t=>{this.gs.log("[IMAGE_SUCCESS]",t),this.fg.controls.image.patchValue(t.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:t=>{this.gs.log("[IMAGE_ERROR]",t,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.fg.controls.image.markAsUntouched(),this.submitted=!1,this.imageErrorText=t.result?.message||t.info}})}onSubmit(){this.bs.busy();const t=this.gs.getDirtyValues(this.fg);if("fansub_list"in t){const i=[];for(const e of this.fg.value.fansub_list)i.push(e.fansub_id);t.fansub_id=i,delete t.fansub_list}return"auto_send"in t&&delete t.auto_send,null===this.fg.value.attachment_id&&0===this.fg.value.download_url.lenth?(this.submitted=!1,this.uploadToast=this.toast.warning("Lampiran DDL / URL Eksternal!","Harap Mengisi Setidaknya Salah Satu ..."),void this.bs.idle()):(this.gs.log("[BERKAS_EDIT_DIRTY]",t),this.submitted=!0,this.fg.invalid?(this.submitted=!1,void this.bs.idle()):void(this.subsBerkasUpdate=this.berkas.updateBerkas(this.berkasId,{...t}).subscribe({next:i=>{this.gs.log("[BERKAS_EDIT_SUCCESS]",i),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/berkas/${this.berkasId}`)},error:i=>{this.gs.log("[BERKAS_EDIT_ERROR]",i,"error"),this.submitted=!1,this.bs.idle()}})))}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(B.QS),u.Y36(Ue.z),u.Y36(o_.o),u.Y36(u_.X),u.Y36(l_.Y),u.Y36(d_.T),u.Y36(rt.A),u.Y36(ee.k),u.Y36(c_.X),u.Y36(ke.U),u.Y36(D.e),u.Y36(f_.Lz),u.Y36(hc.x))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-edit"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],["class","col-12 py-3",4,"ngIf"],[1,"col-12","py-3"],["formControlName","r18","matTooltip","Konten Eksplisit"],["appearance","outline",1,"px-3","pt-3","col-12",3,"color"],["formControlName","projectType_id","placeholder","Anime / Drama"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf","ngIfThen","ngIfElse"],["anime_",""],["notAnime_",""],["formArrayName","fansub_list","matTooltip","Silahkan Buat Terlebih Dahulu Jika Tidak Ada"],[4,"ngFor","ngForOf"],[1,"col","px-3"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add",1,"me-1"],["routerLink","/create/fansub",1,"text-warning","text-decoration-none"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","[Fansub] Judul Anime - 00 [BD 4K x265 FLAC][CRC32].mkv"],["fontIcon","wysiwyg","matSuffix",""],["formControlName","description",1,"py-3","w-100",3,"config"],["ddlExist",""],["ddlNotExist",""],["formArrayName","download_url"],[1,"row","mb-4"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],[1,"col-12","mb-4"],["fontIcon","add_photo_alternate",1,"me-1"],["formControlName","private","matTooltip","Hanya Dapat Di Akses Melalui URL"],[3,"value"],["appearance","outline",1,"px-3","pt-3","w-100",3,"color"],["matInput","","formControlName","anime_id","placeholder","Full Metal Alchemist",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix",""],["autoCompleteAnime","matAutocomplete"],["class","is-loading",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"is-loading"],["mode","indeterminate"],["class","px-1",3,"value","click",4,"ngFor","ngForOf"],[1,"px-1",3,"value","click"],[1,"me-1",2,"height","40px","width","30px","object-fit","cover",3,"src"],[1,"ms-1"],[1,"text-warning"],["dorama_",""],["notDorama_",""],["matInput","","formControlName","dorama_id","placeholder","Flying Colors",3,"matAutocomplete","keyup"],["autoCompleteDorama","matAutocomplete"],["appearance","outline","class","px-3 pt-3 col-12",3,"color",4,"ngIf"],["class","col-12 px-3",4,"ngIf"],["matInput","","formControlName","sn_code","placeholder","XXX-999","required",""],["fontIcon","tag","matSuffix",""],[1,"col-12","px-3"],[1,"text-success"],[1,"row",3,"formGroupName"],["matInput","","formControlName","fansub_id","placeholder","NamaFansub",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix","",4,"ngIf"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click",4,"ngIf"],["autoCompleteFansub","matAutocomplete"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click"],["fontIcon","close"],[1,"me-1",2,"height","40px","width","40px","object-fit","cover",3,"src"],["mat-subheader","",1,"text-warning"],["fontIcon","attach_file","mat-list-icon",""],["mat-line",""],["class","py-3 m-0",4,"ngIf"],[1,"py-3","m-0"],["ddlVerified",""],["ddlNotVerified",""],["appearance","outline",1,"px-3","pt-3","col",3,"color"],["uploadx","",1,"w-100",3,"disabled","accept","change"],["ddl",""],["fontIcon","attach_file","matSuffix",""],[1,"px-4","w-100"],["class","row mb-4",4,"ngFor","ngForOf"],["formControlName","auto_send","matTooltip","Pastikan Semua Isian Yang Dibutuhkan Sudah Terisi",1,"px-3",3,"disabled"],[1,"col"],[1,"ps-3"],[3,"mode","value"],[1,"col-6","col-lg-4","px-3"],["fontIcon","attachment",1,"me-1"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"],["fontIcon","enhanced_encryption",1,"me-1"],["matTooltip","Silahkan Isi Alamat Website Kamu Jika Ingin Mendapatkan Traffic Pengunjung",1,"row",3,"formGroupName"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","name","placeholder","Web Shit","required",""],["fontIcon","web","matSuffix","",4,"ngIf"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","url","placeholder","https://drive.google.com/drive/u/2/folders/1KYTJZsmH9dyyHBXnQD4N0SjSBXcs8qD-","required",""],["fontIcon","link","matSuffix","",4,"ngIf"],["fontIcon","web","matSuffix",""],["fontIcon","link","matSuffix",""]],template:function(i,e){1&i&&(u._UZ(0,"app-notifications"),u.TgZ(1,"div",0)(2,"div",1)(3,"div",2),u.YNc(4,b0,98,29,"form",3),u.qZA()()()),2&i&&(u.xp6(4),u.Q6J("ngIf",e.fg))},dependencies:[X.sg,X.O5,_e.rH,pc.VN,pc.QJ,te.CK,ue.eB,ue.Nr,h_.d,p_.X2,J.Hw,ie.nI,ie.v_,ie.$V,ie.nX,m_.k0,Ae.Zj,Ae.oh,Ae.ap,Ae.Sc,Ze.eI,We.x8,mc.iZ,qe.Kd,B._Y,B.Fj,B.JJ,B.JL,B.Q7,B.sg,B.u,B.x0,B.CE,ve.Yh,Me.t,we.s6,X.Ov,fc.$]})}return s})();var S0=H(5155),E0=H(1338);function C0(s,n){1&s&&(u.TgZ(0,"div",11),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Seluruh Pengguna Tidak Di Tampilkan "),u.qZA())}function k0(s,n){1&s&&(u.TgZ(0,"div",11),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Pengguna "),u.TgZ(5,"i"),u._uU(6,"Private"),u.qZA(),u._uU(7," Tidak Di Tampilkan "),u.qZA())}function A0(s,n){1&s&&(u.TgZ(0,"div",6),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," => Warna Abu-Abu "),u.qZA())}function w0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",1)(1,"div",2)(2,"div",3),u.YNc(3,C0,5,0,"div",4),u.YNc(4,k0,8,0,"div",4),u.YNc(5,A0,5,0,"div",5),u.TgZ(6,"div",6),u._uU(7," * Berkas Anggota Fansub => Warna Oranye "),u.qZA()()(),u.TgZ(8,"div",2)(9,"div",7)(10,"mat-slide-toggle",8),u.NdJ("ngModelChange",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.r18=e)})("change",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.r18Changed())}),u._uU(11," Tampilkan R-18+ "),u.qZA()()(),u.TgZ(12,"div",9)(13,"app-material-tab",10),u.NdJ("tableRowClicked",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.openBerkas(e))})("paginatorClicked",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.onPaginatorClicked(e))})("serverSideFilter",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.onServerSideFilter(e))})("serverSideOrder",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.onServerSideOrder(e))}),u.qZA()()()}if(2&s){const t=u.oxw();u.xp6(3),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&null!=t.AS.currentUserSubject.value&&t.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified)&&!t.showTruelyPrivate),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified)||t.showTruelyPrivate),u.xp6(5),u.Q6J("ngModel",t.r18),u.xp6(3),u.Q6J("tablePageSizeOptions",t.tablePageSizeOptions)("tabData",t.tabData)("count",t.count)("serverSide",!0)}}let I0=(()=>{class s{constructor(t,i,e,r,a,o,l,d){this.router=t,this.gs=i,this.ls=e,this.bs=r,this.berkas=a,this.fs=o,this.as=l,this.ds=d,this.allBerkasId=[],this.berkasData=[],this.tabData=[{name:"Berkas Terkini",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Kunjungan","Pemilik"],row:[]}}],this.count=0,this.page=1,this.row=50,this.tablePageSizeOptions=[50,75,100,125,150],this.q="",this.sort="",this.order="",this.subsBerkas=null,this.subsTrusted=null,this.subsDialog=null,this.r18=!1,this.gs.bannerImg="/assets/img/banner/berkas.jpg",this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get showTruelyPrivate(){return this.as.currentUserSubject?.value?.role===Ce.yS.ADMIN||this.as.currentUserSubject?.value?.role===Ce.yS.MODERATOR||this.as.currentUserSubject?.value?.role===Ce.yS.FANSUBBER}ngOnDestroy(){this.subsBerkas?.unsubscribe(),this.subsTrusted?.unsubscribe(),this.subsDialog?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.r18="true"===this.ls.getItem(this.gs.localStorageKeys.R18),this.gs.isDesktop||(this.tablePageSizeOptions=[10,25,50,75,100]),this.row=this.tablePageSizeOptions[0],this.getBerkas())}r18Changed(){var t=this;return(0,se.Z)(function*(){t.r18?t.subsDialog=(yield t.ds.openKonfirmasiDialog("Tampilkan Kontent R-18+","Apakah Yakin Untuk Melanjutkan ?")).afterClosed().subscribe({next:i=>{t.gs.log("[INFO_DIALOG_CLOSED]",i),i||(t.r18=!1),t.ls.setItem(t.gs.localStorageKeys.R18,JSON.stringify(t.r18)),t.getBerkas(),t.subsDialog.unsubscribe()}}):(t.ls.setItem(t.gs.localStorageKeys.R18,JSON.stringify(t.r18)),t.getBerkas())})()}getBerkas(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.berkas.getAllBerkas(this.q,this.page,this.row,this.sort,this.order,this.r18).subscribe({next:t=>{this.gs.log("[BERKAS_LIST_SUCCESS]",t),this.count=t.count,this.berkasData=[];for(const i of t.results)this.allBerkasId.push(i.id),this.berkasData.push({id:i.id,private:i.private,foto:i.user_.image_url,Proyek:i.project_type_.name,Tanggal:i.created_at,Kunjungan:i.view_count,Pemilik:i.user_.username,"Nama Berkas":i.name});this.tabData[0].data.row=this.berkasData,this.allBerkasId.length>0&&this.checkTrusted(),this.fs.initializeFab("add",null,"Tambah Berkas Baru","/create/berkas",!1),this.bs.idle()},error:t=>{this.gs.log("[BERKAS_LIST_ERROR]",t,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasId).subscribe({next:t=>{this.gs.log("[BERKAS_TRUSTED_SUCCESS]",t);for(const i of this.berkasData)i.trusted=t.results[i.id];this.bs.idle()},error:t=>{this.gs.log("[BERKAS_TRUSTED_ERROR]",t,"error"),this.bs.idle()}})}openBerkas(t){this.gs.log("[BERKAS_LIST_CLICK_BERKAS]",t),this.router.navigateByUrl(`/berkas/${t.id}`)}onPaginatorClicked(t){this.gs.log("[BERKAS_LIST_CLICK_PAGINATOR]",t),this.page=t.pageIndex+1,this.row=t.pageSize,this.getBerkas()}onServerSideFilter(t){this.gs.log("[BERKAS_LIST_ENTER_FILTER]",t),this.q=t,this.getBerkas()}onServerSideOrder(t){this.gs.log("[BERKAS_LIST_CLICK_ORDER]",t),this.q=t.q,this.sort=t.active,this.order=t.direction,this.getBerkas()}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(_e.F0),u.Y36(ke.U),u.Y36(S0.n),u.Y36(Ue.z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e),u.Y36(hc.x))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-list"]],decls:2,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","my-4"],[1,"col-12"],["class","text-danger text-end",4,"ngIf"],["class","text-success text-end",4,"ngIf"],[1,"text-success","text-end"],[1,"col-12","text-end","text-warning"],["labelPosition","before",3,"ngModel","ngModelChange","change"],[1,"row"],[3,"tablePageSizeOptions","tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"text-danger","text-end"]],template:function(i,e){1&i&&(u._UZ(0,"app-notifications"),u.YNc(1,w0,14,8,"div",0)),2&i&&(u.xp6(1),u.Q6J("ngIf",e.berkasData))},dependencies:[X.O5,mc.iZ,E0.H,B.JJ,B.On,Me.t]})}return s})();var D0=H(5208);const P0=[{path:"",pathMatch:"full",component:I0},{path:":berkasId",children:[{path:"",pathMatch:"full",component:s_},{path:"edit",component:x0,canActivate:[yt.t],data:{title:"Berkas - Ubah Data",description:"Halaman Pembaharuan Data Fansub",keywords:"Ubah Berkas",[$.t.decoratorRoles]:[Ce.yS.ADMIN,Ce.yS.MODERATOR,Ce.yS.FANSUBBER,Ce.yS.USER]}}]}];let O0=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=u.oAB({type:s});static#i=this.\u0275inj=u.cJS({imports:[X.ez,_e.Bz.forChild(P0),Ee.m,Te.L,B.u5,B.UX,ve.Ad,pe.F,we.UM,oe,Fe.R,He.b,it.T,D0.d]})}return s})()},3992:(je,Ie,H)=>{"use strict";var X=H(9226);je.exports=function(ve,$){return void 0===$&&($=!1),function(Ce,Ee,Te){if(Ce)ve(Ce);else if(Ee.statusCode>=400&&Ee.statusCode<=599){var pe=Te;if($)if(X.TextDecoder){var u=function B(we){return void 0===we&&(we=""),we.toLowerCase().split(";").reduce(function(ve,$){var Ce=$.split("="),Te=Ce[1];return"charset"===Ce[0].trim()?Te.trim():ve},"utf-8")}(Ee.headers&&Ee.headers["content-type"]);try{pe=new TextDecoder(u).decode(Te)}catch{}}else pe=String.fromCharCode.apply(null,new Uint8Array(Te));ve({cause:pe})}else ve(null,Te)}}},745:(je,Ie,H)=>{"use strict";var X=H(9226),_e=H(434),B=H(2703);Ee.httpHandler=H(3992);var we=function(Fe){var He={};return Fe&&Fe.trim().split("\n").forEach(function(it){var yt=it.indexOf(":"),se=it.slice(0,yt).trim().toLowerCase(),Le=it.slice(yt+1).trim();typeof He[se]>"u"?He[se]=Le:Array.isArray(He[se])?He[se].push(Le):He[se]=[He[se],Le]}),He};function Ce(oe,Fe,He){var it=oe;return B(Fe)?(He=Fe,"string"==typeof oe&&(it={uri:oe})):it=_e({},Fe,{uri:oe}),it.callback=He,it}function Ee(oe,Fe,He){return Te(Fe=Ce(oe,Fe,He))}function Te(oe){if(typeof oe.callback>"u")throw new Error("callback argument missing");var Fe=!1,He=function(de,le,xe){Fe||(Fe=!0,oe.callback(de,le,xe))};function yt(){var Q=void 0;if(Q=me.response?me.response:me.responseText||function pe(oe){try{if("document"===oe.responseType)return oe.responseXML;if(""===oe.responseType&&(!oe.responseXML||"parsererror"!==oe.responseXML.documentElement.nodeName))return oe.responseXML}catch{}return null}(me),D)try{Q=JSON.parse(Q)}catch{}return Q}function se(Q){return clearTimeout(V),Q instanceof Error||(Q=new Error(""+(Q||"Unknown XMLHttpRequest Error"))),Q.statusCode=0,He(Q,ee)}function Le(){if(!Ge){var Q;clearTimeout(V);var de=ee,le=null;return 0!==(Q=oe.useXDR&&void 0===me.status?200:1223===me.status?204:me.status)?(de={body:yt(),statusCode:Q,method:Ue,headers:{},url:ke,rawRequest:me},me.getAllResponseHeaders&&(de.headers=we(me.getAllResponseHeaders()))):le=new Error("Internal XMLHttpRequest Error"),He(le,de,de.body)}}var me=oe.xhr||null;me||(me=oe.cors||oe.useXDR?new Ee.XDomainRequest:new Ee.XMLHttpRequest);var Oe,Ge,V,ke=me.url=oe.uri||oe.url,Ue=me.method=oe.method||"GET",Ve=oe.body||oe.data,rt=me.headers=oe.headers||{},w=!!oe.sync,D=!1,ee={body:void 0,headers:{},statusCode:0,method:Ue,url:ke,rawRequest:me};if("json"in oe&&!1!==oe.json&&(D=!0,rt.accept||rt.Accept||(rt.Accept="application/json"),"GET"!==Ue&&"HEAD"!==Ue&&(rt["content-type"]||rt["Content-Type"]||(rt["Content-Type"]="application/json"),Ve=JSON.stringify(!0===oe.json?Ve:oe.json))),me.onreadystatechange=function it(){4===me.readyState&&setTimeout(Le,0)},me.onload=Le,me.onerror=se,me.onprogress=function(){},me.onabort=function(){Ge=!0},me.ontimeout=se,me.open(Ue,ke,!w,oe.username,oe.password),w||(me.withCredentials=!!oe.withCredentials),!w&&oe.timeout>0&&(V=setTimeout(function(){if(!Ge){Ge=!0,me.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",se(Q)}},oe.timeout)),me.setRequestHeader)for(Oe in rt)rt.hasOwnProperty(Oe)&&me.setRequestHeader(Oe,rt[Oe]);else if(oe.headers&&!function $(oe){for(var Fe in oe)if(oe.hasOwnProperty(Fe))return!1;return!0}(oe.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in oe&&(me.responseType=oe.responseType),"beforeSend"in oe&&"function"==typeof oe.beforeSend&&oe.beforeSend(me),me.send(Ve||null),me}je.exports=Ee,je.exports.default=Ee,Ee.XMLHttpRequest=X.XMLHttpRequest||function u(){},Ee.XDomainRequest="withCredentials"in new Ee.XMLHttpRequest?Ee.XMLHttpRequest:X.XDomainRequest,function ve(oe,Fe){for(var He=0;He{"use strict";function H(B,we){return void 0===we&&(we=Object),we&&"function"==typeof we.freeze?we.freeze(B):B}var X=H({HTML:"text/html",isHTML:function(B){return B===X.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_e=H({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(B){return B===_e.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ie.freeze=H,Ie.MIME_TYPE=X,Ie.NAMESPACE=_e},1991:(je,Ie,H)=>{var _e=H(9401),B=H(6853),we=H(4436),ve=H(8702),$=B.DOMImplementation,Ce=_e.NAMESPACE,Ee=ve.ParseError,Te=ve.XMLReader;function pe(se){this.options=se||{locator:{}}}function oe(){this.cdata=!1}function Fe(se,Le){Le.lineNumber=se.lineNumber,Le.columnNumber=se.columnNumber}function He(se){if(se)return"\n@"+(se.systemId||"")+"#[line:"+se.lineNumber+",col:"+se.columnNumber+"]"}function it(se,Le,me){return"string"==typeof se?se.substr(Le,me):se.length>=Le+me||Le?new java.lang.String(se,Le,me)+"":se}function yt(se,Le){se.currentElement?se.currentElement.appendChild(Le):se.doc.appendChild(Le)}pe.prototype.parseFromString=function(se,Le){var me=this.options,Oe=new Te,Ge=me.domBuilder||new oe,ke=me.errorHandler,Ue=me.locator,Ve=me.xmlns||{},rt=/\/x?html?$/.test(Le),w=rt?we.HTML_ENTITIES:we.XML_ENTITIES;return Ue&&Ge.setDocumentLocator(Ue),Oe.errorHandler=function u(se,Le,me){if(!se){if(Le instanceof oe)return Le;se=Le}var Oe={},Ge=se instanceof Function;function ke(Ue){var Ve=se[Ue];!Ve&&Ge&&(Ve=2==se.length?function(rt){se(Ue,rt)}:se),Oe[Ue]=Ve&&function(rt){Ve("[xmldom "+Ue+"]\t"+rt+He(me))}||function(){}}return me=me||{},ke("warning"),ke("error"),ke("fatalError"),Oe}(ke,Ge,Ue),Oe.domBuilder=me.domBuilder||Ge,rt&&(Ve[""]=Ce.HTML),Ve.xml=Ve.xml||Ce.XML,se&&"string"==typeof se?Oe.parse(se,Ve,w):Oe.errorHandler.error("invalid doc source"),Ge.doc},oe.prototype={startDocument:function(){this.doc=(new $).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(se,Le,me,Oe){var Ge=this.doc,ke=Ge.createElementNS(se,me||Le),Ue=Oe.length;yt(this,ke),this.currentElement=ke,this.locator&&Fe(this.locator,ke);for(var Ve=0;Ve{var _e=H(9401).NAMESPACE;function B(C){return""!==C}function ve(C,A){return C.hasOwnProperty(A)||(C[A]=!0),C}function $(C){if(!C)return[];var A=function we(C){return C?C.split(/[\t\n\f\r ]+/).filter(B):[]}(C);return Object.keys(A.reduce(ve,{}))}function Ee(C,A){for(var R in C)A[R]=C[R]}function Te(C,A){var R=C.prototype;if(!(R instanceof A)){let ce=function(){};ce.prototype=A.prototype,ce=new ce,Ee(R,ce),C.prototype=R=ce}R.constructor!=C&&("function"!=typeof C&&console.error("unknown Class:"+C),R.constructor=C)}var pe={},u=pe.ELEMENT_NODE=1,oe=pe.ATTRIBUTE_NODE=2,Fe=pe.TEXT_NODE=3,He=pe.CDATA_SECTION_NODE=4,it=pe.ENTITY_REFERENCE_NODE=5,yt=pe.ENTITY_NODE=6,se=pe.PROCESSING_INSTRUCTION_NODE=7,Le=pe.COMMENT_NODE=8,me=pe.DOCUMENT_NODE=9,Oe=pe.DOCUMENT_TYPE_NODE=10,Ge=pe.DOCUMENT_FRAGMENT_NODE=11,ke=pe.NOTATION_NODE=12,Ue={},Ve={},D=(Ue.INDEX_SIZE_ERR=(Ve[1]="Index size error",1),Ue.DOMSTRING_SIZE_ERR=(Ve[2]="DOMString size error",2),Ue.HIERARCHY_REQUEST_ERR=(Ve[3]="Hierarchy request error",3)),le=(Ue.WRONG_DOCUMENT_ERR=(Ve[4]="Wrong document",4),Ue.INVALID_CHARACTER_ERR=(Ve[5]="Invalid character",5),Ue.NO_DATA_ALLOWED_ERR=(Ve[6]="No data allowed",6),Ue.NO_MODIFICATION_ALLOWED_ERR=(Ve[7]="No modification allowed",7),Ue.NOT_FOUND_ERR=(Ve[8]="Not found",8)),te=(Ue.NOT_SUPPORTED_ERR=(Ve[9]="Not supported",9),Ue.INUSE_ATTRIBUTE_ERR=(Ve[10]="Attribute in use",10));function We(C,A){if(A instanceof Error)var R=A;else R=this,Error.call(this,Ve[C]),this.message=Ve[C],Error.captureStackTrace&&Error.captureStackTrace(this,We);return R.code=C,A&&(this.message=this.message+": "+A),R}function qe(){}function Me(C,A){this._node=C,this._refresh=A,Pt(this)}function Pt(C){var A=C._node._inc||C._node.ownerDocument._inc;if(C._inc!=A){var R=C._refresh(C._node);Ar(C,"length",R.length),Ee(R,C),C._inc=A}}function P(){}function St(C,A){for(var R=C.length;R--;)if(C[R]===A)return R}function z(C,A,R,Z){if(Z?A[St(A,Z)]=R:A[A.length++]=R,C){R.ownerElement=C;var ce=C.ownerDocument;ce&&(Z&&Yi(ce,C,Z),function Ct(C,A,R){C&&C._inc++,R.namespaceURI===_e.XMLNS&&(A._nsMap[R.prefix?R.localName:""]=R.value)}(ce,C,R))}}function gt(C,A,R){var Z=St(A,R);if(!(Z>=0))throw We(le,new Error(C.tagName+"@"+R));for(var ce=A.length-1;Z"==C&&">")||"&"==C&&"&"||'"'==C&&"""||"&#"+C.charCodeAt()+";"}function lt(C,A){if(A(C))return!0;if(C=C.firstChild)do{if(lt(C,A))return!0}while(C=C.nextSibling)}function re(){}function Yi(C,A,R,Z){C&&C._inc++,R.namespaceURI===_e.XMLNS&&delete A._nsMap[R.prefix?R.localName:""]}function $i(C,A,R){if(C&&C._inc){C._inc++;var Z=A.childNodes;if(R)Z[Z.length++]=R;else{for(var ce=A.firstChild,ze=0;ce;)Z[ze++]=ce,ce=ce.nextSibling;Z.length=ze}}}function ki(C,A){var R=A.previousSibling,Z=A.nextSibling;return R?R.nextSibling=Z:C.firstChild=Z,Z?Z.previousSibling=R:C.lastChild=R,$i(C.ownerDocument,C),A}function Qi(C,A,R){var Z=A.parentNode;if(Z&&Z.removeChild(A),A.nodeType===Ge){var ce=A.firstChild;if(null==ce)return A;var ze=A.lastChild}else ce=ze=A;var Xe=R?R.previousSibling:C.lastChild;ce.previousSibling=Xe,ze.nextSibling=R,Xe?Xe.nextSibling=ce:C.firstChild=ce,null==R?C.lastChild=ze:R.previousSibling=ze;do{ce.parentNode=C}while(ce!==ze&&(ce=ce.nextSibling));return $i(C.ownerDocument||C,C),A.nodeType==Ge&&(A.firstChild=A.lastChild=null),A}function vt(){this._nsMap={}}function oi(){}function Xi(){}function rn(){}function xr(){}function Sr(){}function Er(){}function Ji(){}function Cr(){}function nn(){}function er(){}function an(){}function Bn(){}function kr(C,A){var R=[],Z=9==this.nodeType&&this.documentElement||this,ce=Z.prefix,ze=Z.namespaceURI;if(ze&&null==ce&&null==(ce=Z.lookupPrefix(ze)))var Xe=[{namespace:ze,prefix:null}];return Vi(this,R,C,A,Xe),R.join("")}function jn(C,A,R){var Z=C.prefix||"",ce=C.namespaceURI;if(!ce||"xml"===Z&&ce===_e.XML||ce===_e.XMLNS)return!1;for(var ze=R.length;ze--;){var Xe=R[ze];if(Xe.prefix===Z)return Xe.namespace!==ce}return!0}function Ft(C,A,R){C.push(" ",A,'="',R.replace(/[<&"]/g,Ne),'"')}function Vi(C,A,R,Z,ce){if(ce||(ce=[]),Z){if(!(C=Z(C)))return;if("string"==typeof C)return void A.push(C)}switch(C.nodeType){case u:var ze=C.attributes,Xe=ze.length,At=C.firstChild,ui=C.tagName,tr=ui;if(!(R=_e.isHTML(C.namespaceURI)||R)&&!C.prefix&&C.namespaceURI){for(var li,di=0;di=0;$t--)if(""===(ii=ce[$t]).prefix&&ii.namespace===C.namespaceURI){li=ii.namespace;break}if(li!==C.namespaceURI)for($t=ce.length-1;$t>=0;$t--){var ii;if((ii=ce[$t]).namespace===C.namespaceURI){ii.prefix&&(tr=ii.prefix+":"+ui);break}}}A.push("<",tr);for(var ci=0;ci"),R&&/^script$/i.test(ui))for(;At;)At.data?A.push(At.data):Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;else for(;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;A.push("")}else A.push("/>");return;case me:case Ge:for(At=C.firstChild;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;return;case oe:return Ft(A,C.name,C.value);case Fe:return A.push(C.data.replace(/[<&]/g,Ne).replace(/]]>/g,"]]>"));case He:return A.push("");case Le:return A.push("\x3c!--",C.data,"--\x3e");case Oe:var sn=C.publicId,qi=C.systemId;if(A.push("");else if(qi&&"."!=qi)A.push(" SYSTEM ",qi,">");else{var Vn=C.internalSubset;Vn&&A.push(" [",Vn,"]"),A.push(">")}return;case se:return A.push("");case it:return A.push("&",C.nodeName,";");default:A.push("??",C.nodeName)}}function Hn(C,A,R){var Z;switch(A.nodeType){case u:(Z=A.cloneNode(!1)).ownerDocument=C;case Ge:break;case oe:R=!0}if(Z||(Z=A.cloneNode(!1)),Z.ownerDocument=C,Z.parentNode=null,R)for(var ce=A.firstChild;ce;)Z.appendChild(Hn(C,ce,R)),ce=ce.nextSibling;return Z}function _i(C,A,R){var Z=new A.constructor;for(var ce in A){var ze=A[ce];"object"!=typeof ze&&ze!=Z[ce]&&(Z[ce]=ze)}switch(A.childNodes&&(Z.childNodes=new qe),Z.ownerDocument=C,Z.nodeType){case u:var Xe=A.attributes,ui=Z.attributes=new P,tr=Xe.length;ui._ownerElement=Z;for(var li=0;li0},lookupPrefix:function(C){for(var A=this;A;){var R=A._nsMap;if(R)for(var Z in R)if(R[Z]==C)return Z;A=A.nodeType==oe?A.ownerDocument:A.parentNode}return null},lookupNamespaceURI:function(C){for(var A=this;A;){var R=A._nsMap;if(R&&C in R)return R[C];A=A.nodeType==oe?A.ownerDocument:A.parentNode}return null},isDefaultNamespace:function(C){return null==this.lookupPrefix(C)}},Ee(pe,De),Ee(pe,De.prototype),re.prototype={nodeName:"#document",nodeType:me,doctype:null,documentElement:null,_inc:1,insertBefore:function(C,A){if(C.nodeType==Ge){for(var R=C.firstChild;R;){var Z=R.nextSibling;this.insertBefore(R,A),R=Z}return C}return null==this.documentElement&&C.nodeType==u&&(this.documentElement=C),Qi(this,C,A),C.ownerDocument=this,C},removeChild:function(C){return this.documentElement==C&&(this.documentElement=null),ki(this,C)},importNode:function(C,A){return Hn(this,C,A)},getElementById:function(C){var A=null;return lt(this.documentElement,function(R){if(R.nodeType==u&&R.getAttribute("id")==C)return A=R,!0}),A},getElementsByClassName:function(C){var A=$(C);return new Me(this,function(R){var Z=[];return A.length>0&<(R.documentElement,function(ce){if(ce!==R&&ce.nodeType===u){var ze=ce.getAttribute("class");if(ze){var Xe=C===ze;if(!Xe){var ui=$(ze);Xe=A.every(function Ce(C){return function(A){return C&&-1!==C.indexOf(A)}}(ui))}Xe&&Z.push(ce)}}}),Z})},createElement:function(C){var A=new vt;return A.ownerDocument=this,A.nodeName=C,A.tagName=C,A.localName=C,A.childNodes=new qe,(A.attributes=new P)._ownerElement=A,A},createDocumentFragment:function(){var C=new er;return C.ownerDocument=this,C.childNodes=new qe,C},createTextNode:function(C){var A=new rn;return A.ownerDocument=this,A.appendData(C),A},createComment:function(C){var A=new xr;return A.ownerDocument=this,A.appendData(C),A},createCDATASection:function(C){var A=new Sr;return A.ownerDocument=this,A.appendData(C),A},createProcessingInstruction:function(C,A){var R=new an;return R.ownerDocument=this,R.tagName=R.target=C,R.nodeValue=R.data=A,R},createAttribute:function(C){var A=new oi;return A.ownerDocument=this,A.name=C,A.nodeName=C,A.localName=C,A.specified=!0,A},createEntityReference:function(C){var A=new nn;return A.ownerDocument=this,A.nodeName=C,A},createElementNS:function(C,A){var R=new vt,Z=A.split(":"),ce=R.attributes=new P;return R.childNodes=new qe,R.ownerDocument=this,R.nodeName=A,R.tagName=A,R.namespaceURI=C,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,ce._ownerElement=R,R},createAttributeNS:function(C,A){var R=new oi,Z=A.split(":");return R.ownerDocument=this,R.nodeName=A,R.name=A,R.namespaceURI=C,R.specified=!0,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,R}},Te(re,De),re.prototype.getElementsByTagName=(vt.prototype={nodeType:u,hasAttribute:function(C){return null!=this.getAttributeNode(C)},getAttribute:function(C){var A=this.getAttributeNode(C);return A&&A.value||""},getAttributeNode:function(C){return this.attributes.getNamedItem(C)},setAttribute:function(C,A){var R=this.ownerDocument.createAttribute(C);R.value=R.nodeValue=""+A,this.setAttributeNode(R)},removeAttribute:function(C){var A=this.getAttributeNode(C);A&&this.removeAttributeNode(A)},appendChild:function(C){return C.nodeType===Ge?this.insertBefore(C,null):function nt(C,A){var R=A.parentNode;if(R){var Z=C.lastChild;R.removeChild(A),Z=C.lastChild}return Z=C.lastChild,A.parentNode=C,A.previousSibling=Z,A.nextSibling=null,Z?Z.nextSibling=A:C.firstChild=A,C.lastChild=A,$i(C.ownerDocument,C,A),A}(this,C)},setAttributeNode:function(C){return this.attributes.setNamedItem(C)},setAttributeNodeNS:function(C){return this.attributes.setNamedItemNS(C)},removeAttributeNode:function(C){return this.attributes.removeNamedItem(C.nodeName)},removeAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);R&&this.removeAttributeNode(R)},hasAttributeNS:function(C,A){return null!=this.getAttributeNodeNS(C,A)},getAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);return R&&R.value||""},setAttributeNS:function(C,A,R){var Z=this.ownerDocument.createAttributeNS(C,A);Z.value=Z.nodeValue=""+R,this.setAttributeNode(Z)},getAttributeNodeNS:function(C,A){return this.attributes.getNamedItemNS(C,A)},getElementsByTagName:function(C){return new Me(this,function(A){var R=[];return lt(A,function(Z){Z!==A&&Z.nodeType==u&&("*"===C||Z.tagName==C)&&R.push(Z)}),R})},getElementsByTagNameNS:function(C,A){return new Me(this,function(R){var Z=[];return lt(R,function(ce){ce!==R&&ce.nodeType===u&&("*"===C||ce.namespaceURI===C)&&("*"===A||ce.localName==A)&&Z.push(ce)}),Z})}}).getElementsByTagName,re.prototype.getElementsByTagNameNS=vt.prototype.getElementsByTagNameNS,Te(vt,De),oi.prototype.nodeType=oe,Te(oi,De),Xi.prototype={data:"",substringData:function(C,A){return this.data.substring(C,C+A)},appendData:function(C){this.nodeValue=this.data=C=this.data+C,this.length=C.length},insertData:function(C,A){this.replaceData(C,0,A)},appendChild:function(C){throw new Error(Ve[D])},deleteData:function(C,A){this.replaceData(C,A,"")},replaceData:function(C,A,R){var Z=this.data.substring(0,C),ce=this.data.substring(C+A);this.nodeValue=this.data=R=Z+R+ce,this.length=R.length}},Te(Xi,De),rn.prototype={nodeName:"#text",nodeType:Fe,splitText:function(C){var A=this.data,R=A.substring(C);A=A.substring(0,C),this.data=this.nodeValue=A,this.length=A.length;var Z=this.ownerDocument.createTextNode(R);return this.parentNode&&this.parentNode.insertBefore(Z,this.nextSibling),Z}},Te(rn,Xi),xr.prototype={nodeName:"#comment",nodeType:Le},Te(xr,Xi),Sr.prototype={nodeName:"#cdata-section",nodeType:He},Te(Sr,Xi),Er.prototype.nodeType=Oe,Te(Er,De),Ji.prototype.nodeType=ke,Te(Ji,De),Cr.prototype.nodeType=yt,Te(Cr,De),nn.prototype.nodeType=it,Te(nn,De),er.prototype.nodeName="#document-fragment",er.prototype.nodeType=Ge,Te(er,De),an.prototype.nodeType=se,Te(an,De),Bn.prototype.serializeToString=function(C,A,R){return kr.call(C,A,R)},De.prototype.toString=kr;try{if(Object.defineProperty){let C=function(A){switch(A.nodeType){case u:case Ge:var R=[];for(A=A.firstChild;A;)7!==A.nodeType&&8!==A.nodeType&&R.push(C(A)),A=A.nextSibling;return R.join("");default:return A.nodeValue}};Object.defineProperty(Me.prototype,"length",{get:function(){return Pt(this),this.$$length}}),Object.defineProperty(De.prototype,"textContent",{get:function(){return C(this)},set:function(A){switch(this.nodeType){case u:case Ge:for(;this.firstChild;)this.removeChild(this.firstChild);(A||String(A))&&this.appendChild(this.ownerDocument.createTextNode(A));break;default:this.data=A,this.value=A,this.nodeValue=A}}}),Ar=function(A,R,Z){A["$$"+R]=Z}}}catch{}Ie.DocumentType=Er,Ie.DOMException=We,Ie.DOMImplementation=vi,Ie.Element=vt,Ie.Node=De,Ie.NodeList=qe,Ie.XMLSerializer=Bn},4436:(je,Ie,H)=>{var X=H(9401).freeze;Ie.XML_ENTITIES=X({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),Ie.HTML_ENTITIES=X({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),Ie.entityMap=Ie.HTML_ENTITIES},978:(je,Ie,H)=>{H(6853);Ie.DOMParser=H(1991).DOMParser},8702:(je,Ie,H)=>{var X=H(9401).NAMESPACE,_e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,B=new RegExp("[\\-\\.0-9"+_e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),we=new RegExp("^"+_e.source+B.source+"*(?::"+_e.source+B.source+"*)?$"),ve=0,$=1,Ce=2,Ee=3,Te=4,pe=5,u=6,oe=7;function Fe(w,D){this.message=w,this.locator=D,Error.captureStackTrace&&Error.captureStackTrace(this,Fe)}function He(){}function yt(w,D){return D.lineNumber=w.lineNumber,D.columnNumber=w.columnNumber,D}function se(w,D,V,ee,Q,de){function le(Ze,We,qe){V.attributeNames.hasOwnProperty(Ze)&&de.fatalError("Attribute "+Ze+" redefined"),V.addValue(Ze,We,qe)}for(var xe,ue=++D,J=ve;;){var ie=w.charAt(ue);switch(ie){case"=":if(J===$)xe=w.slice(D,ue),J=Ee;else{if(J!==Ce)throw new Error("attribute equal must after attrName");J=Ee}break;case"'":case'"':if(J===Ee||J===$){if(J===$&&(de.warning('attribute value must after "="'),xe=w.slice(D,ue)),!((ue=w.indexOf(ie,D=ue+1))>0))throw new Error("attribute value no end '"+ie+"' match");le(xe,te=w.slice(D,ue).replace(/&#?\w+;/g,Q),D-1),J=pe}else{if(J!=Te)throw new Error('attribute value must after "="');le(xe,te=w.slice(D,ue).replace(/&#?\w+;/g,Q),D),de.warning('attribute "'+xe+'" missed start quot('+ie+")!!"),D=ue+1,J=pe}break;case"/":switch(J){case ve:V.setTagName(w.slice(D,ue));case pe:case u:case oe:J=oe,V.closed=!0;case Te:case $:case Ce:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return de.error("unexpected end of input"),J==ve&&V.setTagName(w.slice(D,ue)),ue;case">":switch(J){case ve:V.setTagName(w.slice(D,ue));case pe:case u:case oe:break;case Te:case $:"/"===(te=w.slice(D,ue)).slice(-1)&&(V.closed=!0,te=te.slice(0,-1));case Ce:J===Ce&&(te=xe),J==Te?(de.warning('attribute "'+te+'" missed quot(")!'),le(xe,te.replace(/&#?\w+;/g,Q),D)):((!X.isHTML(ee[""])||!te.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+te+'" missed value!! "'+te+'" instead!!'),le(te,te,D));break;case Ee:throw new Error("attribute value missed!!")}return ue;case"\x80":ie=" ";default:if(ie<=" ")switch(J){case ve:V.setTagName(w.slice(D,ue)),J=u;break;case $:xe=w.slice(D,ue),J=Ce;break;case Te:var te=w.slice(D,ue).replace(/&#?\w+;/g,Q);de.warning('attribute "'+te+'" missed quot(")!!'),le(xe,te,D);case pe:J=u}else switch(J){case Ce:(!X.isHTML(ee[""])||!xe.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+xe+'" missed value!! "'+xe+'" instead2!!'),le(xe,xe,D),D=ue,J=$;break;case pe:de.warning('attribute space is required"'+xe+'"!!');case u:J=$,D=ue;break;case Ee:J=Te,D=ue;break;case oe:throw new Error("elements closed character '/' and '>' must be connected to")}}ue++}}function Le(w,D,V){for(var ee=w.tagName,Q=null,ie=w.length;ie--;){var de=w[ie],le=de.qName,xe=de.value;if((Ae=le.indexOf(":"))>0)var te=de.prefix=le.slice(0,Ae),ue=le.slice(Ae+1),J="xmlns"===te&&ue;else ue=le,te=null,J="xmlns"===le&&"";de.localName=ue,!1!==J&&(null==Q&&(Q={},Ge(V,V={})),V[J]=Q[J]=xe,de.uri=X.XMLNS,D.startPrefixMapping(J,xe))}for(ie=w.length;ie--;)(te=(de=w[ie]).prefix)&&("xml"===te&&(de.uri=X.XML),"xmlns"!==te&&(de.uri=V[te||""]));var Ae;(Ae=ee.indexOf(":"))>0?(te=w.prefix=ee.slice(0,Ae),ue=w.localName=ee.slice(Ae+1)):(te=null,ue=w.localName=ee);var Ze=w.uri=V[te||""];if(D.startElement(Ze,ue,ee,w),!w.closed)return w.currentNSMap=V,w.localNSMap=Q,!0;if(D.endElement(Ze,ue,ee),Q)for(te in Q)D.endPrefixMapping(te)}function me(w,D,V,ee,Q){if(/^(?:script|textarea)$/i.test(V)){var de=w.indexOf("",D),le=w.substring(D+1,de);if(/[&<]/.test(le))return/^script$/i.test(V)?(Q.characters(le,0,le.length),de):(le=le.replace(/&#?\w+;/g,ee),Q.characters(le,0,le.length),de)}return D+1}function Oe(w,D,V,ee){var Q=ee[V];return null==Q&&((Q=w.lastIndexOf(""))D?(V.comment(w,D+4,de-D-4),de+3):(ee.error("Unclosed comment"),-1):-1;if("CDATA["==w.substr(D+3,6)){var de=w.indexOf("]]>",D+9);return V.startCDATA(),V.characters(w,D+9,de-D-9),V.endCDATA(),de+3}var le=function rt(w,D){var V,ee=[],Q=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Q.lastIndex=D,Q.exec(w);V=Q.exec(w);)if(ee.push(V),V[1])return ee}(w,D),xe=le.length;if(xe>1&&/!doctype/i.test(le[0][0])){var te=le[1][0],ue=!1,J=!1;xe>3&&(/^public$/i.test(le[2][0])?(ue=le[3][0],J=xe>4&&le[4][0]):/^system$/i.test(le[2][0])&&(J=le[3][0]));var ie=le[xe-1];return V.startDTD(te,ue,J),V.endDTD(),ie.index+ie[0].length}return-1}function Ue(w,D,V){var ee=w.indexOf("?>",D);if(ee){var Q=w.substring(D,ee).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Q?(V.processingInstruction(Q[1],Q[2]),ee+2):-1}return-1}function Ve(){this.attributeNames={}}(Fe.prototype=new Error).name=Fe.name,He.prototype={parse:function(w,D,V){var ee=this.domBuilder;ee.startDocument(),Ge(D,D={}),function it(w,D,V,ee,Q){function le(nt){var vt=nt.slice(1,-1);return vt in V?V[vt]:"#"===vt.charAt(0)?function de(nt){return nt>65535?(nt-=65536,String.fromCharCode(55296+(nt>>10),56320+(1023&nt))):String.fromCharCode(nt)}(parseInt(vt.substr(1).replace("x","0x"))):(Q.error("entity not found:"+nt),nt)}function xe(nt){if(nt>qe){var vt=w.substring(qe,nt).replace(/&#?\w+;/g,le);Ae&&te(qe),ee.characters(vt,0,nt-qe),qe=nt}}function te(nt,vt){for(;nt>=J&&(vt=ie.exec(w));)J=(ue=vt.index)+vt[0].length,Ae.lineNumber++;Ae.columnNumber=nt-ue+1}for(var ue=0,J=0,ie=/.*(?:\r\n?|\n)|.*$/g,Ae=ee.locator,Ze=[{currentNSMap:D}],We={},qe=0;;){try{var Me=w.indexOf("<",qe);if(Me<0){if(!w.substr(qe).match(/^\s*$/)){var Pt=ee.doc,P=Pt.createTextNode(w.substr(qe));Pt.appendChild(P),ee.currentElement=P}return}switch(Me>qe&&xe(Me),w.charAt(Me+1)){case"/":var Ct=w.indexOf(">",Me+3),St=w.substring(Me+2,Ct).replace(/[ \t\n\r]+$/g,""),z=Ze.pop();Ct<0?(St=w.substring(Me+2).replace(/[\s<].*/,""),Q.error("end tag name: "+St+" is not complete:"+z.tagName),Ct=Me+1+St.length):St.match(/\sqe?qe=Ct:xe(Math.max(Me,qe)+1)}}(w,D,V,ee,this.errorHandler),ee.endDocument()}},Ve.prototype={setTagName:function(w){if(!we.test(w))throw new Error("invalid tagName:"+w);this.tagName=w},addValue:function(w,D,V){if(!we.test(w))throw new Error("invalid attribute:"+w);this.attributeNames[w]=this.length,this[this.length++]={qName:w,value:D,offset:V}},length:0,getLocalName:function(w){return this[w].localName},getLocator:function(w){return this[w].locator},getQName:function(w){return this[w].qName},getURI:function(w){return this[w].uri},getValue:function(w){return this[w].value}},Ie.XMLReader=He,Ie.ParseError=Fe},1421:(je,Ie,H)=>{var B,X=typeof global<"u"?global:typeof window<"u"?window:{},_e=H(5893);typeof document<"u"?B=document:(B=X["__GLOBAL_DOCUMENT_CACHE@4"])||(B=X["__GLOBAL_DOCUMENT_CACHE@4"]=_e),je.exports=B},9226:je=>{var Ie;Ie=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},je.exports=Ie},2703:je=>{je.exports=function H(X){if(!X)return!1;var _e=Ie.call(X);return"[object Function]"===_e||"function"==typeof X&&"[object RegExp]"!==_e||typeof window<"u"&&(X===window.setTimeout||X===window.alert||X===window.confirm||X===window.prompt)};var Ie=Object.prototype.toString},1234:(je,Ie)=>{function H($){if($&&"object"==typeof $){var Ce=$.which||$.keyCode||$.charCode;Ce&&($=Ce)}if("number"==typeof $)return we[$];var Te,Ee=String($);return(Te=X[Ee.toLowerCase()])?Te:(Te=_e[Ee.toLowerCase()])||(1===Ee.length?Ee.charCodeAt(0):void 0)}H.isEventKey=function(Ce,Ee){if(Ce&&"object"==typeof Ce){var Te=Ce.which||Ce.keyCode||Ce.charCode;if(null==Te)return!1;if("string"==typeof Ee){var pe;if(pe=X[Ee.toLowerCase()])return pe===Te;if(pe=_e[Ee.toLowerCase()])return pe===Te}else if("number"==typeof Ee)return Ee===Te;return!1}};var X=(Ie=je.exports=H).code=Ie.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},_e=Ie.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(B=97;B<123;B++)X[String.fromCharCode(B)]=B-32;for(var B=48;B<58;B++)X[B-48]=B;for(B=1;B<13;B++)X["f"+B]=B+111;for(B=0;B<10;B++)X["numpad "+B]=B+96;var we=Ie.names=Ie.title={};for(B in X)we[X[B]]=B;for(var ve in _e)X[ve]=_e[ve]},7459:(je,Ie,H)=>{var X=H(3357).getUint64;je.exports=function(B){var we=new DataView(B.buffer,B.byteOffset,B.byteLength),ve={version:B[0],flags:new Uint8Array(B.subarray(1,4)),references:[],referenceId:we.getUint32(4),timescale:we.getUint32(8)},$=12;0===ve.version?(ve.earliestPresentationTime=we.getUint32($),ve.firstOffset=we.getUint32($+4),$+=8):(ve.earliestPresentationTime=X(B.subarray($)),ve.firstOffset=X(B.subarray($+8)),$+=16);var Ce=we.getUint16($+=2);for($+=2;Ce>0;$+=12,Ce--)ve.references.push({referenceType:(128&B[$])>>>7,referencedSize:2147483647&we.getUint32($),subsegmentDuration:we.getUint32($+4),startsWithSap:!!(128&B[$+8]),sapType:(112&B[$+8])>>>4,sapDeltaTime:268435455&we.getUint32($+8)});return ve}},6277:je=>{var H,X,_e,B,we,ve,$;we=function(Ce,Ee){return H(B(Ce,Ee))},ve=function(Ce,Ee){return X(_e(Ce),Ee)},$=function(Ce,Ee,Te){return _e(Te?Ce:Ce-Ee)},je.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:H=function(Ce){return 9e4*Ce},secondsToAudioTs:X=function(Ce,Ee){return Ce*Ee},videoTsToSeconds:_e=function(Ce){return Ce/9e4},audioTsToSeconds:B=function(Ce,Ee){return Ce/Ee},audioTsToVideoTs:we,videoTsToAudioTs:ve,metadataTsToSeconds:$}},3357:je=>{var Ie=Math.pow(2,32);je.exports={getUint64:function(X){var B,_e=new DataView(X.buffer,X.byteOffset,X.byteLength);return _e.getBigUint64?(B=_e.getBigUint64(0)){je.exports=function Ie(H,X){var _e,B=null;try{_e=JSON.parse(H,X)}catch(we){B=we}return[B,_e]}},3871:function(je){var H,X,_e,B,we;H=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,X=/^(?=([^\/?#]*))\1([^]*)$/,_e=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,je.exports=we={buildAbsoluteURL:function(ve,$,Ce){if(Ce=Ce||{},ve=ve.trim(),!($=$.trim())){if(!Ce.alwaysNormalize)return ve;var Ee=we.parseURL(ve);if(!Ee)throw new Error("Error trying to parse base URL.");return Ee.path=we.normalizePath(Ee.path),we.buildURLFromParts(Ee)}var Te=we.parseURL($);if(!Te)throw new Error("Error trying to parse relative URL.");if(Te.scheme)return Ce.alwaysNormalize?(Te.path=we.normalizePath(Te.path),we.buildURLFromParts(Te)):$;var pe=we.parseURL(ve);if(!pe)throw new Error("Error trying to parse base URL.");if(!pe.netLoc&&pe.path&&"/"!==pe.path[0]){var u=X.exec(pe.path);pe.netLoc=u[1],pe.path=u[2]}pe.netLoc&&!pe.path&&(pe.path="/");var oe={scheme:pe.scheme,netLoc:Te.netLoc,path:null,params:Te.params,query:Te.query,fragment:Te.fragment};if(!Te.netLoc&&(oe.netLoc=pe.netLoc,"/"!==Te.path[0]))if(Te.path){var Fe=pe.path,He=Fe.substring(0,Fe.lastIndexOf("/")+1)+Te.path;oe.path=we.normalizePath(He)}else oe.path=pe.path,Te.params||(oe.params=pe.params,Te.query||(oe.query=pe.query));return null===oe.path&&(oe.path=Ce.alwaysNormalize?we.normalizePath(Te.path):Te.path),we.buildURLFromParts(oe)},parseURL:function(ve){var $=H.exec(ve);return $?{scheme:$[1]||"",netLoc:$[2]||"",path:$[3]||"",params:$[4]||"",query:$[5]||"",fragment:$[6]||""}:null},normalizePath:function(ve){for(ve=ve.split("").reverse().join("").replace(_e,"");ve.length!==(ve=ve.replace(B,"")).length;);return ve.split("").reverse().join("")},buildURLFromParts:function(ve){return ve.scheme+ve.netLoc+ve.path+ve.params+ve.query+ve.fragment}}},3629:(je,Ie,H)=>{var X=H(9226),_e=je.exports={WebVTT:H(8318),VTTCue:H(5713),VTTRegion:H(3872)};X.vttjs=_e,X.WebVTT=_e.WebVTT;var B=_e.VTTCue,we=_e.VTTRegion,ve=X.VTTCue,$=X.VTTRegion;_e.shim=function(){X.VTTCue=B,X.VTTRegion=we},_e.restore=function(){X.VTTCue=ve,X.VTTRegion=$},X.VTTCue||_e.shim()},8318:(je,Ie,H)=>{var X=H(1421),_e=Object.create||function(){function w(){}return function(D){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return w.prototype=D,new w}}();function B(w,D){this.name="ParsingError",this.code=w.code,this.message=D||w.message}function we(w){function D(ee,Q,de,le){return 3600*(0|ee)+60*(0|Q)+(0|de)+(0|le)/1e3}var V=w.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return V?V[3]?D(V[1],V[2],V[3].replace(":",""),V[4]):V[1]>59?D(V[1],V[2],0,V[4]):D(0,V[1],V[2],V[4]):null}function ve(){this.values=_e(null)}function $(w,D,V,ee){var Q=ee?w.split(ee):[w];for(var de in Q)if("string"==typeof Q[de]){var le=Q[de].split(V);2===le.length&&D(le[0],le[1])}}function Ce(w,D,V){var ee=w;function Q(){var xe=we(w);if(null===xe)throw new B(B.Errors.BadTimeStamp,"Malformed timestamp: "+ee);return w=w.replace(/^[^\sa-zA-Z-]+/,""),xe}function le(){w=w.replace(/^\s+/,"")}if(le(),D.startTime=Q(),le(),"--\x3e"!==w.substr(0,3))throw new B(B.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+ee);w=w.substr(3),le(),D.endTime=Q(),le(),function de(xe,te){var ue=new ve;$(xe,function(J,ie){switch(J){case"region":for(var Ae=V.length-1;Ae>=0;Ae--)if(V[Ae].id===ie){ue.set(J,V[Ae].region);break}break;case"vertical":ue.alt(J,ie,["rl","lr"]);break;case"line":var Ze=ie.split(","),We=Ze[0];ue.integer(J,We),ue.percent(J,We)&&ue.set("snapToLines",!1),ue.alt(J,We,["auto"]),2===Ze.length&&ue.alt("lineAlign",Ze[1],["start","center","end"]);break;case"position":Ze=ie.split(","),ue.percent(J,Ze[0]),2===Ze.length&&ue.alt("positionAlign",Ze[1],["start","center","end"]);break;case"size":ue.percent(J,ie);break;case"align":ue.alt(J,ie,["start","center","end","left","right"])}},/:/,/\s/),te.region=ue.get("region",null),te.vertical=ue.get("vertical","");try{te.line=ue.get("line","auto")}catch{}te.lineAlign=ue.get("lineAlign","start"),te.snapToLines=ue.get("snapToLines",!0),te.size=ue.get("size",100);try{te.align=ue.get("align","center")}catch{te.align=ue.get("align","middle")}try{te.position=ue.get("position","auto")}catch{te.position=ue.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},te.align)}te.positionAlign=ue.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},te.align)}(w,D)}(B.prototype=_e(Error.prototype)).constructor=B,B.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ve.prototype={set:function(w,D){!this.get(w)&&""!==D&&(this.values[w]=D)},get:function(w,D,V){return V?this.has(w)?this.values[w]:D[V]:this.has(w)?this.values[w]:D},has:function(w){return w in this.values},alt:function(w,D,V){for(var ee=0;ee=0&&D<=100))&&(this.set(w,D),!0)}};var Ee=X.createElement&&X.createElement("textarea"),Te={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},pe={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},u={v:"title",lang:"lang"},oe={rt:"ruby"};function Fe(w,D){function V(){if(!D)return null;var qe=D.match(/^([^<]*)(<[^>]*>?)?/);return function We(Me){return D=D.substr(Me.length),Me}(qe[1]?qe[1]:qe[2])}function ee(We){return Ee.innerHTML=We,We=Ee.textContent,Ee.textContent="",We}function de(We,qe){var Me=Te[We];if(!Me)return null;var Pt=w.document.createElement(Me),P=u[We];return P&&qe&&(Pt[P]=qe.trim()),Pt}for(var te,le=w.document.createElement("div"),xe=le,ue=[];null!==(te=V());)if("<"!==te[0])xe.appendChild(w.document.createTextNode(ee(te)));else{if("/"===te[1]){ue.length&&ue[ue.length-1]===te.substr(2).replace(">","")&&(ue.pop(),xe=xe.parentNode);continue}var ie,J=we(te.substr(1,te.length-2));if(J){ie=w.document.createProcessingInstruction("timestamp",J),xe.appendChild(ie);continue}var Ae=te.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!Ae||!(ie=de(Ae[1],Ae[3]))||oe[(qe=ie).localName]&&oe[qe.localName]!==xe.localName)continue;if(Ae[2]){var Ze=Ae[2].split(".");Ze.forEach(function(We){var qe=/^bg_/.test(We),Me=qe?We.slice(3):We;pe.hasOwnProperty(Me)&&(ie.style[qe?"background-color":"color"]=pe[Me])}),ie.className=Ze.join(" ")}ue.push(Ae[1]),xe.appendChild(ie),xe=ie}var qe;return le}var He=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function it(w){for(var D=0;D=V[0]&&w<=V[1])return!0}return!1}function yt(w){var D=[],V="";if(!w||!w.childNodes)return"ltr";function Q(xe,te){for(var ue=te.childNodes.length-1;ue>=0;ue--)xe.push(te.childNodes[ue])}function de(xe){if(!xe||!xe.length)return null;var te=xe.pop(),ue=te.textContent||te.innerText;if(ue){var J=ue.match(/^.*(\n|\r)/);return J?(xe.length=0,J[0]):ue}return"ruby"===te.tagName?de(xe):te.childNodes?(Q(xe,te),de(xe)):void 0}for(Q(D,w);V=de(D);)for(var le=0;le=0&&w.line<=100))return w.line;if(!w.track||!w.track.textTrackList||!w.track.textTrackList.mediaElement)return-1;for(var D=w.track,V=D.textTrackList,ee=0,Q=0;QAe&&(ie=ie<0?-1:1,ie*=Math.ceil(Ae/J)*J),xe<0&&(ie+=""===le.vertical?V.height:V.width,te=te.reverse()),de.move(Ze,ie)}else{var We=de.lineHeight/V.height*100;switch(le.lineAlign){case"center":xe-=We/2;break;case"end":xe-=We}switch(le.vertical){case"":D.applyStyles({top:D.formatStyle(xe,"%")});break;case"rl":D.applyStyles({left:D.formatStyle(xe,"%")});break;case"lr":D.applyStyles({right:D.formatStyle(xe,"%")})}te=["+y","-x","+x","-y"],de=new Oe(D)}var qe=function Q(Me,Pt){for(var P,St=new Oe(Me),z=1,gt=0;gtvi&&(P=new Oe(Me),z=vi),Me=new Oe(St)}return P||St}(de,te);D.move(qe.toCSSCompatValues(V))}function ke(){}Le.prototype.applyStyles=function(w,D){for(var V in D=D||this.div,w)w.hasOwnProperty(V)&&(D.style[V]=w[V])},Le.prototype.formatStyle=function(w,D){return 0===w?0:w+D},(me.prototype=_e(Le.prototype)).constructor=me,Oe.prototype.move=function(w,D){switch(D=void 0!==D?D:this.lineHeight,w){case"+x":this.left+=D,this.right+=D;break;case"-x":this.left-=D,this.right-=D;break;case"+y":this.top+=D,this.bottom+=D;break;case"-y":this.top-=D,this.bottom-=D}},Oe.prototype.overlaps=function(w){return this.leftw.left&&this.topw.top},Oe.prototype.overlapsAny=function(w){for(var D=0;D=w.top&&this.bottom<=w.bottom&&this.left>=w.left&&this.right<=w.right},Oe.prototype.overlapsOppositeAxis=function(w,D){switch(D){case"+x":return this.leftw.right;case"+y":return this.topw.bottom}},Oe.prototype.intersectPercentage=function(w){return Math.max(0,Math.min(this.right,w.right)-Math.max(this.left,w.left))*Math.max(0,Math.min(this.bottom,w.bottom)-Math.max(this.top,w.top))/(this.height*this.width)},Oe.prototype.toCSSCompatValues=function(w){return{top:this.top-w.top,bottom:w.bottom-this.bottom,left:this.left-w.left,right:w.right-this.right,height:this.height,width:this.width}},Oe.getSimpleBoxPosition=function(w){var D=w.div?w.div.offsetHeight:w.tagName?w.offsetHeight:0,V=w.div?w.div.offsetWidth:w.tagName?w.offsetWidth:0,ee=w.div?w.div.offsetTop:w.tagName?w.offsetTop:0;return{left:(w=w.div?w.div.getBoundingClientRect():w.tagName?w.getBoundingClientRect():w).left,right:w.right,top:w.top||ee,height:w.height||D,bottom:w.bottom||ee+(w.height||D),width:w.width||V}},ke.StringDecoder=function(){return{decode:function(w){if(!w)return"";if("string"!=typeof w)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(w))}}},ke.convertCueToDOMTree=function(w,D){return w&&D?Fe(w,D):null},ke.processCues=function(w,D,V){if(!w||!D||!V)return null;for(;V.firstChild;)V.removeChild(V.firstChild);var ee=w.document.createElement("div");if(ee.style.position="absolute",ee.style.left="0",ee.style.right="0",ee.style.top="0",ee.style.bottom="0",ee.style.margin="1.5%",V.appendChild(ee),function Q(J){for(var ie=0;ie{var Ie="auto",H={"":1,lr:1,rl:1},X={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function B(ve){return"string"==typeof ve&&!!X[ve.toLowerCase()]&&ve.toLowerCase()}function we(ve,$,Ce){this.hasBeenReset=!1;var Ee="",Te=!1,pe=ve,u=$,oe=Ce,Fe=null,He="",it=!0,yt="auto",se="start",Le="auto",me="auto",Oe=100,Ge="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return Ee},set:function(ke){Ee=""+ke}},pauseOnExit:{enumerable:!0,get:function(){return Te},set:function(ke){Te=!!ke}},startTime:{enumerable:!0,get:function(){return pe},set:function(ke){if("number"!=typeof ke)throw new TypeError("Start time must be set to a number.");pe=ke,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(ke){if("number"!=typeof ke)throw new TypeError("End time must be set to a number.");u=ke,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return oe},set:function(ke){oe=""+ke,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return Fe},set:function(ke){Fe=ke,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return He},set:function(ke){var Ue=function _e(ve){return"string"==typeof ve&&!!H[ve.toLowerCase()]&&ve.toLowerCase()}(ke);if(!1===Ue)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");He=Ue,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return it},set:function(ke){it=!!ke,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return yt},set:function(ke){if("number"!=typeof ke&&ke!==Ie)throw new SyntaxError("Line: an invalid number or illegal string was specified.");yt=ke,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return se},set:function(ke){var Ue=B(ke);Ue?(se=Ue,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return Le},set:function(ke){if(ke<0||ke>100)throw new Error("Position must be between 0 and 100.");Le=ke,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return me},set:function(ke){var Ue=B(ke);Ue?(me=Ue,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return Oe},set:function(ke){if(ke<0||ke>100)throw new Error("Size must be between 0 and 100.");Oe=ke,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return Ge},set:function(ke){var Ue=B(ke);if(!Ue)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");Ge=Ue,this.hasBeenReset=!0}}}),this.displayState=void 0}we.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},je.exports=we},3872:je=>{var Ie={"":!0,up:!0};function X(B){return"number"==typeof B&&B>=0&&B<=100}je.exports=function _e(){var B=100,we=3,ve=0,$=100,Ce=0,Ee=100,Te="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return B},set:function(pe){if(!X(pe))throw new Error("Width must be between 0 and 100.");B=pe}},lines:{enumerable:!0,get:function(){return we},set:function(pe){if("number"!=typeof pe)throw new TypeError("Lines must be set to a number.");we=pe}},regionAnchorY:{enumerable:!0,get:function(){return $},set:function(pe){if(!X(pe))throw new Error("RegionAnchorX must be between 0 and 100.");$=pe}},regionAnchorX:{enumerable:!0,get:function(){return ve},set:function(pe){if(!X(pe))throw new Error("RegionAnchorY must be between 0 and 100.");ve=pe}},viewportAnchorY:{enumerable:!0,get:function(){return Ee},set:function(pe){if(!X(pe))throw new Error("ViewportAnchorY must be between 0 and 100.");Ee=pe}},viewportAnchorX:{enumerable:!0,get:function(){return Ce},set:function(pe){if(!X(pe))throw new Error("ViewportAnchorX must be between 0 and 100.");Ce=pe}},scroll:{enumerable:!0,get:function(){return Te},set:function(pe){var u=function H(B){return"string"==typeof B&&!!Ie[B.toLowerCase()]&&B.toLowerCase()}(pe);!1===u?console.warn("Scroll: an invalid or illegal string was specified."):Te=u}}})}},5893:()=>{},434:je=>{function Ie(){return je.exports=Ie=Object.assign?Object.assign.bind():function(H){for(var X=1;X{"use strict";H.r(Ie),H.d(Ie,{BerkasModule:()=>O0});var X=H(6895),_e=H(1390),B=H(4006),we=H(7375),ve=H(5128),$=H(3659),Ce=H(1741),Ee=H(2314),Te=H(9736),pe=H(6319),u=H(4650);let oe=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=u.oAB({type:s});static#i=this.\u0275inj=u.cJS({imports:[X.ez]})}return s})();var Fe=H(4529),He=H(8866),it=H(3811),yt=H(5816),se=H(5861),Le=H(529),me=H(8505),Oe=H(7272),Ge=H(4674),ke=H(9816),Ue=H(3322),Ve=H(5141),rt=H(1428),w=H(5312),D=H(80),V=H(4327),ee=H(2693),Q=H(8925);let de=(()=>{class s{constructor(t,i,e){this.gs=t,this.toast=i,this.dls=e,this.attachmentsDownload={}}getAttachmentDownloadFile(t){return this.attachmentsDownload[t.id]||(this.attachmentsDownload[t.id]={},this.attachmentsDownload[t.id].name=t.name,this.attachmentsDownload[t.id].orig=t.orig,this.attachmentsDownload[t.id].size=t.size,this.attachmentsDownload[t.id].ext=t.ext,this.attachmentsDownload[t.id].download_count=t.download_count,this.attachmentsDownload[t.id].google_drive=t.google_drive,this.attachmentsDownload[t.id].aws_s3=t.aws_s3,this.attachmentsDownload[t.id].discord=t.discord,this.attachmentsDownload[t.id].mode="indeterminate",this.attachmentsDownload[t.id].isDownloading=!1,this.attachmentsDownload[t.id].isCompleted=!1,this.attachmentsDownload[t.id].data=null,this.attachmentsDownload[t.id].handler=null,this.attachmentsDownload[t.id].toast=null,this.attachmentsDownload[t.id].totals=0,this.attachmentsDownload[t.id].percentage=0,this.attachmentsDownload[t.id].speed=0,this.attachmentsDownload[t.id].loaded=0),this.attachmentsDownload[t.id]}stopFail(t){t.isDownloading=!1,t.isCompleted=!1,t.toast&&this.toast.remove(t.toast.toastId)}onProgress(t,i){if(i.loaded){this.gs.log("[DOWNLOAD_PROGRESS]",i),t.mode="determinate";const e=i.loaded-t.loaded;t.totals+=e,t.speed=e/1e3,t.percentage=Math.round(t.totals/t.size*100),t.loaded=i.loaded,t.toast.toastRef.componentInstance.message=`${t.percentage}% @ ${t.speed} KB/s`}}startDownload(t,i=!0){var e=this;const r=this.attachmentsDownload[t];var a;r.toast=this.toast.warning(`${r.percentage}% @ ${r.speed} KB/s`,"Mengunduh ...",{closeButton:!1,timeOut:0,disableTimeOut:"extendedTimeOut",tapToDismiss:!1}),r.isCompleted?this.saveFileAs(t):(r.isDownloading=!0,r.discord?this.dls.getListDdl(t).subscribe({next:(a=(0,se.Z)(function*(o){e.gs.log("[DOWNLOAD_LIST_DDL]",o);const l=o.results.sort((v,g)=>v.chunk_idx-g.chunk_idx),d=[];for(const v of l){let g=null;g=i&&v.url?e.dls.downloadDdlDirect(v.url):e.dls.downloadDdlProxy(v.id),d.push(g)}const f=[];var v;r.handler=(0,Oe.z)(...d).subscribe({next:(v=(0,se.Z)(function*(g){if(g.type===Le.dt.DownloadProgress&&e.onProgress(r,g),g.type===Le.dt.Response){r.loaded=0;const E=yield g.body.arrayBuffer(),x=new Uint8Array(E);e.gs.log("[DOWNLOAD_CHUNK_APPEND]",E.byteLength),f.push(x)}if(g.type===Le.dt.Response&&f.length===l.length){e.gs.log("[DOWNLOAD_CHUNK_COMPLETED]",f);const T=new Blob(f);r.mode="determinate",r.isDownloading=!1,r.isCompleted=!0,r.data=T,e.toast.remove(r.toast.toastId),e.saveFileAs(t)}}),function(T){return v.apply(this,arguments)}),error:v=>{e.gs.log("[DOWNLOAD_CHUNK_ERROR]",v,"error"),e.stopFail(r)}})}),function(l){return a.apply(this,arguments)}),error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(r)}}):r.handler=this.dls.downloadLampiran(t).subscribe({next:a=>{a.type===Le.dt.DownloadProgress&&this.onProgress(r,a),a.type===Le.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",a),r.mode="determinate",r.isDownloading=!1,r.isCompleted=!0,r.data=a.body,this.toast.remove(r.toast.toastId),this.saveFileAs(t))},error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(r)}}))}cancelDownload(t){const i=this.attachmentsDownload[t];i.mode="indeterminate",i.percentage=0,i.speed=0,i.totals=0,i.loaded=0,i.isDownloading=!1,i.isCompleted=!1,i.handler&&i.handler.unsubscribe(),i.toast&&this.toast.remove(i.toast.toastId)}saveFileAs(t){this.gs.log("[SAVE_FILE]",t);const i=this.attachmentsDownload[t];(0,V.saveAs)(i.data,`${i.orig||i.name+"."+i.ext}`)}static#e=this.\u0275fac=function(i){return new(i||s)(u.LFG(ke.U),u.LFG(ee.k),u.LFG(Q.v))};static#t=this.\u0275prov=u.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var le=H(8151),xe=H(7396),te=H(4363),ue=H(9818),J=H(7392),ie=H(8455),Ae=H(9982),Ze=H(1256),We=H(6289),qe=H(7462),Me=H(4758),Pt=H(9226),P=H.n(Pt),St=H(1421),z=H.n(St);function gt(){return gt=Object.assign?Object.assign.bind():function(s){for(var n=1;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(e,r,a){var o=[null];o.push.apply(o,r);var d=new(Function.bind.apply(e,o));return a&<(d,a.prototype),d}).apply(null,arguments)}var rn=H(3871),xr=H.n(rn),Sr="http://example.com";const Ji=function(n,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(n)&&(n=P().location&&P().location.href||"");var i="function"==typeof P().URL,e=/^\/\//.test(n),r=!P().location&&!/\/\//i.test(n);if(i?n=new(P().URL)(n,P().location||Sr):/\/\//i.test(n)||(n=xr().buildAbsoluteURL(P().location&&P().location.href||"",n)),i){var a=new URL(t,n);return r?a.href.slice(Sr.length):e?a.href.slice(a.protocol.length):a.href}return xr().buildAbsoluteURL(n,t)};var Cr=function(){function s(){this.listeners={}}var n=s.prototype;return n.on=function(i,e){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(e)},n.off=function(i,e){if(!this.listeners[i])return!1;var r=this.listeners[i].indexOf(e);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(r,1),r>-1},n.trigger=function(i){var e=this.listeners[i];if(e)if(2===arguments.length)for(var r=e.length,a=0;a-1;r=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,r)),this.buffer=this.buffer.substring(r+1)},n}(Cr),Bn=String.fromCharCode(9),kr=function(n){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(n||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},Ft=function(n){for(var r,t=n.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},e=t.length;e--;)""!==t[e]&&((r=/([^=]*)=(.*)/.exec(t[e]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i},Vi=function(s){function n(){var i;return(i=s.call(this)||this).customParsers=[],i.tagMappers=[],i}re(n,s);var t=n.prototype;return t.push=function(e){var a,o,r=this;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(d,f){var v=f(e);return v===e?d:d.concat([v])},[e]).forEach(function(d){for(var f=0;f0&&(a.duration=S.duration),0===S.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){if(S.attributes)if("NONE"!==S.attributes.METHOD)if(S.attributes.URI){if("com.apple.streamingkeydelivery"===S.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:S.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===S.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(S.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===S.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==S.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):S.attributes.KEYID&&"0x"===S.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:S.attributes.KEYFORMAT,keyId:S.attributes.KEYID.substring(2)},pssh:er(S.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));S.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:S.attributes.METHOD||"AES-128",uri:S.attributes.URI},typeof S.attributes.IV<"u"&&(l.iv=S.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else l=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(S.number)?this.manifest.mediaSequence=S.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+S.number})},"discontinuity-sequence":function(){isFinite(S.number)?(this.manifest.discontinuitySequence=S.number,T=S.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+S.number})},"playlist-type":function(){/VOD|EVENT/.test(S.playlistType)?this.manifest.playlistType=S.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+S.playlist})},map:function(){o={},S.uri&&(o.uri=S.uri),S.byterange&&(o.byterange=S.byterange),l&&(o.key=l)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes?(a.attributes||(a.attributes={}),gt(a.attributes,S.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes&&S.attributes.TYPE&&S.attributes["GROUP-ID"]&&S.attributes.NAME){var q=this.manifest.mediaGroups[S.attributes.TYPE];q[S.attributes["GROUP-ID"]]=q[S.attributes["GROUP-ID"]]||{},N=q[S.attributes["GROUP-ID"]],(F={default:/yes/i.test(S.attributes.DEFAULT)}).autoselect=!!F.default||/yes/i.test(S.attributes.AUTOSELECT),S.attributes.LANGUAGE&&(F.language=S.attributes.LANGUAGE),S.attributes.URI&&(F.uri=S.attributes.URI),S.attributes["INSTREAM-ID"]&&(F.instreamId=S.attributes["INSTREAM-ID"]),S.attributes.CHARACTERISTICS&&(F.characteristics=S.attributes.CHARACTERISTICS),S.attributes.FORCED&&(F.forced=/yes/i.test(S.attributes.FORCED)),N[S.attributes.NAME]=F}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){T+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=S.dateTimeString,this.manifest.dateTimeObject=S.dateTimeObject),a.dateTimeString=S.dateTimeString,a.dateTimeObject=S.dateTimeObject},targetduration:function(){!isFinite(S.duration)||S.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+S.duration}):(this.manifest.targetDuration=S.duration,Ar.call(this,this.manifest))},start:function(){S.attributes&&!isNaN(S.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:S.attributes["TIME-OFFSET"],precise:S.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=S.data},"cue-out-cont":function(){a.cueOutCont=S.data},"cue-in":function(){a.cueIn=S.data},skip:function(){this.manifest.skip=_i(S.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",S.attributes,["SKIPPED-SEGMENTS"])},part:function(){var q=this;d=!0;var ne=this.manifest.segments.length,he=_i(S.attributes);a.parts=a.parts||[],a.parts.push(he),he.byterange&&(he.byterange.hasOwnProperty("offset")||(he.byterange.offset=x),x=he.byterange.offset+he.byterange.length),this.warnOnMissingAttributes_("#EXT-X-PART #"+(a.parts.length-1)+" for segment #"+ne,S.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(ye,ge){ye.hasOwnProperty("lastPart")||q.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+ge+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var q=this.manifest.serverControl=_i(S.attributes);q.hasOwnProperty("canBlockReload")||(q.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ar.call(this,this.manifest),q.canSkipDateranges&&!q.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var q=this.manifest.segments.length,ne=_i(S.attributes),he=ne.type&&"PART"===ne.type;a.preloadHints=a.preloadHints||[],a.preloadHints.push(ne),ne.byterange&&(ne.byterange.hasOwnProperty("offset")||(ne.byterange.offset=he?x:0,he&&(x=ne.byterange.offset+ne.byterange.length)));var K=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+K+" for segment #"+q,S.attributes,["TYPE","URI"]),ne.type)for(var ye=0;yei.timeline?1:-1})},lu=function(n){var t=[];return function(n,t,i){t.forEach(function(e){for(var r in n.mediaGroups[e])for(var a in n.mediaGroups[e][r])i(n.mediaGroups[e][r][a])})}(n,lf,function(i,e,r,a){t=t.concat(i.playlists||[])}),t},du=function(n){var t=n.playlist;t.mediaSequence=n.mediaSequence,t.segments.forEach(function(e,r){e.number=t.mediaSequence+r})},Gn=function(n){return n&&n.uri+"-"+function(n){var t;return t="bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1,n.offset+"-"+t}(n.byterange)},os=function(n){return nu(n.reduce(function(i,e){var a,r=e.attributes.id+(e.attributes.lang||"");i[r]?(e.segments&&(e.segments[0]&&(e.segments[0].discontinuity=!0),(a=i[r].segments).push.apply(a,e.segments)),e.attributes.contentProtection&&(i[r].attributes.contentProtection=e.attributes.contentProtection)):(i[r]=e,i[r].attributes.timelineStarts=[]);return i[r].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),i},{})).map(function(i){return i.discontinuityStarts=function(n,t){return n.reduce(function(i,e,r){return e.discontinuity&&i.push(r),i},[])}(i.segments||[]),i})},us=function(n,t){var i=Gn(n.sidx),e=i&&t[i]&&t[i].sidx;return e&&ss(n,e,n.sidx.resolvedUri),n},pf=function(n,t){if(void 0===t&&(t={}),!Object.keys(t).length)return n;for(var i in n)n[i]=us(n[i],t);return n},Tf=function(n){var t,i=n.attributes,e=n.segments,r=n.sidx,a=n.discontinuityStarts,o={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:a,timelineStarts:i.timelineStarts,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),r&&(o.sidx=r),o},bf=function(n){var t=n.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},xf=function(n){var t=n.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},Sf=function(n){var t=n.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},cu=function(n){return n?Object.keys(n).reduce(function(t,i){return t.concat(n[i].playlists)},[]):[]},Cf=function(n){var t,i=n.dashPlaylists,e=n.locations,r=n.sidxMapping,a=void 0===r?{}:r,o=n.previousManifest;if(!i.length)return{};var l=i[0].attributes,d=l.sourceDuration,f=l.type,v=l.suggestedPresentationDelay,g=l.minimumUpdatePeriod,T=os(i.filter(bf)).map(Tf),E=os(i.filter(xf)),x=os(i.filter(Sf)),S=i.map(function(he){return he.attributes.captionServices}).filter(Boolean),N={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:d,playlists:pf(T,a)};g>=0&&(N.minimumUpdatePeriod=1e3*g),e&&(N.locations=e),"dynamic"===f&&(N.suggestedPresentationDelay=v);var j=E.length?function(n,t,i){void 0===t&&(t={}),void 0===i&&(i=!1);var e,r=n.reduce(function(o,l){var d=l.attributes.role&&l.attributes.role.value||"",f=l.attributes.lang||"",v=l.attributes.label||"main";f&&!l.attributes.label&&(v=l.attributes.lang+(d?" ("+d+")":"")),o[v]||(o[v]={language:f,autoselect:!0,default:"main"===d,playlists:[],uri:""});var T=us(function(n,t){var i,e=n.attributes,r=n.segments,a=n.sidx,o=n.mediaSequence,l=n.discontinuitySequence,d=n.discontinuityStarts,f={attributes:(i={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:l,discontinuityStarts:d,timelineStarts:e.timelineStarts,mediaSequence:o,segments:r};return e.contentProtection&&(f.contentProtection=e.contentProtection),a&&(f.sidx=a),t&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs"),f}(l,i),t);return o[v].playlists.push(T),typeof e>"u"&&"main"===d&&((e=l).default=!0),o},{});return e||(r[Object.keys(r)[0]].default=!0),r}(E,a,0===N.playlists.length):null,G=x.length?function(n,t){return void 0===t&&(t={}),n.reduce(function(i,e){var r=e.attributes.lang||"text";return i[r]||(i[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),i[r].playlists.push(us(function(n){var t,i=n.attributes,e=n.segments,r=n.mediaSequence,a=n.discontinuityStarts,o=n.discontinuitySequence;typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var l=((t={NAME:i.id,BANDWIDTH:i.bandwidth})["PROGRAM-ID"]=1,t);return i.codecs&&(l.CODECS=i.codecs),{attributes:l,uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:r,segments:e}}(e),t)),i},{})}(x,a):null,q=T.concat(cu(j),cu(G)),ne=q.map(function(he){return he.timelineStarts});return N.timelineStarts=uu(ne),function(n,t){n.forEach(function(i){i.mediaSequence=0,i.discontinuitySequence=ns(t,function(e){return e.timeline===i.timeline}),i.segments&&i.segments.forEach(function(e,r){e.number=r})})}(q,N.timelineStarts),j&&(N.mediaGroups.AUDIO.audio=j),G&&(N.mediaGroups.SUBTITLES.subs=G),S.length&&(N.mediaGroups["CLOSED-CAPTIONS"].cc=function(n){return n.reduce(function(t,i){return i&&i.forEach(function(e){var a=e.language;t[a]={autoselect:!1,default:!1,instreamId:e.channel,language:a},e.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(t[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(t[a]["3D"]=e["3D"])}),t},{})}(S)),o?function(n){var t=n.oldManifest,i=n.newManifest,e=t.playlists.concat(lu(t)),r=i.playlists.concat(lu(i));return i.timelineStarts=uu([t.timelineStarts,i.timelineStarts]),function(n){var t=n.oldPlaylists,e=n.timelineStarts;n.newPlaylists.forEach(function(r){r.discontinuitySequence=ns(e,function(f){return f.timeline===r.timeline});var a=function(n,t){for(var i=0;ia.timeline||a.segments.length&&r.timeline>a.segments[a.segments.length-1].timeline)&&r.discontinuitySequence--);a.segments[l].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),du({playlist:r,mediaSequence:a.segments[l].number})}})}({oldPlaylists:e,newPlaylists:r,timelineStarts:i.timelineStarts}),i}({oldManifest:o,newManifest:N}):N},kf=function(n,t,i){var o=n.timescale,d=n.periodStart,v=n.minimumUpdatePeriod;return Math.ceil((((n.NOW+n.clientOffset)/1e3+(void 0===v?0:v)-(n.availabilityStartTime+(void 0===d?0:d)))*(void 0===o?1:o)-t)/i)},fu=function(n,t){for(var i=n.type,e=n.minimumUpdatePeriod,r=void 0===e?0:e,a=n.media,o=void 0===a?"":a,l=n.sourceDuration,d=n.timescale,f=void 0===d?1:d,v=n.startNumber,g=void 0===v?1:v,T=n.periodStart,E=[],x=-1,S=0;Sx&&(x=G);var q=void 0;if(j<0){var ne=S+1;q=ne===t.length?"dynamic"===i&&r>0&&o.indexOf("$Number$")>0?kf(n,x,F):(l*f-x)/F:(t[ne].t-x)/F}else q=j+1;for(var he=g+E.length+q,K=g+E.length;K"u")return t;var a=""+n[i];return"RepresentationID"===i||(r=e?parseInt(r,10):1,a.length>=r)?a:""+new Array(r-a.length+1).join("0")+a}}(t))},Df=function(n,t){var i={RepresentationID:n.id,Bandwidth:n.bandwidth||0},e=n.initialization,r=void 0===e?{sourceURL:"",range:""}:e,a=on({baseUrl:n.baseUrl,source:hu(r.sourceURL,i),range:r.range}),o=function(n,t){return n.duration||t?n.duration?as(n):fu(n,t):[{number:n.startNumber||1,duration:n.sourceDuration,time:0,timeline:n.periodStart}]}(n,t);return o.map(function(l){i.Number=l.number,i.Time=l.time;var d=hu(n.media||"",i),g=n.periodStart+(l.time-(n.presentationTimeOffset||0))/(n.timescale||1);return{uri:d,timeline:l.timeline,duration:l.duration,resolvedUri:Ji(n.baseUrl||"",d),map:a,number:l.number,presentationTime:g}})},Of=function(n,t){var i=n.duration,e=n.segmentUrls,r=void 0===e?[]:e,a=n.periodStart;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var l,o=r.map(function(f){return function(n,t){var i=n.baseUrl,e=n.initialization,r=void 0===e?{}:e,a=on({baseUrl:i,source:r.sourceURL,range:r.range}),o=on({baseUrl:i,source:t.media,range:t.mediaRange});return o.map=a,o}(n,f)});return i&&(l=as(n)),t&&(l=fu(n,t)),l.map(function(f,v){if(o[v]){var g=o[v],T=n.timescale||1,E=n.presentationTimeOffset||0;return g.timeline=f.timeline,g.duration=f.duration,g.number=f.number,g.presentationTime=a+(f.time-E)/T,g}}).filter(function(f){return f})},Lf=function(n){var e,r,t=n.attributes,i=n.segmentInfo;i.template?(r=Df,e=Bt(t,i.template)):i.base?(r=ou,e=Bt(t,i.base)):i.list&&(r=Of,e=Bt(t,i.list));var a={attributes:t};if(!r)return a;var o=r(e,i.segmentTimeline);if(e.duration){var f=e.timescale;e.duration=e.duration/(void 0===f?1:f)}else e.duration=o.length?o.reduce(function(g,T){return Math.max(g,Math.ceil(T.duration))},0):0;return a.attributes=e,a.segments=o,i.base&&e.indexRange&&(a.sidx=o[0],a.segments=[]),a},Tt=function(n,t){return au(n.childNodes).filter(function(i){return i.tagName===t})},ls=function(n){return n.textContent.trim()},Ir=function(n){var l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(n);if(!l)return 0;var d=l.slice(1),v=d[1],g=d[2],T=d[3],E=d[4],x=d[5];return 31536e3*parseFloat(d[0]||0)+2592e3*parseFloat(v||0)+86400*parseFloat(g||0)+3600*parseFloat(T||0)+60*parseFloat(E||0)+parseFloat(x||0)},pu={mediaPresentationDuration:function(n){return Ir(n)},availabilityStartTime:function(n){return function(n){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(n)&&(n+="Z"),Date.parse(n)}(n)/1e3},minimumUpdatePeriod:function(n){return Ir(n)},suggestedPresentationDelay:function(n){return Ir(n)},type:function(n){return n},timeShiftBufferDepth:function(n){return Ir(n)},start:function(n){return Ir(n)},width:function(n){return parseInt(n,10)},height:function(n){return parseInt(n,10)},bandwidth:function(n){return parseInt(n,10)},startNumber:function(n){return parseInt(n,10)},timescale:function(n){return parseInt(n,10)},presentationTimeOffset:function(n){return parseInt(n,10)},duration:function(n){var t=parseInt(n,10);return isNaN(t)?Ir(n):t},d:function(n){return parseInt(n,10)},t:function(n){return parseInt(n,10)},r:function(n){return parseInt(n,10)},DEFAULT:function(n){return n}},Mt=function(n){return n&&n.attributes?au(n.attributes).reduce(function(t,i){return t[i.name]=(pu[i.name]||pu.DEFAULT)(i.value),t},{}):{}},Uf={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Wn=function(n,t){return t.length?qn(n.map(function(i){return t.map(function(e){return Ji(i,ls(e))})})):n},ds=function(n){var t=Tt(n,"SegmentTemplate")[0],i=Tt(n,"SegmentList")[0],e=i&&Tt(i,"SegmentURL").map(function(g){return Bt({tag:"SegmentURL"},Mt(g))}),r=Tt(n,"SegmentBase")[0],a=i||t,o=a&&Tt(a,"SegmentTimeline")[0],l=i||r||t,d=l&&Tt(l,"Initialization")[0],f=t&&Mt(t);f&&d?f.initialization=d&&Mt(d):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});var v={template:f,segmentTimeline:o&&Tt(o,"S").map(function(g){return Mt(g)}),list:i&&Bt(Mt(i),{segmentUrls:e,initialization:Mt(d)}),base:r&&Bt(Mt(r),{initialization:Mt(d)})};return Object.keys(v).forEach(function(g){v[g]||delete v[g]}),v},Hf=function(n,t){return function(i,e){var r=Wn(t,Tt(i.node,"BaseURL")),a=Bt(n,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(a.periodDuration=i.attributes.duration);var o=Tt(i.node,"AdaptationSet"),l=ds(i.node);return qn(o.map(function(n,t,i){return function(e){var r=Mt(e),a=Wn(t,Tt(e,"BaseURL")),o=Tt(e,"Role")[0],l={role:Mt(o)},d=Bt(n,r,l),f=Tt(e,"Accessibility")[0],v=function(n){return"urn:scte:dash:cc:cea-608:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var r,a;if(a=e,/^CC\d=/.test(e)){var o=e.split("=");r=o[0],a=o[1]}else/^CC\d$/.test(e)&&(r=e);return{channel:r,language:a}}):"urn:scte:dash:cc:cea-708:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var a=e.split("="),l=a[1],d=void 0===l?"":l;r.channel=a[0],r.language=e,d.split(",").forEach(function(f){var v=f.split(":"),g=v[0],T=v[1];"lang"===g?r.language=T:"er"===g?r.easyReader=Number(T):"war"===g?r.aspectRatio=Number(T):"3D"===g&&(r["3D"]=Number(T))})}else r.language=e;return r.channel&&(r.channel="SERVICE"+r.channel),r}):void 0}(Mt(f));v&&(d=Bt(d,{captionServices:v}));var g=Tt(e,"Label")[0];if(g&&g.childNodes.length){var T=g.childNodes[0].nodeValue.trim();d=Bt(d,{label:T})}var E=function(n){return n.reduce(function(t,i){var e=Mt(i),r=Uf[e.schemeIdUri];if(r){t[r]={attributes:e};var a=Tt(i,"cenc:pssh")[0];if(a){var o=ls(a),l=o&&er(o);t[r].pssh=l}}return t},{})}(Tt(e,"ContentProtection"));Object.keys(E).length&&(d=Bt(d,{contentProtection:E}));var x=ds(e),S=Tt(e,"Representation"),N=Bt(i,x);return qn(S.map(function(n,t,i){return function(e){var r=Tt(e,"BaseURL"),a=Wn(t,r),o=Bt(n,Mt(e)),l=ds(e);return a.map(function(d){return{segmentInfo:Bt(i,l),attributes:Bt(o,{baseUrl:d})}})}}(d,a,N)))}}(a,r,l)))}},mu=function(n){if(""===n)throw new Error("DASH_EMPTY_MANIFEST");var i,e,t=new Vn.DOMParser;try{e=(i=t.parseFromString(n,"application/xml"))&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch{}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return e},Kf=H(7459),zf=H.n(Kf),Re=function(n){return n instanceof Uint8Array?n:(!Array.isArray(n)&&!function(n){return function(n){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer}(n)}(n)&&!(n instanceof ArrayBuffer)&&(n="number"!=typeof n||"number"==typeof n&&n!=n?0:[n]),new Uint8Array(n&&n.buffer||n,n&&n.byteOffset||0,n&&n.byteLength||0))},Ot=P().BigInt||Number,cs=[Ot("0x1"),Ot("0x100"),Ot("0x10000"),Ot("0x1000000"),Ot("0x100000000"),Ot("0x10000000000"),Ot("0x1000000000000"),Ot("0x100000000000000"),Ot("0x10000000000000000")],eh=(s=new Uint16Array([65484]),new Uint8Array(s.buffer,s.byteOffset,s.byteLength),function(n,t){var i=void 0===t?{}:t,e=i.signed,r=void 0!==e&&e,a=i.le,o=void 0!==a&&a;n=Re(n);var l=o?"reduce":"reduceRight",f=(n[l]?n[l]:Array.prototype[l]).call(n,function(g,T,E){var x=o?E:Math.abs(E+1-n.length);return g+Ot(T)*cs[x]},Ot(0));if(r){var v=cs[n.length]/Ot(2)-Ot(1);(f=Ot(f))>v&&(f-=v,f-=v,f-=Ot(2))}return Number(f)}),_u=function(n,t){if("string"!=typeof n&&n&&"function"==typeof n.toString&&(n=n.toString()),"string"!=typeof n)return new Uint8Array;t||(n=unescape(encodeURIComponent(n)));for(var i=new Uint8Array(n.length),e=0;e=t.length&&(t.every?t.every:Array.prototype.every).call(t,function(f,v){return f===(l[v]?l[v]&n[a+v]:n[a+v])})},nh=Re([73,68,51]),un=function s(n,t){return void 0===t&&(t=0),(n=Re(n)).length-t<10||!ht(n,nh,{offset:t})?t:(t+=function(n,t){void 0===t&&(t=0);var e=(n=Re(n))[t+6]<<21|n[t+7]<<14|n[t+8]<<7|n[t+9];return(16&n[t+5])>>4?e+20:e+10}(n,t),s(n,t))},fs=(new Uint8Array([79,112,117,115,72,101,97,100]),function(n){return"string"==typeof n?_u(n):n}),ps=function(n){n=Re(n);for(var t=[],i=0;n.length>i;){var e=n[i],r=0,a=0,o=n[++a];for(a++;128&o;)r=(127&o)<<7,o=n[a],a++;r+=127&o;for(var l=0;l>>0,o=n.subarray(r+4,r+8);if(0===a)break;var l=r+a;if(l>n.length){if(i)break;l=n.length}var d=n.subarray(r+8,l);ht(o,t[0])&&(1===t.length?e.push(d):e.push.apply(e,s(d,t.slice(1),i))),r=l}return e},dt={EBML:Re([26,69,223,163]),DocType:Re([66,130]),Segment:Re([24,83,128,103]),SegmentInfo:Re([21,73,169,102]),Tracks:Re([22,84,174,107]),Track:Re([174]),TrackNumber:Re([215]),DefaultDuration:Re([35,227,131]),TrackEntry:Re([174]),TrackType:Re([131]),FlagDefault:Re([136]),CodecID:Re([134]),CodecPrivate:Re([99,162]),VideoTrack:Re([224]),AudioTrack:Re([225]),Cluster:Re([31,67,182,117]),Timestamp:Re([231]),TimestampScale:Re([42,215,177]),BlockGroup:Re([160]),BlockDuration:Re([155]),Block:Re([161]),SimpleBlock:Re([163])},ms=[128,64,32,16,8,4,2,1],rr=function(n,t,i,e){void 0===i&&(i=!0),void 0===e&&(e=!1);var r=function(n){for(var t=1,i=0;i=t.length)return t.length;var e=rr(t,i,!1);if(ht(n.bytes,e.bytes))return i;var r=rr(t,i+e.length);return s(n,t,i+r.length+r.value+e.length)},pt=function s(n,t){t=function(n){return Array.isArray(n)?n.map(function(t){return yu(t)}):[yu(n)]}(t),n=Re(n);var i=[];if(!t.length)return i;for(var e=0;en.length?n.length:o+a.value);ht(t[0],r.bytes)&&(1===t.length?i.push(d):i=i.concat(s(d,t.slice(1)))),e+=r.length+a.length+d.length}return i},mh=Re([0,0,0,1]),gh=Re([0,0,1]),vh=Re([0,0,3]),_h=function(n){for(var t=[],i=1;i>1&63),-1!==i.indexOf(d)&&(a=r+l),r+=l+("h264"===t?1:2)}else r++}return n.subarray(0,0)},jt={webm:Re([119,101,98,109]),matroska:Re([109,97,116,114,111,115,107,97]),flac:Re([102,76,97,67]),ogg:Re([79,103,103,83]),ac3:Re([11,119]),riff:Re([82,73,70,70]),avi:Re([65,86,73]),wav:Re([87,65,86,69]),"3gp":Re([102,116,121,112,51,103]),mp4:Re([102,116,121,112]),fmp4:Re([115,116,121,112]),mov:Re([102,116,121,112,113,116]),moov:Re([109,111,111,118]),moof:Re([109,111,111,102])},Pr={aac:function(n){var t=un(n);return ht(n,[255,16],{offset:t,mask:[255,22]})},mp3:function(n){var t=un(n);return ht(n,[255,2],{offset:t,mask:[255,6]})},webm:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,jt.webm)},mkv:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,jt.matroska)},mp4:function(n){return!Pr["3gp"](n)&&!Pr.mov(n)&&(!!(ht(n,jt.mp4,{offset:4})||ht(n,jt.fmp4,{offset:4})||ht(n,jt.moof,{offset:4})||ht(n,jt.moov,{offset:4}))||void 0)},mov:function(n){return ht(n,jt.mov,{offset:4})},"3gp":function(n){return ht(n,jt["3gp"],{offset:4})},ac3:function(n){var t=un(n);return ht(n,jt.ac3,{offset:t})},ts:function(n){if(n.length<189&&n.length>=1)return 71===n[0];for(var t=0;t+1880?l:0)}if(P().console){var d=P().console[i];!d&&"debug"===i&&(d=P().console.info||P().console.log),d&&a&&o.test(i)&&d[Array.isArray(r)?"apply":"call"](P().console,r)}}}(s,i),i.createLogger=function(e){return Eu(s+": "+e)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(i.history=function(){return zt?[].concat(zt):[]}).filter=function(e){return(zt||[]).filter(function(r){return new RegExp(".*"+e+".*").test(r[0])})},i.history.clear=function(){zt&&(zt.length=0)},i.history.disable=function(){null!==zt&&(zt.length=0,zt=null)},i.history.enable=function(){null===zt&&(zt=[])},i.error=function(){for(var e=arguments.length,r=new Array(e),a=0;a1?n-1:0),i=1;i=0)throw new Error("class has illegal whitespace characters")}function Rr(){return z()===P().document}function Mr(s){return Ii(s)&&1===s.nodeType}function Mu(){try{return P().parent!==P().self}catch{return!0}}function Uu(s){return function(n,t){if(!Lu(n))return z()[s](null);Lu(t)&&(t=z().querySelector(t));var i=Mr(t)?t:z();return i[s]&&i[s](n)}}function Ye(s,n,t,i){void 0===s&&(s="div"),void 0===n&&(n={}),void 0===t&&(t={});var e=z().createElement(s);return Object.getOwnPropertyNames(n).forEach(function(r){var a=n[r];-1!==r.indexOf("aria-")||"role"===r||"type"===r?(Ke.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+r+" to "+a+"."),e.setAttribute(r,a)):"textContent"===r?nr(e,a):(e[r]!==a||"tabIndex"===r)&&(e[r]=a)}),Object.getOwnPropertyNames(t).forEach(function(r){e.setAttribute(r,t[r])}),i&&Es(e,i),e}function nr(s,n){return typeof s.textContent>"u"?s.innerText=n:s.textContent=n,s}function xs(s,n){n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s)}function ar(s,n){return Ru(n),s.classList?s.classList.contains(n):function Ph(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}(n).test(s.className)}function Oi(s,n){return s.classList?s.classList.add(n):ar(s,n)||(s.className=(s.className+" "+n).trim()),s}function mn(s,n){return s?(s.classList?s.classList.remove(n):(Ru(n),s.className=s.className.split(/\s+/).filter(function(t){return t!==n}).join(" ")),s):(Ke.warn("removeClass was called with an element that doesn't exist"),null)}function Nu(s,n,t){var i=ar(s,n);if("function"==typeof t&&(t=t(s,n)),"boolean"!=typeof t&&(t=!i),t!==i)return t?Oi(s,n):mn(s,n),s}function Fu(s,n){Object.getOwnPropertyNames(n).forEach(function(t){var i=n[t];null===i||typeof i>"u"||!1===i?s.removeAttribute(t):s.setAttribute(t,!0===i?"":i)})}function Li(s){var n={};if(s&&s.attributes&&s.attributes.length>0)for(var i=s.attributes,e=i.length-1;e>=0;e--){var r=i[e].name,a=i[e].value;("boolean"==typeof s[r]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+","))&&(a=null!==a),n[r]=a}return n}function Bu(s,n){return s.getAttribute(n)}function Ur(s,n,t){s.setAttribute(n,t)}function Xn(s,n){s.removeAttribute(n)}function ju(){z().body.focus(),z().onselectstart=function(){return!1}}function Hu(){z().onselectstart=function(){return!0}}function Nr(s){if(s&&s.getBoundingClientRect&&s.parentNode){var n=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(i){void 0!==n[i]&&(t[i]=n[i])}),t.height||(t.height=parseFloat(fn(s,"height"))),t.width||(t.width=parseFloat(fn(s,"width"))),t}}function gn(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var n=s.offsetWidth,t=s.offsetHeight,i=0,e=0;s.offsetParent&&s!==z()[Kn.fullscreenElement];)i+=s.offsetLeft,e+=s.offsetTop,s=s.offsetParent;return{left:i,top:e,width:n,height:t}}function Jn(s,n){var t={x:0,y:0};if(Ht)for(var i=s;i&&"html"!==i.nodeName.toLowerCase();){var e=fn(i,"transform");if(/^matrix/.test(e)){var r=e.slice(7,-1).split(/,\s/).map(Number);t.x+=r[4],t.y+=r[5]}else if(/^matrix3d/.test(e)){var a=e.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}i=i.parentNode}var o={},l=gn(n.target),d=gn(s),f=d.width,g=n.offsetY-(d.top-l.top),T=n.offsetX-(d.left-l.left);return n.changedTouches&&(T=n.changedTouches[0].pageX-d.left,g=n.changedTouches[0].pageY+d.top,Ht&&(T-=t.x,g-=t.y)),o.y=1-Math.max(0,Math.min(1,g/d.height)),o.x=Math.max(0,Math.min(1,T/f)),o}function Vu(s){return Ii(s)&&3===s.nodeType}function Ss(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function qu(s){return"function"==typeof s&&(s=s()),(Array.isArray(s)?s:[s]).map(function(n){return"function"==typeof n&&(n=n()),Mr(n)||Vu(n)?n:"string"==typeof n&&/\S/.test(n)?z().createTextNode(n):void 0}).filter(function(n){return n})}function Es(s,n){return qu(n).forEach(function(t){return s.appendChild(t)}),s}function Gu(s,n){return Es(Ss(s),n)}function vn(s){return void 0===s.button&&void 0===s.buttons||0===s.button&&void 0===s.buttons||"mouseup"===s.type&&0===s.button&&0===s.buttons||!(0!==s.button||1!==s.buttons)}var Cs,Wi=Uu("querySelector"),Wu=Uu("querySelectorAll"),Zu=Object.freeze({__proto__:null,isReal:Rr,isEl:Mr,isInFrame:Mu,createEl:Ye,textContent:nr,prependTo:xs,hasClass:ar,addClass:Oi,removeClass:mn,toggleClass:Nu,setAttributes:Fu,getAttributes:Li,getAttribute:Bu,setAttribute:Ur,removeAttribute:Xn,blockTextSelection:ju,unblockTextSelection:Hu,getBoundingClientRect:Nr,findPosition:gn,getPointerPosition:Jn,isTextNode:Vu,emptyEl:Ss,normalizeContent:qu,appendContent:Es,insertContent:Gu,isSingleLeftClick:vn,$:Wi,$$:Wu}),Ku=!1,Oh=function(){if(!1!==Cs.options.autoSetup){var n=Array.prototype.slice.call(z().getElementsByTagName("video")),t=Array.prototype.slice.call(z().getElementsByTagName("audio")),i=Array.prototype.slice.call(z().getElementsByTagName("video-js")),e=n.concat(t,i);if(e&&e.length>0)for(var r=0,a=e.length;r-1&&(e={passive:!0}),s.addEventListener(n,i.dispatcher,e)}else s.attachEvent&&s.attachEvent("on"+n,i.dispatcher)}function Ut(s,n,t){if(Vt.has(s)){var i=Vt.get(s);if(i.handlers){if(Array.isArray(n))return ws(Ut,s,n,t);var e=function(d,f){i.handlers[f]=[],Qu(d,f)};if(void 0===n){for(var r in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},r)&&e(s,r);return}var a=i.handlers[n];if(a){if(!t)return void e(s,n);if(t.guid)for(var o=0;o=t&&(n.apply(void 0,arguments),i=a)}},Fh=function(n,t,i,e){void 0===e&&(e=P());var r,o=function(){var d=this,f=arguments,v=function(){r=null,v=null,i||n.apply(d,f)};!r&&i&&n.apply(d,f),e.clearTimeout(r),r=e.setTimeout(v,t)};return o.cancel=function(){e.clearTimeout(r),r=null},o},It=function(){};It.prototype.allowedEvents_={},It.prototype.on=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Xt(this,s,n),this.addEventListener=t},It.prototype.addEventListener=It.prototype.on,It.prototype.off=function(s,n){Ut(this,s,n)},It.prototype.removeEventListener=It.prototype.off,It.prototype.one=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},ia(this,s,n),this.addEventListener=t},It.prototype.any=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Xu(this,s,n),this.addEventListener=t},It.prototype.trigger=function(s){var n=s.type||s;"string"==typeof s&&(s={type:n}),s=ea(s),this.allowedEvents_[n]&&this["on"+n]&&this["on"+n](s),Fr(this,s)},It.prototype.dispatchEvent=It.prototype.trigger,It.prototype.queueTrigger=function(s){var n=this;_n||(_n=new Map);var t=s.type||s,i=_n.get(this);i||_n.set(this,i=new Map);var e=i.get(t);i.delete(t),P().clearTimeout(e);var r=P().setTimeout(function(){0===i.size&&(i=null,_n.delete(n)),n.trigger(s)},0);i.set(t,r)};var ra=function(n){return"function"==typeof n.name?n.name():"string"==typeof n.name?n.name:n.name_?n.name_:n.constructor&&n.constructor.name?n.constructor.name:typeof n},Mi=function(n){return n instanceof It||!!n.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof n[t]})},Is=function(n){return"string"==typeof n&&/\S/.test(n)||Array.isArray(n)&&!!n.length},na=function(n,t,i){if(!n||!n.nodeName&&!Mi(n))throw new Error("Invalid target for "+ra(t)+"#"+i+"; must be a DOM node or evented object.")},Ju=function(n,t,i){if(!Is(n))throw new Error("Invalid event type for "+ra(t)+"#"+i+"; must be a non-empty string or array.")},el=function(n,t,i){if("function"!=typeof n)throw new Error("Invalid listener for "+ra(t)+"#"+i+"; must be a function.")},Ds=function(n,t,i){var r,a,o,e=t.length<3||t[0]===n||t[0]===n.eventBusEl_;return e?(r=n.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(r=t[0],a=t[1],o=t[2]),na(r,n,i),Ju(a,n,i),el(o,n,i),{isTargetingSelf:e,target:r,type:a,listener:o=at(n,o)}},sr=function(n,t,i,e){na(n,n,t),n.nodeName?Nh[t](n,i,e):n[t](i,e)},jh={on:function(){for(var n=this,t=arguments.length,i=new Array(t),e=0;e=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},n.isDisposed=function(){return Boolean(this.isDisposed_)},n.player=function(){return this.player_},n.options=function(i){return i?(this.options_=ct(this.options_,i),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(i,e,r){return Ye(i,e,r)},n.localize=function(i,e,r){void 0===r&&(r=i);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],d=a&&a.split("-")[0],f=o&&o[d],v=r;return l&&l[i]?v=l[i]:f&&f[i]&&(v=f[i]),e&&(v=v.replace(/\{(\d+)\}/g,function(g,T){var E=e[T-1],x=E;return typeof E>"u"&&(x=g),x})),v},n.handleLanguagechange=function(){},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(i){return this.childIndex_[i]},n.getChild=function(i){if(i)return this.childNameIndex_[i]},n.getDescendant=function(){for(var i=arguments.length,e=new Array(i),r=0;r=0;r--)if(this.children_[r]===i){e=!0,this.children_.splice(r,1);break}if(e){i.parentComponent_=null,this.childIndex_[i.id()]=null,this.childNameIndex_[bt(i.name())]=null,this.childNameIndex_[aa(i.name())]=null;var a=i.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(i.el())}}},n.initChildren=function(){var i=this,e=this.options_.children;if(e){var o,r=this.options_,l=s.getComponent("Tech");(o=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(d){return!o.some(function(f){return"string"==typeof f?d===f:d===f.name})})).map(function(d){var f,v;return"string"==typeof d?v=e[f=d]||i.options_[f]||{}:(f=d.name,v=d),{name:f,opts:v}}).filter(function(d){var f=s.getComponent(d.opts.componentClass||bt(d.name));return f&&!l.isTech(f)}).forEach(function(f){var v=f.name,g=f.opts;if(void 0!==r[v]&&(g=r[v]),!1!==g){!0===g&&(g={}),g.playerOptions=i.options_.playerOptions;var T=i.addChild(v,g);T&&(i[v]=T)}})}},n.buildCSSClass=function(){return""},n.ready=function(i,e){if(void 0===e&&(e=!1),i){if(!this.isReady_)return this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(i);e?i.call(this):this.setTimeout(i,1)}},n.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var i=this.readyQueue_;this.readyQueue_=[],i&&i.length>0&&i.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},n.$=function(i,e){return Wi(i,e||this.contentEl())},n.$$=function(i,e){return Wu(i,e||this.contentEl())},n.hasClass=function(i){return ar(this.el_,i)},n.addClass=function(i){Oi(this.el_,i)},n.removeClass=function(i){mn(this.el_,i)},n.toggleClass=function(i,e){Nu(this.el_,i,e)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(i){return Bu(this.el_,i)},n.setAttribute=function(i,e){Ur(this.el_,i,e)},n.removeAttribute=function(i){Xn(this.el_,i)},n.width=function(i,e){return this.dimension("width",i,e)},n.height=function(i,e){return this.dimension("height",i,e)},n.dimensions=function(i,e){this.width(i,!0),this.height(e)},n.dimension=function(i,e,r){if(void 0!==e)return(null===e||e!=e)&&(e=0),this.el_.style[i]=-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?e:"auto"===e?"":e+"px",void(r||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[i],o=a.indexOf("px");return parseInt(-1!==o?a.slice(0,o):this.el_["offset"+bt(i)],10)},n.currentDimension=function(i){var e=0;if("width"!==i&&"height"!==i)throw new Error("currentDimension only accepts width or height value");if(e=fn(this.el_,i),0===(e=parseFloat(e))||isNaN(e)){var r="offset"+bt(i);e=this.el_[r]}return e},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(i){this.player_&&(De().isEventKey(i,"Tab")||i.stopPropagation(),this.player_.handleKeyDown(i))},n.handleKeyPress=function(i){this.handleKeyDown(i)},n.emitTapEvents=function(){var o,i=0,e=null;this.on("touchstart",function(d){1===d.touches.length&&(e={pageX:d.touches[0].pageX,pageY:d.touches[0].pageY},i=P().performance.now(),o=!0)}),this.on("touchmove",function(d){if(d.touches.length>1)o=!1;else if(e){var f=d.touches[0].pageX-e.pageX,v=d.touches[0].pageY-e.pageY;Math.sqrt(f*f+v*v)>10&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(d){e=null,!0===o&&P().performance.now()-i<200&&(d.preventDefault(),this.trigger("tap"))})},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,i=at(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){i(),this.clearInterval(e),e=this.setInterval(i,250)});var r=function(o){i(),this.clearInterval(e)};this.on("touchmove",i),this.on("touchend",r),this.on("touchcancel",r)}},n.setTimeout=function(i,e){var a,r=this;return i=at(this,i),this.clearTimersOnDispose_(),a=P().setTimeout(function(){r.setTimeoutIds_.has(a)&&r.setTimeoutIds_.delete(a),i()},e),this.setTimeoutIds_.add(a),a},n.clearTimeout=function(i){return this.setTimeoutIds_.has(i)&&(this.setTimeoutIds_.delete(i),P().clearTimeout(i)),i},n.setInterval=function(i,e){i=at(this,i),this.clearTimersOnDispose_();var r=P().setInterval(i,e);return this.setIntervalIds_.add(r),r},n.clearInterval=function(i){return this.setIntervalIds_.has(i)&&(this.setIntervalIds_.delete(i),P().clearInterval(i)),i},n.requestAnimationFrame=function(i){var r,e=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),i=at(this,i),r=P().requestAnimationFrame(function(){e.rafIds_.has(r)&&e.rafIds_.delete(r),i()}),this.rafIds_.add(r),r):this.setTimeout(i,1e3/60)},n.requestNamedAnimationFrame=function(i,e){var r=this;if(!this.namedRafs_.has(i)){this.clearTimersOnDispose_(),e=at(this,e);var a=this.requestAnimationFrame(function(){e(),r.namedRafs_.has(i)&&r.namedRafs_.delete(i)});return this.namedRafs_.set(i,a),i}},n.cancelNamedAnimationFrame=function(i){this.namedRafs_.has(i)&&(this.cancelAnimationFrame(this.namedRafs_.get(i)),this.namedRafs_.delete(i))},n.cancelAnimationFrame=function(i){return this.supportsRaf_?(this.rafIds_.has(i)&&(this.rafIds_.delete(i),P().cancelAnimationFrame(i)),i):this.clearTimeout(i)},n.clearTimersOnDispose_=function(){var i=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var a=e[1];i[e[0]].forEach(function(o,l){return i[a](l)})}),i.clearingTimersOnDispose_=!1}))},s.registerComponent=function(i,e){if("string"!=typeof i||!i)throw new Error('Illegal component name, "'+i+'"; must be a non-empty string.');var r=s.getComponent("Tech"),a=r&&r.isTech(e),o=s===e||s.prototype.isPrototypeOf(e.prototype);if(a||!o)throw new Error('Illegal component, "'+i+'"; '+(a?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");i=bt(i),s.components_||(s.components_={});var d=s.getComponent("Player");if("Player"===i&&d&&d.players){var f=d.players,v=Object.keys(f);if(f&&v.length>0&&v.map(function(g){return f[g]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[i]=e,s.components_[aa(i)]=e,e},s.getComponent=function(i){if(i&&s.components_)return s.components_[i]},s}();function il(s,n,t,i){return function Zh(s,n,t){if("number"!=typeof n||n<0||n>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+n+") is non-numeric or out of bounds (0-"+t+").")}(s,i,t.length-1),t[i][n]}function Ls(s){var n;return n=void 0===s||0===s.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:il.bind(null,"start",0,s),end:il.bind(null,"end",1,s)},P().Symbol&&P().Symbol.iterator&&(n[P().Symbol.iterator]=function(){return(s||[]).values()}),n}function or(s,n){return Array.isArray(s)?Ls(s):void 0===s||void 0===n?Ls():Ls([[s,n]])}function rl(s,n){var i,e,t=0;if(!n)return 0;(!s||!s.length)&&(s=or(0,0));for(var r=0;rn&&(e=n),t+=e-i;return t/n}function qt(s){if(s instanceof qt)return s;"number"==typeof s?this.code=s:"string"==typeof s?this.message=s:Ii(s)&&("number"==typeof s.code&&(this.code=s.code),_t(this,s)),this.message||(this.message=qt.defaultMessages[this.code]||"")}Y.prototype.supportsRaf_="function"==typeof P().requestAnimationFrame&&"function"==typeof P().cancelAnimationFrame,Y.registerComponent("Component",Y),qt.prototype.code=0,qt.prototype.message="",qt.prototype.status=null,qt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],qt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Br=0;Br=0;r--)if(i[r].enabled){Us(i,i[r]);break}return(e=s.call(this,i)||this).changing_=!1,e}re(n,s);var t=n.prototype;return t.addTrack=function(e){var r=this;e.enabled&&Us(this,e),s.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){r.changing_||(r.changing_=!0,Us(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},n}(Hr),Ns=function(n,t){for(var i=0;i=0;r--)if(i[r].selected){Ns(i,i[r]);break}return(e=s.call(this,i)||this).changing_=!1,Object.defineProperty(Ne(e),"selectedIndex",{get:function(){for(var o=0;o0&&(P().console&&P().console.groupCollapsed&&P().console.groupCollapsed("Text Track parsing errors for "+t.src),e.forEach(function(r){return Ke.error(r)}),P().console&&P().console.groupEnd&&P().console.groupEnd()),i.flush()},dl=function(n,t){var i={uri:n},e=sa(n);e&&(i.cors=e);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),ki()(i,at(this,function(a,o,l){if(a)return Ke.error(a,o);t.loaded_=!0,"function"!=typeof P().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(d){if("vttjserror"!==d.type)return ll(l,t);Ke.error("vttjs failed to load, stopping trying to process "+t.src)}):ll(l,t)}))},Tn=function(s){function n(i){var e;if(void 0===i&&(i={}),!i.tech)throw new Error("A tech was not provided.");var r=ct(i,{kind:tp[i.kind]||"subtitles",language:i.language||i.srclang||""}),a=ol[r.mode]||"disabled",o=r.default;("metadata"===r.kind||"chapters"===r.kind)&&(a="hidden"),(e=s.call(this,r)||this).tech_=r.tech,e.cues_=[],e.activeCues_=[],e.preload_=!1!==e.tech_.preloadTextTracks;var l=new sl(e.cues_),d=new sl(e.activeCues_),f=!1,v=at(Ne(e),function(){!this.tech_.isReady_||this.tech_.isDisposed()||(this.activeCues=this.activeCues,f&&(this.trigger("cuechange"),f=!1))});return e.tech_.one("dispose",function(){e.tech_.off("timeupdate",v)}),"disabled"!==a&&e.tech_.on("timeupdate",v),Object.defineProperties(Ne(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(E){ol[E]&&a!==E&&(a=E,!this.preload_&&"disabled"!==a&&0===this.cues.length&&dl(this.src,this),this.tech_.off("timeupdate",v),"disabled"!==a&&this.tech_.on("timeupdate",v),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var E=this.tech_.currentTime(),x=[],S=0,N=this.cues.length;S=E||F.startTime===F.endTime&&F.startTime<=E&&F.startTime+.5>=E)&&x.push(F)}if(f=!1,x.length!==this.activeCues_.length)f=!0;else for(var j=0;j0)return void this.trigger("vttjsloaded");var r=z().createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){e.trigger("vttjsloaded")},r.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){r.onload=null,r.onerror=null}),P().WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var e=this,r=this.textTracks(),a=this.remoteTextTracks(),o=function(g){return r.addTrack(g.track)},l=function(g){return r.removeTrack(g.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var d=function(){return e.trigger("texttrackchange")},f=function(){d();for(var g=0;g=0;e--){var r=s[e];r[n]&&r[n](i,t)}}(s,t,o,a),o}var cp={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},fp={setCurrentTime:1,setMuted:1,setVolume:1},gl={play:1,pause:1};function Vs(s){return function(n,t){return n===oa?oa:t[s]?t[s](n):n}}function lr(s,n,t,i,e,r){void 0===s&&(s={}),void 0===n&&(n=[]),void 0===e&&(e=[]),void 0===r&&(r=!1);var o=n[0],l=n.slice(1);if("string"==typeof o)lr(s,ur[o],t,i,e,r);else if(o){var d=function mp(s,n){var t=Hs[s.id()],i=null;if(null==t)return i=n(s),Hs[s.id()]=[[n,i]],i;for(var e=0;e0;this.player_.tech(!0)&&!((pn||hn)&&r)&&this.player_.tech(!0).focus(),this.player_.paused()?yi(this.player_.play()):this.player_.pause()}},n}(la);Y.registerComponent("PosterImage",Tp);var ni="#222",bp={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function qs(s,n){var t;if(4===s.length)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(7!==s.length)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+n+")"}function Gs(s,n,t){try{s.style[n]=t}catch{return}}var xp=function(s){function n(i,e,r){var a;a=s.call(this,i,e,r)||this;var o=function(d){return a.updateDisplay(d)};return i.on("loadstart",function(l){return a.toggleDisplay(l)}),i.on("texttrackchange",o),i.on("loadedmetadata",function(l){return a.preselectTrack(l)}),i.ready(at(Ne(a),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),P().addEventListener("orientationchange",o),i.on("dispose",function(){return P().removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],d=0;d0;return yi(r),void(this.player_.tech(!0)&&(!pn&&!hn||!a)&&this.player_.tech(!0).focus())}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(l){var d=function(){return l.focus()};yn(r)?r.then(d,function(){}):this.setTimeout(d,1)}else this.player_.tech(!0).focus()},t.handleKeyDown=function(e){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,e)},t.handleMouseDown=function(e){this.mouseused_=!0},n}(hi);yl.prototype.controlText_="Play Video",Y.registerComponent("BigPlayButton",yl);var Ep=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).controlText(e&&e.controlText||r.localize("Close")),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(e){De().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,e)},n}(hi);Y.registerComponent("CloseButton",Ep);var Tl=function(s){function n(i,e){var r;return void 0===e&&(e={}),r=s.call(this,i,e)||this,e.replay=void 0===e.replay||e.replay,r.on(i,"play",function(a){return r.handlePlay(a)}),r.on(i,"pause",function(a){return r.handlePause(a)}),e.replay&&r.on(i,"ended",function(a){return r.handleEnded(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.player_.paused()?yi(this.player_.play()):this.player_.pause()},t.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(e){var r=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return r.handleSeeked(a)})},n}(hi);Tl.prototype.controlText_="Play",Y.registerComponent("PlayToggle",Tl);var bl=function(n,t){n=n<0?0:n;var i=Math.floor(n%60),e=Math.floor(n/60%60),r=Math.floor(n/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(n)||n===1/0)&&(r=e=i="-"),(r=r>0||o>0?r+":":"")+(e=((r||a>=10)&&e<10?"0"+e:e)+":")+(i<10?"0"+i:i)},Ws=bl;function Gr(s,n){return void 0===n&&(n=s),Ws(s,n)}var Wr=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,["timeupdate","ended"],function(a){return r.updateContent(a)}),r.updateTextNode_(),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=this.buildCSSClass(),r=s.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=Ye("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return r.appendChild(a),this.contentEl_=Ye("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),r.appendChild(this.contentEl_),r},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(e){var r=this;void 0===e&&(e=0),e=Gr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(r.contentEl_){var a=r.textNode_;a&&r.contentEl_.firstChild!==a&&(a=null,Ke.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),r.textNode_=z().createTextNode(r.formattedTime_),r.textNode_&&(a?r.contentEl_.replaceChild(r.textNode_,a):r.contentEl_.appendChild(r.textNode_))}}))},t.updateContent=function(e){},n}(Y);Wr.prototype.labelText_="Time",Wr.prototype.controlText_="Time",Y.registerComponent("TimeDisplay",Wr);var Zs=function(s){function n(){return s.apply(this,arguments)||this}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(e){var r;r=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(r)},n}(Wr);Zs.prototype.labelText_="Current Time",Zs.prototype.controlText_="Current Time",Y.registerComponent("CurrentTimeDisplay",Zs);var Ks=function(s){function n(i,e){var r,a=function(l){return r.updateContent(l)};return(r=s.call(this,i,e)||this).on(i,"durationchange",a),r.on(i,"loadstart",a),r.on(i,"loadedmetadata",a),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var r=this.player_.duration();this.updateTextNode_(r)},n}(Wr);Ks.prototype.labelText_="Duration",Ks.prototype.controlText_="Duration",Y.registerComponent("DurationDisplay",Ks);var Ap=function(s){function n(){return s.apply(this,arguments)||this}return re(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),r=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return r.appendChild(a),e.appendChild(r),e},n}(Y);Y.registerComponent("TimeDivider",Ap);var zs=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,"durationchange",function(a){return r.updateContent(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=s.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&e.insertBefore(Ye("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){var r;"number"==typeof this.player_.duration()&&(r=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(r))},n}(Wr);zs.prototype.labelText_="Remaining Time",zs.prototype.controlText_="Remaining Time",Y.registerComponent("RemainingTimeDisplay",zs);var wp=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).updateShowing(),r.on(r.player(),"durationchange",function(a){return r.updateShowing(a)}),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ye("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Ye("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(z().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},n}(Y);Y.registerComponent("LiveDisplay",wp);var xl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).updateLiveEdgeStatus(),r.player_.liveTracker&&(r.updateLiveEdgeStatusHandler_=function(a){return r.updateLiveEdgeStatus(a)},r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatusHandler_)),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Ye("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},n}(hi);xl.prototype.controlText_="Seek to live, currently playing live",Y.registerComponent("SeekToLive",xl);var da=function(n,t,i){return n=Number(n),Math.min(i,Math.max(t,isNaN(n)?t:n))},Ys=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).handleMouseDown_=function(a){return r.handleMouseDown(a)},r.handleMouseUp_=function(a){return r.handleMouseUp(a)},r.handleKeyDown_=function(a){return r.handleKeyDown(a)},r.handleClick_=function(a){return r.handleClick(a)},r.handleMouseMove_=function(a){return r.handleMouseMove(a)},r.update_=function(a){return r.update(a)},r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}re(n,s);var t=n.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(e,r,a){return void 0===r&&(r={}),void 0===a&&(a={}),r.className=r.className+" vjs-slider",r=_t({tabIndex:0},r),a=_t({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,e,r,a)},t.handleMouseDown=function(e){var r=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"===e.type&&!Pi&&e.preventDefault(),ju(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(r,"mousemove",this.handleMouseMove_),this.on(r,"mouseup",this.handleMouseUp_),this.on(r,"touchmove",this.handleMouseMove_),this.on(r,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},t.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Hu(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var e=this;if(this.el_&&this.bar){var r=this.getProgress();return r===this.progress_||(this.progress_=r,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*r).toFixed(2)+"%"})),r}},t.getProgress=function(){return Number(da(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(e){var r=Jn(this.el_,e);return this.vertical()?r.y:r.x},t.handleKeyDown=function(e){De().isEventKey(e,"Left")||De().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):De().isEventKey(e,"Right")||De().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.addClass(this.vertical_?"vjs-slider-vertical":"vjs-slider-horizontal")},n}(Y);Y.registerComponent("Slider",Ys);var $s=function(n,t){return da(n/t*100,0,100).toFixed(2)+"%"},Ip=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).partEls_=[],r.on(i,"progress",function(a){return r.update(a)}),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),r=Ye("span",{className:"vjs-control-text"}),a=Ye("span",{textContent:this.localize("Loaded")}),o=z().createTextNode(": ");return this.percentageEl_=Ye("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(r),r.appendChild(a),r.appendChild(o),r.appendChild(this.percentageEl_),e},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(e){var r=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=r.player_.liveTracker,o=r.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():r.player_.duration(),d=r.player_.bufferedEnd(),f=r.partEls_,v=$s(d,l);r.percent_!==v&&(r.el_.style.width=v,nr(r.percentageEl_,v),r.percent_=v);for(var g=0;go.length;S--)r.el_.removeChild(f[S-1]);f.length=o.length})},n}(Y);Y.registerComponent("LoadProgressBar",Ip);var Dp=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,r,a){var o=gn(this.el_),l=Nr(this.player_.el()),d=e.width*r;if(l&&o){var f=e.left-l.left+d,v=e.width-d+(l.right-e.right),g=o.width/2;fo.width&&(g=o.width),g=Math.round(g),this.el_.style.right="-"+g+"px",this.write(a)}},t.write=function(e){nr(this.el_,e)},t.updateTime=function(e,r,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var d,f=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var v=l.player_.liveTracker.liveWindow(),g=v-r*v;d=(g<1?"":"-")+Gr(g,v)}else d=Gr(a,f);l.update(e,r,d),o&&o()})},n}(Y);Y.registerComponent("TimeTooltip",Dp);var Qs=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,r){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,r,o)}},n}(Y);Qs.prototype.options_={children:[]},!Ht&&!Di&&Qs.prototype.options_.children.push("timeTooltip"),Y.registerComponent("PlayProgressBar",Qs);var Sl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,r){var a=this,o=r*this.player_.duration();this.getChild("timeTooltip").updateTime(e,r,o,function(){a.el_.style.left=e.width*r+"px"})},n}(Y);Sl.prototype.options_={children:["timeTooltip"]},Y.registerComponent("MouseTimeDisplay",Sl);var Xs=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).setEventHandlers_(),r}re(n,s);var t=n.prototype;return t.setEventHandlers_=function(){var e=this;this.update_=at(this,this.update),this.update=Ri(this.update_,fi),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(r){return e.enableInterval_(r)},this.disableIntervalHandler_=function(r){return e.disableInterval_(r)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in z()&&"visibilityState"in z()&&this.on(z(),"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){"hidden"===z().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,fi))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var r=this;if("hidden"!==z().visibilityState){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=r.player_.ended()?r.player_.duration():r.getCurrentTime_(),l=r.player_.liveTracker,d=r.player_.duration();l&&l.isLive()&&(d=r.player_.liveTracker.liveCurrentTime()),r.percent_!==a&&(r.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),r.percent_=a),(r.currentTime_!==o||r.duration_!==d)&&(r.el_.setAttribute("aria-valuetext",r.localize("progress bar timing: currentTime={1} duration={2}",[Gr(o,d),Gr(d,d)],"{1} of {2}")),r.currentTime_=o,r.duration_=d),r.bar&&r.bar.update(Nr(r.el()),r.getProgress())}),a}},t.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var r,e=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(r=(e-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(r=1)):r=e/this.player_.duration(),r},t.handleMouseDown=function(e){vn(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e,r){if(void 0===r&&(r=!1),vn(e)){!r&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(e),l=this.player_.liveTracker;if(l&&l.isLive()){if(o>=.99)return void l.seekToLiveEdge();var d=l.seekableStart(),f=l.liveCurrentTime();if((a=d+o*l.liveWindow())>=f&&(a=f),a<=d&&(a=d+.1),a===1/0)return}else(a=o*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},t.disable=function(){s.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},t.handleMouseUp=function(e){s.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?yi(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){var r=this.player_.liveTracker;if(De().isEventKey(e,"Space")||De().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(De().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(De().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),r&&r.isLive()?this.userSeek_(r.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(De()(e))){e.preventDefault(),e.stopPropagation();var a=10*(De().codes[De()(e)]-De().codes[0])/100;r&&r.isLive()?this.userSeek_(r.seekableStart()+r.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else De().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):De().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):s.prototype.handleKeyDown.call(this,e)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in z()&&"visibilityState"in z()&&this.off(z(),"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},n}(Ys);Xs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},!Ht&&!Di&&Xs.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Y.registerComponent("SeekBar",Xs);var Cl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).handleMouseMove=Ri(at(Ne(r),r.handleMouseMove),fi),r.throttledHandleMouseSeek=Ri(at(Ne(r),r.handleMouseSeek),fi),r.handleMouseUpHandler_=function(a){return r.handleMouseUp(a)},r.handleMouseDownHandler_=function(a){return r.handleMouseDown(a)},r.enable(),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var r=this.getChild("seekBar");if(r){var a=r.getChild("playProgressBar"),o=r.getChild("mouseTimeDisplay");if(a||o){var l=r.el(),d=gn(l),f=Jn(l,e).x;f=da(f,0,1),o&&o.update(d,f),a&&a.update(d,r.getProgress())}}},t.handleMouseSeek=function(e){var r=this.getChild("seekBar");r&&r.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(r){return r.disable&&r.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&yi(this.player_.play())}},t.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(e){var r=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(r,"mousemove",this.throttledHandleMouseSeek),this.on(r,"touchmove",this.throttledHandleMouseSeek),this.on(r,"mouseup",this.handleMouseUpHandler_),this.on(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var r=this.getChild("seekBar");r&&r.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},n}(Y);Cl.prototype.options_={children:["seekBar"]},Y.registerComponent("ProgressControl",Cl);var kl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,["enterpictureinpicture","leavepictureinpicture"],function(a){return r.handlePictureInPictureChange(a)}),r.on(i,["disablepictureinpicturechanged","loadedmetadata"],function(a){return r.handlePictureInPictureEnabledChange(a)}),r.disable(),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){z().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},t.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},n}(hi);kl.prototype.controlText_="Picture-in-Picture",Y.registerComponent("PictureInPictureToggle",kl);var Al=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,"fullscreenchange",function(a){return r.handleFullscreenChange(a)}),!1===z()[i.fsApi_.fullscreenEnabled]&&r.disable(),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},n}(hi);Al.prototype.controlText_="Fullscreen",Y.registerComponent("FullscreenToggle",Al);var Pp=function(n,t){t.tech_&&!t.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})},Op=function(s){function n(){return s.apply(this,arguments)||this}return re(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},n}(Y);Y.registerComponent("VolumeLevel",Op);var Lp=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(e,r,a,o){if(!a){var l=Nr(this.el_),d=Nr(this.player_.el()),f=e.width*r;if(!d||!l)return;var v=e.left-d.left+f,g=e.width-f+(d.right-e.right),T=l.width/2;vl.width&&(T=l.width),this.el_.style.right="-"+T+"px"}this.write(o+"%")},t.write=function(e){nr(this.el_,e)},t.updateVolume=function(e,r,a,o,l){var d=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){d.update(e,r,a,o.toFixed(0)),l&&l()})},n}(Y);Y.registerComponent("VolumeLevelTooltip",Lp);var wl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).update=Ri(at(Ne(r),r.update),fi),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,r,a){var o=this,l=100*r;this.getChild("volumeLevelTooltip").updateVolume(e,r,a,l,function(){a?o.el_.style.bottom=e.height*r+"px":o.el_.style.left=e.width*r+"px"})},n}(Y);wl.prototype.options_={children:["volumeLevelTooltip"]},Y.registerComponent("MouseVolumeLevelDisplay",wl);var fa=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on("slideractive",function(a){return r.updateLastVolume_(a)}),r.on(i,"volumechange",function(a){return r.updateARIAAttributes(a)}),i.ready(function(){return r.updateARIAAttributes()}),r}re(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){vn(e)&&s.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){var r=this.getChild("mouseVolumeLevelDisplay");if(r){var a=this.el(),o=Nr(a),l=this.vertical(),d=Jn(a,e);d=da(d=l?d.y:d.x,0,1),r.update(o,d,l)}vn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var r=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",r),this.el_.setAttribute("aria-valuetext",r+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,r=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(r)})},n}(Ys);fa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!Ht&&!Di&&fa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),fa.prototype.playerEvent="volumechange",Y.registerComponent("VolumeBar",fa);var Il=function(s){function n(i,e){var r;return void 0===e&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar>"u"||cn(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),r=s.call(this,i,e)||this,Pp(Ne(r),i),r.throttledHandleMouseMove=Ri(at(Ne(r),r.handleMouseMove),fi),r.handleMouseUpHandler_=function(a){return r.handleMouseUp(a)},r.on("mousedown",function(a){return r.handleMouseDown(a)}),r.on("touchstart",function(a){return r.handleMouseDown(a)}),r.on("mousemove",function(a){return r.handleMouseMove(a)}),r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")}),r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")}),r}re(n,s);var t=n.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var r=this.el_.ownerDocument;this.on(r,"mousemove",this.throttledHandleMouseMove),this.on(r,"touchmove",this.throttledHandleMouseMove),this.on(r,"mouseup",this.handleMouseUpHandler_),this.on(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var r=this.el_.ownerDocument;this.off(r,"mousemove",this.throttledHandleMouseMove),this.off(r,"touchmove",this.throttledHandleMouseMove),this.off(r,"mouseup",this.handleMouseUpHandler_),this.off(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},n}(Y);Il.prototype.options_={children:["volumeBar"]},Y.registerComponent("VolumeControl",Il);var Rp=function(n,t){t.tech_&&!t.tech_.featuresMuteControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresMuteControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})},Dl=function(s){function n(i,e){var r;return r=s.call(this,i,e)||this,Rp(Ne(r),i),r.on(i,["loadstart","volumechange"],function(a){return r.update(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var r=this.player_.volume(),a=this.player_.lastVolume_();0===r?(this.player_.volume(a<.1?.1:a),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),r=3;Ht&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?r=0:e<.33?r=1:e<.67&&(r=2);for(var a=0;a<4;a++)mn(this.el_,"vjs-vol-"+a);Oi(this.el_,"vjs-vol-"+r)},t.updateControlText_=function(){var r=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==r&&this.controlText(r)},n}(hi);Dl.prototype.controlText_="Mute",Y.registerComponent("MuteToggle",Dl);var Pl=function(s){function n(i,e){var r;return void 0===e&&(e={}),e.inline=!(typeof e.inline<"u")||e.inline,(typeof e.volumeControl>"u"||cn(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),(r=s.call(this,i,e)||this).handleKeyPressHandler_=function(a){return r.handleKeyPress(a)},r.on(i,["loadstart"],function(a){return r.volumePanelState_(a)}),r.on(r.muteToggle,"keyup",function(a){return r.handleKeyPress(a)}),r.on(r.volumeControl,"keyup",function(a){return r.handleVolumeControlKeyUp(a)}),r.on("keydown",function(a){return r.handleKeyPress(a)}),r.on("mouseover",function(a){return r.handleMouseOver(a)}),r.on("mouseout",function(a){return r.handleMouseOut(a)}),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}re(n,s);var t=n.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(e){De().isEventKey(e,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(e){this.addClass("vjs-hover"),Xt(z(),"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(e){this.removeClass("vjs-hover"),Ut(z(),"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(e){De().isEventKey(e,"Esc")&&this.handleMouseOut()},n}(Y);Pl.prototype.options_={children:["muteToggle","volumeControl"]},Y.registerComponent("VolumePanel",Pl);var Ol=function(s){function n(i,e){var r;return r=s.call(this,i,e)||this,e&&(r.menuButton_=e.menuButton),r.focusedChild_=-1,r.on("keydown",function(a){return r.handleKeyDown(a)}),r.boundHandleBlur_=function(a){return r.handleBlur(a)},r.boundHandleTapClick_=function(a){return r.handleTapClick(a)},r}re(n,s);var t=n.prototype;return t.addEventListenerForItem=function(e){e instanceof Y&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof Y&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),s.prototype.removeChild.call(this,e)},t.addItem=function(e){var r=this.addChild(e);r&&this.addEventListenerForItem(r)},t.createEl=function(){this.contentEl_=Ye(this.options_.contentElType||"ul",{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),Xt(r,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),r},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(e){var r=e.relatedTarget||z().activeElement;if(!this.children().some(function(o){return o.el()===r})){var a=this.menuButton_;a&&a.buttonPressed_&&r!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var r=this.children();if(!Array.isArray(r))return;var a=r.filter(function(o){return o.el()===e.target})[0];if(!a)return;"CaptionSettingsMenuItem"!==a.name()&&this.menuButton_.focus()}},t.handleKeyDown=function(e){De().isEventKey(e,"Left")||De().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(De().isEventKey(e,"Right")||De().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var r=this.children().slice();r.length&&r[0].hasClass("vjs-menu-title")&&r.shift(),r.length>0&&(e<0?e=0:e>=r.length&&(e=r.length-1),this.focusedChild_=e,r[e].el_.focus())},n}(Y);Y.registerComponent("Menu",Ol);var Js=function(s){function n(i,e){var r;void 0===e&&(e={}),(r=s.call(this,i,e)||this).menuButton_=new hi(i,e),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var a=hi.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+a,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0;var o=function(d){return r.handleClick(d)};return r.handleMenuKeyUp_=function(l){return r.handleMenuKeyUp(l)},r.on(r.menuButton_,"tap",o),r.on(r.menuButton_,"click",o),r.on(r.menuButton_,"keydown",function(l){return r.handleKeyDown(l)}),r.on(r.menuButton_,"mouseenter",function(){r.addClass("vjs-hover"),r.menu.show(),Xt(z(),"keyup",r.handleMenuKeyUp_)}),r.on("mouseleave",function(l){return r.handleMouseLeave(l)}),r.on("keydown",function(l){return r.handleSubmenuKeyDown(l)}),r}re(n,s);var t=n.prototype;return t.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.createMenu=function(){var e=new Ol(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var r=Ye("li",{className:"vjs-menu-title",textContent:bt(this.options_.title),tabIndex:-1}),a=new Y(this.player_,{el:r});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o-1&&"showing"===d.mode){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(e){for(var r=this.player().textTracks(),a=!0,o=0,l=r.length;o-1&&"showing"===d.mode){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},n}(xn);Y.registerComponent("OffTextTrackMenuItem",Ll);var Zr=function(s){function n(i,e){return void 0===e&&(e={}),e.tracks=i.textTracks(),s.call(this,i,e)||this}return re(n,s),n.prototype.createItems=function(e,r){var a;void 0===e&&(e=[]),void 0===r&&(r=xn),this.label_&&(a=this.label_+" off"),e.push(new Ll(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l-1){var f=new r(this.player_,{track:d,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});f.addClass("vjs-"+d.kind+"-menu-item"),e.push(f)}}return e},n}(eo);Y.registerComponent("TextTrackButton",Zr);var Rl=function(s){function n(i,e){var r,a=e.track,o=e.cue,l=i.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=l&&l=0;r--){var a=e[r];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(bt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var e=[];if(!this.track_)return e;var r=this.track_.cues;if(!r)return e;for(var a=0,o=r.length;a-1&&(r.label_="captions"),r.menuButton_.controlText(bt(r.label_)),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new no(this.player_,{kind:this.label_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,e,Ml)},n}(Zr);so.prototype.kinds_=["captions","subtitles"],so.prototype.controlText_="Subtitles",Y.registerComponent("SubsCapsButton",so);var Ul=function(s){function n(i,e){var r,a=e.track,o=i.audioTracks();e.label=a.label||a.language||"Unknown",e.selected=a.enabled,(r=s.call(this,i,e)||this).track=a,r.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var f=arguments.length,v=new Array(f),g=0;g=0;a--)r.push(new oo(this.player(),{rate:e[a]+"x"}));return r},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(e){var r=this.player().playbackRate(),a=this.playbackRates(),l=(a.indexOf(r)+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(e){this.update()},t.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},n}(Js);Fl.prototype.controlText_="Playback Rate",Y.registerComponent("PlaybackRateMenuButton",Fl);var Bl=function(s){function n(){return s.apply(this,arguments)||this}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(e,r,a){return void 0===e&&(e="div"),void 0===r&&(r={}),void 0===a&&(a={}),r.className||(r.className=this.buildCSSClass()),s.prototype.createEl.call(this,e,r,a)},n}(Y);Y.registerComponent("Spacer",Bl);var Up=function(s){function n(){return s.apply(this,arguments)||this}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xa0"})},n}(Bl);Y.registerComponent("CustomControlSpacer",Up);var ha=function(s){function n(){return s.apply(this,arguments)||this}return re(n,s),n.prototype.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},n}(Y);ha.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in z()&&ha.prototype.options_.children.splice(ha.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Y.registerComponent("ControlBar",ha);var jl=function(s){function n(i,e){var r;return(r=s.call(this,i,e)||this).on(i,"error",function(a){return r.open(a)}),r}re(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var e=this.player().error();return e?this.localize(e.message):""},n}(jr);jl.prototype.options_=gt({},jr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Y.registerComponent("ErrorDisplay",jl);var uo="vjs-text-track-settings",Hl=["#000","Black"],Vl=["#00F","Blue"],ql=["#0FF","Cyan"],Gl=["#0F0","Green"],Wl=["#F0F","Magenta"],Zl=["#F00","Red"],Kl=["#FFF","White"],zl=["#FF0","Yellow"],lo=["1","Opaque"],co=["0.5","Semi-Transparent"],Yl=["0","Transparent"],dr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Hl,Kl,Zl,Gl,Vl,zl,Wl,ql]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[lo,co,Yl]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Kl,Hl,Zl,Gl,Vl,zl,Wl,ql]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(n){return"1.00"===n?null:Number(n)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[lo,co]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Yl,co,lo]}};function $l(s,n){if(n&&(s=n(s)),s&&"none"!==s)return s}dr.windowColor.options=dr.backgroundColor.options;var Bp=function(s){function n(i,e){var r;return e.temporary=!1,(r=s.call(this,i,e)||this).updateDisplay=r.updateDisplay.bind(Ne(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=Ye("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===e.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",function(){r.saveSettings(),r.close()}),r.on(r.$(".vjs-default-button"),"click",function(){r.setDefaults(),r.updateDisplay()}),Or(dr,function(a){r.on(r.$(a.selector),"change",r.updateDisplay)}),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}re(n,s);var t=n.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(e,r,a){var o=this;void 0===r&&(r=""),void 0===a&&(a="label");var l=dr[e],d=l.id.replace("%s",this.id_),f=[r,d].join(" ").trim();return["<"+a+' id="'+d+'" class="'+("label"===a?"vjs-label":"")+'">',this.localize(l.label),"",'").join("")},t.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},t.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},t.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},t.createElColors_=function(){return Ye("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return Ye("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},t.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Ye("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var e=this;return function Ah(s,n,t){return void 0===t&&(t=0),ku(s).reduce(function(i,e){return n(i,s[e],e)},t)}(dr,function(r,a,o){var l=function Np(s,n){return $l(s.options[s.options.selectedIndex].value,n)}(e.$(a.selector),a.parser);return void 0!==l&&(r[o]=l),r},{})},t.setValues=function(e){var r=this;Or(dr,function(a,o){!function Fp(s,n,t){if(n)for(var i=0;ithis.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(d=!1),d!==this.behindLiveEdge_&&(this.behindLiveEdge_=d,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,fi),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var e=this.player_.seekable(),r=[],a=e?e.length:0;a--;)r.push(e.end(a));return r.length?r.sort()[r.length-1]:1/0},t.seekableStart=function(){for(var e=this.player_.seekable(),r=[],a=e?e.length:0;a--;)r.push(e.start(a));return r.length?r.sort()[0]:0},t.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return"number"==typeof this.trackingInterval_},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(z(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},n}(Y);Y.registerComponent("LiveTracker",Vp);var pa,fo=function(n){var t=n.el();if(t.hasAttribute("src"))return n.triggerSourceset(t.src),!0;var i=n.$$("source"),e=[],r="";if(!i.length)return!1;for(var a=0;a=2&&l.push("loadeddata"),e.readyState>=3&&l.push("canplay"),e.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(d){this.trigger(d)},this)})}},t.setScrubbing=function(e){this.isScrubbing_=e},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Qn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(r){Ke(r,"Video is not ready. (Video.js)")}},t.duration=function(){var e=this;return this.el_.duration===1/0&&Di&&Pi&&0===this.el_.currentTime?(this.on("timeupdate",function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))}),NaN):this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var r=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",r),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",r)})}},t.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=P().navigator&&P().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)yi(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(r){this.trigger("fullscreenerror",r)}},0);else try{e.webkitEnterFullScreen()}catch(r){this.trigger("fullscreenerror",r)}},t.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.reset=function(){n.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(e){this.el_.controls=!!e},t.addTextTrack=function(e,r,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,r,a):s.prototype.addTextTrack.call(this,e,r,a)},t.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,e);var r=z().createElement("track");return e.kind&&(r.kind=e.kind),e.label&&(r.label=e.label),(e.language||e.srclang)&&(r.srclang=e.language||e.srclang),e.default&&(r.default=e.default),e.id&&(r.id=e.id),e.src&&(r.src=e.src),r},t.addRemoteTextTrack=function(e,r){var a=s.prototype.addRemoteTextTrack.call(this,e,r);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(e){if(s.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var r=this.$$("track"),a=r.length;a--;)(e===r[a]||e===r[a].track)&&this.el().removeChild(r[a])},t.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),P().performance&&"function"==typeof P().performance.now?e.creationTime=P().performance.now():P().performance&&P().performance.timing&&"number"==typeof P().performance.timing.navigationStart&&(e.creationTime=P().Date.now()-P().performance.timing.navigationStart),e},n}(st);ho(be,"TEST_VID",function(){if(Rr()){var s=z().createElement("video"),n=z().createElement("track");return n.kind="captions",n.srclang="en",n.label="English",s.appendChild(n),s}}),be.isSupported=function(){try{be.TEST_VID.volume=.5}catch{return!1}return!(!be.TEST_VID||!be.TEST_VID.canPlayType)},be.canPlayType=function(s){return be.TEST_VID.canPlayType(s)},be.canPlaySource=function(s,n){return be.canPlayType(s.type)},be.canControlVolume=function(){try{var s=be.TEST_VID.volume;be.TEST_VID.volume=s/2+.1;var n=s!==be.TEST_VID.volume;return n&&Ht?(P().setTimeout(function(){be&&be.prototype&&(be.prototype.featuresVolumeControl=s!==be.TEST_VID.volume)}),!1):n}catch{return!1}},be.canMuteVolume=function(){try{var s=be.TEST_VID.muted;return be.TEST_VID.muted=!s,be.TEST_VID.muted?Ur(be.TEST_VID,"muted","muted"):Xn(be.TEST_VID,"muted"),s!==be.TEST_VID.muted}catch{return!1}},be.canControlPlaybackRate=function(){if(Di&&Pi&&Pu<58)return!1;try{var s=be.TEST_VID.playbackRate;return be.TEST_VID.playbackRate=s/2+.1,s!==be.TEST_VID.playbackRate}catch{return!1}},be.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(z().createElement("video"),"src",{get:s,set:s}),Object.defineProperty(z().createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(z().createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(z().createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0},be.supportsNativeTextTracks=function(){return Qn||Ht&&Pi},be.supportsNativeVideoTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.videoTracks)},be.supportsNativeAudioTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.audioTracks)},be.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var t=s[1];ho(be.prototype,s[0],function(){return be[t]()},!0)}),be.prototype.featuresVolumeControl=be.canControlVolume(),be.prototype.movingMediaElementInDOM=!Ht,be.prototype.featuresFullscreenResize=!0,be.prototype.featuresProgressEvents=!0,be.prototype.featuresTimeupdateEvents=!0,be.patchCanPlayType=function(){_s>=4&&!Du&&!Pi&&(pa=be.TEST_VID&&be.TEST_VID.constructor.prototype.canPlayType,be.TEST_VID.constructor.prototype.canPlayType=function(s){return s&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(s)?"maybe":pa.call(this,s)})},be.unpatchCanPlayType=function(){var s=be.TEST_VID.constructor.prototype.canPlayType;return pa&&(be.TEST_VID.constructor.prototype.canPlayType=pa),s},be.patchCanPlayType(),be.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch{}}()}},be.resetMediaElement=function(s){if(s){for(var n=s.querySelectorAll("source"),t=n.length;t--;)s.removeChild(n[t]);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch{}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n,n?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n}}),["pause","load","play"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]()}}),st.withSourceHandlers(be),be.nativeSourceHandler={},be.nativeSourceHandler.canPlayType=function(s){try{return be.TEST_VID.canPlayType(s)}catch{return""}},be.nativeSourceHandler.canHandleSource=function(s,n){if(s.type)return be.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=js(s.src);return be.nativeSourceHandler.canPlayType("video/"+t)}return""},be.nativeSourceHandler.handleSource=function(s,n,t){n.setSrc(s.src)},be.nativeSourceHandler.dispose=function(){},be.registerSourceHandler(be.nativeSourceHandler),st.registerTech("Html5",be);var Jl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],po={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},mo=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};mo.forEach(function(s){var n="x"===s.charAt(0)?"x-"+s.substring(1):s;ma[s]="vjs-layout-"+n});var zp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Et=function(s){function n(i,e,r){var a;if(i.id=i.id||e.id||"vjs_video_"+Zi(),(e=_t(n.getTagSettings(i),e)).initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if("function"==typeof i.closest){var o=i.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var l=i;l&&1===l.nodeType;){if(Li(l).hasOwnProperty("lang")){e.language=l.getAttribute("lang");break}l=l.parentNode}if((a=s.call(this,null,e,r)||this).boundDocumentFullscreenChange_=function(g){return a.documentFullscreenChange_(g)},a.boundFullWindowOnEscKey_=function(g){return a.fullWindowOnEscKey(g)},a.boundUpdateStyleEl_=function(g){return a.updateStyleEl_(g)},a.boundApplyInitTime_=function(g){return a.applyInitTime_(g)},a.boundUpdateCurrentBreakpoint_=function(g){return a.updateCurrentBreakpoint_(g)},a.boundHandleTechClick_=function(g){return a.handleTechClick_(g)},a.boundHandleTechDoubleClick_=function(g){return a.handleTechDoubleClick_(g)},a.boundHandleTechTouchStart_=function(g){return a.handleTechTouchStart_(g)},a.boundHandleTechTouchMove_=function(g){return a.handleTechTouchMove_(g)},a.boundHandleTechTouchEnd_=function(g){return a.handleTechTouchEnd_(g)},a.boundHandleTechTap_=function(g){return a.handleTechTap_(g)},a.isFullscreen_=!1,a.log=Cu(a.id_),a.fsApi_=Kn,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&Li(i),a.language(a.options_.language),e.languages){var d={};Object.getOwnPropertyNames(e.languages).forEach(function(g){d[g.toLowerCase()]=e.languages[g]}),a.languages_=d}else a.languages_=n.prototype.options_.languages;a.resetCache_(),a.poster_=e.poster||"",a.controls_=!!e.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(g){if("function"!=typeof a[g])throw new Error('plugin "'+g+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),Ps(Ne(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Xt(z(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var f=ct(a.options_);e.plugins&&Object.keys(e.plugins).forEach(function(g){a[g](e.plugins[g])}),e.debug&&a.debug(!0),a.options_.playerOptions=f,a.middleware_=[],a.playbackRates(e.playbackRates),a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Lr&&a.addClass("vjs-touch-enabled"),Ht||a.addClass("vjs-workinghover"),n.players[a.id_]=Ne(a);var v=bu.split(".")[0];return a.addClass("vjs-v"+v),a.userActive(!0),a.reportUserActivity(),a.one("play",function(g){return a.listenForUserActivity_(g)}),a.on("stageclick",function(g){return a.handleStageClick_(g)}),a.on("keydown",function(g){return a.handleKeyDown(g)}),a.on("languagechange",function(g){return a.handleLanguagechange(g)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}re(n,s);var t=n.prototype;return t.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Ut(z(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ut(z(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),n.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),function pp(s){Hs[s.id()]=null}(this),Gt.names.forEach(function(r){var o=e[Gt[r].getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this)},t.createEl=function(){var r,e=this.tag,a=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();a?r=this.el_=e.parentNode:o||(r=this.el_=s.prototype.createEl.call(this,"div"));var l=Li(e);if(o){for(r=this.el_=e,e=this.tag=z().createElement("video");r.children.length;)e.appendChild(r.firstChild);ar(r,"video-js")||Oi(r,"video-js"),r.appendChild(e),a=this.playerElIngest_=r,Object.keys(r).forEach(function(E){try{e[E]=r[E]}catch{}})}if(e.setAttribute("tabindex","-1"),l.tabindex="-1",(pn||Pi&&Ou)&&(e.setAttribute("role","application"),l.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(E){o&&"class"===E||r.setAttribute(E,l[E]),o&&e.setAttribute(E,l[E])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=r.player=this,this.addClass("vjs-paused"),!0!==P().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=zu("vjs-styles-dimensions");var d=Wi(".vjs-styles-defaults"),f=Wi("head");f.insertBefore(this.styleEl_,d?d.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var v=e.getElementsByTagName("a"),g=0;g0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),g=v[1]/v[0];o=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/g:this.videoWidth()||300,l=void 0!==this.height_?this.height_:o*g,f=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(f),Yu(this.styleEl_,"\n ."+f+" {\n width: "+o+"px;\n height: "+l+"px;\n }\n\n ."+f+".vjs-fluid {\n padding-top: "+100*g+"%;\n }\n ")}else{var e="number"==typeof this.width_?this.width_:this.options_.width,r="number"==typeof this.height_?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(e>=0&&(a.width=e),r>=0&&(a.height=r))}},t.loadTech_=function(e,r){var a=this;this.tech_&&this.unloadTech_();var o=bt(e),l=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==o&&this.tag&&(st.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var d=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(d=!1);var f={source:r,autoplay:d,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Gt.names.forEach(function(g){var T=Gt[g];f[T.getterName]=a[T.privateName]}),_t(f,this.options_[o]),_t(f,this.options_[l]),_t(f,this.options_[e.toLowerCase()]),this.tag&&(f.tag=this.tag),r&&r.src===this.cache_.src&&this.cache_.currentTime>0&&(f.startTime=this.cache_.currentTime);var v=st.getTech(e);if(!v)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new v(f),this.tech_.ready(at(this,this.handleTechReady_),!0),function(n,t){n.forEach(function(i){var e=t.addRemoteTextTrack(i).track;!i.src&&i.cues&&i.cues.forEach(function(r){return e.addCue(r)})}),t.textTracks()}(this.textTracksJson_||[],this.tech_),Jl.forEach(function(g){a.on(a.tech_,g,function(T){return a["handleTech"+bt(g)+"_"](T)})}),Object.keys(po).forEach(function(g){a.on(a.tech_,g,function(T){0===a.tech_.playbackRate()&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+po[g]+"_"].bind(a),event:T}):a["handleTech"+po[g]+"_"](T)})}),this.on(this.tech_,"loadstart",function(g){return a.handleTechLoadStart_(g)}),this.on(this.tech_,"sourceset",function(g){return a.handleTechSourceset_(g)}),this.on(this.tech_,"waiting",function(g){return a.handleTechWaiting_(g)}),this.on(this.tech_,"ended",function(g){return a.handleTechEnded_(g)}),this.on(this.tech_,"seeking",function(g){return a.handleTechSeeking_(g)}),this.on(this.tech_,"play",function(g){return a.handleTechPlay_(g)}),this.on(this.tech_,"firstplay",function(g){return a.handleTechFirstPlay_(g)}),this.on(this.tech_,"pause",function(g){return a.handleTechPause_(g)}),this.on(this.tech_,"durationchange",function(g){return a.handleTechDurationChange_(g)}),this.on(this.tech_,"fullscreenchange",function(g,T){return a.handleTechFullscreenChange_(g,T)}),this.on(this.tech_,"fullscreenerror",function(g,T){return a.handleTechFullscreenError_(g,T)}),this.on(this.tech_,"enterpictureinpicture",function(g){return a.handleTechEnterPictureInPicture_(g)}),this.on(this.tech_,"leavepictureinpicture",function(g){return a.handleTechLeavePictureInPicture_(g)}),this.on(this.tech_,"error",function(g){return a.handleTechError_(g)}),this.on(this.tech_,"posterchange",function(g){return a.handleTechPosterChange_(g)}),this.on(this.tech_,"textdata",function(g){return a.handleTechTextData_(g)}),this.on(this.tech_,"ratechange",function(g){return a.handleTechRateChange_(g)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&("Html5"!==o||!this.tag)&&xs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var e=this;Gt.names.forEach(function(r){var a=Gt[r];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=function(n){var t=n.$$("track"),i=Array.prototype.map.call(t,function(r){return r.track});return Array.prototype.map.call(t,function(r){var a=Rs(r.track);return r.src&&(a.src=r.src),a}).concat(Array.prototype.filter.call(n.textTracks(),function(r){return-1===i.indexOf(r)}).map(Rs))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(e){return void 0===e&&Ke.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(e){var r=this;if(this.tech_&&"string"==typeof e){var o,a=function(){var d=r.muted();r.muted(!0);var f=function(){r.muted(d)};r.playTerminatedQueue_.push(f);var v=r.play();if(yn(v))return v.catch(function(g){throw f(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(g||""))})};if("any"!==e||this.muted()?o="muted"!==e||this.muted()?this.play():a():yn(o=this.play())&&(o=o.catch(a)),yn(o))return o.then(function(){r.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){r.trigger({type:"autoplay-failure",autoplay:e})})}},t.updateSourceCaches_=function(e){void 0===e&&(e="");var r=e,a="";"string"!=typeof r&&(r=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],r&&!a&&(a=function(n,t){if(!t)return"";if(n.cache_.source.src===t&&n.cache_.source.type)return n.cache_.source.type;var i=n.cache_.sources.filter(function(o){return o.src===t});if(i.length)return i[0].type;for(var e=n.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var r=this.currentTime();this.on("timeupdate",function o(){r!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))})},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(Ke.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?yi(this.play()):this.pause())},t.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(e.target)})||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.doubleClick||!1!==this.options_.userActions.doubleClick)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(e){var r=e.target.player;if(!r||r===this){var a=this.el(),o=z()[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(e,r){var a=this;r&&(r.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(r.isFullscreen))},t.handleTechFullscreenError_=function(e,r){this.trigger("fullscreenerror",r)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(e,r){this.ready(function(){if(e in fp)return function dp(s,n,t,i){return n[t](s.reduce(Vs(t),i))}(this.middleware_,this.tech_,e,r);if(e in gl)return ml(this.middleware_,this.tech_,e,r);try{this.tech_&&this.tech_[e](r)}catch(a){throw Ke(a),a}},!0)},t.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in cp)return function lp(s,n,t){return s.reduceRight(Vs(t),n[t]())}(this.middleware_,this.tech_,e);if(e in gl)return ml(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(r){throw void 0===this.tech_[e]?(Ke("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",r),r):"TypeError"===r.name?(Ke("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",r),this.tech_.isReady_=!1,r):(Ke(r),r)}}},t.play=function(){var e=this,r=this.options_.Promise||P().Promise;return r?new r(function(a){e.play_(a)}):this.play_()},t.play_=function(e){var r=this;void 0===e&&(e=yi),this.playCallbacks_.push(e);var a=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(l){r.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&(Qn||Ht)&&this.load());var o=this.techGet_("play");null===o?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},t.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(r){r()})},t.runPlayCallbacks_=function(e){var r=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],r.forEach(function(a){a(e)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return!1!==this.techGet_("paused")},t.played=function(){return this.techGet_("played")||or(0,0)},t.scrubbing=function(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(e){return typeof e<"u"?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=or(0,0)),e},t.bufferedPercent=function(){return rl(this.buffered(),this.duration())},t.bufferedEnd=function(){var e=this.buffered(),r=this.duration(),a=e.end(e.length-1);return a>r&&(a=r),a},t.volume=function(e){var r;return void 0!==e?(r=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=r,this.techCall_("setVolume",r),void(r>0&&this.lastVolume_(r))):(r=parseFloat(this.techGet_("volume")),isNaN(r)?1:r)},t.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(e){if(void 0!==e){var r=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==r&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},t.requestFullscreen=function(e){var r=this.options_.Promise||P().Promise;if(r){var a=this;return new r(function(o,l){function d(){a.off("fullscreenerror",v),a.off("fullscreenchange",f)}function f(){d(),o()}function v(T,E){d(),l(E)}a.one("fullscreenchange",f),a.one("fullscreenerror",v);var g=a.requestFullscreenHelper_(e);g&&(g.then(d,d),g.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(e){var a,r=this;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(a=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return r.isFullscreen(!0)},function(){return r.isFullscreen(!1)}),o}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var e=this.options_.Promise||P().Promise;if(e){var r=this;return new e(function(a,o){function l(){r.off("fullscreenerror",f),r.off("fullscreenchange",d)}function d(){l(),a()}function f(g,T){l(),o(T)}r.one("fullscreenchange",d),r.one("fullscreenerror",f);var v=r.exitFullscreenHelper_();v&&(v.then(l,l),v.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var r=z()[this.fsApi_.exitFullscreen]();return r&&yi(r.then(function(){return e.isFullscreen(!1)})),r}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=z().documentElement.style.overflow,Xt(z(),"keydown",this.boundFullWindowOnEscKey_),z().documentElement.style.overflow="hidden",Oi(z().body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(e){De().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ut(z(),"keydown",this.boundFullWindowOnEscKey_),z().documentElement.style.overflow=this.docOrigOverflow,mn(z().body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in z()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in z())return z().exitPictureInPicture()},t.handleKeyDown=function(e){var l,d,r=this.options_.userActions;r&&r.hotkeys&&(d=(l=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),l.isContentEditable||("input"===d?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(l.type):-1!==["textarea"].indexOf(d))||("function"==typeof r.hotkeys?r.hotkeys.call(this,e):this.handleHotkeys(e)))},t.handleHotkeys=function(e){var r=this.options_.userActions?this.options_.userActions.hotkeys:{},a=r.fullscreenKey,l=r.muteKey,d=void 0===l?function(x){return De().isEventKey(x,"m")}:l,f=r.playPauseKey,v=void 0===f?function(x){return De().isEventKey(x,"k")||De().isEventKey(x,"Space")}:f;if((void 0===a?function(x){return De().isEventKey(x,"f")}:a).call(this,e)){e.preventDefault(),e.stopPropagation();var g=Y.getComponent("FullscreenToggle");!1!==z()[this.fsApi_.fullscreenEnabled]&&g.prototype.handleClick.call(this,e)}else d.call(this,e)?(e.preventDefault(),e.stopPropagation(),Y.getComponent("MuteToggle").prototype.handleClick.call(this,e)):v.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Y.getComponent("PlayToggle").prototype.handleClick.call(this,e))},t.canPlayType=function(e){for(var r,a=0,o=this.options_.techOrder;a"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=_p(e);if(o.length){if(this.changingSrc_=!0,r||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),op(this,o[0],function(f,v){if(a.middleware_=v,r||(a.cache_.sources=o),a.updateSourceCaches_(f),a.src_(f))return o.length>1?a.handleSrc_(o.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void a.triggerReady());!function up(s,n){s.forEach(function(t){return t.setTech&&t.setTech(n)})}(v,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},d=function(){a.off("error",l)};this.one("error",l),this.one("playing",d),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",d)}}}else this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},t.src=function(e){return this.handleSrc_(e,!1)},t.src_=function(e){var r=this,a=this.selectSource([e]);return!a||(function(n,t){return bt(n)===bt(t)}(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){r.changingSrc_=!1}),!1))},t.load=function(){this.techCall_("load")},t.reset=function(){var e=this,r=this.options_.Promise||P().Promise;this.paused()||!r?this.doReset_():yi(this.play().then(function(){return e.doReset_()}))},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Mi(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,r=e.durationDisplay,a=e.remainingTimeDisplay;r&&r.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var e=this.currentSource(),r=[];return 0!==Object.keys(e).length&&r.push(e),this.cache_.sources||r},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var r;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),r=!1):this.options_.autoplay=!!e,r=typeof r>"u"?this.options_.autoplay:r,this.tech_&&this.techCall_("setAutoplay",r)},t.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(e){var r=this;if(void 0===e)return this.error_||null;if(Gi("beforeerror").forEach(function(o){var l=o(r,e);Ii(l)&&!Array.isArray(l)||"string"==typeof l||"number"==typeof l||null===l?e=l:r.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){var a=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new qt(e),this.addClass("vjs-error"),Ke.error("(CODE:"+this.error_.code+" "+qt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Gi("error").forEach(function(o){return o(r,r.error_)})},t.reportUserActivity=function(e){this.userActivity_=!0},t.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(r){r.stopPropagation(),r.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var e,r,a,o=at(this,this.reportUserActivity),f=function(E){o(),this.clearInterval(e)};this.on("mousedown",function(){o(),this.clearInterval(e),e=this.setInterval(o,250)}),this.on("mousemove",function(E){(E.screenX!==r||E.screenY!==a)&&(r=E.screenX,a=E.screenY,o())}),this.on("mouseup",f),this.on("mouseleave",f);var g,v=this.getChild("controlBar");v&&!Ht&&!Di&&(v.on("mouseenter",function(T){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),v.on("mouseleave",function(T){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);var T=this.options_.inactivityTimeout;T<=0||(g=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},T))}},250)},t.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.addTextTrack=function(e,r,a){if(this.tech_)return this.tech_.addTextTrack(e,r,a)},t.addRemoteTextTrack=function(e,r){if(this.tech_)return this.tech_.addRemoteTextTrack(e,r)},t.removeRemoteTextTrack=function(e){void 0===e&&(e={});var a=e.track;if(a||(a=e),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Mi(this)&&this.trigger("languagechange"))},t.languages=function(){return ct(n.prototype.options_.languages,this.languages_)},t.toJSON=function(){var e=ct(this.options_),r=e.tracks;e.tracks=[];for(var a=0;a"):function(){}},Ki=1/30,bi=.1,rd=function(n,t){var e,i=[];if(n&&n.length)for(e=0;e=t})},xa=function(n,t){return rd(n,function(i){return i-Ki>=t})},nd=function(n){var t=[];if(!n||!n.length)return"";for(var i=0;i "+n.end(i));return t.join(", ")},cr=function(n){for(var t=[],i=0;ia)){if(t>r&&t<=a){i+=a-t;continue}i+=a-r}}return i},sd=U.createTimeRange,_o=function(n,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(e){"PART"===e.type&&(i+=n.partTargetDuration)}),i},yo=function(n){return(n.segments||[]).reduce(function(t,i,e){return i.parts?i.parts.forEach(function(r,a){t.push({duration:r.duration,segmentIndex:e,partIndex:a,part:r,segment:i})}):t.push({duration:i.duration,segmentIndex:e,partIndex:null,segment:i,part:null}),t},[])},od=function(n){var t=n.segments&&n.segments.length&&n.segments[n.segments.length-1];return t&&t.parts||[]},ud=function(n){var t=n.preloadSegment;if(t){var i=t.parts;return(t.preloadHints||[]).reduce(function(a,o){return a+("PART"===o.type?1:0)},0)+(i&&i.length?i.length:0)}},ld=function(n,t){if(t.endList)return 0;if(n&&n.suggestedPresentationDelay)return n.suggestedPresentationDelay;var i=od(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},dd=function(n,t,i){if(typeof t>"u"&&(t=n.mediaSequence+n.segments.length),t"u"){if(n.totalDuration)return n.totalDuration;if(!n.endList)return P()[1/0]}return dd(n,t,i)},En=function(n){var t=n.defaultDuration,i=n.durationList,e=n.startIndex,r=n.endIndex,a=0;if(e>r){var o=[r,e];e=o[0],r=o[1]}if(e<0){for(var l=e;lDate.now()},To=function(n){return n.excludeUntil&&n.excludeUntil===1/0},Sa=function(n){var t=hd(n);return!n.disabled&&!t},pd=function(n,t){return t.attributes&&t.attributes[n]},bo=function(n,t){if(1===n.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===n.playlists.filter(function(e){return!!Sa(e)&&(e.attributes.BANDWIDTH||0)0)for(var T=f-1;T>=0;T--){var E=d[T];if(l+=E.duration,o){if(l<0)continue}else if(l+Ki<=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a-En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:T})}}return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:i}}if(f<0){for(var x=f;x<0;x++)if((l-=t.targetDuration)<0)return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:i};f=0}for(var S=f;S0)continue}else if(l-Ki>=0)continue;return{partIndex:N.partIndex,segmentIndex:N.segmentIndex,startTime:a+En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:S})}}return{segmentIndex:d[d.length-1].segmentIndex,partIndex:d[d.length-1].partIndex,startTime:i}},isEnabled:Sa,isDisabled:function(n){return n.disabled},isBlacklisted:hd,isIncompatible:To,playlistEnd:fd,isAes:function(n){for(var t=0;t-1&&o!==a.length-1&&(i._HLS_part=o),(o>-1||a.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var l=new(P().URL)(n);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(d){i.hasOwnProperty(d)&&l.searchParams.set(d,i[d])}),n=l.toString()}return n}(a,r)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},t.playlistRequestError=function(e,r,a){var o=r.uri,l=r.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(e){var r=this,a=e.url;return function(n){var t=n.onwarn,i=n.oninfo,e=n.manifestString,r=n.customTagParsers,a=void 0===r?[]:r,o=n.customTagMappers,l=void 0===o?[]:o,d=n.experimentalLLHLS,f=new tf;t&&f.on("warn",t),i&&f.on("info",i),a.forEach(function(x){return f.addParser(x)}),l.forEach(function(x){return f.addTagMapper(x)}),f.push(e),f.end();var v=f.manifest;if(d||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(x){v.hasOwnProperty(x)&&delete v[x]}),v.segments&&v.segments.forEach(function(x){["parts","preloadHints"].forEach(function(S){x.hasOwnProperty(S)&&delete x[S]})})),!v.targetDuration){var g=10;v.segments&&v.segments.length&&(g=v.segments.reduce(function(x,S){return Math.max(x,S.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+g),v.targetDuration=g}var T=od(v);if(T.length&&!v.partTargetDuration){var E=T.reduce(function(x,S){return Math.max(x,S.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+E),gd.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),v.partTargetDuration=E}return v}({onwarn:function(d){return r.logger_("m3u8-parser warn for "+a+": "+d.message)},oninfo:function(d){return r.logger_("m3u8-parser info for "+a+": "+d.message)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(e){var r=e.playlistString,a=e.playlistObject,o=e.url,l=e.id;this.request=null,this.state="HAVE_METADATA";var d=a||this.parseManifest_({url:o,manifestString:r});d.lastRequest=Date.now(),vd({playlist:d,uri:o,id:l});var f=Eo(this.master,d);this.targetDuration=d.partTargetDuration||d.targetDuration,this.pendingMedia_=null,f?(this.master=f,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!f)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),P().clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e,r){var a=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(P().clearTimeout(this.finalRenditionTimeout),r){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=P().setTimeout(this.media.bind(this,e,!1),o)}else{var l=this.state,d=!this.media_||e.id!==this.media_.id,f=this.master.playlists[e.id];if(f&&f.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(d&&(this.trigger("mediachanging"),this.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),d){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(v,g){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=ba(a.handleManifestRedirects,e.resolvedUri,g),v)return a.playlistRequestError(a.request,e,l);a.haveMetadata({playlistString:g.responseText,url:e.uri,id:e.id}),a.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")}})}}},t.pause=function(){this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},t.load=function(e){var r=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){r.mediaUpdateTimeout=null,r.load()},o)}else this.started?this.trigger(a&&!a.endList?"mediaupdatetimeout":"loadedplaylist"):this.start()},t.updateMediaUpdateTimeout_=function(e){var r=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=P().setTimeout(function(){r.mediaUpdateTimeout=null,r.trigger("mediaupdatetimeout"),r.updateMediaUpdateTimeout_(e)},e))},t.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=P().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(r,a){if(e.request){if(e.request=null,r)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=ba(e.handleManifestRedirects,e.src,a);var o=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(o)}})},t.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},t.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,_d(this.master,this.srcUri()),e.playlists.forEach(function(a){a.segments=Td(a),a.segments.forEach(function(o){yd(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var r=this.srcUri()||P().location.href;this.master=function(n,t){var i=So(0,t),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:P().location.href,resolvedUri:P().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return e.playlists[i]=e.playlists[0],e.playlists[t]=e.playlists[0],e}(0,r),this.haveMetadata({playlistObject:e,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},n}(U.EventTarget),gm=U.xhr,vm=U.mergeOptions,ko=function(n,t,i,e){var r="arraybuffer"===n.responseType?n.response:n.responseText;!t&&r&&(n.responseTime=Date.now(),n.roundTripTime=n.responseTime-n.requestTime,n.bytesReceived=r.byteLength||r.length,n.bandwidth||(n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3))),i.headers&&(n.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(n.timedout=!0),!t&&!n.aborted&&200!==i.statusCode&&206!==i.statusCode&&0!==i.statusCode&&(t=new Error("XHR Failed with a response of: "+(n&&(r||n.responseText)))),e(t,n)},xd=function(){var n=function t(i,e){i=vm({timeout:45e3},i);var r=t.beforeRequest||U.Vhs.xhr.beforeRequest;if(r&&"function"==typeof r){var a=r(i);a&&(i=a)}var l=(!0===U.Vhs.xhr.original?gm:U.Vhs.xhr)(i,function(f,v){return ko(l,f,v,e)}),d=l.abort;return l.abort=function(){return l.aborted=!0,d.apply(l,arguments)},l.uri=i.uri,l.requestTime=Date.now(),l};return n.original=!0,n},Ao=function(n){var t={};return n.byterange&&(t.Range=function(n){return"bytes="+n.offset+"-"+("bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1)}(n.byterange)),t},ym=function(n,t){return n.start(t)+"-"+n.end(t)},Tm=function(n,t){var i=n.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},bm=function(n){return n>=32&&n<126?String.fromCharCode(n):"."},Sd=function(n){var t={};return Object.keys(n).forEach(function(i){var e=n[i];t[i]=ArrayBuffer.isView(e)?{bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:e}),t},Ca=function(n){var t=n.byterange||{length:1/0,offset:0};return[t.length,t.offset,n.resolvedUri].join(",")},Ed=function(n){return n.resolvedUri},Cd=function(n){for(var t=Array.prototype.slice.call(n),i=16,e="",o=0;o"u"||!i||!a)return f({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!d.hasStarted_)return f({message:"player must be playing a live stream to start buffering"});if(!function(n){if(!n.segments||0===n.segments.length)return!1;for(var t=0;tnew Date(l.getTime()+1e3*d)?null:(i>l&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:Yt.duration(t,t.mediaSequence+t.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})}(t,i);if(!v)return f({message:t+" was not found in the stream"});var g=v.segment,T=function(n,t){var i,e;try{i=new Date(n),e=new Date(t)}catch{}var r=i.getTime();return(e.getTime()-r)/1e3}(g.dateTimeObject,t);if("estimate"===v.type)return 0===r?f({message:t+" is not buffered yet. Try again"}):(a(v.estimatedStart+T),void d.one("seeked",function(){s({programTime:t,playlist:i,retryCount:r-1,seekTo:a,pauseAfterSeek:l,tech:d,callback:f})}));var E=g.start+T;d.one("seeked",function(){return f(null,d.currentTime())}),l&&d.pause(),a(E)},wo=function(n,t){if(4===n.readyState)return t()},Ad=U.mergeOptions,wd=function(n,t){if(!bd(n,t)||n.sidx&&t.sidx&&(n.sidx.offset!==t.sidx.offset||n.sidx.length!==t.sidx.length))return!1;if(!n.sidx&&t.sidx||n.sidx&&!t.sidx||n.segments&&!t.segments||!n.segments&&t.segments)return!1;if(!n.segments&&!t.segments)return!0;for(var i=0;i=N+S)return f(v,{response:E.subarray(S,S+N),status:g.status,uri:g.uri});o.request=o.vhs_.xhr({uri:d,responseType:"arraybuffer",headers:Ao({byterange:e.sidx.byterange})},f)})}else this.mediaRequest_=P().setTimeout(function(){return a(!1)},0)},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},P().clearTimeout(this.minimumUpdatePeriodTimeout_),P().clearTimeout(this.mediaRequest_),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e){var r=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var o=!this.media_||e.id!==this.media_.id;if(o&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(o&&(this.trigger("mediachanging"),this.trigger("mediachange")));o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,a,function(l){r.haveMetadata({startingState:a,playlist:e})}))},t.haveMetadata=function(e){var r=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),this.trigger("HAVE_MASTER"===r?"loadedmetadata":"mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(P().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},t.load=function(e){var r=this;P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){return r.load()},o)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},t.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(r,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=P().setTimeout(function(){return e.haveMaster_()},0)},t.requestMaster_=function(e){var r=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(!r.requestErrored_(a,o)){var l=o.responseText!==r.masterPlaylistLoader_.masterXml_;return r.masterPlaylistLoader_.masterXml_=o.responseText,r.masterLoaded_=o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):Date.now(),r.masterPlaylistLoader_.srcUrl=ba(r.handleManifestRedirects,r.masterPlaylistLoader_.srcUrl,o),l?(r.handleMaster_(),void r.syncClientServerClock_(function(){return e(o,l)})):e(o,l)}"HAVE_NOTHING"===r.state&&(r.started=!1)})},t.syncClientServerClock_=function(e){var r=this,a=function(n){return function(n){var t=Tt(n,"UTCTiming")[0];if(!t)return null;var i=Mt(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i}(mu(n))}(this.masterPlaylistLoader_.masterXml_);return null===a?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===a.method?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:pi(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(r.request){if(o)return r.masterPlaylistLoader_.clientOffset_=r.masterLoaded_-Date.now(),e();var d;d="HEAD"===a.method?l.responseHeaders&&l.responseHeaders.date?Date.parse(l.responseHeaders.date):r.masterLoaded_:Date.parse(l.responseText),r.masterPlaylistLoader_.clientOffset_=d-Date.now(),e()}}))},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,r=function(n){var i=n.srcUrl,o=function(n,t){void 0===t&&(t={});var i=function(n,t){void 0===t&&(t={});var i=t,e=i.manifestUri,r=void 0===e?"":e,a=i.NOW,o=void 0===a?Date.now():a,l=i.clientOffset,d=void 0===l?0:l,f=Tt(n,"Period");if(!f.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var v=Tt(n,"Location"),g=Mt(n),T=Wn([r],Tt(n,"BaseURL"));g.type=g.type||"static",g.sourceDuration=g.mediaPresentationDuration||0,g.NOW=o,g.clientOffset=d,v.length&&(g.locations=v.map(ls));var E=[];return f.forEach(function(x,S){var N=Mt(x),F=E[S-1];N.start=function(n){var t=n.attributes,i=n.priorPeriodAttributes;return"number"==typeof t.start?t.start:i&&"number"==typeof i.start&&"number"==typeof i.duration?i.start+i.duration:i||"static"!==n.mpdType?null:0}({attributes:N,priorPeriodAttributes:F?F.attributes:null,mpdType:g.type}),E.push({node:x,attributes:N})}),{locations:g.locations,representationInfo:qn(E.map(Hf(g,T)))}}(mu(n),t),e=function(n){return n.map(Lf)}(i.representationInfo);return Cf({dashPlaylists:e,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}(n.masterXml,{manifestUri:i,clientOffset:n.clientOffset,sidxMapping:n.sidxMapping,previousManifest:n.previousManifest});return _d(o,i),o}({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(r=function(n,t,i){for(var e=!0,r=Ad(n,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a-1)},this.trigger=function(p){var h,m,_,y;if(h=c[p])if(2===arguments.length)for(_=h.length,m=0;m<_;++m)h[m].call(this,arguments[1]);else{for(y=[],m=arguments.length,m=1;m"u")){for(b in Pe)Pe.hasOwnProperty(b)&&(Pe[b]=[b.charCodeAt(0),b.charCodeAt(1),b.charCodeAt(2),b.charCodeAt(3)]);ot=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),Je=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Nt=new Uint8Array([0,0,0,1]),fr=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ai=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),si={video:fr,audio:ai},hr=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Fi=new Uint8Array([0,0,0,0,0,0,0,0]),Bi=new Uint8Array([0,0,0,0,0,0,0,0]),pr=Bi,mr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),gc=Bi,Ei=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(c){var m,_,p=[],h=0;for(m=1;m>>1,c.samplingfrequencyindex<<7|c.channelcount<<3,6,1,2]))},d=function(){return a(Pe.ftyp,ot,Nt,ot,Je)},q=function(c){return a(Pe.hdlr,si[c])},f=function(c){return a(Pe.mdat,c)},G=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,c.duration>>>24&255,c.duration>>>16&255,c.duration>>>8&255,255&c.duration,85,196,0,0]);return c.samplerate&&(p[12]=c.samplerate>>>24&255,p[13]=c.samplerate>>>16&255,p[14]=c.samplerate>>>8&255,p[15]=255&c.samplerate),a(Pe.mdhd,p)},j=function(c){return a(Pe.mdia,G(c),q(c.type),g(c))},v=function(c){return a(Pe.mfhd,new Uint8Array([0,0,0,0,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c]))},g=function(c){return a(Pe.minf,"video"===c.type?a(Pe.vmhd,Ei):a(Pe.smhd,Fi),o(),he(c))},T=function(c,p){for(var h=[],m=p.length;m--;)h[m]=ye(p[m]);return a.apply(null,[Pe.moof,v(c)].concat(h))},E=function(c){for(var p=c.length,h=[];p--;)h[p]=N(c[p]);return a.apply(null,[Pe.moov,S(4294967295)].concat(h).concat(x(c)))},x=function(c){for(var p=c.length,h=[];p--;)h[p]=ge(c[p]);return a.apply(null,[Pe.mvex].concat(h))},S=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(Pe.mvhd,p)},ne=function(c){var m,_,p=c.samples||[],h=new Uint8Array(4+p.length);for(_=0;_>>8),y.push(255&m[I].byteLength),y=y.concat(Array.prototype.slice.call(m[I]));for(I=0;I<_.length;I++)k.push((65280&_[I].byteLength)>>>8),k.push(255&_[I].byteLength),k=k.concat(Array.prototype.slice.call(_[I]));if(L=[Pe.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&h.width)>>8,255&h.width,(65280&h.height)>>8,255&h.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(Pe.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([m.length],y,[_.length],k))),a(Pe.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var O=h.sarRatio[0],M=h.sarRatio[1];L.push(a(Pe.pasp,new Uint8Array([(4278190080&O)>>24,(16711680&O)>>16,(65280&O)>>8,255&O,(4278190080&M)>>24,(16711680&M)>>16,(65280&M)>>8,255&M])))}return a.apply(null,L)},c=function(h){return a(Pe.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&h.channelcount)>>8,255&h.channelcount,(65280&h.samplesize)>>8,255&h.samplesize,0,0,0,0,(65280&h.samplerate)>>8,255&h.samplerate,0,0]),l(h))},F=function(c){var p=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,0,(4278190080&c.duration)>>24,(16711680&c.duration)>>16,(65280&c.duration)>>8,255&c.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&c.width)>>8,255&c.width,0,0,(65280&c.height)>>8,255&c.height,0,0]);return a(Pe.tkhd,p)},ye=function(c){var p,h,m,_,k,I;return p=a(Pe.tfhd,new Uint8Array([0,0,0,58,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),k=Math.floor(c.baseMediaDecodeTime/r),I=Math.floor(c.baseMediaDecodeTime%r),h=a(Pe.tfdt,new Uint8Array([1,0,0,0,k>>>24&255,k>>>16&255,k>>>8&255,255&k,I>>>24&255,I>>>16&255,I>>>8&255,255&I])),"audio"===c.type?(m=$e(c,92),a(Pe.traf,p,h,m)):(_=ne(c),m=$e(c,_.length+92),a(Pe.traf,p,h,m,_))},N=function(c){return c.duration=c.duration||4294967295,a(Pe.trak,F(c),j(c))},ge=function(c){var p=new Uint8Array([0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==c.type&&(p[p.length-1]=0),a(Pe.trex,p)},function(){var b,c,p;p=function(m,_){var y=0,k=0,I=0,L=0;return m.length&&(void 0!==m[0].duration&&(y=1),void 0!==m[0].size&&(k=2),void 0!==m[0].flags&&(I=4),void 0!==m[0].compositionTimeOffset&&(L=8)),[0,0,y|k|I|L,1,(4278190080&m.length)>>>24,(16711680&m.length)>>>16,(65280&m.length)>>>8,255&m.length,(4278190080&_)>>>24,(16711680&_)>>>16,(65280&_)>>>8,255&_]},c=function(m,_){var y,k,I,L,O,M;for(I=p(L=m.samples||[],_+=20+16*L.length),(k=new Uint8Array(I.length+16*L.length)).set(I),y=I.length,M=0;M>>24,k[y++]=(16711680&O.duration)>>>16,k[y++]=(65280&O.duration)>>>8,k[y++]=255&O.duration,k[y++]=(4278190080&O.size)>>>24,k[y++]=(16711680&O.size)>>>16,k[y++]=(65280&O.size)>>>8,k[y++]=255&O.size,k[y++]=O.flags.isLeading<<2|O.flags.dependsOn,k[y++]=O.flags.isDependedOn<<6|O.flags.hasRedundancy<<4|O.flags.paddingValue<<1|O.flags.isNonSyncSample,k[y++]=61440&O.flags.degradationPriority,k[y++]=15&O.flags.degradationPriority,k[y++]=(4278190080&O.compositionTimeOffset)>>>24,k[y++]=(16711680&O.compositionTimeOffset)>>>16,k[y++]=(65280&O.compositionTimeOffset)>>>8,k[y++]=255&O.compositionTimeOffset;return a(Pe.trun,k)},b=function(m,_){var y,k,I,L,O,M;for(I=p(L=m.samples||[],_+=20+8*L.length),(y=new Uint8Array(I.length+8*L.length)).set(I),k=I.length,M=0;M>>24,y[k++]=(16711680&O.duration)>>>16,y[k++]=(65280&O.duration)>>>8,y[k++]=255&O.duration,y[k++]=(4278190080&O.size)>>>24,y[k++]=(16711680&O.size)>>>16,y[k++]=(65280&O.size)>>>8,y[k++]=255&O.size;return a(Pe.trun,y)},$e=function(m,_){return"audio"===m.type?b(m,_):c(m,_)}}();var Vo,Go,Wo,Na,Zo,_c,yc,Tc,Dn_mdat=f,Dn_moof=T,vc=function(c,p){var h={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return h.dataOffset=p,h.compositionTimeOffset=c.pts-c.dts,h.duration=c.duration,h.size=4*c.length,h.size+=c.byteLength,c.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},zi=[33,16,5,32,164,27],Ho=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],et=function(c){for(var p=[];c--;)p.push(0);return p};Go=function(c){return 9e4*c},Wo=function(c,p){return c*p},Na=function(c){return c/9e4},Zo=function(c,p){return c/p},_c=function(c,p){return Go(Zo(c,p))},yc=function(c,p){return Wo(Na(c),p)},Tc=function(c,p,h){return Na(h?c:c-p)};var Qe_secondsToVideoTs=Go,Qe_videoTsToSeconds=Na,Qe_audioTsToVideoTs=_c,Qe_videoTsToAudioTs=yc,Qe_metadataTsToSeconds=Tc,Fa_prefixWithSilence=function(c,p,h,m){var _,O,M,W,y=0,k=0,I=0,L=0;if(p.length&&(_=Qe_audioTsToVideoTs(c.baseMediaDecodeTime,c.samplerate),y=Math.ceil(9e4/(c.samplerate/1024)),h&&m&&(k=_-Math.max(h,m),L=(I=Math.floor(k/y))*y),!(I<1||L>45e3))){for((O=function(){if(!Vo){var c={96e3:[zi,[227,64],et(154),[56]],88200:[zi,[231],et(170),[56]],64e3:[zi,[248,192],et(240),[56]],48e3:[zi,[255,192],et(268),[55,148,128],et(54),[112]],44100:[zi,[255,192],et(268),[55,163,128],et(84),[112]],32e3:[zi,[255,192],et(268),[55,234],et(226),[112]],24e3:[zi,[255,192],et(268),[55,255,128],et(268),[111,112],et(126),[224]],16e3:[zi,[255,192],et(268),[55,255,128],et(268),[111,255],et(269),[223,108],et(195),[1,192]],12e3:[Ho,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,253,128],et(259),[56]],11025:[Ho,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,255,192],et(268),[55,175,128],et(108),[112]],8e3:[Ho,et(268),[3,121,16],et(47),[7]]};Vo=function(c){return Object.keys(c).reduce(function(p,h){return p[h]=new Uint8Array(c[h].reduce(function(m,_){return m.concat(_)},[])),p},{})}(c)}return Vo}()[c.samplerate])||(O=p[0].data),M=0;M=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(b),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ji.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ji.prototype.addText=function(b){this.rows[this.rowIdx]+=b},ji.prototype.backspace=function(){if(!this.isEmpty()){var b=this.rows[this.rowIdx];this.rows[this.rowIdx]=b.substr(0,b.length-1)}};var ja=function(c,p,h){this.serviceNum=c,this.text="",this.currentWindow=new ji(-1),this.windows=[],this.stream=h,"string"==typeof p&&this.createTextDecoder(p)};ja.prototype.init=function(b,c){this.startPts=b;for(var p=0;p<8;p++)this.windows[p]=new ji(p),"function"==typeof c&&(this.windows[p].beforeRowOverflow=c)},ja.prototype.setCurrentWindow=function(b){this.currentWindow=this.windows[b]},ja.prototype.createTextDecoder=function(b){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(b)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+b+" encoding. "+c})}};var ut=function b(c){c=c||{},b.prototype.init.call(this);var _,p=this,h=c.captionServices||{},m={};Object.keys(h).forEach(function(y){_=h[y],/^SERVICE/.test(y)&&(m[y]=_.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(y){3===y.type?(p.new708Packet(),p.add708Bytes(y)):(null===p.current708Packet&&p.new708Packet(),p.add708Bytes(y))}};ut.prototype=new n,ut.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ut.prototype.add708Bytes=function(b){var c=b.ccData,p=c>>>8,h=255&c;this.current708Packet.ptsVals.push(b.pts),this.current708Packet.data.push(p),this.current708Packet.data.push(h)},ut.prototype.push708Packet=function(){var b=this.current708Packet,c=b.data,p=null,h=null,m=0,_=c[m++];for(b.seq=_>>6,b.sizeCode=63&_;m>5)&&h>0&&(p=_=c[m++]),this.pushServiceBlock(p,m,h),h>0&&(m+=h-1)},ut.prototype.pushServiceBlock=function(b,c,p){var h,m=c,_=this.current708Packet.data,y=this.services[b];for(y||(y=this.initService(b,m));m>5,_.rowLock=(16&h)>>4,_.columnLock=(8&h)>>3,_.priority=7&h,h=p[++b],_.relativePositioning=(128&h)>>7,_.anchorVertical=127&h,h=p[++b],_.anchorHorizontal=h,h=p[++b],_.anchorPoint=(240&h)>>4,_.rowCount=15&h,h=p[++b],_.columnCount=63&h,h=p[++b],_.windowStyle=(56&h)>>3,_.penStyle=7&h,_.virtualRowCount=_.rowCount+1,b},ut.prototype.setWindowAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.winAttr;return h=p[++b],m.fillOpacity=(192&h)>>6,m.fillRed=(48&h)>>4,m.fillGreen=(12&h)>>2,m.fillBlue=3&h,h=p[++b],m.borderType=(192&h)>>6,m.borderRed=(48&h)>>4,m.borderGreen=(12&h)>>2,m.borderBlue=3&h,h=p[++b],m.borderType+=(128&h)>>5,m.wordWrap=(64&h)>>6,m.printDirection=(48&h)>>4,m.scrollDirection=(12&h)>>2,m.justify=3&h,h=p[++b],m.effectSpeed=(240&h)>>4,m.effectDirection=(12&h)>>2,m.displayEffect=3&h,b},ut.prototype.flushDisplayed=function(b,c){for(var p=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&p.push(c.windows[h].getText());c.endPts=b,c.text=p.join("\n\n"),this.pushCaption(c),c.startPts=b},ut.prototype.pushCaption=function(b){""!==b.text&&(this.trigger("data",{startPts:b.startPts,endPts:b.endPts,text:b.text,stream:"cc708_"+b.serviceNum}),b.text="",b.startPts=b.endPts)},ut.prototype.displayWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=1);return b},ut.prototype.hideWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=0);return b},ut.prototype.toggleWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible^=1);return b},ut.prototype.clearWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].clearText();return b},ut.prototype.deleteWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].reset();return b},ut.prototype.setPenAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penAttr;return h=p[++b],m.textTag=(240&h)>>4,m.offset=(12&h)>>2,m.penSize=3&h,h=p[++b],m.italics=(128&h)>>7,m.underline=(64&h)>>6,m.edgeType=(56&h)>>3,m.fontStyle=7&h,b},ut.prototype.setPenColor=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penColor;return h=p[++b],m.fgOpacity=(192&h)>>6,m.fgRed=(48&h)>>4,m.fgGreen=(12&h)>>2,m.fgBlue=3&h,h=p[++b],m.bgOpacity=(192&h)>>6,m.bgRed=(48&h)>>4,m.bgGreen=(12&h)>>2,m.bgBlue=3&h,h=p[++b],m.edgeRed=(48&h)>>4,m.edgeGreen=(12&h)>>2,m.edgeBlue=3&h,b},ut.prototype.setPenLocation=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=p[++b],m.row=15&h,h=p[++b],m.column=63&h,b},ut.prototype.reset=function(b,c){var p=this.getPts(b);return this.flushDisplayed(p,c),this.initService(c.serviceNum,b)};var ay={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ha=function(c){return null===c?"":(c=ay[c]||c,String.fromCharCode(c))},sy=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],gr=function(){for(var c=[],p=15;p--;)c.push("");return c},mt=function b(c,p){b.prototype.init.call(this),this.field_=c||0,this.dataChannel_=p||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(h){var m,_,y,k,I;if((m=32639&h.ccData)!==this.lastControlCode_){if(4096==(61440&m)?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),y=m>>>8,k=255&m,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),_=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=_,this.startPts_=h.pts;else if(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(m===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=gr();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=gr();else if(m===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(h.pts),this.displayed_=gr()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(y,k))I=Ha((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isExtCharacter(y,k))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),I=Ha((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isMidRowCode(y,k))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,14==(14&k)&&this.addFormatting(h.pts,["i"]),1==(1&k)&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(y,k))this.column_+=3&k;else if(this.isPAC(y,k)){var L=sy.indexOf(7968&m);"rollUp"===this.mode_&&(L-this.rollUpRows_+1<0&&(L=this.rollUpRows_-1),this.setRollUp(h.pts,L)),L!==this.row_&&(this.clearFormatting(h.pts),this.row_=L),1&k&&-1===this.formatting_.indexOf("u")&&this.addFormatting(h.pts,["u"]),16==(16&m)&&(this.column_=4*((14&m)>>1)),this.isColorPAC(k)&&14==(14&k)&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(y)&&(0===k&&(k=null),I=Ha(y),I+=Ha(k),this[this.mode_](h.pts,I),this.column_+=I.length)}else this.lastControlCode_=null}};mt.prototype=new n,mt.prototype.flushDisplayed=function(b){var c=this.displayed_.map(function(p,h){try{return p.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");c.length&&this.trigger("data",{startPts:this.startPts_,endPts:b,text:c,stream:this.name_})},mt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=gr(),this.nonDisplayed_=gr(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},mt.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},mt.prototype.isSpecialCharacter=function(b,c){return b===this.EXT_&&c>=48&&c<=63},mt.prototype.isExtCharacter=function(b,c){return(b===this.EXT_+1||b===this.EXT_+2)&&c>=32&&c<=63},mt.prototype.isMidRowCode=function(b,c){return b===this.EXT_&&c>=32&&c<=47},mt.prototype.isOffsetControlCode=function(b,c){return b===this.OFFSET_&&c>=33&&c<=35},mt.prototype.isPAC=function(b,c){return b>=this.BASE_&&b=64&&c<=127},mt.prototype.isColorPAC=function(b){return b>=64&&b<=79||b>=96&&b<=127},mt.prototype.isNormalChar=function(b){return b>=32&&b<=127},mt.prototype.setRollUp=function(b,c){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(b),this.nonDisplayed_=gr(),this.displayed_=gr()),void 0!==c&&c!==this.row_)for(var p=0;p"},"");this[this.mode_](b,p)},mt.prototype.clearFormatting=function(b){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(p,h){return p+""},"");this.formatting_=[],this[this.mode_](b,c)}},mt.prototype.popOn=function(b,c){var p=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=p+=c},mt.prototype.rollUp=function(b,c){var p=this.displayed_[this.row_];this.displayed_[this.row_]=p+=c},mt.prototype.shiftRowsUp_=function(){var b;for(b=0;bp&&(h=-1);Math.abs(p-c)>4294967296;)c+=8589934592*h;return c},Sc=function b(c){var p,h;b.prototype.init.call(this),this.type_=c||"shared",this.push=function(m){"shared"!==this.type_&&m.type!==this.type_||(void 0===h&&(h=m.dts),m.dts=Ko(m.dts,h),m.pts=Ko(m.pts,h),p=m.dts,this.trigger("data",m))},this.flush=function(){h=p,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,p=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Sc.prototype=new n;var Za,Ec_TimestampRolloverStream=Sc,Ec_handleRollover=Ko,Cc=function(c,p,h){var m,_="";for(m=p;m>>2;ae*=4,M.timeStamp=ae+=3&Se[7],void 0===I.pts&&void 0===I.dts&&(I.pts=M.timeStamp,I.dts=M.timeStamp),this.trigger("timestamp",M)}I.frames.push(M),L+=10,L+=O}while(L>>4>1&&(k+=_[k]+1),0===y.pid)y.type="pat",c(_.subarray(k),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",c(_.subarray(k),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([_,k,y]):this.processPes_(_,k,y)},this.processPes_=function(_,y,k){k.streamType=k.pid===this.programMapTable.video?Rt.H264_STREAM_TYPE:k.pid===this.programMapTable.audio?Rt.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][k.pid],k.type="pes",k.data=_.subarray(y),this.trigger("data",k)}},Ln.prototype=new n,Ln.STREAM_TYPES={h264:27,adts:15},za=function(){var y,c=this,p=!1,h={data:[],size:0},m={data:[],size:0},_={data:[],size:0},I=function(O,M,W){var Zt,fe=new Uint8Array(O.size),Se={type:M},ae=0,Be=0,kt=!1;if(O.data.length&&!(O.size<9)){for(Se.trackId=O.data[0].pid,ae=0;ae>>3,M.pts*=4,M.pts+=(6&O[13])>>>1,M.dts=M.pts,64&W&&(M.dts=(14&O[14])<<27|(255&O[15])<<20|(254&O[16])<<12|(255&O[17])<<5|(254&O[18])>>>3,M.dts*=4,M.dts+=(6&O[18])>>>1)),M.data=O.subarray(9+O[8]))})(fe,Se),kt="video"===M||Se.packetLength<=O.size,(W||kt)&&(O.size=0,O.data.length=0),kt&&c.trigger("data",Se)}};za.prototype.init.call(this),this.push=function(L){({pat:function(){},pes:function(){var M,W;switch(L.streamType){case Rt.H264_STREAM_TYPE:M=h,W="video";break;case Rt.ADTS_STREAM_TYPE:M=m,W="audio";break;case Rt.METADATA_STREAM_TYPE:M=_,W="timed-metadata";break;default:return}L.payloadUnitStartIndicator&&I(M,W,!0),M.data.push(L),M.size+=L.data.byteLength},pmt:function(){var M={type:"metadata",tracks:[]};null!==(y=L.programMapTable).video&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),p=!0,c.trigger("data",M)}})[L.type]()},this.reset=function(){h.size=0,h.data.length=0,m.size=0,m.data.length=0,this.trigger("reset")},this.flushStreams_=function(){I(h,"video"),I(m,"audio"),I(_,"timed-metadata")},this.flush=function(){if(!p&&y){var L={type:"metadata",tracks:[]};null!==y.video&&L.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&L.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),c.trigger("data",L)}p=!1,this.flushStreams_(),this.trigger("done")}},za.prototype=new n;var Ac={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Ka,TransportParseStream:Ln,ElementaryStream:za,TimestampRolloverStream:cy,CaptionStream:qa.CaptionStream,Cea608Stream:qa.Cea608Stream,Cea708Stream:qa.Cea708Stream,MetadataStream:dy};for(var Yo in Rt)Rt.hasOwnProperty(Yo)&&(Ac[Yo]=Rt[Yo]);var Ya,Hi=Ac,wc=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ya=function(c){var p,h=0;Ya.prototype.init.call(this),this.skipWarn_=function(m,_){this.trigger("log",{level:"warn",message:"adts skiping bytes "+m+" to "+_+" in frame "+h+" outside syncword"})},this.push=function(m){var y,k,I,L,O,_=0;if(c||(h=0),"audio"===m.type){p&&p.length?(I=p,(p=new Uint8Array(I.byteLength+m.data.byteLength)).set(I),p.set(m.data,I.byteLength)):p=m.data;for(var M;_+7>>2],p.byteLength-_<(y=(3&p[_+3])<<11|p[_+4]<<3|(224&p[_+5])>>5))break;this.trigger("data",{pts:m.pts+h*O,dts:m.dts+h*O,sampleCount:L,audioobjecttype:1+(p[_+2]>>>6&3),channelcount:(1&p[_+2])<<2|(192&p[_+3])>>>6,samplerate:wc[(60&p[_+2])>>>2],samplingfrequencyindex:(60&p[_+2])>>>2,samplesize:16,data:p.subarray(_+7+k,_+y)}),h++,_+=y}else"number"!=typeof M&&(M=_),_++;"number"==typeof M&&(this.skipWarn_(M,_),M=null),p=p.subarray(_)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){p=void 0,this.trigger("reset")},this.endTimeline=function(){p=void 0,this.trigger("endedtimeline")}},Ya.prototype=new n;var Dc,Ic=Ya;Dc=function(c){var p=c.byteLength,h=0,m=0;this.length=function(){return 8*p},this.bitsAvailable=function(){return 8*p+m},this.loadWord=function(){var _=c.byteLength-p,y=new Uint8Array(4),k=Math.min(4,p);if(0===k)throw new Error("no bytes available");y.set(c.subarray(_,_+k)),h=new DataView(y.buffer).getUint32(0),m=8*k,p-=k},this.skipBits=function(_){var y;m>_?(h<<=_,m-=_):(_-=m,_-=8*(y=Math.floor(_/8)),p-=y,this.loadWord(),h<<=_,m-=_)},this.readBits=function(_){var y=Math.min(m,_),k=h>>>32-y;return(m-=y)>0?h<<=y:p>0&&this.loadWord(),(y=_-y)>0?k<>>_)return h<<=_,m-=_,_;return this.loadWord(),_+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var _=this.skipLeadingZeros();return this.readBits(_+1)-1},this.readExpGolomb=function(){var _=this.readUnsignedExpGolomb();return 1&_?1+_>>>1:-1*(_>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var $a,Rn,Pc,hy=Dc;Rn=function(){var p,h,c=0;Rn.prototype.init.call(this),this.push=function(m){var _;h?((_=new Uint8Array(h.byteLength+m.data.byteLength)).set(h),_.set(m.data,h.byteLength),h=_):h=m.data;for(var y=h.byteLength;c3&&this.trigger("data",h.subarray(c+3)),h=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Rn.prototype=new n,Pc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},$a=function(){var p,h,m,_,y,k,I,c=new Rn;$a.prototype.init.call(this),p=this,this.push=function(L){"video"===L.type&&(h=L.trackId,m=L.pts,_=L.dts,c.push(L))},c.on("data",function(L){var O={trackId:h,pts:m,dts:_,data:L,nalUnitTypeCode:31&L[0]};switch(O.nalUnitTypeCode){case 5:O.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:O.nalUnitType="sei_rbsp",O.escapedRBSP=y(L.subarray(1));break;case 7:O.nalUnitType="seq_parameter_set_rbsp",O.escapedRBSP=y(L.subarray(1)),O.config=k(O.escapedRBSP);break;case 8:O.nalUnitType="pic_parameter_set_rbsp";break;case 9:O.nalUnitType="access_unit_delimiter_rbsp"}p.trigger("data",O)}),c.on("done",function(){p.trigger("done")}),c.on("partialdone",function(){p.trigger("partialdone")}),c.on("reset",function(){p.trigger("reset")}),c.on("endedtimeline",function(){p.trigger("endedtimeline")}),this.flush=function(){c.flush()},this.partialFlush=function(){c.partialFlush()},this.reset=function(){c.reset()},this.endTimeline=function(){c.endTimeline()},I=function(O,M){var Se,W=8,fe=8;for(Se=0;Se=0?h:0,(16&c[p+5])>>4?h+20:h+10},gy=function b(c,p){return c.length-p<10||c[p]!=="I".charCodeAt(0)||c[p+1]!=="D".charCodeAt(0)||c[p+2]!=="3".charCodeAt(0)?p:b(c,p+=Oc(c,p))},Lc=function(c){return c[0]<<21|c[1]<<14|c[2]<<7|c[3]},yy=function(c,p,h){return unescape(function(c,p,h){var m,_="";for(m=p;m=p+2&&255==(255&c[p])&&240==(240&c[p+1])&&16==(22&c[p+1])},parseId3TagSize:Oc,parseAdtsSize:function(c,p){return 6144&c[p+3]|c[p+4]<<3|(224&c[p+5])>>5},parseType:function(c,p){return c[p]==="I".charCodeAt(0)&&c[p+1]==="D".charCodeAt(0)&&c[p+2]==="3".charCodeAt(0)?"timed-metadata":!0&c[p]&&240==(240&c[p+1])?"audio":null},parseSampleRate:function(c){for(var p=0;p+5>>2];p++}return null},parseAacTimestamp:function(c){var p,h,m;p=10,64&c[5]&&(p+=4,p+=Lc(c.subarray(10,14)));do{if((h=Lc(c.subarray(p+4,p+8)))<1)return null;if("PRIV"===String.fromCharCode(c[p],c[p+1],c[p+2],c[p+3])){m=c.subarray(p+10,p+h+10);for(var y=0;y>>2;return(L*=4)+(3&I[7])}break}}p+=10,p+=h}while(p=3;)if(c[_]!=="I".charCodeAt(0)||c[_+1]!=="D".charCodeAt(0)||c[_+2]!=="3".charCodeAt(0))if(255!=(255&c[_])||240!=(240&c[_+1]))_++;else{if(c.length-_<7||_+(m=Qa.parseAdtsSize(c,_))>c.length)break;I={type:"audio",data:c.subarray(_,_+m),pts:p,dts:p},this.trigger("data",I),_+=m}else{if(c.length-_<10||_+(m=Qa.parseId3TagSize(c,_))>c.length)break;k={type:"timed-metadata",data:c.subarray(_,_+m)},this.trigger("data",k),_+=m}c=c.length-_>0?c.subarray(_):new Uint8Array},this.reset=function(){c=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){c=new Uint8Array,this.trigger("endedtimeline")}},Xa.prototype=new n;var Mn,en,Ja,vr,Ey=Xa,$o=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Qo=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ay=py.H264Stream,wy=Qa.isLikelyAacData,Dy=function(c,p){p.stream=c,this.trigger("log",p)},Rc=function(c,p){for(var h=Object.keys(p),m=0;m=h?c:(p.minSegmentDts=1/0,c.filter(function(m){return m.dts>=h&&(p.minSegmentDts=Math.min(p.minSegmentDts,m.dts),p.minSegmentPts=p.minSegmentDts,!0)}))}(h,c,_),c.baseMediaDecodeTime=gi_calculateTrackBaseMediaDecodeTime(c,p.keepOriginalTimestamps),Se=Fa_prefixWithSilence(c,I,y,k),c.samples=function(c){var p,m=[];for(p=0;p1&&(p=c.shift(),c.byteLength-=p.byteLength,c.nalCount-=p.nalCount,c[0][0].dts=p.dts,c[0][0].pts=p.pts,c[0][0].duration+=p.duration),c}(O)),_.length){var kt;if(!(kt=p.alignGopsAtEnd?this.alignGopsAtEnd_(O):this.alignGopsAtStart_(O)))return this.gopCache_.unshift({gop:O.pop(),pps:c.pps,sps:c.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),m=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");gi_clearDtsInfo(c),O=kt}gi_collectDtsInfo(c,O),c.samples=function(c,p){var h,m,_,y,I=p||0,L=[];for(h=0;h=-1e4&&W<=45e3&&(!fe||M>W)&&(fe=ae,M=W));return fe?fe.gop:null},this.alignGopsAtStart_=function(I){var L,O,M,W,fe,Se,ae,Be;for(fe=I.byteLength,Se=I.nalCount,ae=I.duration,L=O=0;L<_.length&&OM.pts?L++:(O++,fe-=W.byteLength,Se-=W.nalCount,ae-=W.duration);return 0===O?I:O===I.length?null:((Be=I.slice(O)).byteLength=fe,Be.duration=ae,Be.nalCount=Se,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be)},this.alignGopsAtEnd_=function(I){var L,O,M,W,fe,Se,ae;for(L=_.length-1,O=I.length-1,fe=null,Se=!1;L>=0&&O>=0;){if((M=_[L]).pts===(W=I[O]).pts){Se=!0;break}M.pts>W.pts?L--:(L===_.length-1&&(fe=O),O--)}if(!Se&&null===fe)return null;if(0===(ae=Se?O:fe))return I;var Be=I.slice(ae),kt=Be.reduce(function(Zt,Tr){return Zt.byteLength+=Tr.byteLength,Zt.duration+=Tr.duration,Zt.nalCount+=Tr.nalCount,Zt},{byteLength:0,duration:0,nalCount:0});return Be.byteLength=kt.byteLength,Be.duration=kt.duration,Be.nalCount=kt.nalCount,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be},this.alignGopsWith=function(I){_=I}},Mn.prototype=new n,vr=function(c,p){this.numberOfTracks=0,this.metadataStream=p,this.remuxTracks=!(typeof(c=c||{}).remux<"u"&&!c.remux),this.keepOriginalTimestamps="boolean"==typeof c.keepOriginalTimestamps&&c.keepOriginalTimestamps,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vr.prototype.init.call(this),this.push=function(h){return h.text?this.pendingCaptions.push(h):h.frames?this.pendingMetadata.push(h):(this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,"video"===h.track.type&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),void("audio"===h.track.type&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))))}},vr.prototype=new n,vr.prototype.flush=function(b){var h,m,_,k,c=0,p={captions:[],captionStreams:{},metadata:[],info:{}},y=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,Qo.forEach(function(I){p.info[I]=this.videoTrack[I]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,$o.forEach(function(I){p.info[I]=this.audioTrack[I]},this)),this.videoTrack||this.audioTrack){for(p.type=1===this.pendingTracks.length?this.pendingTracks[0].type:"combined",this.emittedTracks+=this.pendingTracks.length,_=function(c){var m,p=d(),h=E(c);return(m=new Uint8Array(p.byteLength+h.byteLength)).set(p),m.set(h,p.byteLength),m}(this.pendingTracks),p.initSegment=new Uint8Array(_.byteLength),p.initSegment.set(_),p.data=new Uint8Array(this.pendingBytes),k=0;k=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vr.prototype.setRemux=function(b){this.remuxTracks=b},Ja=function(c){var m,_,p=this,h=!0;Ja.prototype.init.call(this),this.baseMediaDecodeTime=(c=c||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new Hi.MetadataStream,y.aacStream=new Ey,y.audioTimestampRolloverStream=new Hi.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new Hi.TimestampRolloverStream("timed-metadata"),y.adtsStream=new Ic,y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(k){y.aacStream.setTimestamp(k.timeStamp)}),y.aacStream.on("data",function(k){"timed-metadata"!==k.type&&"audio"!==k.type||y.audioSegmentStream||(_=_||{timelineStartInfo:{baseMediaDecodeTime:p.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Rc(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new Hi.MetadataStream,y.packetStream=new Hi.TransportPacketStream,y.parseStream=new Hi.TransportParseStream,y.elementaryStream=new Hi.ElementaryStream,y.timestampRolloverStream=new Hi.TimestampRolloverStream,y.adtsStream=new Ic,y.h264Stream=new Ay,y.captionStream=new Hi.CaptionStream(c),y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(k){var I;if("metadata"===k.type){for(I=k.tracks.length;I--;)m||"video"!==k.tracks[I].type?!_&&"audio"===k.tracks[I].type&&((_=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime):(m=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime;m&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new Mn(m,c),y.videoSegmentStream.on("log",p.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(L){_&&!c.keepOriginalTimestamps&&(_.timelineStartInfo=L,y.audioSegmentStream.setEarliestDts(L.dts-p.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",p.trigger.bind(p,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(L){_&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(L)}),y.videoSegmentStream.on("timingInfo",p.trigger.bind(p,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),_&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(k){k.dispatchType=y.metadataStream.dispatchType,p.trigger("id3Frame",k)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Rc(this,y)},this.setBaseMediaDecodeTime=function(y){var k=this.transmuxPipeline_;c.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),_&&(_.timelineStartInfo.dts=void 0,_.timelineStartInfo.pts=void 0,gi_clearDtsInfo(_),k.audioTimestampRolloverStream&&k.audioTimestampRolloverStream.discontinuity()),m&&(k.videoSegmentStream&&(k.videoSegmentStream.gopCache_=[]),m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,gi_clearDtsInfo(m),k.captionStream.reset()),k.timestampRolloverStream&&k.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){_&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var k=this.transmuxPipeline_;c.remux=y,k&&k.coalesceStream&&k.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){m&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var k=this;return function(I){I.stream=y,k.trigger("log",I)}},this.push=function(y){if(h){var k=wy(y);k&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():!k&&"ts"!==this.transmuxPipeline_.type&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ja.prototype=new n;var Vc,Wc,Jo,Py={Transmuxer:Ja,VideoSegmentStream:Mn,AudioSegmentStream:en,AUDIO_PROPERTIES:$o,VIDEO_PROPERTIES:Qo,generateSegmentTimingInfo:Xo},es_toUnsigned=function(c){return c>>>0},_r=function(c){var p="";return p+=String.fromCharCode(c[0]),p+=String.fromCharCode(c[1]),(p+=String.fromCharCode(c[2]))+String.fromCharCode(c[3])},My=es_toUnsigned,ft=function b(c,p){var m,_,y,k,I,h=[];if(!p.length)return null;for(m=0;m1?m+_:c.byteLength,y===p[0]&&(1===p.length?h.push(c.subarray(m+8,k)):(I=b(c.subarray(m+8,k),p.slice(1))).length&&(h=h.concat(I))),m=k;return h},Ny=es_toUnsigned,Fy=e.getUint64,Nc=function(c){return{isLeading:(12&c[0])>>>2,dependsOn:3&c[0],isDependedOn:(192&c[1])>>>6,hasRedundancy:(48&c[1])>>>4,paddingValue:(14&c[1])>>>1,isNonSyncSample:1&c[1],degradationPriority:c[2]<<8|c[3]}},jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nn=typeof window<"u"?window:typeof jc<"u"?jc:typeof self<"u"?self:{},qy=function(c){for(var _,y,p=c.byteLength,h=[],m=1;m0?function(c){var p={version:c[0],flags:new Uint8Array(c.subarray(1,4))};return p.baseMediaDecodeTime=1===p.version?Fy(c.subarray(4)):Ny(c[4]<<24|c[5]<<16|c[6]<<8|c[7]),p}(fe[0]).baseMediaDecodeTime:0,ae=ft(L,["trun"]);p===W&&ae.length>0&&(Be=function(c,p,h){var m=p,_=h.defaultSampleDuration||0,y=h.defaultSampleSize||0,k=h.trackId,I=[];return c.forEach(function(L){var M=function(c){var W,p={version:c[0],flags:new Uint8Array(c.subarray(1,4)),samples:[]},h=new DataView(c.buffer,c.byteOffset,c.byteLength),m=1&p.flags[2],_=4&p.flags[2],y=1&p.flags[1],k=2&p.flags[1],I=4&p.flags[1],L=8&p.flags[1],O=h.getUint32(4),M=8;for(m&&(p.dataOffset=h.getInt32(M),M+=4),_&&O&&(W={flags:Nc(c.subarray(M,M+4))},M+=4,y&&(W.duration=h.getUint32(M),M+=4),k&&(W.size=h.getUint32(M),M+=4),L&&(W.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(W),O--);O--;)W={},y&&(W.duration=h.getUint32(M),M+=4),k&&(W.size=h.getUint32(M),M+=4),I&&(W.flags=Nc(c.subarray(M,M+4)),M+=4),L&&(W.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(W);return p}(L).samples;M.forEach(function(W){void 0===W.duration&&(W.duration=_),void 0===W.size&&(W.size=y),W.trackId=k,W.dts=m,void 0===W.compositionTimeOffset&&(W.compositionTimeOffset=0),"bigint"==typeof m?(W.pts=m+Nn.BigInt(W.compositionTimeOffset),m+=Nn.BigInt(W.duration)):(W.pts=m+W.compositionTimeOffset,m+=W.duration)}),I=I.concat(M)}),I}(ae,Se,M),kt=function(c,p,h){var y,k,I,L,m=new DataView(c.buffer,c.byteOffset,c.byteLength),_={logs:[],seiNals:[]};for(k=0;k+40;){var W=h.shift();this.parse(W,L,O)}return M=function(c,p,h){if(null===p)return null;var _=zy(c,p)[p]||{};return{seiNals:_.seiNals,logs:_.logs,timescale:h}}(I,m,_),M&&M.logs&&(y.logs=y.logs.concat(M.logs)),null!==M&&M.seiNals?(this.pushNals(M.seiNals),this.flushStream(),y):y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(I){if(!this.isInitialized()||!I||0===I.length)return null;I.forEach(function(L){p.push(L)})},this.flushStream=function(){if(!this.isInitialized())return null;k?p.partialFlush():p.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;p.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],m=null,_=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},ts=es_toUnsigned,Fn=function(c){return("00"+c.toString(16)).slice(-2)},Xy=e.getUint64;Vc=function(c,p){var m=ft(p,["moof","traf"]).reduce(function(_,y){var W,fe,k=ft(y,["tfhd"])[0],I=ts(k[4]<<24|k[5]<<16|k[6]<<8|k[7]),L=c[I]||9e4,O=ft(y,["tfdt"])[0],M=new DataView(O.buffer,O.byteOffset,O.byteLength);return"bigint"==typeof(W=1===O[0]?Xy(O.subarray(4,12)):M.getUint32(4))?fe=W/Nn.BigInt(L):"number"==typeof W&&!isNaN(W)&&(fe=W/L),fe11?(_.codec+=".",_.codec+=Fn(Se[9]),_.codec+=Fn(Se[10]),_.codec+=Fn(Se[11])):_.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(_.codec)?(Se=fe.subarray(28),"esds"===_r(Se.subarray(4,8))&&Se.length>20&&0!==Se[19]?(_.codec+="."+Fn(Se[19]),_.codec+="."+Fn(Se[20]>>>2&63).replace(/^0/,"")):_.codec="mp4a.40.2"):_.codec=_.codec.toLowerCase())}var Be=ft(m,["mdia","mdhd"])[0];Be&&(_.timescale=Jo(Be)),h.push(_)}),h};var Zc_startTime=Vc,Zc_tracks=Wc,Kc=function(c){var p=31&c[1];return(p<<=8)|c[2]},is=function(c){return!!(64&c[1])},rs=function(c){var p=0;return(48&c[3])>>>4>1&&(p+=c[4]+1),p},eu=function(c){switch(c){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},aT={parseType:function(c,p){var h=Kc(c);return 0===h?"pat":h===p?"pmt":p?"pes":null},parsePat:function(c){var p=is(c),h=4+rs(c);return p&&(h+=c[h]+1),(31&c[h+10])<<8|c[h+11]},parsePmt:function(c){var p={},h=is(c),m=4+rs(c);if(h&&(m+=c[m]+1),1&c[m+5]){var y;y=3+((15&c[m+1])<<8|c[m+2])-4;for(var I=12+((15&c[m+10])<<8|c[m+11]);I=c.byteLength)return null;var _,m=null;return 192&(_=c[h+7])&&((m={}).pts=(14&c[h+9])<<27|(255&c[h+10])<<20|(254&c[h+11])<<12|(255&c[h+12])<<5|(254&c[h+13])>>>3,m.pts*=4,m.pts+=(6&c[h+13])>>>1,m.dts=m.pts,64&_&&(m.dts=(14&c[h+14])<<27|(255&c[h+15])<<20|(254&c[h+16])<<12|(255&c[h+17])<<5|(254&c[h+18])>>>3,m.dts*=4,m.dts+=(6&c[h+18])>>>1)),m},videoPacketContainsKeyFrame:function(c){for(var p=4+rs(c),h=c.subarray(p),m=0,_=0,y=!1;_3&&"slice_layer_without_partitioning_rbsp_idr"===eu(31&h[_+3])&&(y=!0),y}},tn=Ec_handleRollover,tt={};tt.ts=aT,tt.aac=Qa;var yr=9e4,Wt=188,zc=function(c,p,h){for(var y,I,L,O,m=0,_=Wt,M=!1;_<=c.byteLength;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m++,_++;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),L=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&L&&(O=tt.ts.parsePesTime(y))&&(O.type="audio",h.audio.push(O),M=!0)),M)break;m+=Wt,_+=Wt}for(m=(_=c.byteLength)-Wt,M=!1;m>=0;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),L=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&L&&(O=tt.ts.parsePesTime(y))&&(O.type="audio",h.audio.push(O),M=!0)),M)break;m-=Wt,_-=Wt}},oT=function(c,p,h){for(var y,I,L,O,M,W,fe,m=0,_=Wt,Se=!1,ae={data:[],size:0};_=0;)if(71!==c[m]||71!==c[_])m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),L=tt.ts.parsePayloadUnitStartIndicator(y),"video"===I&&L&&(O=tt.ts.parsePesTime(y))&&(O.type="video",h.video.push(O),Se=!0)),Se)break;m-=Wt,_-=Wt}},fT_inspect=function(c,p){var m;return m=tt.aac.isLikelyAacData(c)?function(c){for(var I,p=!1,h=0,m=null,_=null,y=0,k=0;c.length-k>=3;){switch(tt.aac.parseType(c,k)){case"timed-metadata":if(c.length-k<10){p=!0;break}if((y=tt.aac.parseId3TagSize(c,k))>c.length){p=!0;break}null===_&&(I=c.subarray(k,k+y),_=tt.aac.parseAacTimestamp(I)),k+=y;break;case"audio":if(c.length-k<7){p=!0;break}if((y=tt.aac.parseAdtsSize(c,k))>c.length){p=!0;break}null===m&&(I=c.subarray(k,k+y),m=tt.aac.parseSampleRate(I)),h++,k+=y;break;default:k++}if(p)return null}if(null===m||null===_)return null;var O=yr/m;return{audio:[{type:"audio",dts:_,pts:_},{type:"audio",dts:_+1024*h*O,pts:_+1024*h*O}]}}(c):function(c){var p={pid:null,table:null},h={};for(var m in function(c,p){for(var _,h=0,m=Wt;m"u"||isNaN(h))&&(h=c.audio[0].dts),c.audio.forEach(function(y){y.dts=tn(y.dts,h),y.pts=tn(y.pts,h),y.dtsTime=y.dts/yr,y.ptsTime=y.pts/yr})}if(c.video&&c.video.length){var m=p;if((typeof m>"u"||isNaN(m))&&(m=c.video[0].dts),c.video.forEach(function(y){y.dts=tn(y.dts,m),y.pts=tn(y.pts,m),y.dtsTime=y.dts/yr,y.ptsTime=y.pts/yr}),c.firstKeyFrame){var _=c.firstKeyFrame;_.dts=tn(_.dts,m),_.pts=tn(_.pts,m),_.dtsTime=_.dts/yr,_.ptsTime=_.pts/yr}}}(m,p),m):null},Yc=function(){function b(p,h){this.options=h||{},this.self=p,this.init()}var c=b.prototype;return c.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Py.Transmuxer(this.options),function(c,p){p.on("data",function(h){var m=h.initSegment;h.initSegment={data:m.buffer,byteOffset:m.byteOffset,byteLength:m.byteLength};var _=h.data;h.data=_.buffer,c.postMessage({action:"data",segment:h,byteOffset:_.byteOffset,byteLength:_.byteLength},[h.data])}),p.on("done",function(h){c.postMessage({action:"done"})}),p.on("gopInfo",function(h){c.postMessage({action:"gopInfo",gopInfo:h})}),p.on("videoSegmentTimingInfo",function(h){var m={start:{decode:Qe_videoTsToSeconds(h.start.dts),presentation:Qe_videoTsToSeconds(h.start.pts)},end:{decode:Qe_videoTsToSeconds(h.end.dts),presentation:Qe_videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Qe_videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(m.prependedContentDuration=Qe_videoTsToSeconds(h.prependedContentDuration)),c.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:m})}),p.on("audioSegmentTimingInfo",function(h){var m={start:{decode:Qe_videoTsToSeconds(h.start.dts),presentation:Qe_videoTsToSeconds(h.start.pts)},end:{decode:Qe_videoTsToSeconds(h.end.dts),presentation:Qe_videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Qe_videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(m.prependedContentDuration=Qe_videoTsToSeconds(h.prependedContentDuration)),c.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:m})}),p.on("id3Frame",function(h){c.postMessage({action:"id3Frame",id3Frame:h})}),p.on("caption",function(h){c.postMessage({action:"caption",caption:h})}),p.on("trackinfo",function(h){c.postMessage({action:"trackinfo",trackInfo:h})}),p.on("audioTimingInfo",function(h){c.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Qe_videoTsToSeconds(h.start),end:Qe_videoTsToSeconds(h.end)}})}),p.on("videoTimingInfo",function(h){c.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Qe_videoTsToSeconds(h.start),end:Qe_videoTsToSeconds(h.end)}})}),p.on("log",function(h){c.postMessage({action:"log",log:h})})}(this.self,this.transmuxer)},c.pushMp4Captions=function(h){this.captionParser||(this.captionParser=new Qy,this.captionParser.init());var m=new Uint8Array(h.data,h.byteOffset,h.byteLength),_=this.captionParser.parse(m,h.trackIds,h.timescales);this.self.postMessage({action:"mp4Captions",captions:_&&_.captions||[],logs:_&&_.logs||[],data:m.buffer},[m.buffer])},c.probeMp4StartTime=function(h){var _=h.data,y=Zc_startTime(h.timescales,_);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:_},[_.buffer])},c.probeMp4Tracks=function(h){var m=h.data,_=Zc_tracks(m);this.self.postMessage({action:"probeMp4Tracks",tracks:_,data:m},[m.buffer])},c.probeTs=function(h){var m=h.data,_=h.baseStartTime,y="number"!=typeof _||isNaN(_)?void 0:9e4*_,k=fT_inspect(m,y),I=null;k&&((I={hasVideo:k.video&&2===k.video.length||!1,hasAudio:k.audio&&2===k.audio.length||!1}).hasVideo&&(I.videoStart=k.video[0].ptsTime),I.hasAudio&&(I.audioStart=k.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:I,data:m},[m.buffer])},c.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},c.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},c.push=function(h){var m=new Uint8Array(h.data,h.byteOffset,h.byteLength);this.transmuxer.push(m)},c.reset=function(){this.transmuxer.reset()},c.setTimestampOffset=function(h){this.transmuxer.setBaseMediaDecodeTime(Math.round(Qe_secondsToVideoTs(h.timestampOffset||0)))},c.setAudioAppendStart=function(h){this.transmuxer.setAudioAppendStart(Math.ceil(Qe_secondsToVideoTs(h.appendStart)))},c.setRemux=function(h){this.transmuxer.setRemux(h.remux)},c.flush=function(h){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},c.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},c.alignGopsWith=function(h){this.transmuxer.alignGopsWith(h.gopsToAlignWith.slice())},b}();self.onmessage=function(b){"init"===b.data.action&&b.data.options?this.messageHandlers=new Yc(self,b.data.options):(this.messageHandlers||(this.messageHandlers=new Yc(self)),b.data&&b.data.action&&"init"!==b.data.action&&this.messageHandlers[b.data.action]&&this.messageHandlers[b.data.action](b.data))}})),Vm=Pd(Hm),Rd=function(n){var t=n.transmuxer,i=n.bytes,e=n.audioAppendStart,r=n.gopsToAlignWith,a=n.remux,o=n.onData,l=n.onTrackInfo,d=n.onAudioTimingInfo,f=n.onVideoTimingInfo,v=n.onVideoSegmentTimingInfo,g=n.onAudioSegmentTimingInfo,T=n.onId3,E=n.onCaptions,x=n.onDone,S=n.onEndedTimeline,N=n.onTransmuxerLog,F=n.isEndOfTimeline,j={buffer:[]},G=F;if(t.onmessage=function(ye){t.currentTransmux===n&&("data"===ye.data.action&&function(n,t,i){var e=n.data.segment,r=e.type,a=e.initSegment,f=e.videoFrameDtsTime,v=e.videoFramePtsTime;t.buffer.push({captions:e.captions,captionStreams:e.captionStreams,metadata:e.metadata});var g=n.data.segment.boxes||{data:n.data.segment.data},T={type:r,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof f<"u"&&(T.videoFrameDtsTime=f),typeof v<"u"&&(T.videoFramePtsTime=v),i(T)}(ye,j,o),"trackinfo"===ye.data.action&&l(ye.data.trackInfo),"gopInfo"===ye.data.action&&function(n,t){t.gopInfo=n.data.gopInfo}(ye,j),"audioTimingInfo"===ye.data.action&&d(ye.data.audioTimingInfo),"videoTimingInfo"===ye.data.action&&f(ye.data.videoTimingInfo),"videoSegmentTimingInfo"===ye.data.action&&v(ye.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===ye.data.action&&g(ye.data.audioSegmentTimingInfo),"id3Frame"===ye.data.action&&T([ye.data.id3Frame],ye.data.id3Frame.dispatchType),"caption"===ye.data.action&&E(ye.data.caption),"endedtimeline"===ye.data.action&&(G=!1,S()),"log"===ye.data.action&&N(ye.data.log),"transmuxed"===ye.data.type&&(G||(t.onmessage=null,function(n){var t=n.transmuxedData,i=n.callback;t.buffer=[],i(t)}({transmuxedData:j,callback:x}),Md(t))))},e&&t.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof a<"u"&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var ne=i instanceof ArrayBuffer?i:i.buffer,he=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:ne,byteOffset:he,byteLength:i.byteLength},[ne])}F&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Md=function(n){n.currentTransmux=null,n.transmuxQueue.length&&(n.currentTransmux=n.transmuxQueue.shift(),"function"==typeof n.currentTransmux?n.currentTransmux():Rd(n.currentTransmux))},Ud=function(n,t){n.postMessage({action:t}),Md(n)},Do_reset=function(n){!function(n,t){if(!t.currentTransmux)return t.currentTransmux=n,void Ud(t,n);t.transmuxQueue.push(Ud.bind(null,t,n))}("reset",n)},ka=function(n){var t=n.transmuxer,i=n.endAction||n.action,e=n.callback,r=gt({},n,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function d(f){f.data.action===i&&(t.removeEventListener("message",d),f.data.data&&(f.data.data=new Uint8Array(f.data.data,n.byteOffset||0,n.byteLength||f.data.data.byteLength),n.data&&(n.data=f.data.data)),e(f.data))}),n.data){var o=n.data instanceof ArrayBuffer;r.byteOffset=o?0:n.data.byteOffset,r.byteLength=n.data.byteLength,t.postMessage(r,[o?n.data:n.data.buffer])}else t.postMessage(r)},Po=function(n){n.forEach(function(t){t.abort()})},Oo=function(n,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:-101,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:-102,xhr:t}:n?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null},Bd=function(n,t,i){return function(e,r){var a=r.response,o=Oo(e,r);if(o)return i(o,n);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:2,xhr:r},n);for(var l=new DataView(a),d=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),f=0;f0}(x)){t.isFmp4=!0;var S=t.map.tracks,N={isFmp4:!0,hasVideo:!!S.video,hasAudio:!!S.audio};S.audio&&S.audio.codec&&"enca"!==S.audio.codec&&(N.audioCodec=S.audio.codec),S.video&&S.video.codec&&"encv"!==S.video.codec&&(N.videoCodec=S.video.codec),S.video&&S.audio&&(N.isMuxed=!0),e(t,N);var F=function(G){g(t,{data:x,type:N.hasAudio&&!N.isMuxed?"audio":"video"}),G&&G.length&&d(t,G),T(null,t,{})};ka({action:"probeMp4StartTime",timescales:t.map.timescales,data:x,transmuxer:t.transmuxer,callback:function(G){var q=G.data,ne=G.startTime;i=q.buffer,t.bytes=x=q,N.hasAudio&&!N.isMuxed&&r(t,"audio","start",ne),N.hasVideo&&r(t,"video","start",ne),S.video&&q.byteLength&&t.transmuxer?ka({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:x,timescales:t.map.timescales,trackIds:[S.video.id],callback:function(K){i=K.data.buffer,t.bytes=x=K.data,K.logs.forEach(function(ye){E(U.mergeOptions(ye,{stream:"mp4CaptionParser"}))}),F(K.captions)}}):F()}})}else{if(t.transmuxer)return typeof t.container>"u"&&(t.container=vs(x)),"ts"!==t.container&&"aac"!==t.container?(e(t,{hasAudio:!1,hasVideo:!1}),void T(null,t,{})):void Jm({segment:t,bytes:i,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});T(null,t,{})}},Vd=function(n,t){var l,i=n.id,e=n.key,r=n.encryptedBytes,a=n.decryptionWorker;a.addEventListener("message",function d(f){if(f.data.source===i){a.removeEventListener("message",d);var v=f.data.decrypted;t(new Uint8Array(v.bytes,v.byteOffset,v.byteLength))}}),l=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),a.postMessage(Sd({source:i,encrypted:r,key:l,iv:e.iv}),[r.buffer,l.buffer])},ng=function(n){var t=n.xhr,i=n.xhrOptions,r=n.segment,a=n.abortFn,o=n.progressFn,l=n.trackInfoFn,d=n.timingInfoFn,f=n.videoSegmentTimingInfoFn,v=n.audioSegmentTimingInfoFn,g=n.id3Fn,T=n.captionsFn,E=n.isEndOfTimeline,x=n.endedTimelineFn,S=n.dataFn,j=[],G=function(n){var t=n.activeXhrs,i=n.decryptionWorker,e=n.trackInfoFn,r=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog,x=0,S=!1;return function(N,F){if(!S){if(N)return S=!0,Po(t),T(N,F);if((x+=1)===t.length){var j=function(){if(F.encryptedBytes)return function(n){var i=n.segment,e=n.trackInfoFn,r=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog;Vd({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:n.decryptionWorker},function(x){i.bytes=x,Hd({segment:i,bytes:i.bytes,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})})}({decryptionWorker:i,segment:F,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});Hd({segment:F,bytes:F.bytes,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})};if(F.endOfAllRequests=Date.now(),F.map&&F.map.encryptedBytes&&!F.map.bytes)return Vd({decryptionWorker:i,id:F.requestId+"-init",encryptedBytes:F.map.encryptedBytes,key:F.map.key},function(G){F.map.bytes=G,jd(F,function(q){if(q)return Po(t),T(q,F);j()})});j()}}}}({activeXhrs:j,decryptionWorker:n.decryptionWorker,trackInfoFn:l,timingInfoFn:d,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:v,id3Fn:g,captionsFn:T,isEndOfTimeline:E,endedTimelineFn:x,dataFn:S,doneFn:n.doneFn,onTransmuxerLog:n.onTransmuxerLog});if(r.key&&!r.key.bytes){var q=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&q.push(r.map.key);var K=t(U.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),Bd(r,q,G));j.push(K)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var Pe=t(U.mergeOptions(i,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),Bd(r,[r.map.key],G));j.push(Pe)}var ot=U.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Ao(r.map)}),Nt=function(n){var t=n.segment,i=n.finishProcessingFn;return function(e,r){var a=Oo(e,r);if(a)return i(a,t);var o=new Uint8Array(r.response);if(t.map.key)return t.map.encryptedBytes=o,i(null,t);t.map.bytes=o,jd(t,function(l){if(l)return l.xhr=r,l.status=r.status,i(l,t);i(null,t)})}}({segment:r,finishProcessingFn:G}),Je=t(ot,Nt);j.push(Je)}var fr=U.mergeOptions(i,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Ao(r)}),si=t(fr,function(n){var t=n.segment,i=n.finishProcessingFn,e=n.responseType;return function(r,a){var o=Oo(r,a);if(o)return i(o,t);var l="arraybuffer"!==e&&a.responseText?function(n){for(var t=new Uint8Array(new ArrayBuffer(n.length)),i=0;i1)return ag("multiple "+i+" codecs found as attributes: "+t[i].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[i]=null);t[i]=t[i][0]}),t},Gd=function(n){var t=0;return n.audio&&t++,n.video&&t++,t},An=function(n,t){var i=t.attributes||{},e=Aa(function(n){var t=n.attributes||{};if(t.CODECS)return Xe(t.CODECS)}(t)||[]);if(qd(n,t)&&!e.audio&&!function(n,t){if(!qd(n,t))return!0;var e=n.mediaGroups.AUDIO[(t.attributes||{}).AUDIO];for(var r in e)if(!e[r].uri&&!e[r].playlists)return!0;return!1}(n,t)){var r=Aa(function(n,t){if(!n.mediaGroups.AUDIO||!t)return null;var i=n.mediaGroups.AUDIO[t];if(!i)return null;for(var e in i){var r=i[e];if(r.default&&r.playlists)return Xe(r.playlists[0].attributes.CODECS)}return null}(n,i.AUDIO)||[]);r.audio&&(e.audio=r.audio)}return e},wa=mi("PlaylistSelector"),Wd=function(n){if(n&&n.playlist){var t=n.playlist;return JSON.stringify({id:t.id,bandwidth:n.bandwidth,width:n.width,height:n.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Ia=function(n,t){if(!n)return"";var i=P().getComputedStyle(n);return i?i[t]:""},Qr=function(n,t){var i=n.slice();n.sort(function(e,r){var a=t(e,r);return 0===a?i.indexOf(e)-i.indexOf(r):a})},Lo=function(n,t){var i,e;return n.attributes.BANDWIDTH&&(i=n.attributes.BANDWIDTH),i=i||P().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(e=t.attributes.BANDWIDTH),i-(e||P().Number.MAX_VALUE)},Zd=function(n,t,i,e,r,a){if(n){var o={bandwidth:t,width:i,height:e,limitRenditionByPlayerDimensions:r},l=n.playlists;Yt.isAudioOnly(n)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var d=l.map(function(ge){var Pe=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.width,ot=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.height;return{bandwidth:ge.attributes&&ge.attributes.BANDWIDTH||P().Number.MAX_VALUE,width:Pe,height:ot,playlist:ge}});Qr(d,function(ge,$e){return ge.bandwidth-$e.bandwidth});var f=(d=d.filter(function(ge){return!Yt.isIncompatible(ge.playlist)})).filter(function(ge){return Yt.isEnabled(ge.playlist)});f.length||(f=d.filter(function(ge){return!Yt.isDisabled(ge.playlist)}));var v=f.filter(function(ge){return ge.bandwidth*Dt.BANDWIDTH_VARIANCEi||ge.height>e})).filter(function(ge){return ge.width===j[0].width&&ge.height===j[0].height}),g=G[G.length-1],q=G.filter(function(ge){return ge.bandwidth===g.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var he=S.map(function(ge){return ge.pixelDiff=Math.abs(ge.width-i)+Math.abs(ge.height-e),ge});Qr(he,function(ge,$e){return ge.pixelDiff===$e.pixelDiff?$e.bandwidth-ge.bandwidth:ge.pixelDiff-$e.pixelDiff}),ne=he[0]}var K=ne||q||F||T||f[0]||d[0];if(K&&K.playlist){var ye="sortedPlaylistReps";return ne?ye="leastPixelDiffRep":q?ye="resolutionPlusOneRep":F?ye="resolutionBestRep":T?ye="bandwidthBestRep":f[0]&&(ye="enabledPlaylistReps"),wa("choosing "+Wd(K)+" using "+ye+" with options",o),K.playlist}return wa("could not choose a playlist with options",o),null}},Kd=function(){var n=this.useDevicePixelRatio&&P().devicePixelRatio||1;return Zd(this.playlists.master,this.systemBandwidth,parseInt(Ia(this.tech_.el(),"width"),10)*n,parseInt(Ia(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},wn=function(n,t,i){var e,r;if(i&&i.cues)for(e=i.cues.length;e--;)(r=i.cues[e]).startTime>=n&&r.endTime<=t&&i.removeCue(r)},Yd=function(n){return"number"==typeof n&&isFinite(n)},Da=1/60,Xr=function(n){var t=n.startOfSegment,i=n.duration,e=n.segment,r=n.part,a=n.playlist,o=a.mediaSequence,l=a.id,d=a.segments,v=n.mediaIndex,g=n.partIndex,T=n.timeline,E=(void 0===d?[]:d).length-1,x="mediaIndex/partIndex increment";n.getMediaInfoForTime?x="getMediaInfoForTime ("+n.getMediaInfoForTime+")":n.isSyncRequest&&(x="getSyncSegmentCandidate (isSyncRequest)"),n.independent&&(x+=" with independent "+n.independent);var S="number"==typeof g,N=n.segment.uri?"segment":"pre-segment",F=S?ud({preloadSegment:e})-1:0;return N+" ["+(o+v)+"/"+(o+E)+"]"+(S?" part ["+g+"/"+F+"]":"")+" segment start/end ["+e.start+" => "+e.end+"]"+(S?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+T+"] selected by ["+x+"] playlist ["+l+"]"},$d=function(n){return n+"TimingInfo"},Qd=function(n){var t=n.timelineChangeController,e=n.segmentTimeline,r=n.loaderType,a=n.audioDisabled;if(n.currentTimeline===e)return!1;if("audio"===r){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==e}if("main"===r&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===e)}return!1},Xd=function(n){var t=n.segmentDuration,i=n.maxDuration;return!!t&&Math.round(t)>i+Ki},Ro=function(s){function n(i,e){var r;if(r=s.call(this)||this,!i)throw new TypeError("Initialization settings are required");if("function"!=typeof i.currentTime)throw new TypeError("No currentTime getter specified");if(!i.mediaSource)throw new TypeError("No MediaSource specified");return r.bandwidth=i.bandwidth,r.throughput={rate:0,count:0},r.roundTrip=NaN,r.resetStats_(),r.mediaIndex=null,r.partIndex=null,r.hasPlayed_=i.hasPlayed,r.currentTime_=i.currentTime,r.seekable_=i.seekable,r.seeking_=i.seeking,r.duration_=i.duration,r.mediaSource_=i.mediaSource,r.vhs_=i.vhs,r.loaderType_=i.loaderType,r.currentMediaInfo_=void 0,r.startingMediaInfo_=void 0,r.segmentMetadataTrack_=i.segmentMetadataTrack,r.goalBufferLength_=i.goalBufferLength,r.sourceType_=i.sourceType,r.sourceUpdater_=i.sourceUpdater,r.inbandTextTracks_=i.inbandTextTracks,r.state_="INIT",r.timelineChangeController_=i.timelineChangeController,r.shouldSaveSegmentTimingInfo_=!0,r.parse708captions_=i.parse708captions,r.captionServices_=i.captionServices,r.experimentalExactManifestTimings=i.experimentalExactManifestTimings,r.checkBufferTimeout_=null,r.error_=void 0,r.currentTimeline_=-1,r.pendingSegment_=null,r.xhrOptions_=null,r.pendingSegments_=[],r.audioDisabled_=!1,r.isPendingTimestampOffset_=!1,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=U.browser.IE_VERSION>=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=i.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=i.decrypter,r.syncController_=i.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",function(){r.isEndOfStream_()||(r.ended_=!1)}),r.fetchAtBuffer_=!1,r.logger_=mi("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty(Ne(r),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),"main"===r.loaderType_&&r.timelineChangeController_.on("pendingtimelinechange",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),"audio"===r.loaderType_&&r.timelineChangeController_.on("timelinechange",function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r}re(n,s);var t=n.prototype;return t.createTransmuxer_=function(){return function(n){var t=new Vm;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:n}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},t.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,P().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},t.error=function(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Do_reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return U.createTimeRanges();if("main"===this.loaderType_){var a=e.hasVideo;if(a&&e.hasAudio&&!this.audioDisabled_&&!e.isMuxed)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(e,r){if(void 0===r&&(r=!1),!e)return null;var a=Ca(e),o=this.initSegments_[a];return r&&!o&&e.bytes&&(this.initSegments_[a]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},t.segmentKey=function(e,r){if(void 0===r&&(r=!1),!e)return null;var a=Ed(e),o=this.keyCache_[a];this.cacheEncryptionKeys_&&r&&!o&&e.bytes&&(this.keyCache_[a]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var l={resolvedUri:(o||e).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(e,r){if(void 0===r&&(r={}),e){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=r,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var d=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+d+"]"),null!==this.mediaIndex)if(this.mediaIndex-=d,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var f=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!f.parts||!f.parts.length||!f.parts[this.partIndex])){var v=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=v}}o&&(o.mediaIndex-=d,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}},t.pause=function(){this.checkBufferTimeout_&&(P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return null===this.checkBufferTimeout_},t.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&Do_reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(e,r,a,o){if(void 0===a&&(a=function(){}),void 0===o&&(o=!1),r===1/0&&(r=this.duration_()),r<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var l=1,d=function(){0==--l&&a()};for(var f in(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,r,d)),(o||"main"===this.loaderType_)&&(this.gopBuffer_=function(n,t,i,e){for(var r=Math.ceil((t-e)*Zn.ONE_SECOND_IN_TS),a=Math.ceil((i-e)*Zn.ONE_SECOND_IN_TS),o=n.slice(),l=n.length;l--&&!(n[l].pts<=a););if(-1===l)return o;for(var d=l+1;d--&&!(n[d].pts<=r););return d=Math.max(d,0),o.splice(d,l-d+1),o}(this.gopBuffer_,e,r,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,r,d)),this.inbandTextTracks_)wn(e,r,this.inbandTextTracks_[f]);wn(e,r,this.segmentMetadataTrack_),d()}else this.logger_("skipping remove because no source updater or starting media info")},t.monitorBuffer_=function(){this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),500)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},t.isEndOfStream_=function(e,r,a){if(void 0===e&&(e=this.mediaIndex),void 0===r&&(r=this.playlist_),void 0===a&&(a=this.partIndex),!r||!this.mediaSource_)return!1;var o="number"==typeof e&&r.segments[e];return r.endList&&"open"===this.mediaSource_.readyState&&e+1===r.segments.length&&(!o||!o.parts||a+1===o.parts.length)},t.chooseNextRequest_=function(){var e=this.buffered_(),r=ad(e)||0,a=vo(e,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),d=this.playlist_.segments;if(!d.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var f={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(f.isSyncRequest)f.mediaIndex=function(n,t,i){t=t||[];for(var e=[],r=0,a=0;ai))return a}return 0===e.length?0:e[e.length-1]}(this.currentTimeline_,d,r);else if(null!==this.mediaIndex){var v=d[this.mediaIndex],g="number"==typeof this.partIndex?this.partIndex:-1;f.startOfSegment=v.end?v.end:r,v.parts&&v.parts[g+1]?(f.mediaIndex=this.mediaIndex,f.partIndex=g+1):f.mediaIndex=this.mediaIndex+1}else{var T=Yt.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?r:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),E=T.segmentIndex,x=T.startTime,S=T.partIndex;f.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+r:"currentTime "+this.currentTime_(),f.mediaIndex=E,f.startOfSegment=x,f.partIndex=S}var N=d[f.mediaIndex],F=N&&"number"==typeof f.partIndex&&N.parts&&N.parts[f.partIndex];if(!N||"number"==typeof f.partIndex&&!F)return null;if("number"!=typeof f.partIndex&&N.parts&&(f.partIndex=0,F=N.parts[0]),!a&&F&&!F.independent)if(0===f.partIndex){var j=d[f.mediaIndex-1],G=j.parts&&j.parts.length&&j.parts[j.parts.length-1];G&&G.independent&&(f.mediaIndex-=1,f.partIndex=j.parts.length-1,f.independent="previous segment")}else N.parts[f.partIndex-1].independent&&(f.partIndex-=1,f.independent="previous part");return f.mediaIndex>=d.length-1&&this.mediaSource_&&"ended"===this.mediaSource_.readyState&&!this.seeking_()?null:this.generateSegmentInfo_(f)},t.generateSegmentInfo_=function(e){var r=e.independent,a=e.playlist,o=e.mediaIndex,l=e.startOfSegment,d=e.isSyncRequest,f=e.partIndex,v=e.forceTimestampOffset,g=e.getMediaInfoForTime,T=a.segments[o],E="number"==typeof f&&T.parts[f],x={requestId:"segment-loader-"+Math.random(),uri:E&&E.resolvedUri||T.resolvedUri,mediaIndex:o,partIndex:E?f:null,isSyncRequest:d,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:T.timeline,duration:E&&E.duration||T.duration,segment:T,part:E,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:g,independent:r},S=typeof v<"u"?v:this.isPendingTimestampOffset_;x.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:T.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:S});var N=ad(this.sourceUpdater_.audioBuffered());return"number"==typeof N&&(x.audioAppendStart=N-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(x.gopsToAlignWith=function(n,t,i){if(typeof t>"u"||null===t||!n.length)return[];var r,e=Math.ceil((t-i+3)*Zn.ONE_SECOND_IN_TS);for(r=0;re);r++);return n.slice(r)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),x},t.timestampOffsetForSegment_=function(e){return function(n){var t=n.segmentTimeline,i=n.currentTimeline,e=n.startOfSegment,r=n.buffered;return n.overrideCheck||t!==i?t "+T+" for "+f),function(n,t,i){if(!n[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var e=i;/^cc708_/.test(i)&&(e="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(e);if(r)n[i]=r;else{var o=i,l=i,d=!1,f=(t.options_.vhs&&t.options_.vhs.captionServices||{})[e];f&&(o=f.label,l=f.language,d=f.default),n[i]=t.addRemoteTextTrack({kind:"captions",id:e,default:d,label:o,language:l},!1).track}}}(x,a.vhs_.tech_,f),wn(g,T,x[f]),function(n){var t=n.inbandTextTracks,i=n.captionArray,e=n.timestampOffset;if(i){var r=P().WebKitDataCue||P().VTTCue;i.forEach(function(a){t[a.stream].addCue(new r(a.startTime+e,a.endTime+e,a.text))})}}({captionArray:E,inbandTextTracks:x,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(e,r,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,r,a));var l=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();(function(n,t,i){n.metadataTrack_||(n.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,n.metadataTrack_.inBandMetadataTrackDispatchType=t)})(this.inbandTextTracks_,a,this.vhs_.tech_),function(n){var t=n.inbandTextTracks,i=n.metadataArray,e=n.timestampOffset,r=n.videoDuration;if(i){var a=P().WebKitDataCue||P().VTTCue,o=t.metadataTrack_;if(o&&(i.forEach(function(T){var E=T.cueTime+e;"number"!=typeof E||P().isNaN(E)||E<0||!(E<1/0)||T.frames.forEach(function(x){var S=new a(E,E,x.value||x.url||x.data||"");S.frame=x,S.value=x,function(n){Object.defineProperties(n.frame,{id:{get:function(){return U.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get:function(){return U.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get:function(){return U.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),n.value.data}}})}(S),o.addCue(S)})}),o.cues&&o.cues.length)){for(var l=o.cues,d=[],f=0;f1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+cr(f).join(", ")),v.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+cr(v).join(", "));var g=f.length?f.start(0):0,T=f.length?f.end(f.length-1):0,E=v.length?v.start(0):0,x=v.length?v.end(v.length-1):0;if(T-g<=1&&x-E<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+d.byteLength+", audio buffer: "+cr(f).join(", ")+", video buffer: "+cr(v).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:d}));var N=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+N),this.remove(0,N,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=P().setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3)},!0)},t.handleAppendError_=function(e,r){var a=e.segmentInfo,o=e.type,l=e.bytes;if(r){if(22===r.code)return void this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(o+" append of "+l.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(e){var r=e.segmentInfo,a=e.type,o=e.initSegment,l=e.data,d=e.bytes;if(!d){var f=[l],v=l.byteLength;o&&(f.unshift(o),v+=o.byteLength),d=function(n){var i,t=0;return n.bytes&&(i=new Uint8Array(n.bytes),n.segments.forEach(function(e){i.set(e,t),t+=e.byteLength})),i}({bytes:v,segments:f})}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:d},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:d}))},t.handleSegmentTimingInfo_=function(e,r,a){if(this.pendingSegment_&&r===this.pendingSegment_.requestId){var o=this.pendingSegment_.segment,l=e+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(e,r){var a=r.type,o=r.data;if(o&&o.byteLength&&("audio"!==a||!this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:r.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:l,data:o})}},t.loadSegment_=function(e){var r=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var a=gt({},e,{forceTimestampOffset:!0});gt(e,r.generateSegmentInfo_(a)),r.isPendingTimestampOffset_=!1,r.updateTransmuxerAndRequestSegment_(e)})},t.updateTransmuxerAndRequestSegment_=function(e){var r=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var a=this.createSimplifiedSegmentObj_(e),f=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)||null!==this.mediaIndex&&e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_("Requesting "+Xr(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=ng({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:f,endedTimelineFn:function(){r.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(g){var T=g.message,E=g.level,x=g.stream;r.logger_(Xr(e)+" logged from transmuxer stream "+x+" as a "+E+": "+T)}})},t.trimBackBuffer_=function(e){var r=function(n,t,i){var e=t-Dt.BACK_BUFFER_LENGTH;return n.length&&(e=Math.max(e,n.start(0))),Math.min(t-i,e)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);r>0&&this.remove(0,r)},t.createSimplifiedSegmentObj_=function(e){var r=e.segment,a=e.part,o={resolvedUri:a?a.resolvedUri:r.resolvedUri,byterange:a?a.byterange:r.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===r.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),r.key){var d=r.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(r.key),o.key.iv=d}return r.map&&(o.map=this.initSegmentForMap(r.map)),o},t.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},t.saveBandwidthRelatedStats_=function(e,r){this.pendingSegment_.byteLength=r.bytesReceived,e=e);r++);return n.slice(0,r).concat(t)}(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(e){var r=this.syncController_.mappingForTimeline(e);null!==r&&(this.timeMapping_=r)},t.updateMediaSecondsLoaded_=function(e){this.mediaSecondsLoaded+="number"==typeof e.start&&"number"==typeof e.end?e.end-e.start:e.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},t.trueSegmentStart_=function(e){var r=e.currentStart,o=e.mediaIndex,l=e.firstVideoFrameTimeForData;if(typeof r<"u")return r;if(!e.useVideoTimingInfo)return e.audioTimingInfo.start;var T=e.playlist.segments[o-1];return 0===o||!T||typeof T.start>"u"||T.end!==l+e.currentVideoTimestampOffset?l:e.videoTimingInfo.start},t.waitForAppendsToComplete_=function(e){var r=this.getCurrentMediaInfo_(e);if(!r)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var d="main"===this.loaderType_&&r.hasVideo,f=!this.audioDisabled_&&r.hasAudio&&!r.isMuxed;if(e.waitingOnAppends=0,!e.hasAppendedData_)return!e.timingInfo&&"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);d&&e.waitingOnAppends++,f&&e.waitingOnAppends++,d&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),f&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},t.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(e){var r=function(n,t,i){return"main"===n&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!r&&(this.error({message:r,blacklistDuration:1/0}),this.trigger("error"),!0)},t.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var r=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),r=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),r=!0),r&&this.trigger("timestampoffset")}},t.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var r=this.getMediaInfo_(),o="main"===this.loaderType_&&r&&r.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end="number"==typeof o.end?o.end:o.start+e.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var r=function(n,t){if("hls"!==t)return null;var i=function(n){var t=0;return["video","audio"].forEach(function(i){var e=n[i+"TimingInfo"];if(e){var o,r=e.start,a=e.end;"bigint"==typeof r||"bigint"==typeof a?o=P().BigInt(a)-P().BigInt(r):"number"==typeof r&&"number"==typeof a&&(o=a-r),typeof o<"u"&&o>t&&(t=o)}}),"bigint"==typeof t&&t3*e.playlist.targetDuration,d=o&&o.end&&this.currentTime_()-o.end>3*e.playlist.partTargetDuration;if(l||d)return this.logger_("bad "+(l?"segment":"part")+" "+Xr(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Xr(e))},t.recordThroughput_=function(e){if(e.duration"u"||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},t.remove=function(e,r){wn(e,r,this.subtitlesTrack_)},t.fillBuffer_=function(){var e=this,r=this.chooseNextRequest_();if(r){if(null===this.syncController_.timestampOffsetForTimeline(r.timeline))return this.syncController_.one("timestampoffset",function(){e.state="READY",e.paused()||e.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(r)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},t.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(e,r,a){var o=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(r.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return-101===e.code&&this.handleTimeout_(),-102===e.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,r.stats),this.state="APPENDING",this.trigger("appending");var d=l.segment;if(d.map&&(d.map.bytes=r.map.bytes),l.bytes=r.bytes,"function"!=typeof P().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var f,v=function(){o.subtitlesTrack_.tech_.off("vttjsloaded",f),o.stopForError({message:"Error loading vtt.js"})};return f=function(){o.subtitlesTrack_.tech_.off("vttjserror",v),o.segmentRequestFinished_(e,r,a)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",f),void this.subtitlesTrack_.tech_.one("vttjserror",v)}d.requested=!0;try{this.parseVTTCues_(l)}catch(g){return void this.stopForError({message:g.message})}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.timingInfo=l.cues.length?{start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:{start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=d.duration,l.cues.forEach(function(g){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new(P().VTTCue)(g.startTime,g.endTime,g.text):g)}),function(n){var t=n.cues;if(t)for(var i=0;i1&&e.push(t[a]);e.length&&e.forEach(function(o){return n.removeCue(o)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(e){var r,a=!1;"function"==typeof P().TextDecoder?r=new(P().TextDecoder)("utf8"):(r=P().WebVTT.StringDecoder(),a=!0);var o=new(P().WebVTT.Parser)(P(),P().vttjs,r);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(f){e.timestampmap=f},o.onparsingerror=function(f){U.log.warn("Error encountered when parsing cues: "+f.message)},e.segment.map){var l=e.segment.map.bytes;a&&(l=rc(l)),o.parse(l)}var d=e.bytes;a&&(d=rc(d)),o.parse(d),o.flush()},t.updateTimeMapping_=function(e,r,a){var o=e.segment;if(r){if(!e.cues.length)return void(o.empty=!0);var l=e.timestampmap,d=l.MPEGTS/Zn.ONE_SECOND_IN_TS-l.LOCAL+r.mapping;e.cues.forEach(function(g){g.startTime+=d,g.endTime+=d}),a.syncInfo||(a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(e.cues[0].startTime,e.cues[e.cues.length-1].startTime-o.duration)})}},n}(Ro),Lg=function(n,t){for(var i=n.cues,e=0;e=r.adStartTime&&t<=r.adEndTime)return r}return null},ac=[{name:"VOD",run:function(n,t,i,e,r){return i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(n,t,i,e,r){if(!Object.keys(n.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=yo(t);r=r||0;for(var d=0;d=E)&&(o=E,a={time:T,segmentIndex:v.segmentIndex,partIndex:v.partIndex})}}return a}},{name:"Discontinuity",run:function(n,t,i,e,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l=g)&&(o=g,a={time:v.time,segmentIndex:d,partIndex:null})}}return a}},{name:"Playlist",run:function(n,t,i,e,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Ug=function(s){function n(i){var e;return(e=s.call(this)||this).timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=mi("SyncController"),e}re(n,s);var t=n.prototype;return t.getSyncPoint=function(e,r,a,o){var l=this.runStrategies_(e,r,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(e,r){if(!e||!e.segments)return null;var a=this.runStrategies_(e,r,e.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+En({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(e,r,a,o){for(var l=[],d=0;d86400)U.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var o=a-1;o>=0;o--){var l=e.segments[o];if(l&&typeof l.start<"u"){r.syncInfo={mediaSequence:e.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+r.syncInfo.time+", mediaSequence: "+r.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var r=e.segments[0],a=r.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[r.timeline]=-a}},t.saveSegmentTimingInfo=function(e){var r=e.segmentInfo,a=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(r,r.timingInfo,a),l=r.segment;o&&(this.saveDiscontinuitySyncInfo_(r),r.playlist.syncInfo||(r.playlist.syncInfo={mediaSequence:r.playlist.mediaSequence+r.mediaIndex,time:l.start}));var d=l.dateTimeObject;l.discontinuity&&a&&d&&(this.timelineToDatetimeMappings[l.timeline]=-d.getTime()/1e3)},t.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time},t.mappingForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping},t.calculateSegmentTimeMapping_=function(e,r,a){var f,v,o=e.segment,l=e.part,d=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)d={time:e.startOfSegment,mapping:e.startOfSegment-r.start},a&&(this.timelines[e.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),f=e.startOfSegment,v=r.end+d.mapping;else{if(!d)return!1;f=r.start+d.mapping,v=r.end+d.mapping}return l&&(l.start=f,l.end=v),(!o.start||fv){var g;g=f<0?a.start-En({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:e.mediaIndex,endIndex:l}):a.end+En({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[d]={time:g,accuracy:v}}}},t.dispose=function(){this.trigger("dispose"),this.off()},n}(U.EventTarget),Ng=function(s){function n(){var i;return(i=s.call(this)||this).pendingTimelineChanges_={},i.lastTimelineChanges_={},i}re(n,s);var t=n.prototype;return t.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(e){var r=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.pendingTimelineChanges_[r]={type:r,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[r]},t.lastTimelineChange=function(e){var r=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.lastTimelineChanges_[r]={type:r,from:a,to:o},delete this.pendingTimelineChanges_[r],this.trigger("timelinechange")),this.lastTimelineChanges_[r]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},n}(U.EventTarget),Fg=Od(Ld(function(){function s(x,S,N){return x(N={path:S,exports:{},require:function(j,G){return function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},N.exports),N.exports}var t=s(function(x){function S(F,j){for(var G=0;G-1},S.trigger=function(F){var j=this.listeners[F];if(j)if(2===arguments.length)for(var G=j.length,q=0;q>7))^q]=q;for(ne=he=0;!j[ne];ne^=ge||1,he=ye[he]||1)for(j[ne]=ot=(ot=he^he<<1^he<<2^he<<3^he<<4)>>8^255&ot^99,G[ot]=ne,Je=16843009*K[$e=K[ge=K[ne]]]^65537*$e^257*ge^16843008*ne,Nt=257*K[ot]^16843008*ot,q=0;q<4;q++)N[q][ne]=Nt=Nt<<24^Nt>>>8,F[q][ot]=Je=Je<<24^Je>>>8;for(q=0;q<5;q++)N[q]=N[q].slice(0),F[q]=F[q].slice(0);return S},l=null,d=function(){function x(N){l||(l=o()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var F,j,G,q=this._tables[0][4],ne=this._tables[1],he=N.length,K=1;if(4!==he&&6!==he&&8!==he)throw new Error("Invalid aes key size");var ye=N.slice(0),ge=[];for(this._key=[ye,ge],F=he;F<4*he+28;F++)G=ye[F-1],(F%he==0||8===he&&F%he==4)&&(G=q[G>>>24]<<24^q[G>>16&255]<<16^q[G>>8&255]<<8^q[255&G],F%he==0&&(G=G<<8^G>>>24^K<<24,K=K<<1^283*(K>>7))),ye[F]=ye[F-he]^G;for(j=0;F;j++,F--)G=ye[3&j?F:F-4],ge[j]=F<=4||j<4?G:ne[0][q[G>>>24]]^ne[1][q[G>>16&255]]^ne[2][q[G>>8&255]]^ne[3][q[255&G]]}return x.prototype.decrypt=function(F,j,G,q,ne,he){var ot,Nt,Je,ai,K=this._key[1],ye=F^K[0],ge=q^K[1],$e=G^K[2],Pe=j^K[3],fr=K.length/4-2,si=4,Ei=this._tables[1],Fi=Ei[0],hr=Ei[1],Bi=Ei[2],pr=Ei[3],mr=Ei[4];for(ai=0;ai>>24]^hr[ge>>16&255]^Bi[$e>>8&255]^pr[255&Pe]^K[si],Nt=Fi[ge>>>24]^hr[$e>>16&255]^Bi[Pe>>8&255]^pr[255&ye]^K[si+1],Je=Fi[$e>>>24]^hr[Pe>>16&255]^Bi[ye>>8&255]^pr[255&ge]^K[si+2],Pe=Fi[Pe>>>24]^hr[ye>>16&255]^Bi[ge>>8&255]^pr[255&$e]^K[si+3],si+=4,ye=ot,ge=Nt,$e=Je;for(ai=0;ai<4;ai++)ne[(3&-ai)+he]=mr[ye>>>24]<<24^mr[ge>>16&255]<<16^mr[$e>>8&255]<<8^mr[255&Pe]^K[si++],ot=ye,ye=ge,ge=$e,$e=Pe,Pe=ot},x}(),f=function(x){function S(){var F;return(F=x.call(this,r)||this).jobs=[],F.delay=1,F.timeout_=null,F}e(S,x);var N=S.prototype;return N.processJob_=function(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null},N.push=function(j){this.jobs.push(j),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},S}(r),v=function(S){return S<<24|(65280&S)<<8|(16711680&S)>>8|S>>>24},T=function(){function x(N,F,j,G){var q=x.STEP,ne=new Int32Array(N.buffer),he=new Uint8Array(N.byteLength),K=0;for(this.asyncStream_=new f,this.asyncStream_.push(this.decryptChunk_(ne.subarray(K,K+q),F,j,he)),K=q;K>2),G=new d(Array.prototype.slice.call(N)),q=new Uint8Array(S.byteLength),ne=new Int32Array(q.buffer);for(he=F[0],K=F[1],ye=F[2],ge=F[3],Je=0;Je=0&&(t="main-desc"),t},Pa=function(n,t){n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},No=function(n,t){t.activePlaylistLoader=n,n.load()},Oa={AUDIO:function(n,t){return function(){var e=t.mediaTypes[n],r=t.blacklistCurrentPlaylist;Pa(t.segmentLoaders[n],e);var a=e.activeTrack(),o=e.activeGroup(),l=(o.filter(function(v){return v.default})[0]||o[0]).id,d=e.tracks[l];if(a!==d){for(var f in U.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[f].enabled=e.tracks[f]===d;e.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(n,t){return function(){var i=t.segmentLoaders[n],e=t.mediaTypes[n];U.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Pa(i,e);var r=e.activeTrack();r&&(r.mode="disabled"),e.onTrackChanged()}}},sc={AUDIO:function(n,t,i){if(t){var e=i.tech,r=i.requestOptions,a=i.segmentLoaders[n];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,r),(!e.paused()||o.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),e.paused()||a.load()}),t.on("error",Oa[n](n,i))}},SUBTITLES:function(n,t,i){var e=i.tech,r=i.requestOptions,a=i.segmentLoaders[n],o=i.mediaTypes[n];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,r),a.track(o.activeTrack()),(!e.paused()||l.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),e.paused()||a.load()}),t.on("error",Oa[n](n,i))}},Gg={AUDIO:function(n,t){var i=t.vhs,e=t.sourceType,r=t.segmentLoaders[n],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[n],d=l.groups,f=l.tracks,v=l.logger_,g=t.masterPlaylistLoader,T=Cn(g.master);for(var E in(!o[n]||0===Object.keys(o[n]).length)&&(o[n]={main:{default:{default:!0}}},T&&(o[n].main.default.playlists=g.master.playlists)),o[n])for(var x in d[E]||(d[E]=[]),o[n][E]){var S=o[n][E][x],N=void 0;if(T?(v("AUDIO group '"+E+"' label '"+x+"' is a master playlist"),S.isMasterPlaylist=!0,N=null):N="vhs-json"===e&&S.playlists?new $r(S.playlists[0],i,a):S.resolvedUri?new $r(S.resolvedUri,i,a):S.playlists&&"dash"===e?new Io(S.playlists[0],i,a,g):null,S=U.mergeOptions({id:x,playlistLoader:N},S),sc[n](n,S.playlistLoader,t),d[E].push(S),typeof f[x]>"u"){var F=new U.AudioTrack({id:x,kind:jg(S),enabled:!1,language:S.language,default:S.default,label:x});f[x]=F}}r.on("error",Oa[n](n,t))},SUBTITLES:function(n,t){var i=t.tech,e=t.vhs,r=t.sourceType,a=t.segmentLoaders[n],o=t.requestOptions,l=t.master.mediaGroups,d=t.mediaTypes[n],f=d.groups,v=d.tracks,g=t.masterPlaylistLoader;for(var T in l[n])for(var E in f[T]||(f[T]=[]),l[n][T])if(!l[n][T][E].forced){var x=l[n][T][E],S=void 0;if("hls"===r)S=new $r(x.resolvedUri,e,o);else if("dash"===r){if(!x.playlists.filter(function(j){return j.excludeUntil!==1/0}).length)return;S=new Io(x.playlists[0],e,o,g)}else"vhs-json"===r&&(S=new $r(x.playlists?x.playlists[0]:x.resolvedUri,e,o));if(x=U.mergeOptions({id:E,playlistLoader:S},x),sc[n](n,x.playlistLoader,t),f[T].push(x),typeof v[E]>"u"){var F=i.addRemoteTextTrack({id:E,kind:"subtitles",default:x.default&&x.autoselect,language:x.language,label:E},!1).track;v[E]=F}}a.on("error",Oa[n](n,t))},"CLOSED-CAPTIONS":function(n,t){var i=t.tech,e=t.master.mediaGroups,r=t.mediaTypes[n],a=r.groups,o=r.tracks;for(var l in e[n])for(var d in a[l]||(a[l]=[]),e[n][l]){var f=e[n][l][d];if(/^(?:CC|SERVICE)/.test(f.instreamId)){var v=i.options_.vhs&&i.options_.vhs.captionServices||{},g={label:d,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(v[g.instreamId]&&(g=U.mergeOptions(g,v[g.instreamId])),void 0===g.default&&delete g.default,a[l].push(U.mergeOptions({id:d},f)),typeof o[d]>"u"){var T=i.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;o[d]=T}}}}},Wg=function s(n,t){for(var i=0;i"u")&&(j=1/0),Ni=f,e.experimentalBufferBasedABR=Boolean(S),e.experimentalLeastPixelDiffSelector=Boolean(N),e.withCredentials=o,e.tech_=l,e.vhs_=l.vhs,e.sourceType_=E,e.useCueTags_=v,e.blacklistDuration=g,e.maxPlaylistRetries=j,e.enableLowInitialPlaylist=T,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:j,timeout:null},e.on("error",e.pauseLoading),e.mediaTypes_=$g(),e.mediaSource=new(P().MediaSource),e.handleDurationChange_=e.handleDurationChange_.bind(Ne(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(Ne(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(Ne(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=U.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new Ug(i),e.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new Bg,e.sourceUpdater_=new ic(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new Ng;var G={vhs:e.vhs_,parse708captions:i.parse708captions,captionServices:F,mediaSource:e.mediaSource,currentTime:e.tech_.currentTime.bind(e.tech_),seekable:function(){return e.seekable()},seeking:function(){return e.tech_.seeking()},duration:function(){return e.duration()},hasPlayed:function(){return e.hasPlayed_},goalBufferLength:function(){return e.goalBufferLength()},bandwidth:d,syncController:e.syncController_,decrypter:e.decrypter_,sourceType:e.sourceType_,inbandTextTracks:e.inbandTextTracks_,cacheEncryptionKeys:x,sourceUpdater:e.sourceUpdater_,timelineChangeController:e.timelineChangeController_,experimentalExactManifestTimings:i.experimentalExactManifestTimings};e.masterPlaylistLoader_="dash"===e.sourceType_?new Io(r,e.vhs_,e.requestOptions_):new $r(r,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Ro(U.mergeOptions(G,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),i),e.audioSegmentLoader_=new Ro(U.mergeOptions(G,{loaderType:"audio"}),i),e.subtitleSegmentLoader_=new Og(U.mergeOptions(G,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks}),i),e.setupSegmentLoaderListeners_(),e.experimentalBufferBasedABR&&(e.masterPlaylistLoader_.one("loadedplaylist",function(){return e.startABRTimer_()}),e.tech_.on("pause",function(){return e.stopABRTimer_()}),e.tech_.on("play",function(){return e.startABRTimer_()})),Xg.forEach(function(ne){e[ne+"_"]=Jg.bind(Ne(e),ne)}),e.logger_=mi("MPC"),e.triggeredFmp4Usage=!1,"none"===e.tech_.preload()?(e.loadOnPlay_=function(){e.loadOnPlay_=null,e.masterPlaylistLoader_.load()},e.tech_.one("play",e.loadOnPlay_)):e.masterPlaylistLoader_.load(),e.timeToLoadedData__=-1,e.mainAppendsToLoadedData__=-1,e.audioAppendsToLoadedData__=-1;var q="none"===e.tech_.preload()?"play":"loadstart";return e.tech_.one(q,function(){var ne=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-ne,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}re(n,s);var t=n.prototype;return t.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},t.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},t.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),r=this.audioAppendsToLoadedData_();return-1===e||-1===r?-1:e+r},t.timeToLoadedData_=function(){return this.timeToLoadedData__},t.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},t.switchMedia_=function(e,r,a){var o=this.media(),l=o&&(o.id||o.uri),d=e.id||e.uri;l&&l!==d&&(this.logger_("switch media "+l+" -> "+d+" from "+r),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+r})),this.masterPlaylistLoader_.media(e,a)},t.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=P().setInterval(function(){return e.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(P().clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var e=this.master(),r=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return r;var l,a=e.mediaGroups.AUDIO,o=Object.keys(a);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var d=a.main||o.length&&a[o[0]];for(var f in d)if(d[f].default){l={label:f};break}}if(!l)return r;var v=[];for(var g in a)if(a[g][l.label]){var T=a[g][l.label];if(T.playlists&&T.playlists.length)v.push.apply(v,T.playlists);else if(T.uri)v.push(T);else if(e.playlists.length)for(var E=0;E1&&Cn(t.master))for(var d=0;d"u"?o:null!==i&&o&&o.filter(function(v){return v.id===i.id})[0]||null}}(E,n),t[E].activeTrack=Kg[E](E,n),t[E].onGroupChanged=function(n,t){return function(){var i=t.segmentLoaders,e=i[n],r=i.main,a=t.mediaTypes[n],o=a.activeTrack(),l=a.getActiveGroup(),d=a.activePlaylistLoader,f=a.lastGroup_;if((!l||!f||l.id!==f.id)&&(a.lastGroup_=l,a.lastTrack_=o,Pa(e,a),l&&!l.isMasterPlaylist)){if(!l.playlistLoader)return void(d&&r.resetEverything());e.resyncLoader(),No(l.playlistLoader,a)}}}(E,n),t[E].onGroupChanging=function(n,t){return function(){var i=t.segmentLoaders[n];t.mediaTypes[n].lastGroup_=null,i.abort(),i.pause()}}(E,n),t[E].onTrackChanged=function(n,t){return function(){var i=t.masterPlaylistLoader,e=t.segmentLoaders,r=e[n],a=e.main,o=t.mediaTypes[n],l=o.activeTrack(),d=o.getActiveGroup(),f=o.activePlaylistLoader,v=o.lastTrack_;if((!v||!l||v.id!==l.id)&&(o.lastGroup_=d,o.lastTrack_=l,Pa(r,o),d)){if(d.isMasterPlaylist){if(!l||!v||l.id===v.id)return;var g=t.vhs.masterPlaylistController_,T=g.selectPlaylist();if(g.media()===T)return;return o.logger_("track change. Switching master audio from "+v.id+" to "+l.id),i.pause(),a.resetEverything(),void g.fastQualityChange_(T)}if("AUDIO"===n){if(!d.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}if(f===d.playlistLoader)return void No(d.playlistLoader,o);r.track&&r.track(l),r.resetEverything(),No(d.playlistLoader,o)}}}(E,n),t[E].getActiveGroup=function(n,t){var i=t.mediaTypes;return function(){var e=i[n].activeTrack();return e?i[n].activeGroup(e):null}}(E,n)});var d=t.AUDIO.activeGroup();if(d){var f=(d.filter(function(E){return E.default})[0]||d[0]).id;t.AUDIO.tracks[f].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}i.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(E){return t[E].onGroupChanged()})}),i.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(E){return t[E].onGroupChanging()})});var g=function(){t.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};for(var T in e.audioTracks().addEventListener("change",g),e.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",function(){e.audioTracks().removeEventListener("change",g),e.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),e.clearTracks("audio"),t.AUDIO.tracks)e.audioTracks().addTrack(t.AUDIO.tracks[T])}({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),r),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var r=e.masterPlaylistLoader_.media();if(!r){var a;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(a=e.selectInitialPlaylist()),a||(a=e.selectPlaylist()),!a||!e.shouldSwitchToMedia_(a))return;if(e.initialMedia_=a,e.switchMedia_(e.initialMedia_,"initial"),"vhs-json"!==e.sourceType_||!e.initialMedia_.segments)return;r=e.initialMedia_}e.handleUpdatedMediaPlaylist(r)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var r=e.masterPlaylistLoader_.media(),a=1.5*r.targetDuration*1e3;e.requestOptions_.timeout=bo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?0:a,e.mainSegmentLoader_.playlist(r,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var r=e.masterPlaylistLoader_.media();"playlist-unchanged"!==r.lastExcludeReason_&&e.stuckAtPlaylistEnd_(r)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},t.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},t.triggerPresenceUsage_=function(e,r){var a=e.mediaGroups||{},o=!0,l=Object.keys(a.AUDIO);for(var d in a.AUDIO)for(var f in a.AUDIO[d])a.AUDIO[d][f].uri||(o=!1);o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Ni.Playlist.isAes(r)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(e){var r=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine();return function(n){var t=n.currentPlaylist,i=n.buffered,e=n.currentTime,r=n.nextPlaylist,a=n.bufferLowWaterLine,o=n.bufferHighWaterLine,l=n.duration,d=n.experimentalBufferBasedABR,f=n.log;if(!r)return U.log.warn("We received no playlist to switch to. Please check your stream."),!1;var v="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return f(v+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var g=Boolean(Yr(i,e).length);if(!t.endList)return g||"number"!=typeof t.partTargetDuration?(f(v+" as current playlist is live"),!0):(f("not "+v+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var T=vo(i,e),E=d?Dt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Dt.MAX_BUFFER_LOW_WATER_LINE;if(lS)&&T>=a){var F=v+" as forwardBuffer >= bufferLowWaterLine ("+T+" >= "+a+")";return d&&(F+=" and next bandwidth > current bandwidth ("+x+" > "+S+")"),f(F),!0}return f("not "+v+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:a,currentPlaylist:r,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var a=e.selectPlaylist();e.shouldSwitchToMedia_(a)&&e.switchMedia_(a,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var r=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();o&&e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",r),this.audioSegmentLoader_.on("trackinfo",r),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},t.fastQualityChange_=function(e){var r=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){r.tech_.setCurrentTime(U.browser.IE_VERSION||U.browser.IS_EDGE?r.tech_.currentTime()+.04:r.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*r,a.excludeUntil=v,e.reason&&(a.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var g=this.selectPlaylist();if(!g)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");(e.internal?this.logger_:U.log.warn)((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(e.message?" "+e.message:"")+" Switching to playlist "+g.id+"."),g.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),g.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var x=g.targetDuration/2*1e3||5e3,S="number"==typeof g.lastRequest&&Date.now()-g.lastRequest<=x;return this.switchMedia_(g,"exclude",d||S)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(e,r){var a=this,o=[],l="all"===e;(l||"main"===e)&&o.push(this.masterPlaylistLoader_);var d=[];(l||"audio"===e)&&d.push("AUDIO"),(l||"subtitle"===e)&&(d.push("CLOSED-CAPTIONS"),d.push("SUBTITLES")),d.forEach(function(f){var v=a.mediaTypes_[f]&&a.mediaTypes_[f].activePlaylistLoader;v&&o.push(v)}),["main","audio","subtitle"].forEach(function(f){var v=a[f+"SegmentLoader_"];v&&(e===f||"all"===e)&&o.push(v)}),o.forEach(function(f){return r.forEach(function(v){"function"==typeof f[v]&&f[v]()})})},t.setCurrentTime=function(e){var r=Yr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?r&&r.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Ni.Playlist.duration(e):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var r=this.masterPlaylistLoader_.media();if(r){var a=this.syncController_.getExpiredTime(r,this.duration());if(null!==a){var d,f,o=this.masterPlaylistLoader_.master,l=Ni.Playlist.seekable(r,a,Ni.Playlist.liveEdgeDelay(o,r));0===l.length||this.mediaTypes_.AUDIO.activePlaylistLoader&&(r=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(a=this.syncController_.getExpiredTime(r,this.duration()))||0===(e=Ni.Playlist.seekable(r,a,Ni.Playlist.liveEdgeDelay(o,r))).length)||(this.seekable_&&this.seekable_.length&&(d=this.seekable_.end(0),f=this.seekable_.start(0)),this.seekable_=e?e.start(0)>l.end(0)||l.start(0)>e.end(0)?l:U.createTimeRanges([[e.start(0)>l.start(0)?e.start(0):l.start(0),e.end(0)0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)}},t.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(r){var a=e.mediaTypes_[r].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,r=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!r||!a)},t.getCodecsOrExclude_=function(){var e=this,r={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};r.video=r.main;var a=An(this.master(),this.media()),o={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(r.main.hasVideo&&(o.video=a.video||r.main.videoCodec||"avc1.4d400d"),r.main.isMuxed&&(o.video+=","+(a.audio||r.main.audioCodec||Qt)),(r.main.hasAudio&&!r.main.isMuxed||r.audio.hasAudio||l)&&(o.audio=a.audio||r.main.audioCodec||r.audio.audioCodec||Qt,r.audio.isFmp4=r.main.hasAudio&&!r.main.isMuxed?r.main.isFmp4:r.audio.isFmp4),o.audio||o.video){var v,f={};if(["video","audio"].forEach(function(x){if(o.hasOwnProperty(x)&&!function(S,N){return S?ii(N):ci(N)}(r[x].isFmp4,o[x])){var S=r[x].isFmp4?"browser":"muxer";f[S]=f[S]||[],f[S].push(o[x]),"audio"===x&&(v=S)}}),l&&v&&this.media().attributes.AUDIO){var g=this.media().attributes.AUDIO;this.master().playlists.forEach(function(x){(x.attributes&&x.attributes.AUDIO)===g&&x!==e.media()&&(x.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+v+' does not support codec(s): "'+o.audio+'"')}if(!Object.keys(f).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var E=[];if(["video","audio"].forEach(function(x){var S=(Xe(e.sourceUpdater_.codecs[x]||"")[0]||{}).type,N=(Xe(o[x]||"")[0]||{}).type;S&&N&&S.toLowerCase()!==N.toLowerCase()&&E.push('"'+e.sourceUpdater_.codecs[x]+'" -> "'+o[x]+'"')}),E.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+E.join(", ")+".",blacklistDuration:1/0,internal:!0})}return o}var T=Object.keys(f).reduce(function(x,S){return x&&(x+=", "),x+(S+' does not support codec(s): "')+f[S].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:T,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},t.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var r=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(r)}}},t.excludeUnsupportedVariants_=function(){var e=this,r=this.master().playlists,a=[];Object.keys(r).forEach(function(o){var l=r[o];if(-1===a.indexOf(l.id)){a.push(l.id);var d=An(e.master,l),f=[];d.audio&&!ci(d.audio)&&!ii(d.audio)&&f.push("audio codec "+d.audio),d.video&&!ci(d.video)&&!ii(d.video)&&f.push("video codec "+d.video),d.text&&"stpp.ttml.im1t"===d.text&&f.push("text codec "+d.text),f.length&&(l.excludeUntil=1/0,e.logger_("excluding "+l.id+" for unsupported: "+f.join(", ")))}})},t.excludeIncompatibleVariants_=function(e){var r=this,a=[],o=this.master().playlists,l=Aa(Xe(e)),d=Gd(l),f=l.video&&Xe(l.video)[0]||null,v=l.audio&&Xe(l.audio)[0]||null;Object.keys(o).forEach(function(g){var T=o[g];if(-1===a.indexOf(T.id)&&T.excludeUntil!==1/0){a.push(T.id);var E=[],x=An(r.masterPlaylistLoader_.master,T),S=Gd(x);if(x.audio||x.video){if(S!==d&&E.push('codec count "'+S+'" !== "'+d+'"'),!r.sourceUpdater_.canChangeType()){var N=x.video&&Xe(x.video)[0]||null,F=x.audio&&Xe(x.audio)[0]||null;N&&f&&N.type.toLowerCase()!==f.type.toLowerCase()&&E.push('video codec "'+N.type+'" !== "'+f.type+'"'),F&&v&&F.type.toLowerCase()!==v.type.toLowerCase()&&E.push('audio codec "'+F.type+'" !== "'+v.type+'"')}E.length&&(T.excludeUntil=1/0,r.logger_("blacklisting "+T.id+": "+E.join(" && ")))}}})},t.updateAdCues_=function(e){var r=0,a=this.seekable();a.length&&(r=a.start(0)),function(n,t,i){if(void 0===i&&(i=0),n.segments)for(var r,e=i,a=0;a"u"?o:(e?delete r.disabled:r.disabled=!0,e!==o&&!a&&(i(),n.trigger(e?"renditionenabled":"renditiondisabled")),e)}}(n.playlists,t.id,o)},oc=["seeking","seeked","pause","playing","error"],av=function(){function s(t){var i=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=mi("PlaybackWatcher"),this.logger_("initialize");var e=function(){return i.monitorCurrentTime_()},r=function(){return i.monitorCurrentTime_()},a=function(){return i.techWaiting_()},o=function(){return i.cancelTimer_()},l=this.masterPlaylistController_,d=["main","subtitle","audio"],f={};d.forEach(function(g){f[g]={reset:function(){return i.resetSegmentDownloads_(g)},updateend:function(){return i.checkSegmentDownloads_(g)}},l[g+"SegmentLoader_"].on("appendsdone",f[g].updateend),l[g+"SegmentLoader_"].on("playlistupdate",f[g].reset),i.tech_.on(["seeked","seeking"],f[g].reset)});var v=function(T){["main","audio"].forEach(function(E){l[E+"SegmentLoader_"][T]("appended",i.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){i.fixesBadSeeks_()&&(i.consecutiveUpdates=0,i.lastRecordedTime=i.tech_.currentTime(),v("off"))},this.clearSeekingAppendCheck_=function(){return v("off")},this.watchForBadSeeking_=function(){i.clearSeekingAppendCheck_(),v("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(oc,o),this.tech_.on("canplay",r),this.tech_.one("play",e),this.dispose=function(){i.clearSeekingAppendCheck_(),i.logger_("dispose"),i.tech_.off("waiting",a),i.tech_.off(oc,o),i.tech_.off("canplay",r),i.tech_.off("play",e),i.tech_.off("seeking",i.watchForBadSeeking_),i.tech_.off("seeked",i.clearSeekingAppendCheck_),d.forEach(function(g){l[g+"SegmentLoader_"].off("appendsdone",f[g].updateend),l[g+"SegmentLoader_"].off("playlistupdate",f[g].reset),i.tech_.off(["seeked","seeking"],f[g].reset)}),i.checkCurrentTimeTimeout_&&P().clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var n=s.prototype;return n.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&P().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=P().setTimeout(this.monitorCurrentTime_.bind(this),250)},n.resetSegmentDownloads_=function(i){var e=this.masterPlaylistController_[i+"SegmentLoader_"];this[i+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+i+" loader"),this[i+"StalledDownloads_"]=0,this[i+"Buffered_"]=e.buffered_()},n.checkSegmentDownloads_=function(i){var e=this.masterPlaylistController_,r=e[i+"SegmentLoader_"],a=r.buffered_(),o=function(n,t){if(n===t)return!1;if(!n&&t||!t&&n||n.length!==t.length)return!0;for(var i=0;i=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&i===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):i===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=i)}},n.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},n.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var o,e=this.seekable(),r=this.tech_.currentTime();if(this.afterSeekableWindow_(e,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(o=e.end(e.length-1)),this.beforeSeekableWindow_(e,r)){var d=e.start(0);o=d+(d===e.end(0)?0:bi)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+r+" with seekable range "+nd(e)+". Seeking to "+o+"."),this.tech_.setCurrentTime(o),!0;for(var f=this.masterPlaylistController_.sourceUpdater_,v=this.tech_.buffered(),g=f.audioBuffer?f.audioBuffered():null,T=f.videoBuffer?f.videoBuffered():null,E=this.media(),x=E.partTargetDuration?E.partTargetDuration:2*(E.targetDuration-Ki),S=[g,T],N=0;N "+r.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}},n.techWaiting_=function(){var i=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(i,e)){var r=i.end(i.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+r),this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var d=xa(o,e);if(d.length>0){var f=d.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+f+", seeking to "+d.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*f,e),!0}return!1},n.afterSeekableWindow_=function(i,e,r,a){if(void 0===a&&(a=!1),!i.length)return!1;var o=i.end(i.length-1)+bi;return!r.endList&&a&&(o=i.end(i.length-1)+3*r.targetDuration),e>o},n.beforeSeekableWindow_=function(i,e){return!!(i.length&&i.start(0)>0&&e2)return{start:o,end:l}}return null},s}(),sv={errorInterval:30,getSource:function(n){return n(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},ov=function s(n,t){var i=0,e=0,r=U.mergeOptions(sv,t);n.ready(function(){n.trigger({type:"usage",name:"vhs-error-reload-initialized"}),n.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){e&&n.currentTime(e)},o=function(g){null!=g&&(e=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",a),n.src(g),n.trigger({type:"usage",name:"vhs-error-reload"}),n.trigger({type:"usage",name:"hls-error-reload"}),n.play())},l=function(){return Date.now()-i<1e3*r.errorInterval?(n.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void n.trigger({type:"usage",name:"hls-error-reload-canceled"})):r.getSource&&"function"==typeof r.getSource?(i=Date.now(),r.getSource.call(n,o)):void U.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},d=function v(){n.off("loadedmetadata",a),n.off("error",l),n.off("dispose",v)};n.on("error",l),n.on("dispose",d),n.reloadSourceOnError=function(g){d(),s(n,g)}},Lt={PlaylistLoader:$r,Playlist:Yt,utils:Em,STANDARD_PLAYLIST_SELECTOR:Kd,INITIAL_PLAYLIST_SELECTOR:function(){var n=this,t=this.playlists.master.playlists.filter(Yt.isEnabled);return Qr(t,function(e,r){return Lo(e,r)}),t.filter(function(e){return!!An(n.playlists.master,e).video})[0]||null},lastBandwidthSelector:Kd,movingAverageBandwidthSelector:function(n){var t=-1,i=-1;if(n<0||n>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&P().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=n*this.systemBandwidth+(1-n)*t,i=this.systemBandwidth),Zd(this.playlists.master,t,parseInt(Ia(this.tech_.el(),"width"),10)*e,parseInt(Ia(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Lo,comparePlaylistResolution:function(n,t){var i,e;return n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(i=n.attributes.RESOLUTION.width),i=i||P().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(e=t.attributes.RESOLUTION.width),i===(e=e||P().Number.MAX_VALUE)&&n.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?n.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-e},xhr:xd()};Object.keys(Dt).forEach(function(s){Object.defineProperty(Lt,s,{get:function(){return U.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Dt[s]},set:function(t){U.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?U.log.warn("value of Vhs."+s+" must be greater than or equal to 0"):Dt[s]=t}})});var lc="videojs-vhs",dc=function(n,t){for(var i=t.media(),e=-1,r=0;r=g&&f>=g?Math.max(f,T):T}return f},set:function(f){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=f,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set:function(){U.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return cr(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return cr(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&function(n){if(!P().localStorage)return!1;var t=cc();t=t?U.mergeOptions(t,n):n;try{P().localStorage.setItem(lc,JSON.stringify(t))}catch{return!1}}({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n){n.representations=function(){var t=n.masterPlaylistController_.master(),i=Cn(t)?n.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!To(e)}).map(function(e,r){return new rv(n,e,e.id)}):[]}}(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=P().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var e=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(n){var t=n.player,i=n.sourceKeySystems,e=n.audioMedia,r=n.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var o=function(n,t){return n.reduce(function(i,e){if(!e.contentProtection)return i;var r=t.reduce(function(a,o){var l=e.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(r).length&&i.push(r),i},[])}(e?r.concat([e]):r,Object.keys(i)),l=[],d=[];return o.forEach(function(f){d.push(new Promise(function(v,g){t.tech_.one("keysessioncreated",v)})),l.push(new Promise(function(v,g){t.eme.initializeMediaKeys({keySystems:f},function(T){T?g(T):v()})}))}),Promise.race([Promise.all(l),Promise.race(d)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:r&&r.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var e=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=function(n){var t=n.player,a=function(n,t,i){if(!n)return n;var e={};t&&t.attributes&&t.attributes.CODECS&&(e=Aa(Xe(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(e.audio=i.attributes.CODECS);var r=$t(e.video),a=$t(e.audio),o={};for(var l in n)o[l]={},a&&(o[l].audioContentType=a),r&&(o[l].videoContentType=r),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),"string"==typeof n[l]&&(o[l].url=n[l]);return U.mergeOptions(n,o)}(n.sourceKeySystems,n.media,n.audioMedia);return!(!a||(t.currentSource().keySystems=a,a&&!t.eme&&(U.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))}({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:r&&r.media()});this.player_.tech_.on("keystatuschange",function(o){"output-restricted"===o.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+o.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==U.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},t.setupQualityLevels_=function(){var e=this,r=U.players[this.tech_.options_.playerId];!r||!r.qualityLevels||this.qualityLevels_||(this.qualityLevels_=r.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n,t){t.representations().forEach(function(i){n.addQualityLevel(i)}),dc(n,t.playlists)}(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){dc(e.qualityLevels_,e.playlists)}))},n.version=function(){return{"@videojs/http-streaming":"2.13.1","mux.js":"6.0.1","mpd-parser":"0.21.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return ic.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&P().URL.revokeObjectURL&&(P().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(e,r){return function(n){var t=n.playlist,i=n.time,e=void 0===i?void 0:i,r=n.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===e)return r({message:"getProgramTime: playlist and time must be provided"});var a=function(n,t){if(!t||!t.segments||0===t.segments.length)return null;for(var e,i=0,r=0;ri){if(n>i+.25*a.duration)return null;e=a}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:i-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}}(e,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:e},l=function(n,t){if(!t.dateTimeObject)return null;var a=n-(t.videoTimingInfo.transmuxedPresentationStart+t.videoTimingInfo.transmuxerPrependedSeconds);return new Date(t.dateTimeObject.getTime()+1e3*a)}(e,a.segment);return l&&(o.programDateTime=l.toISOString()),r(null,o)}({playlist:this.masterPlaylistController_.media(),time:e,callback:r})},t.seekToProgramTime=function(e,r,a,o){return void 0===a&&(a=!0),void 0===o&&(o=2),Om({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:r})},n}(U.getComponent("Component")),La={name:"videojs-http-streaming",VERSION:"2.13.1",canHandleSource:function(n,t){void 0===t&&(t={});var i=U.mergeOptions(U.options,t);return La.canPlayType(n.type,i)},handleSource:function(n,t,i){void 0===i&&(i={});var e=U.mergeOptions(U.options,i);return t.vhs=new Fo(n,t,e),U.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return U.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=xd(),t.vhs.src(n.src,n.type),t.vhs},canPlayType:function(n,t){void 0===t&&(t={});var i=U.mergeOptions(U.options,t),e=i.vhs,r=(e=void 0===e?{}:e).overrideNative,a=void 0===r?!U.browser.IS_ANY_SAFARI:r,o=i.hls,l=(o=void 0===o?{}:o).overrideNative,d=void 0!==l&&l,f=sn(n);return f&&(!Lt.supportsTypeNatively(f)||d||a)?"maybe":""}};ii("avc1.4d400d,mp4a.40.2")&&U.getTech("Html5").registerSourceHandler(La,0),U.VhsHandler=Fo,Object.defineProperty(U,"HlsHandler",{get:function(){return U.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Fo},configurable:!0}),U.VhsSourceHandler=La,Object.defineProperty(U,"HlsSourceHandler",{get:function(){return U.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),La},configurable:!0}),U.Vhs=Lt,Object.defineProperty(U,"Hls",{get:function(){return U.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Lt},configurable:!0}),U.use||(U.registerComponent("Hls",Lt),U.registerComponent("Vhs",Lt)),U.options.vhs=U.options.vhs||{},U.options.hls=U.options.hls||{},U.getPlugin&&U.getPlugin("reloadSourceOnError")||(U.registerPlugin||U.plugin)("reloadSourceOnError",function(n){ov(this,n)});const Sv=U,Ev=["target"];let Cv=(()=>{class s{constructor(t){this.gs=t,this.subtitlesOctopus=null,this.videoUrl=null,this.videoThumb=null,this.subtitleUrl=null,this.subtitleFonts=[]}ngOnInit(){this.gs.isBrowser&&this.target&&this.videoUrl&&(this.gs.log("[VIDEO-JS_INIT_URL]",this.videoUrl),this.player=Sv(this.target.nativeElement,{autoplay:!1,controls:!0,fluid:!0,muted:!1,sources:[{src:this.videoUrl,type:"video/mp4"}],poster:this.videoThumb},()=>{this.gs.log("[VIDEO-JS_READY]",this.player),this.initSubtitle()}))}ngOnDestroy(){this.subtitlesOctopus?.dispose(),this.player?.dispose()}ngOnChanges(){this.subtitlesOctopus?this.subtitleUrl&&this.subtitlesOctopus.setTrackByUrl(this.subtitleUrl):this.initSubtitle()}initSubtitle(){this.subtitleUrl&&(this.subtitlesOctopus=new SubtitlesOctopus({video:this.target.nativeElement,subUrl:this.subtitleUrl,fonts:this.subtitleFonts,workerUrl:"/assets/lib/subtitles-octopus-worker.js",legacyWorkerUrl:"/assets/lib/subtitles-octopus-worker-legacy.js"}),this.gs.log("[SUBTITLE_INIT]",this.subtitlesOctopus))}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(ke.U))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-vjs-player"]],viewQuery:function(i,e){if(1&i&&u.Gf(Ev,7),2&i){let r;u.iGM(r=u.CRH())&&(e.target=r.first)}},inputs:{videoUrl:"videoUrl",videoThumb:"videoThumb",subtitleUrl:"subtitleUrl",subtitleFonts:"subtitleFonts"},features:[u.TTD],decls:2,vars:0,consts:[["controls","","muted","","playsinline","","preload","none",1,"video-js","w-100"],["target",""]],template:function(i,e){1&i&&u._UZ(0,"video",0,1)}})}return s})();var kv=H(8124),Av=H(3710),fc=H(7443);function wv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",23),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.hYB("routerLink","/anime/",t.berkasData.anime_.id,"-",t.animeName,""),u.xp6(1),u.s9C("src",t.berkasData.anime_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.anime_.name)}}function Iv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",23),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.MGl("routerLink","/dorama/",t.berkasData.dorama_.slug,""),u.xp6(1),u.s9C("src",t.berkasData.dorama_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.dorama_.name)}}function Dv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option"),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(1),u.MGl("src","",t.ENV.baseUrl,"/assets/img/favicon.png",u.LSH),u.xp6(2),u.Oqu(t.berkasData.sn_code)}}function Pv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",23),u._UZ(1,"img",24),u.TgZ(2,"h4",25),u._uU(3),u.qZA()()),2&s){const t=n.$implicit;u.MGl("routerLink","/fansub/",t.slug,""),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.Oqu(t.name)}}function Ov(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return u.KtG(e.ddl(e.berkasData.attachment_.id))}),u._UZ(1,"mat-icon",41),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.orig||t.lampiran.name+"."+t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.lampiran.orig?null:t.lampiran.orig.split(".")[0])||t.lampiran.name,0,5),".....",t.lampiran.ext," (",u.lcZ(4,9,t.lampiran.size),") ")}}function Lv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",42),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return u.KtG(e.cancel_dl(e.berkasData.attachment_.id))}),u._UZ(1,"mat-icon",43),u._uU(2," Batal Unduh "),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.orig||t.lampiran.name+"."+t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan")}}function Rv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return u.KtG(e.saveFileAs(e.berkasData.attachment_.id))}),u._UZ(1,"mat-icon",44),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.orig||t.lampiran.name+"."+t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.lampiran.orig?null:t.lampiran.orig.split(".")[0])||t.lampiran.name,0,5),".....",t.lampiran.ext," (",u.lcZ(4,9,t.lampiran.size),") ")}}function Mv(s,n){if(1&s&&(u.TgZ(0,"div",33),u._uU(1),u._UZ(2,"br"),u._uU(3),u._UZ(4,"br")(5,"mat-progress-bar",45),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.AsE(" ",t.lampiran.percentage>=100?"Selesai Mengunduh ... ":"Sedang Mengunduh ... "," ",t.lampiran.totals," Bytes "),u.xp6(2),u.AsE(" ",t.lampiran.percentage,"% @ ",t.lampiran.speed," KB/s "),u.xp6(2),u.Q6J("mode",t.lampiran.mode)("value",t.lampiran.percentage)}}function Uv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",47),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(5);return u.KtG(e.standardDdlVideo(e.berkasData.attachment_.id))}),u._uU(1," Unduhan Macet? "),u.TgZ(2,"i")(3,"u"),u._uU(4,"Coba Gunakan Unduhan Biasa~"),u.qZA()()()}}function Nv(s,n){if(1&s&&(u.TgZ(0,"div",18),u.YNc(1,Uv,5,0,"div",46),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Q6J("ngIf",t.lampiran.isDownloading)}}function Fv(s,n){1&s&&(u.TgZ(0,"div",48),u._UZ(1,"hr",49),u.qZA())}function Bv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",42),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.standardDdlSubsFont(r.id))}),u._UZ(1,"mat-icon",50),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.hYB("matTooltip","",t.orig||t.name+"."+t.ext," :: ",t.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.orig?null:t.orig.split(".")[0])||t.name,0,5),".....",t.ext," (",u.lcZ(4,9,t.size),") ")}}function jv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",42),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.standardDdlSubsFont(r.id))}),u._UZ(1,"mat-icon",51),u._uU(2),u.ALo(3,"slice"),u.ALo(4,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.hYB("matTooltip","",t.orig||t.name+"."+t.ext," :: ",t.download_count,"x Unduhan"),u.xp6(2),u.lnq(" ",u.Dn7(3,5,(null==t.orig?null:t.orig.split(".")[0])||t.name,0,5),".....",t.ext," (",u.lcZ(4,9,t.size),") ")}}function Hv(s,n){if(1&s&&(u.TgZ(0,"div",32)(1,"div",33),u.YNc(2,Ov,5,11,"button",34),u.YNc(3,Lv,3,2,"button",35),u.YNc(4,Rv,5,11,"button",34),u.TgZ(5,"div",13),u.YNc(6,Mv,6,6,"div",36),u.qZA(),u.YNc(7,Nv,2,1,"div",37),u.YNc(8,Fv,2,0,"div",38),u.YNc(9,Bv,5,11,"button",39),u.YNc(10,jv,5,11,"button",39),u.qZA()()),2&s){const t=u.oxw(3);u.xp6(2),u.Q6J("ngIf",!t.lampiran.data&&!t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",!t.lampiran.data&&t.lampiran.isDownloading),u.xp6(1),u.Q6J("ngIf",t.lampiran.data),u.xp6(2),u.Q6J("ngIf",t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.isDiscord),u.xp6(1),u.Q6J("ngIf",(null==t.berkasData.attachment_||null==t.berkasData.attachment_.subtitles_?null:t.berkasData.attachment_.subtitles_.length)>0||(null==t.berkasData.attachment_||null==t.berkasData.attachment_.fonts_?null:t.berkasData.attachment_.fonts_.length)>0),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.subtitles_),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.fonts_)}}function Vv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",32)(1,"div",33)(2,"button",52),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.verify())}),u._UZ(3,"mat-icon",53),u._uU(4),u.qZA()()()}if(2&s){const t=u.oxw(3);u.xp6(4),u.hij(" ",t.berkasData.attachment_," ")}}function qv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17)(4,"i"),u._uU(5,"Direct Download"),u.qZA()()()(),u.YNc(6,Hv,11,8,"div",31),u.YNc(7,Vv,5,1,"div",31),u.qZA()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("ngIf",t.isHaveDDL),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function Gv(s,n){if(1&s&&(u.TgZ(0,"a",55),u._UZ(1,"img",56),u._uU(2),u.qZA()),2&s){const t=n.$implicit,i=u.oxw(4);u.s9C("href",t.url,u.LSH),u.xp6(1),u.s9C("src",i.getIconFromUrl(t.url),u.LSH),u.xp6(1),u.hij(" ",t.name," ")}}function Wv(s,n){if(1&s&&(u.TgZ(0,"div",32),u.YNc(1,Gv,3,3,"a",54),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.berkasData.download_url)}}function Zv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",32)(1,"button",57),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.login())}),u._UZ(2,"mat-icon",58),u._uU(3," Klik Untuk Login "),u.qZA()()}}function Kv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4," Tautan Unduhan "),u.TgZ(5,"i"),u._uU(6),u.qZA()()()(),u.YNc(7,Wv,2,1,"div",31),u.YNc(8,Zv,4,0,"div",31),u.qZA()),2&s){const t=u.oxw(2);u.xp6(6),u.Oqu(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value?"External":""),u.xp6(1),u.Q6J("ngIf",null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value))}}function zv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Deskripsi & Informasi"),u.qZA()()(),u.TgZ(5,"div",18),u._UZ(6,"div",59),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("innerHTML",t.berkasData.description,u.oJD)}}function Yv(s,n){if(1&s&&(u.TgZ(0,"mat-option",71),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.url),u.xp6(1),u.Oqu(t.name)}}function $v(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",68)(1,"mat-label"),u._uU(2,"Pilih Subtitle / Takarir (.ASS Saja)"),u.qZA(),u.TgZ(3,"mat-select",69),u.NdJ("valueChange",function(e){u.CHM(t);const r=u.oxw(3);return u.KtG(r.selectedSubsUrl=e)}),u.YNc(4,Yv,2,2,"mat-option",70),u.qZA()()}if(2&s){const t=u.oxw(3);u.Q6J("color","accent"),u.xp6(3),u.Q6J("value",t.selectedSubsUrl),u.xp6(1),u.Q6J("ngForOf",t.subtitles)}}function Qv(s,n){1&s&&u._UZ(0,"mat-progress-bar",72)}function Xv(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1,"Mulai Streaming Video"),u.qZA())}function Jv(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1," Loading ... "),u.qZA())}function e_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",73),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.watchDdl())}),u._UZ(1,"mat-icon",74),u.YNc(2,Xv,2,0,"span",21),u.YNc(3,Jv,2,0,"span",21),u.qZA()}if(2&s){const t=u.oxw(3);u.Q6J("disabled",t.vjsInit),u.xp6(2),u.Q6J("ngIf",!t.vjsInit),u.xp6(1),u.Q6J("ngIf",t.vjsInit)}}function t_(s,n){if(1&s&&u._UZ(0,"app-vjs-player",75),2&s){const t=u.oxw(3);u.Q6J("videoUrl",t.ddlVideo)("videoThumb",t.videoThumb)("subtitleUrl",t.selectedSubsUrl)("subtitleFonts",t.ddlFonts)}}function i_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",76),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.verify())}),u._UZ(1,"mat-icon",53),u._uU(2),u.qZA()}if(2&s){const t=u.oxw(3);u.xp6(2),u.hij(" ",t.berkasData.attachment_," ")}}function r_(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Video Stream (Browser Tertentu T.T)"),u.qZA()()(),u.TgZ(5,"div",18)(6,"div",60),u._uU(7," Dapat digunakan sebagai referensi untuk pratinjau namun kemungkinan jenis huruf tulisan gagal dimuat sehingga nantinya akan muncul huruf dengan gambar \u{1f533} misalnya kanji. Lalu juga memungkinkan terjadinya gerakan patah - patah jika browser tidak kuat untuk render .ASS subtitle dengan efek yang terlalu banyak. "),u.TgZ(8,"span",61)(9,"i"),u._uU(10,"Player"),u.qZA(),u._uU(11," ini mungkin tidak dapat memutar video HEVC-x265 (belum support semua "),u.TgZ(12,"i"),u._uU(13,"web browser"),u.qZA(),u._uU(14,") dan audio AC3 (atau ekstensi lain yang masih memiliki lisensi paten belum "),u.TgZ(15,"i"),u._uU(16,"open source"),u.qZA(),u._uU(17,"). Takarir / "),u.TgZ(18,"i"),u._uU(19,"subtitle"),u.qZA(),u._uU(20," yang dapat ditampilkan jenis .ASS saja, itupun jika tersedia di dalam video internalnya. "),u.qZA(),u.TgZ(21,"a",62),u._uU(22," * Browser Firefox sudah pasti tidak bisa memutar .MKV "),u.qZA()(),u.TgZ(23,"div",33),u.YNc(24,$v,5,3,"mat-form-field",63),u.YNc(25,Qv,1,0,"mat-progress-bar",64),u.YNc(26,e_,4,3,"button",65),u.YNc(27,t_,1,4,"app-vjs-player",66),u.YNc(28,i_,3,1,"button",67),u.qZA()()()),2&s){const t=u.oxw(2);u.xp6(24),u.Q6J("ngIf",t.subtitles.length>0),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&t.vjsReady),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function n_(s,n){1&s&&(u.TgZ(0,"div",14)(1,"div",18),u._UZ(2,"app-report"),u.qZA()())}function a_(s,n){if(1&s&&(u.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"ul",4),u._UZ(4,"li")(5,"li")(6,"li")(7,"li")(8,"li")(9,"li")(10,"li")(11,"li")(12,"li")(13,"li"),u.TgZ(14,"div",5)(15,"h2",6),u._uU(16),u.qZA(),u.TgZ(17,"p",7),u._uU(18),u.qZA(),u.TgZ(19,"p",8),u._uU(20),u.ALo(21,"date"),u.qZA()()()()(),u._UZ(22,"app-notifications"),u.TgZ(23,"div",9)(24,"div",10)(25,"div",11)(26,"div",12)(27,"div",13)(28,"div",14)(29,"div",15)(30,"h2",16)(31,"b",17),u._uU(32,"Rujukan"),u.qZA()()(),u.TgZ(33,"div",18)(34,"mat-selection-list",19),u.YNc(35,wv,4,4,"mat-list-option",20),u.YNc(36,Iv,4,3,"mat-list-option",20),u.YNc(37,Dv,4,2,"mat-list-option",21),u.YNc(38,Pv,4,3,"mat-list-option",22),u.TgZ(39,"mat-list-option",23),u._UZ(40,"img",24),u.TgZ(41,"h4",25),u._uU(42),u.qZA()()()()(),u.YNc(43,qv,8,2,"div",26),u.YNc(44,Kv,9,3,"div",26),u.qZA()()(),u.TgZ(45,"div",27)(46,"div",12)(47,"div",13),u.YNc(48,zv,7,1,"div",26),u.YNc(49,r_,29,5,"div",26),u.YNc(50,n_,3,0,"div",26),u.TgZ(51,"div",14)(52,"div",28)(53,"h2",29)(54,"b",17),u._uU(55,"Komentar"),u.qZA()()(),u.TgZ(56,"div",18)(57,"div",30),u._UZ(58,"app-discussion"),u.qZA()()()()()()()()()),2&s){const t=u.oxw();u.xp6(2),u.Udp("background","url(/assets/img/banner/berkas-detail.png), linear-gradient(to bottom, "+(t.GS.isDarkMode?"#673ab7":"#3f51b5")+" 0%, #ee0dfd 100%)"),u.xp6(14),u.hij(" ",t.berkasData.name," "),u.xp6(2),u.AsE(" ",t.berkasData.view_count,"x Dilihat :: ",t.berkasData.like_count," Orang Suka "),u.xp6(2),u.hij(" ",u.xi3(21,19,t.berkasData.created_at,"d MMMM y, hh:mm:ss a z")," "),u.xp6(14),u.Q6J("multiple",!1),u.xp6(1),u.Q6J("ngIf",t.berkasData.anime_),u.xp6(1),u.Q6J("ngIf",t.berkasData.dorama_),u.xp6(1),u.Q6J("ngIf",t.berkasData.sn_code),u.xp6(1),u.Q6J("ngForOf",t.berkasData.fansub_),u.xp6(1),u.MGl("routerLink","/user/",t.berkasData.user_.username,""),u.xp6(1),u.s9C("src",t.berkasData.user_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.user_.username),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&t.berkasData.attachment_),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value)||(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.berkasData.download_url?null:t.berkasData.download_url.length)>0),u.xp6(4),u.Q6J("ngIf",t.berkasData.description),u.xp6(1),u.Q6J("ngIf",t.berkasData.attachment_&&t.isStreamable),u.xp6(1),u.Q6J("ngIf",null==t.SS.mySocket?null:t.SS.mySocket.id)}}let s_=(()=>{class s{constructor(t,i,e,r,a,o,l,d,f,v,g,T){this.router=t,this.activatedRoute=i,this.gs=e,this.bs=r,this.pi=a,this.berkas=o,this.fs=l,this.as=d,this.dm=f,this.wb=v,this.ss=g,this.dls=T,this.berkasId="",this.berkasData=null,this.subsBerkas=null,this.subsParam=null,this.subsDialog=null,this.subsSubtitlesFonts=null,this.subtitles=[],this.fonts=[],this.selectedSubsUrl=null,this.vjsInit=!1,this.vjsReady=!1,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get ENV(){return Ge.N}get GS(){return this.gs}get AS(){return this.as}get SS(){return this.ss}ngOnDestroy(){this.subsBerkas?.unsubscribe(),this.subsParam?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsSubtitlesFonts?.unsubscribe()}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:t=>{this.berkasId=t.berkasId,this.bs.busy(),this.subsBerkas=this.berkas.getBerkas(this.berkasId).subscribe({next:i=>{this.gs.log("[BERKAS_DETAIL_SUCCESS]",i),this.berkasData=i.result,this.pi.updatePageMetaData(this.berkasData.name,this.berkasData.description,this.berkasData.name,this.berkasData.image_url,this.berkasData.user_.username),this.pi.updatePageHeader(this.berkasData.project_type_.name),this.bs.idle(),this.gs.isBrowser&&this.fs.initializeFab("edit",null,"Ubah Data Berkas",`/berkas/${this.berkasId}/edit`,!1)},error:i=>{this.gs.log("[BERKAS_DETAIL_ERROR]",i,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/berkas"}})}})}})}watchDdl(){this.vjsInit=!0,this.setupVjs()}login(){this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}get animeName(){return this.berkasData.anime_.name.replace(/[^a-zA-Z0-9]/g,"-")}get lampiran(){return this.dm.getAttachmentDownloadFile(this.berkasData.attachment_)}get ddlVideo(){return this.ddlUrlLinkVideo(this.berkasData.attachment_.id)}get videoThumb(){return this.berkasData.image_url}get ddlFonts(){return this.fonts.length>0?this.fonts:[]}get isHaveDDL(){return!(!("attachment_"in this.berkasData)||!this.berkasData.attachment_)&&"string"!=typeof this.berkasData.attachment_}get isDiscord(){return this.isHaveDDL&&this.berkasData.attachment_?.discord}get isStreamable(){return this.isHaveDDL&&this.gs.includesOneOf(this.berkasData.attachment_?.ext,$.t.fileTypeAttachmentStreamable)}ddl(t){var i=this;return(0,se.Z)(function*(){i.isDiscord?i.dm.startDownload(t,!1):i.dm.startDownload(t)})()}cancel_dl(t){this.dm.cancelDownload(t)}saveFileAs(t){this.dm.saveFileAs(t)}standardDdlVideo(t){this.wb.winboxOpenUri(this.ddlUrlLinkVideo(t))}ddlUrlLinkVideo(t){return this.isDiscord?`${Ge.N.apiUrl}/ddl-seek/${t}?ngsw-bypass=true`:`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}standardDdlSubsFont(t){this.wb.winboxOpenUri(this.ddlUrlLinkSubsFont(t))}ddlUrlLinkSubsFont(t){return`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}setupVjs(){if(this.isHaveDDL){const t=[],i=[],e=[];if("subtitles_"in this.berkasData.attachment_&&this.berkasData.attachment_.subtitles_)for(const r of this.berkasData.attachment_.subtitles_){const a=this.dls.downloadLampiran(r.id).pipe((0,me.b)(o=>{o.type===Le.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),i.push({name:r.name,url:URL.createObjectURL(new Blob([o.body]))}))}));t.push(a)}if("fonts_"in this.berkasData.attachment_&&this.berkasData.attachment_.fonts_)for(const r of this.berkasData.attachment_.fonts_){const a=this.dls.downloadLampiran(r.id).pipe((0,me.b)(o=>{o.type===Le.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),e.push(URL.createObjectURL(new Blob([o.body]))))}));t.push(a)}this.subsSubtitlesFonts=(0,Oe.z)(...t).subscribe({next:r=>{r.type===Le.dt.DownloadProgress&&this.gs.log("[DOWNLOAD_PROGRESS]",r),r.type===Le.dt.Response&&this.gs.log("[DOWNLOAD_COMPLETED]",r)},error:r=>{this.gs.log("[DOWNLOAD_ERROR]",r,"error")},complete:()=>{this.subtitles=i,this.fonts=e,this.vjsReady=!0}})}}getIconFromUrl(t){try{return"http://www.google.com/s2/favicons?sz=64&domain="+new URL(t).host}catch{return`${Ge.N.baseUrl}/favicon.ico`}}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(ke.U),u.Y36(Ue.z),u.Y36(Ve.Z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e),u.Y36(de),u.Y36(le.N),u.Y36(xe.R),u.Y36(Q.v))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-detail"]],decls:1,vars:1,consts:[["class","p-0 m-0",4,"ngIf"],[1,"p-0","m-0"],[1,"container-fluid","p-0"],[1,"wrapper"],[1,"bg-bubbles","align-items-center","p-0"],[1,"container","align-items-center","h-100","p-3","text-light",2,"overflow-y","auto"],["_ngcontent-serverapp-c311","",1,"mb-0",2,"line-height","normal"],[1,"mt-3","mb-0"],[1,"mb-0"],[1,"container"],[1,"row"],[1,"col-md-5","col-xl-4","p-3"],[1,"row","sticky-top"],[1,"col"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12"],[3,"multiple"],[3,"routerLink",4,"ngIf"],[4,"ngIf"],[3,"routerLink",4,"ngFor","ngForOf"],[3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],[1,"text-truncate"],["class","row py-3",4,"ngIf"],[1,"col-md-7","col-xl-8","p-3","sticky-top"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"p-3"],["class","col-12 text-center",4,"ngIf"],[1,"col-12","text-center"],[1,"px-3"],["type","button","class","m-1 w-100 shiny","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngIf"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngIf"],["class","px-3",4,"ngIf"],["class","col-12",4,"ngIf"],["class","col-12 m-1",4,"ngIf"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","color","accent",1,"m-1","w-100","shiny",3,"matTooltip","click"],["fontIcon","movie",1,"me-1"],["type","button","mat-stroked-button","","color","accent",1,"m-1","w-100",3,"matTooltip","click"],["fontIcon","close",1,"me-1"],["fontIcon","save",1,"me-1"],["color","accent",3,"mode","value"],["class","px-3 text-danger","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"px-3","text-danger",2,"cursor","pointer",3,"click"],[1,"col-12","m-1"],[1,"my-3","border-bottom-dotted",2,"height","4px","background","url('/assets/img/stripe.png')"],["fontIcon","notes",1,"me-1"],["fontIcon","font_download",1,"me-1"],["type","button","mat-stroked-button","","color","accent","matTooltip","Direct Download Link Berkas",1,"m-1",3,"click"],["fontIcon","enhanced_encryption",1,"me-1"],["class","m-1","target","_blank","mat-stroked-button","","color","accent",3,"href",4,"ngFor","ngForOf"],["target","_blank","mat-stroked-button","","color","accent",1,"m-1",3,"href"],["width","24px","height","24px",1,"me-1",2,"object-fit","cover",3,"src"],["type","button","mat-stroked-button","","color","accent",1,"m-1",3,"click"],["fontIcon","vpn_key",1,"me-1"],[1,"py-2","px-3",2,"white-space","pre-line !important",3,"innerHTML"],[1,"py-2","px-3"],[1,"text-success"],["href","https://bugzilla.mozilla.org/show_bug.cgi?id=1422891",1,"text-warning","text-decoration-none"],["appearance","outline","class","pt-3 col-12",3,"color",4,"ngIf"],["color","warn","mode","buffer","class","mb-3",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","warn",3,"disabled","click",4,"ngIf"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","accent",3,"click",4,"ngIf"],["appearance","outline",1,"pt-3","col-12",3,"color"],["placeholder","Pilih Salah Satu",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["color","warn","mode","buffer",1,"mb-3"],["type","button","mat-stroked-button","","color","warn",1,"w-100",3,"disabled","click"],["fontIcon","play_arrow",1,"me-1"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"]],template:function(i,e){1&i&&u.YNc(0,a_,59,22,"div",0),2&i&&u.Q6J("ngIf",e.berkasData)},dependencies:[X.sg,X.O5,_e.rH,te.CK,ue.eB,ue.Nr,J.Hw,ie.v_,ie.$V,Ae.Wx,Ae.kh,Ae.O$,Ze.eI,We.x8,qe.Kd,Me.t,Cv,kv.S,Av.Y,X.OU,X.uU,fc.$],styles:[".wrapper[_ngcontent-%COMP%]{position:sticky;left:0;width:100%;height:128px;overflow:hidden;background-size:168px,auto!important;background-repeat:no-repeat,repeat!important;background-position-x:100%,0%!important}.bg-bubbles[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:#ffffff26;bottom:-160px;animation:_ngcontent-%COMP%_square 25s infinite;transition-timing-function:linear}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(1){left:10%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:#ffffff40}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(5){left:70%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:#fff3}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:#ffffff4d}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes _ngcontent-%COMP%_square{0%{transform:translateY(0)}to{transform:translateY(-512px) rotate(512deg)}}"]})}return s})();var Ra=H(8372),Ma=H(9094),Bo=H(3900),jo=H(8746),Ua=H(5625),o_=H(6841),u_=H(642),l_=H(3719),d_=H(3842),c_=H(7245),f_=H(6493),hc=H(2970),pc=H(2447),h_=H(4850),p_=H(3238),m_=H(9203),mc=H(7732);function g_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"bytes"),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.hij("Ukuran Upload Melebihi Batas ",u.lcZ(2,1,t.imageLimitExceeded)," !")}}function v_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.Oqu(t.imageErrorText)}}function __(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",50)(1,"button",31),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(2);return u.KtG(e.submitImage())}),u._UZ(2,"mat-icon",51),u._uU(3," Unggah "),u.qZA()()}if(2&s){const t=u.oxw(2);u.xp6(1),u.Q6J("disabled",t.submitted)}}function y_(s,n){1&s&&(u.TgZ(0,"div",20)(1,"mat-slide-toggle",52)(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Akses Hanya Dengan URL "),u.qZA()())}function T_(s,n){if(1&s&&(u.TgZ(0,"mat-option",53),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.Oqu(t.name)}}function b_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Tidak Boleh Kosong"),u.qZA())}function x_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function S_(s,n){1&s&&u.GkF(0)}function E_(s,n){1&s&&(u.TgZ(0,"mat-option",60),u._UZ(1,"mat-progress-bar",61),u.qZA())}function C_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",63),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.filterAnimeSelected(r))}),u._UZ(1,"img",64),u.TgZ(2,"span",65),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.lnq("",t.id," :: ",null==t.media_type?null:t.media_type.toUpperCase()," :: ",t.title,"")}}function k_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,C_,4,5,"mat-option",62),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredAnime)}}function A_(s,n){if(1&s&&(u.TgZ(0,"small",66),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.fg.get("anime_name").value)}}function w_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Tidak Boleh Kosong"),u.qZA())}function I_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Hanya Boleh Angka"),u.qZA())}function D_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",54)(1,"mat-label"),u._uU(2,"Anime Terkait"),u.qZA(),u.TgZ(3,"input",55),u.NdJ("keyup",function(){u.CHM(t);const e=u.oxw(2);return u.KtG(e.resetSelectedAnime())}),u.qZA(),u._UZ(4,"mat-icon",56),u.TgZ(5,"mat-autocomplete",null,57),u.YNc(7,E_,2,0,"mat-option",58),u.YNc(8,k_,2,1,"ng-container",17),u.qZA(),u.YNc(9,A_,2,1,"small",59),u.TgZ(10,"mat-error"),u.YNc(11,w_,2,0,"div",17),u.YNc(12,I_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(6),i=u.oxw(2);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(4),u.Q6J("ngIf",i.isLoading),u.xp6(1),u.Q6J("ngIf",!i.isLoading),u.xp6(1),u.Q6J("ngIf",i.fg.get("anime_name").value),u.xp6(2),u.Q6J("ngIf",i.fg.get("anime_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",i.fg.get("anime_id").hasError("pattern"))}}function P_(s,n){1&s&&u.GkF(0)}function O_(s,n){1&s&&(u.TgZ(0,"mat-option",60),u._UZ(1,"mat-progress-bar",61),u.qZA())}function L_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",63),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(5);return u.KtG(a.filterDoramaSelected(r))}),u._UZ(1,"img",64),u.TgZ(2,"span",65),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.mdl_id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.mdl_id," :: ",t.title,"")}}function R_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,L_,4,4,"mat-option",62),u.BQk()),2&s){const t=u.oxw(4);u.xp6(1),u.Q6J("ngForOf",t.filteredDorama)}}function M_(s,n){if(1&s&&(u.TgZ(0,"small",66),u._uU(1),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Oqu(t.fg.get("dorama_name").value)}}function U_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Tidak Boleh Kosong"),u.qZA())}function N_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Hanya Boleh Angka"),u.qZA())}function F_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",54)(1,"mat-label"),u._uU(2,"Dorama Terkait"),u.qZA(),u.TgZ(3,"input",69),u.NdJ("keyup",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.resetSelectedDorama())}),u.qZA(),u._UZ(4,"mat-icon",56),u.TgZ(5,"mat-autocomplete",null,70),u.YNc(7,O_,2,0,"mat-option",58),u.YNc(8,R_,2,1,"ng-container",17),u.qZA(),u.YNc(9,M_,2,1,"small",59),u.TgZ(10,"mat-error"),u.YNc(11,U_,2,0,"div",17),u.YNc(12,N_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(6),i=u.oxw(3);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(4),u.Q6J("ngIf",i.isLoading),u.xp6(1),u.Q6J("ngIf",!i.isLoading),u.xp6(1),u.Q6J("ngIf",i.fg.get("dorama_name").value),u.xp6(2),u.Q6J("ngIf",i.fg.get("dorama_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",i.fg.get("dorama_id").hasError("pattern"))}}function B_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Kode Serial Tidak Boleh Kosong"),u.qZA())}function j_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Kode Serial Hanya Boleh Huruf Besar, Strip, Dan Angka"),u.qZA())}function H_(s,n){if(1&s&&(u.TgZ(0,"mat-form-field",22)(1,"mat-label"),u._uU(2,"Kode / Serial Number"),u.qZA(),u._UZ(3,"input",73)(4,"mat-icon",74),u.TgZ(5,"mat-error"),u.YNc(6,B_,2,0,"div",17),u.YNc(7,j_,2,0,"div",17),u.qZA()()),2&s){const t=u.oxw(4);u.Q6J("color","accent"),u.xp6(6),u.Q6J("ngIf",t.fg.get("sn_code").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.fg.get("sn_code").hasError("pattern"))}}function V_(s,n){1&s&&(u.TgZ(0,"div",75)(1,"small",76),u._uU(2," * Jika tidak ada kode serial isi saja - strip "),u.qZA()())}function q_(s,n){if(1&s&&(u.YNc(0,H_,8,3,"mat-form-field",71),u.YNc(1,V_,3,0,"div",72)),2&s){const t=u.oxw(3);u.Q6J("ngIf",t.berkasType),u.xp6(1),u.Q6J("ngIf",t.berkasType)}}function G_(s,n){if(1&s&&(u.YNc(0,P_,1,0,"ng-container",25),u.YNc(1,F_,13,7,"ng-template",null,67,u.W1O),u.YNc(3,q_,2,2,"ng-template",null,68,u.W1O)),2&s){const t=u.MAs(2),i=u.MAs(4),e=u.oxw(2);u.Q6J("ngIf",e.berkasType.toLowerCase().includes("dorama_"))("ngIfThen",t)("ngIfElse",i)}}function W_(s,n){1&s&&u._UZ(0,"mat-icon",56)}function Z_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",82),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index,r=u.oxw(2);return u.KtG(r.removeFansub(e))}),u._UZ(1,"mat-icon",83),u.qZA()}}function K_(s,n){1&s&&(u.TgZ(0,"mat-option",60),u._UZ(1,"mat-progress-bar",61),u.qZA())}function z_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",63),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(2).index,o=u.oxw(2);return u.KtG(o.filterFansubSelected(r,a))}),u._UZ(1,"img",84),u.TgZ(2,"span",65),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.slug," :: ",t.name,"")}}function Y_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,z_,4,4,"mat-option",62),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredFansub)}}function $_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Tidak Boleh Kosong"),u.qZA())}function Q_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Hanya Boleh Angka"),u.qZA())}function X_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div")(1,"div",77)(2,"mat-form-field",54)(3,"mat-label"),u._uU(4,"Fansub Terkait"),u.qZA(),u.TgZ(5,"input",78),u.NdJ("keyup",function(){const r=u.CHM(t).index,a=u.oxw(2);return u.KtG(a.resetSelectedFansub(r))}),u.qZA(),u.YNc(6,W_,1,0,"mat-icon",79),u.YNc(7,Z_,2,0,"button",80),u.TgZ(8,"mat-autocomplete",null,81),u.YNc(10,K_,2,0,"mat-option",58),u.YNc(11,Y_,2,1,"ng-container",17),u.qZA(),u.TgZ(12,"small",66),u._uU(13),u.qZA(),u.TgZ(14,"mat-error"),u.YNc(15,$_,2,0,"div",17),u.YNc(16,Q_,2,0,"div",17),u.qZA()()()()}if(2&s){const t=n.$implicit,i=n.index,e=u.MAs(9),r=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",i),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",e),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").value||0===i),u.xp6(1),u.Q6J("ngIf",!t.get("fansub_id").value&&i>0),u.xp6(3),u.Q6J("ngIf",r.isLoading),u.xp6(1),u.Q6J("ngIf",!r.isLoading),u.xp6(2),u.Oqu(t.get("fansub_name").value),u.xp6(2),u.Q6J("ngIf",t.get("fansub_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").hasError("pattern"))}}function J_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Tidak Boleh Kosong"),u.qZA())}function e0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function t0(s,n){1&s&&u.GkF(0)}function i0(s,n){if(1&s&&(u.TgZ(0,"p",89),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.attachmentFontSubtitle.join(", ").toLowerCase())}}function r0(s,n){if(1&s&&(u.TgZ(0,"div",9)(1,"mat-list")(2,"div",85),u._uU(3,"Berkas yang terlampir tidak boleh diubah."),u.qZA(),u.TgZ(4,"mat-list-item"),u._UZ(5,"mat-icon",86),u.TgZ(6,"div",87),u._uU(7),u.qZA(),u.TgZ(8,"div",87),u._uU(9),u.ALo(10,"bytes"),u.qZA()(),u.YNc(11,i0,2,1,"p",88),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(7),u.AsE("",t.attachmentFile.name,".",t.attachmentFile.ext,""),u.xp6(2),u.Oqu(u.lcZ(10,4,t.attachmentFile.size)),u.xp6(2),u.Q6J("ngIf",t.attachmentFontSubtitle.length>0)}}function n0(s,n){1&s&&u.GkF(0)}function a0(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"bytes"),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.hij("Ukuran Upload Melebihi Batas ",u.lcZ(2,1,t.attachmentLimitExceeded)," !")}}function s0(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Oqu(t.attachmentErrorText)}}function o0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",42)(1,"div",99)(2,"div",100),u._uU(3),u.ALo(4,"bytes"),u._UZ(5,"br")(6,"mat-progress-bar",101),u.qZA()(),u.TgZ(7,"div",102)(8,"button",31),u.NdJ("click",function(){const r=u.CHM(t).$implicit,a=u.oxw(4);return u.KtG(a.submitAttachment(r))}),u._UZ(9,"mat-icon",103),u._uU(10," Unggah "),u.qZA()()()}if(2&s){const t=n.$implicit,i=u.oxw(4);u.xp6(3),u.HOy(" ",t.status," :: ",t.progress,"% @ ",u.lcZ(4,7,t.speed),"/s # ",t.remaining," detik "),u.xp6(3),u.Q6J("mode","determinate")("value",t.progress),u.xp6(2),u.Q6J("disabled",i.submitted||"complete"===t.status||"uploading"===t.status)}}function u0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",9)(1,"div",75)(2,"small",76),u._uU(3," * "),u.TgZ(4,"i"),u._uU(5,"Resume-able Upload"),u.qZA(),u._uU(6," :: "),u.TgZ(7,"i"),u._uU(8,"expired"),u.qZA(),u._uU(9),u.TgZ(10,"i"),u._uU(11,"upload"),u.qZA(),u._uU(12),u.qZA()(),u.TgZ(13,"mat-form-field",92)(14,"mat-label"),u._uU(15,"Upload Lampiran Berkas -- DDL"),u.qZA(),u.TgZ(16,"ngx-mat-file-input",93,94),u.NdJ("change",function(e){u.CHM(t);const r=u.MAs(17),a=u.oxw(3);return u.KtG(a.uploadAttachment(e,r))}),u.qZA(),u._UZ(18,"mat-icon",95),u.qZA(),u.TgZ(19,"mat-error",96)(20,"small"),u.YNc(21,a0,3,3,"div",17),u.YNc(22,s0,2,1,"div",17),u.qZA()()(),u.YNc(23,o0,11,9,"div",97),u.ALo(24,"async"),u.TgZ(25,"div",9)(26,"mat-slide-toggle",98),u._uU(27," Otomatis Simpan & Kirim Setelah Selesai Upload DDL "),u.qZA()()}if(2&s){const t=u.oxw(3);u.xp6(9),u.hij(" 3 hari (Tidak wajib, jika sudah ada URL eksternal, misal alamat webmu gdrive mediafire mega dan lain sebagainya). Mohon ditunggu, jika ingin di tinggal dapat menyelesaikan semua isian yang diperlukan dan menyalakan 'Otomatis Simpan & Kirim' dibawah ini, berkas lampiran akan dibatalkan dan dihapus apabila tidak disimpan dalam ",t.CONSTANTS.timeoutDeleteTempAttachmentTime/60/1e3," menit setelah berhasil "),u.xp6(3),u.hij(". Lalu kemudian saat berkas berhasil dibuat, lampiran tidak akan bisa di modifikasi. Tipe file yang diperbolehkan :: ",t.extAttachment," "),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("disabled",null!==t.attachmentSelected)("accept",t.fileTypeAttachmentAllowed),u.xp6(5),u.Q6J("ngIf",t.attachmentLimitExceeded),u.xp6(1),u.Q6J("ngIf",t.attachmentErrorText),u.xp6(1),u.Q6J("ngForOf",u.lcZ(24,9,t.uploads$)),u.xp6(3),u.Q6J("disabled",t.fg.invalid||"uploading"!==(null==t.attachmentSelected?null:t.attachmentSelected.status))}}function l0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",104),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(3);return u.KtG(e.verify())}),u._UZ(1,"mat-icon",105),u._uU(2," Verifikasi Akun Untuk Upload DDL! "),u.qZA()}}function d0(s,n){if(1&s&&(u.YNc(0,n0,1,0,"ng-container",25),u.YNc(1,u0,28,11,"ng-template",null,90,u.W1O),u.YNc(3,l0,3,0,"ng-template",null,91,u.W1O)),2&s){const t=u.MAs(2),i=u.MAs(4),e=u.oxw(2);u.Q6J("ngIf",null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified)("ngIfThen",t)("ngIfElse",i)}}function c0(s,n){1&s&&(u.TgZ(0,"div",75)(1,"small",76),u._uU(2,"* "),u.TgZ(3,"i"),u._uU(4,"Gunakan tombol (X) untuk menghapus URL Eksternal jika ingin hanya menggunakan lampiran "),u.TgZ(5,"i"),u._uU(6,"upload"),u.qZA(),u._uU(7," DDL saja"),u.qZA()()())}function f0(s,n){1&s&&u._UZ(0,"mat-icon",113)}function h0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",82),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index,r=u.oxw(2);return u.KtG(r.removeDownloadLink(e))}),u._UZ(1,"mat-icon",83),u.qZA()}}function p0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Tidak Boleh Kosong"),u.qZA())}function m0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function g0(s,n){1&s&&u._UZ(0,"mat-icon",114)}function v0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",82),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index,r=u.oxw(2);return u.KtG(r.removeDownloadLink(e))}),u._UZ(1,"mat-icon",83),u.qZA()}}function _0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Tidak Boleh Kosong"),u.qZA())}function y0(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Link Tidak Valid"),u.qZA())}function T0(s,n){if(1&s&&(u.ynx(0),u.TgZ(1,"div",106),u.YNc(2,c0,8,0,"div",72),u.TgZ(3,"mat-form-field",107)(4,"mat-label"),u._uU(5,"Nama Website"),u.qZA(),u._UZ(6,"input",108),u.YNc(7,f0,1,0,"mat-icon",109),u.YNc(8,h0,2,0,"button",80),u.TgZ(9,"mat-error"),u.YNc(10,p0,2,0,"div",17),u.YNc(11,m0,2,0,"div",17),u.qZA()(),u.TgZ(12,"mat-form-field",110)(13,"mat-label"),u._uU(14,"Tautan Link"),u.qZA(),u._UZ(15,"input",111),u.YNc(16,g0,1,0,"mat-icon",112),u.YNc(17,v0,2,0,"button",80),u.TgZ(18,"mat-error"),u.YNc(19,_0,2,0,"div",17),u.YNc(20,y0,2,0,"div",17),u.qZA()()(),u.BQk()),2&s){const t=n.$implicit,i=n.index,e=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",i),u.xp6(1),u.Q6J("ngIf",(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified)&&0===i),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("name").value||0===i&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("name").value&&(i>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("name").hasError("pattern")),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("url").value||0===i&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("url").value&&(i>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("url").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("url").hasError("pattern"))}}function b0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"form",4),u.NdJ("submit",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.onSubmit())}),u.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),u._uU(5,"Ubah Berkas"),u.qZA()()(),u.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),u._UZ(11,"img",11),u.TgZ(12,"mat-form-field",12)(13,"mat-label"),u._uU(14,"Gambar Untuk Embed SEO"),u.qZA(),u.TgZ(15,"ngx-mat-file-input",13,14),u.NdJ("change",function(e){u.CHM(t);const r=u.MAs(16),a=u.oxw();return u.KtG(a.uploadImage(e,r))}),u.qZA(),u._UZ(17,"mat-icon",15),u.qZA(),u.TgZ(18,"mat-error",16)(19,"small"),u.YNc(20,g_,3,3,"div",17),u.YNc(21,v_,2,1,"div",17),u.qZA()()(),u.YNc(22,__,4,1,"div",18),u.YNc(23,y_,5,0,"div",19),u.TgZ(24,"div",20)(25,"mat-slide-toggle",21),u._uU(26," R-18+ Konten Eksplisit "),u.qZA()(),u.TgZ(27,"mat-form-field",22)(28,"mat-label"),u._uU(29,"Jenis Proyek"),u.qZA(),u.TgZ(30,"mat-select",23),u.YNc(31,T_,2,2,"mat-option",24),u.qZA(),u.TgZ(32,"mat-error"),u.YNc(33,b_,2,0,"div",17),u.YNc(34,x_,2,0,"div",17),u.qZA()(),u.YNc(35,S_,1,0,"ng-container",25),u.YNc(36,D_,13,7,"ng-template",null,26,u.W1O),u.YNc(38,G_,5,3,"ng-template",null,27,u.W1O),u.TgZ(40,"div",20),u._UZ(41,"mat-divider"),u.qZA(),u.TgZ(42,"div",28),u.YNc(43,X_,17,10,"div",29),u.qZA(),u.TgZ(44,"div",2)(45,"div",9),u._UZ(46,"div",30),u.TgZ(47,"div",30)(48,"button",31),u.NdJ("click",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.addFansub())}),u._UZ(49,"mat-icon",32),u._uU(50," Tambah Fansub "),u.qZA()()()(),u.TgZ(51,"div",20)(52,"a",33),u._uU(53," * Jika pencarian tidak ditemukan, silahkan membuat halaman Fansub baru terlebih dahulu "),u.qZA()()()(),u.TgZ(54,"div",34)(55,"div",9)(56,"mat-form-field",35)(57,"mat-label"),u._uU(58,"Nama Berkas"),u.qZA(),u._UZ(59,"input",36)(60,"mat-icon",37),u.TgZ(61,"mat-error"),u.YNc(62,J_,2,0,"div",17),u.YNc(63,e0,2,0,"div",17),u.qZA()(),u._UZ(64,"angular-editor",38),u.qZA(),u.TgZ(65,"div",9)(66,"div",20),u._UZ(67,"mat-divider"),u.qZA()(),u.YNc(68,t0,1,0,"ng-container",25),u.YNc(69,r0,12,6,"ng-template",null,39,u.W1O),u.YNc(71,d0,5,3,"ng-template",null,40,u.W1O),u.TgZ(73,"div",9)(74,"div",20),u._UZ(75,"mat-divider"),u.qZA()(),u.ynx(76,41),u.YNc(77,T0,21,12,"ng-container",29),u.BQk(),u.TgZ(78,"div",42),u._UZ(79,"div",30)(80,"div",30)(81,"div",30),u.TgZ(82,"div",30)(83,"button",31),u.NdJ("click",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.addDownloadLink())}),u._UZ(84,"mat-icon",32),u._uU(85," Tambah URL Eksternal "),u.qZA()()()()(),u.TgZ(86,"div",9)(87,"div",20)(88,"div",43),u._UZ(89,"div",44),u.TgZ(90,"div",45)(91,"a",46),u._UZ(92,"mat-icon",47),u._uU(93," Batal "),u.qZA()(),u.TgZ(94,"div",45)(95,"button",48),u._uU(96," Simpan "),u._UZ(97,"mat-icon",49),u.qZA()()()()()()()()}if(2&s){const t=u.MAs(37),i=u.MAs(39),e=u.MAs(70),r=u.MAs(72),a=u.oxw();u.Q6J("formGroup",a.fg),u.xp6(11),u.Q6J("src",a.image_url,u.LSH),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("disabled",a.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),u.xp6(5),u.Q6J("ngIf",a.imageLimitExceeded),u.xp6(1),u.Q6J("ngIf",a.imageErrorText),u.xp6(1),u.Q6J("ngIf",a.image&&!a.fg.value.image),u.xp6(1),u.Q6J("ngIf",null==a.AS.currentUserSubject||null==a.AS.currentUserSubject.value?null:a.AS.currentUserSubject.value.verified),u.xp6(4),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngForOf",a.projectList),u.xp6(2),u.Q6J("ngIf",a.fg.get("projectType_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",a.fg.get("projectType_id").hasError("pattern")),u.xp6(1),u.Q6J("ngIf",a.berkasType.toLowerCase().includes("anime_"))("ngIfThen",t)("ngIfElse",i),u.xp6(8),u.Q6J("ngForOf",a.getFansubControl.controls),u.xp6(5),u.Q6J("disabled",a.submitted),u.xp6(8),u.Q6J("color","accent"),u.xp6(6),u.Q6J("ngIf",a.fg.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",a.fg.get("name").hasError("pattern")),u.xp6(1),u.Q6J("config",a.GS.angularEditorConfig),u.xp6(4),u.Q6J("ngIf",a.attachmentFile)("ngIfThen",e)("ngIfElse",r),u.xp6(9),u.Q6J("ngForOf",a.getDownloadUrlControl.controls),u.xp6(6),u.Q6J("disabled",a.submitted),u.xp6(8),u.Q6J("disabled",a.submitted),u.xp6(4),u.Q6J("disabled",a.submitted||a.fg.invalid||!a.fg.dirty||"uploading"===(null==a.attachmentSelected?null:a.attachmentSelected.status))}}let x0=(()=>{class s{constructor(t,i,e,r,a,o,l,d,f,v,g,T,E,x,S){this.router=t,this.activatedRoute=i,this.fb=e,this.bs=r,this.anime=a,this.dorama=o,this.project=l,this.fansub=d,this.berkas=f,this.toast=v,this.imgbb=g,this.gs=T,this.as=E,this.uploadService=x,this.ds=S,this.berkasId="",this.attachmentSelected=null,this.attachmentErrorText=null,this.attachmentLimitExceeded=null,this.timerTimeout1=null,this.timerTimeout2=null,this.submitted=!1,this.projectList=[],this.uploadToast=null,this.gambar=null,this.ddl=null,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.filteredAnime=[],this.filteredDorama=[],this.filteredFansub=[],this.isLoading=!1,this.animeCheckOrAddResponse=null,this.doramaCheckOrAddResponse=null,this.attachmentFile=null,this.attachmentFontSubtitle=[],this.subsProject=null,this.subsFansub=null,this.subsAnimeDetail=null,this.subsDoramaDetail=null,this.subsProjectDetail=null,this.subsFansubDetail=[],this.subsAnimeNew=null,this.subsDoramaNew=null,this.subsImgbb=null,this.subsBerkasDetail=null,this.subsBerkasUpdate=null,this.subsUpload=null,this.subsDialog=null,this.berkasType="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get CONSTANTS(){return $.t}get AS(){return this.as}get GS(){return this.gs}get extAttachment(){return $.t.extAttachment.join(", ")}get fileTypeAttachmentAllowed(){return $.t.fileTypeAttachmentAllowed.join(", ")}ngOnInit(){this.gs.isBrowser&&(this.berkasId=this.activatedRoute.snapshot.paramMap.get("berkasId"),this.bs.busy(),this.subsBerkasDetail=this.berkas.getBerkas(this.berkasId).subscribe({next:t=>{this.gs.log("[BERKAS_DETAIL_SUCCESS]",t),this.bs.idle(),this.as.currentUserSubject?.value?.id!==t.result.user_.id&&(this.toast.warning("Berkas Ini Bukan Milikmu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)),!this.as.currentUserSubject?.value?.verified&&t.result.attachment_?(this.toast.warning("string"==typeof t.result.attachment_?t.result.attachment_:"Harap Verifikasi Akun Terlebih Dahulu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)):(this.loadProjectList(),this.initForm(t.result),this.uploads$=this.uploadService.connect(),this.subsUpload=this.uploadService.events.subscribe({next:i=>{this.gs.log("[UPLOAD_EVENTS]",i),("uploading"===i.status||"complete"===i.status)&&(this.attachmentSelected=i),"complete"===i.status?(this.gs.log("[UPLOAD_COMPLETED]",i.response),this.fg.controls.attachment_id.patchValue(i.response.result.id),this.fg.controls.attachment_id.markAsDirty(),this.uploadToast=this.toast.warning("Segera Kirim Data Berkas!","Lampiran Akan Dihapus ...",{closeButton:!1,timeOut:$.t.timeoutDeleteTempAttachmentTime,disableTimeOut:"extendedTimeOut",tapToDismiss:!1,progressAnimation:"decreasing"},!0),this.timerTimeout1=setTimeout(()=>{this.gs.log("[UPLOAD_TIMEOUT]",$.t.timeoutDeleteTempAttachmentTime),this.failOrCancelUpload({info:"Expired, Silahkan Upload Ulang!"})},$.t.timeoutDeleteTempAttachmentTime),this.fg.value.auto_send&&(this.timerTimeout2=setTimeout(()=>{this.onSubmit()},2500))):"error"===i.status&&(this.gs.log("[UPLOAD_ERROR]",i.response,"error"),this.failOrCancelUpload(i.response))},error:i=>{this.gs.log("[UPLOAD_ERROR]",i,"error"),this.failOrCancelUpload(i)}}))},error:t=>{this.gs.log("[BERKAS_DETAIL_ERROR]",t,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/berkas/${this.berkasId}`}})}}))}ngOnDestroy(){this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.timerTimeout1&&(clearTimeout(this.timerTimeout1),this.timerTimeout1=null),this.timerTimeout2&&(clearTimeout(this.timerTimeout2),this.timerTimeout2=null),this.subsProject?.unsubscribe(),this.subsFansub?.unsubscribe(),this.subsAnimeDetail?.unsubscribe(),this.subsDoramaDetail?.unsubscribe(),this.subsProjectDetail?.unsubscribe();for(const t of this.subsFansubDetail)t?.unsubscribe();this.subsAnimeNew?.unsubscribe(),this.subsDoramaNew?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsBerkasDetail?.unsubscribe(),this.subsBerkasUpdate?.unsubscribe(),this.subsUpload?.unsubscribe(),this.subsDialog?.unsubscribe()}uploadAttachment(t,i){var e=this;return(0,se.Z)(function*(){e.ddl=i;const r=t.target.files[0];e.attachmentLimitExceeded=null,e.attachmentErrorText=null,e.gs.log("[ATTACHMENT_SELECTED]",r),e.fg.controls.attachment_id.patchValue(null),e.uploadService.disconnect();try{r.size<=$.t.fileSizeAttachmentTotalLimit?(e.uploadService.handleFiles(r),e.subsDialog=(yield e.ds.openKonfirmasiDialog("Saran Penamaan Berkas","Apakah Ingin Mengganti Penamaan Berkas Sesuai Dengan Nama Lampiran Yang Di Unggah ?")).afterClosed().subscribe({next:a=>{e.gs.log("[INFO_DIALOG_CLOSED]",a),!0===a&&(e.fg.controls.name.patchValue(r.name),e.fg.controls.name.markAsDirty()),e.subsDialog.unsubscribe()}})):(e.attachmentLimitExceeded=$.t.fileSizeAttachmentTotalLimit,e.ddl.clear(t))}catch{e.ddl.clear(t)}})()}submitAttachment(t){const i=this.uploadService.state().find(e=>e.uploadId===t.uploadId);i&&(this.attachmentSelected=i,t.status="queue")}failOrCancelUpload(t=null){this.attachmentSelected=null,this.attachmentErrorText=t?.result?.message||t?.info||t?.error?.message||"Terjadi Kesalahan, Harap Reload Halaman!",this.uploadService.disconnect(),this.fg.controls.attachment_id.patchValue(null),this.fg.controls.attachment_id.markAsPristine(),this.fg.controls.attachment_id.markAsUntouched(),this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.ddl.clear()}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]},state:{bypassCanDeactivate:!0}})}loadProjectList(){this.bs.busy(),this.subsProject=this.project.getProject().subscribe({next:t=>{this.gs.log("[PROJECT_LOAD_SUCCESS]",t),this.projectList=t.results,this.bs.idle()},error:t=>{this.gs.log("[PROJECT_LOAD_ERROR]",t,"error"),this.bs.idle()}})}hasRequiredField(t,i){return t.get(i).hasValidator(B.kI.required)}animeValueChanged(){this.subsAnimeDetail=this.fg.get("anime_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(t=>this.anime.searchAnime(t).pipe((0,jo.x)(()=>this.isLoading=!1))),(0,Ua.X)(-1)).subscribe({next:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_SUCCESS]",t),this.filteredAnime=t.results},error:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_ERROR]",t,"error"),this.animeValueChanged()}})}doramaValueChanged(){this.subsDoramaDetail=this.fg.get("dorama_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(t=>this.dorama.searchDorama(t).pipe((0,jo.x)(()=>this.isLoading=!1))),(0,Ua.X)(-1)).subscribe({next:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_SUCCESS]",t);for(const i of t.results)i.mdl_id=i.mdl_id.split("-")[1],i.image_url=i.thumb;this.filteredDorama=t.results},error:t=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_ERROR]",t,"error"),this.doramaValueChanged()}})}projectTypeValueChanged(){this.subsProjectDetail=this.fg.get("projectType_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,Ua.X)(-1)).subscribe({next:t=>{this.gs.log("[BERKAS_CREATE_PROJECT_CHANGED]",t),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null),this.fg.controls.sn_code.patchValue(null),this.fg.controls.anime_id.setErrors(null),this.fg.controls.anime_name.setErrors(null),this.fg.controls.dorama_id.setErrors(null),this.fg.controls.dorama_name.setErrors(null),this.fg.controls.sn_code.setErrors(null),this.fg.controls.anime_id.clearValidators(),this.fg.controls.anime_name.clearValidators(),this.fg.controls.dorama_id.clearValidators(),this.fg.controls.dorama_name.clearValidators(),this.fg.controls.sn_code.clearValidators(),this.fg.controls.anime_id.markAsPristine(),this.fg.controls.anime_name.markAsPristine(),this.fg.controls.dorama_id.markAsPristine(),this.fg.controls.dorama_name.markAsPristine(),this.fg.controls.sn_code.markAsPristine(),this.fg.controls.anime_id.markAsUntouched(),this.fg.controls.anime_name.markAsUntouched(),this.fg.controls.dorama_id.markAsUntouched(),this.fg.controls.dorama_name.markAsUntouched(),this.fg.controls.sn_code.markAsUntouched();const i=this.projectList.find(e=>e.id===t);i&&(this.berkasType=i.name,i.name.toLowerCase().includes("anime_")?(this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required]),this.subsAnimeDetail?.unsubscribe(),this.animeValueChanged()):i.name.toLowerCase().includes("dorama_")?(this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required]),this.subsDoramaDetail?.unsubscribe(),this.doramaValueChanged()):this.fg.controls.sn_code.setValidators([B.kI.required,B.kI.pattern(/^[A-Z0-9\-]+$/)])),this.fg.controls.anime_id.updateValueAndValidity(),this.fg.controls.anime_name.updateValueAndValidity(),this.fg.controls.dorama_id.updateValueAndValidity(),this.fg.controls.dorama_name.updateValueAndValidity(),this.fg.controls.sn_code.updateValueAndValidity()}})}initForm(t){"attachment_"in t&&t.attachment_&&(this.attachmentFile=t.attachment_,t.attachment_.fonts_&&t.attachment_.fonts_.forEach(i=>{this.attachmentFontSubtitle.push(`${i.name}.${i.ext}`)}),t.attachment_.subtitles_&&t.attachment_.subtitles_.forEach(i=>{this.attachmentFontSubtitle.push(`${i.name}.${i.ext}`)})),this.fg=this.fb.group({name:[t.name,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexEnglishKeyboardKeys)])],description:[t.description,B.kI.compose([B.kI.pattern($.t.regexEnglishKeyboardKeys)])],projectType_id:[t.project_type_.id,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexEnglishKeyboardKeys)])],anime_id:[t.anime_?.id||null,B.kI.compose([])],anime_name:[t.anime_?.name||null,B.kI.compose([])],dorama_id:[t.dorama_?.id||null,B.kI.compose([])],dorama_name:[t.dorama_?.name||null,B.kI.compose([])],fansub_list:this.fb.array([]),image:[null,B.kI.compose([B.kI.pattern($.t.regexUrl)])],sn_code:[t.sn_code,B.kI.compose([])],attachment_id:[t.attachment_?.id,B.kI.compose([B.kI.pattern($.t.regexEnglishKeyboardKeys)])],download_url:this.fb.array([]),private:[t.private,B.kI.compose([B.kI.required])],r18:[t.r18,B.kI.compose([B.kI.required])],auto_send:[!1,B.kI.compose([B.kI.required])]}),this.image_url=t.image_url,this.image_url_original=this.image_url,this.berkasType=t.project_type_.name,t.anime_&&(this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required])),t.dorama_&&(this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required]));for(const i of t.download_url)this.addDownloadLink(i);for(const i of t.fansub_)this.addFansub(i);this.projectTypeValueChanged()}get getDownloadUrlControl(){return this.fg.get("download_url")}createDownloadLink(t=null,i=null){return this.fb.group({name:[t,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexEnglishKeyboardKeys)])],url:[i,B.kI.compose([B.kI.required,B.kI.pattern($.t.regexUrl)])]})}addDownloadLink(t=null){this.getDownloadUrlControl.push(t?this.createDownloadLink(t.name,t.url):this.createDownloadLink())}removeDownloadLink(t){this.getDownloadUrlControl.removeAt(t)}get getFansubControl(){return this.fg.get("fansub_list")}createFansub(t=null){const i=this.fb.group({fansub_id:[t?.id||null,B.kI.compose([B.kI.required,B.kI.pattern(/^\d+$/)])],fansub_name:[t?.name||null,B.kI.compose([B.kI.required])]});return this.subsFansubDetail.push(i.get("fansub_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(e=>this.fansub.searchFansub(e).pipe((0,jo.x)(()=>this.isLoading=!1))),(0,Ua.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_EDIT_SEARCH_FANSUB_RESULT]",e),this.filteredFansub=e.results}})),i}removeFansub(t){this.getFansubControl.removeAt(t),this.subsFansubDetail[t]?.unsubscribe(),this.subsFansubDetail.splice(t,1)}addFansub(t=null){this.getFansubControl.push(t?this.createFansub(t):this.createFansub())}resetSelectedAnime(){this.fg.controls.anime_name.patchValue(null)}resetSelectedDorama(){this.fg.controls.dorama_name.patchValue(null)}resetSelectedFansub(t){this.getFansubControl.controls[t].get("fansub_name").patchValue(null)}filterAnimeSelected(t){this.gs.log("[ANIME_FILTER_CLICK]",t),this.submitted=!0,this.subsAnimeNew=this.anime.addNewAnime({id:t.id,name:t.title,image_url:t.image_url,type:t.media_type?.toUpperCase()}).subscribe({next:i=>{this.gs.log("[ANIME_CHECK_ADD_SUCCESS]",i),this.animeCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.anime_id.patchValue(i.result.id),this.fg.controls.anime_name.patchValue(i.result.name)},error:i=>{this.gs.log("[ANIME_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedAnime(),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null)}})}filterDoramaSelected(t){this.gs.log("[DORAMA_FILTER_CLICK]",t),this.submitted=!0,this.subsDoramaNew=this.dorama.addNewDorama({id:parseInt(t.mdl_id,10),slug:t.slug,name:t.title,image_url:t.image_url,type:t.type}).subscribe({next:i=>{this.gs.log("[DORAMA_CHECK_ADD_SUCCESS]",i),this.doramaCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.dorama_id.patchValue(i.result.id),this.fg.controls.dorama_name.patchValue(i.result.name)},error:i=>{this.gs.log("[DORAMA_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedDorama(),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null)}})}filterFansubSelected(t,i){this.gs.log("[FANSUB_FILTER_CLICK]",t),this.getFansubControl.controls[i].get("fansub_id").patchValue(t.id),this.getFansubControl.controls[i].get("fansub_name").patchValue(t.name)}uploadImage(t,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.fg.controls.image.markAsUntouched();const e=t.target.files[0];try{const r=new FileReader;r.readAsDataURL(e),r.onload=a=>{if(this.gs.log("[IMAGE_SELECTED]",a),e.size<=$.t.fileSizeImageLimit){const o=this.gs.document.createElement("img");o.onload=()=>{this.image=e,this.image_url=r.result.toString()},o.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=$.t.fileSizeImageLimit,this.gambar.clear(t)}}catch{this.image=null,this.image_url=this.image_url_original,this.gambar.clear(t)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:t=>{this.gs.log("[IMAGE_SUCCESS]",t),this.fg.controls.image.patchValue(t.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:t=>{this.gs.log("[IMAGE_ERROR]",t,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.fg.controls.image.markAsUntouched(),this.submitted=!1,this.imageErrorText=t.result?.message||t.info}})}onSubmit(){this.bs.busy();const t=this.gs.getDirtyValues(this.fg);if("fansub_list"in t){const i=[];for(const e of this.fg.value.fansub_list)i.push(e.fansub_id);t.fansub_id=i,delete t.fansub_list}return"auto_send"in t&&delete t.auto_send,null===this.fg.value.attachment_id&&0===this.fg.value.download_url.lenth?(this.submitted=!1,this.uploadToast=this.toast.warning("Lampiran DDL / URL Eksternal!","Harap Mengisi Setidaknya Salah Satu ..."),void this.bs.idle()):(this.gs.log("[BERKAS_EDIT_DIRTY]",t),this.submitted=!0,this.fg.invalid?(this.submitted=!1,void this.bs.idle()):void(this.subsBerkasUpdate=this.berkas.updateBerkas(this.berkasId,{...t}).subscribe({next:i=>{this.gs.log("[BERKAS_EDIT_SUCCESS]",i),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/berkas/${this.berkasId}`)},error:i=>{this.gs.log("[BERKAS_EDIT_ERROR]",i,"error"),this.submitted=!1,this.bs.idle()}})))}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(B.QS),u.Y36(Ue.z),u.Y36(o_.o),u.Y36(u_.X),u.Y36(l_.Y),u.Y36(d_.T),u.Y36(rt.A),u.Y36(ee.k),u.Y36(c_.X),u.Y36(ke.U),u.Y36(D.e),u.Y36(f_.Lz),u.Y36(hc.x))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-edit"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],["class","col-12 py-3",4,"ngIf"],[1,"col-12","py-3"],["formControlName","r18","matTooltip","Konten Eksplisit"],["appearance","outline",1,"px-3","pt-3","col-12",3,"color"],["formControlName","projectType_id","placeholder","Anime / Drama"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf","ngIfThen","ngIfElse"],["anime_",""],["notAnime_",""],["formArrayName","fansub_list","matTooltip","Silahkan Buat Terlebih Dahulu Jika Tidak Ada"],[4,"ngFor","ngForOf"],[1,"col","px-3"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add",1,"me-1"],["routerLink","/create/fansub",1,"text-warning","text-decoration-none"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","[Fansub] Judul Anime - 00 [BD 4K x265 FLAC][CRC32].mkv"],["fontIcon","wysiwyg","matSuffix",""],["formControlName","description",1,"py-3","w-100",3,"config"],["ddlExist",""],["ddlNotExist",""],["formArrayName","download_url"],[1,"row","mb-4"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],[1,"col-12","mb-4"],["fontIcon","add_photo_alternate",1,"me-1"],["formControlName","private","matTooltip","Hanya Dapat Di Akses Melalui URL"],[3,"value"],["appearance","outline",1,"px-3","pt-3","w-100",3,"color"],["matInput","","formControlName","anime_id","placeholder","Full Metal Alchemist",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix",""],["autoCompleteAnime","matAutocomplete"],["class","is-loading",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"is-loading"],["mode","indeterminate"],["class","px-1",3,"value","click",4,"ngFor","ngForOf"],[1,"px-1",3,"value","click"],[1,"me-1",2,"height","40px","width","30px","object-fit","cover",3,"src"],[1,"ms-1"],[1,"text-warning"],["dorama_",""],["notDorama_",""],["matInput","","formControlName","dorama_id","placeholder","Flying Colors",3,"matAutocomplete","keyup"],["autoCompleteDorama","matAutocomplete"],["appearance","outline","class","px-3 pt-3 col-12",3,"color",4,"ngIf"],["class","col-12 px-3",4,"ngIf"],["matInput","","formControlName","sn_code","placeholder","XXX-999","required",""],["fontIcon","tag","matSuffix",""],[1,"col-12","px-3"],[1,"text-success"],[1,"row",3,"formGroupName"],["matInput","","formControlName","fansub_id","placeholder","NamaFansub",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix","",4,"ngIf"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click",4,"ngIf"],["autoCompleteFansub","matAutocomplete"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click"],["fontIcon","close"],[1,"me-1",2,"height","40px","width","40px","object-fit","cover",3,"src"],["mat-subheader","",1,"text-warning"],["fontIcon","attach_file","mat-list-icon",""],["mat-line",""],["class","py-3 m-0",4,"ngIf"],[1,"py-3","m-0"],["ddlVerified",""],["ddlNotVerified",""],["appearance","outline",1,"px-3","pt-3","col",3,"color"],["uploadx","",1,"w-100",3,"disabled","accept","change"],["ddl",""],["fontIcon","attach_file","matSuffix",""],[1,"px-4","pb-4","w-100"],["class","row mb-4",4,"ngFor","ngForOf"],["formControlName","auto_send","matTooltip","Pastikan Semua Isian Yang Dibutuhkan Sudah Terisi",1,"px-3",3,"disabled"],[1,"col"],[1,"ps-3"],[3,"mode","value"],[1,"col-6","col-lg-4","px-3"],["fontIcon","attachment",1,"me-1"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"],["fontIcon","enhanced_encryption",1,"me-1"],["matTooltip","Silahkan Isi Alamat Website Kamu Jika Ingin Mendapatkan Traffic Pengunjung",1,"row",3,"formGroupName"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","name","placeholder","Web Shit","required",""],["fontIcon","web","matSuffix","",4,"ngIf"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","url","placeholder","https://drive.google.com/drive/u/2/folders/1KYTJZsmH9dyyHBXnQD4N0SjSBXcs8qD-","required",""],["fontIcon","link","matSuffix","",4,"ngIf"],["fontIcon","web","matSuffix",""],["fontIcon","link","matSuffix",""]],template:function(i,e){1&i&&(u._UZ(0,"app-notifications"),u.TgZ(1,"div",0)(2,"div",1)(3,"div",2),u.YNc(4,b0,98,29,"form",3),u.qZA()()()),2&i&&(u.xp6(4),u.Q6J("ngIf",e.fg))},dependencies:[X.sg,X.O5,_e.rH,pc.VN,pc.QJ,te.CK,ue.eB,ue.Nr,h_.d,p_.X2,J.Hw,ie.nI,ie.v_,ie.$V,ie.nX,m_.k0,Ae.Zj,Ae.oh,Ae.ap,Ae.Sc,Ze.eI,We.x8,mc.iZ,qe.Kd,B._Y,B.Fj,B.JJ,B.JL,B.Q7,B.sg,B.u,B.x0,B.CE,ve.Yh,Me.t,we.s6,X.Ov,fc.$]})}return s})();var S0=H(5155),E0=H(1338);function C0(s,n){1&s&&(u.TgZ(0,"div",11),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Seluruh Pengguna Tidak Di Tampilkan "),u.qZA())}function k0(s,n){1&s&&(u.TgZ(0,"div",11),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Pengguna "),u.TgZ(5,"i"),u._uU(6,"Private"),u.qZA(),u._uU(7," Tidak Di Tampilkan "),u.qZA())}function A0(s,n){1&s&&(u.TgZ(0,"div",6),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," => Warna Abu-Abu "),u.qZA())}function w0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",1)(1,"div",2)(2,"div",3),u.YNc(3,C0,5,0,"div",4),u.YNc(4,k0,8,0,"div",4),u.YNc(5,A0,5,0,"div",5),u.TgZ(6,"div",6),u._uU(7," * Berkas Anggota Fansub => Warna Oranye "),u.qZA()()(),u.TgZ(8,"div",2)(9,"div",7)(10,"mat-slide-toggle",8),u.NdJ("ngModelChange",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.r18=e)})("change",function(){u.CHM(t);const e=u.oxw();return u.KtG(e.r18Changed())}),u._uU(11," Tampilkan R-18+ "),u.qZA()()(),u.TgZ(12,"div",9)(13,"app-material-tab",10),u.NdJ("tableRowClicked",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.openBerkas(e))})("paginatorClicked",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.onPaginatorClicked(e))})("serverSideFilter",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.onServerSideFilter(e))})("serverSideOrder",function(e){u.CHM(t);const r=u.oxw();return u.KtG(r.onServerSideOrder(e))}),u.qZA()()()}if(2&s){const t=u.oxw();u.xp6(3),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&null!=t.AS.currentUserSubject.value&&t.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified)&&!t.showTruelyPrivate),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified)||t.showTruelyPrivate),u.xp6(5),u.Q6J("ngModel",t.r18),u.xp6(3),u.Q6J("tablePageSizeOptions",t.tablePageSizeOptions)("tabData",t.tabData)("count",t.count)("serverSide",!0)}}let I0=(()=>{class s{constructor(t,i,e,r,a,o,l,d){this.router=t,this.gs=i,this.ls=e,this.bs=r,this.berkas=a,this.fs=o,this.as=l,this.ds=d,this.allBerkasId=[],this.berkasData=[],this.tabData=[{name:"Berkas Terkini",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Kunjungan","Pemilik"],row:[]}}],this.count=0,this.page=1,this.row=50,this.tablePageSizeOptions=[50,75,100,125,150],this.q="",this.sort="",this.order="",this.subsBerkas=null,this.subsTrusted=null,this.subsDialog=null,this.r18=!1,this.gs.bannerImg="/assets/img/banner/berkas.jpg",this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get showTruelyPrivate(){return this.as.currentUserSubject?.value?.role===Ce.yS.ADMIN||this.as.currentUserSubject?.value?.role===Ce.yS.MODERATOR||this.as.currentUserSubject?.value?.role===Ce.yS.FANSUBBER}ngOnDestroy(){this.subsBerkas?.unsubscribe(),this.subsTrusted?.unsubscribe(),this.subsDialog?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.r18="true"===this.ls.getItem(this.gs.localStorageKeys.R18),this.gs.isDesktop||(this.tablePageSizeOptions=[10,25,50,75,100]),this.row=this.tablePageSizeOptions[0],this.getBerkas())}r18Changed(){var t=this;return(0,se.Z)(function*(){t.r18?t.subsDialog=(yield t.ds.openKonfirmasiDialog("Tampilkan Kontent R-18+","Apakah Yakin Untuk Melanjutkan ?")).afterClosed().subscribe({next:i=>{t.gs.log("[INFO_DIALOG_CLOSED]",i),i||(t.r18=!1),t.ls.setItem(t.gs.localStorageKeys.R18,JSON.stringify(t.r18)),t.getBerkas(),t.subsDialog.unsubscribe()}}):(t.ls.setItem(t.gs.localStorageKeys.R18,JSON.stringify(t.r18)),t.getBerkas())})()}getBerkas(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.berkas.getAllBerkas(this.q,this.page,this.row,this.sort,this.order,this.r18).subscribe({next:t=>{this.gs.log("[BERKAS_LIST_SUCCESS]",t),this.count=t.count,this.berkasData=[];for(const i of t.results)this.allBerkasId.push(i.id),this.berkasData.push({id:i.id,private:i.private,foto:i.user_.image_url,Proyek:i.project_type_.name,Tanggal:i.created_at,Kunjungan:i.view_count,Pemilik:i.user_.username,"Nama Berkas":i.name});this.tabData[0].data.row=this.berkasData,this.allBerkasId.length>0&&this.checkTrusted(),this.fs.initializeFab("add",null,"Tambah Berkas Baru","/create/berkas",!1),this.bs.idle()},error:t=>{this.gs.log("[BERKAS_LIST_ERROR]",t,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasId).subscribe({next:t=>{this.gs.log("[BERKAS_TRUSTED_SUCCESS]",t);for(const i of this.berkasData)i.trusted=t.results[i.id];this.bs.idle()},error:t=>{this.gs.log("[BERKAS_TRUSTED_ERROR]",t,"error"),this.bs.idle()}})}openBerkas(t){this.gs.log("[BERKAS_LIST_CLICK_BERKAS]",t),this.router.navigateByUrl(`/berkas/${t.id}`)}onPaginatorClicked(t){this.gs.log("[BERKAS_LIST_CLICK_PAGINATOR]",t),this.page=t.pageIndex+1,this.row=t.pageSize,this.getBerkas()}onServerSideFilter(t){this.gs.log("[BERKAS_LIST_ENTER_FILTER]",t),this.q=t,this.getBerkas()}onServerSideOrder(t){this.gs.log("[BERKAS_LIST_CLICK_ORDER]",t),this.q=t.q,this.sort=t.active,this.order=t.direction,this.getBerkas()}static#e=this.\u0275fac=function(i){return new(i||s)(u.Y36(_e.F0),u.Y36(ke.U),u.Y36(S0.n),u.Y36(Ue.z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e),u.Y36(hc.x))};static#t=this.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-list"]],decls:2,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","my-4"],[1,"col-12"],["class","text-danger text-end",4,"ngIf"],["class","text-success text-end",4,"ngIf"],[1,"text-success","text-end"],[1,"col-12","text-end","text-warning"],["labelPosition","before",3,"ngModel","ngModelChange","change"],[1,"row"],[3,"tablePageSizeOptions","tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"text-danger","text-end"]],template:function(i,e){1&i&&(u._UZ(0,"app-notifications"),u.YNc(1,w0,14,8,"div",0)),2&i&&(u.xp6(1),u.Q6J("ngIf",e.berkasData))},dependencies:[X.O5,mc.iZ,E0.H,B.JJ,B.On,Me.t]})}return s})();var D0=H(5208);const P0=[{path:"",pathMatch:"full",component:I0},{path:":berkasId",children:[{path:"",pathMatch:"full",component:s_},{path:"edit",component:x0,canActivate:[yt.t],data:{title:"Berkas - Ubah Data",description:"Halaman Pembaharuan Data Fansub",keywords:"Ubah Berkas",[$.t.decoratorRoles]:[Ce.yS.ADMIN,Ce.yS.MODERATOR,Ce.yS.FANSUBBER,Ce.yS.USER]}}]}];let O0=(()=>{class s{static#e=this.\u0275fac=function(i){return new(i||s)};static#t=this.\u0275mod=u.oAB({type:s});static#i=this.\u0275inj=u.cJS({imports:[X.ez,_e.Bz.forChild(P0),Ee.m,Te.L,B.u5,B.UX,ve.Ad,pe.F,we.UM,oe,Fe.R,He.b,it.T,D0.d]})}return s})()},3992:(je,Ie,H)=>{"use strict";var X=H(9226);je.exports=function(ve,$){return void 0===$&&($=!1),function(Ce,Ee,Te){if(Ce)ve(Ce);else if(Ee.statusCode>=400&&Ee.statusCode<=599){var pe=Te;if($)if(X.TextDecoder){var u=function B(we){return void 0===we&&(we=""),we.toLowerCase().split(";").reduce(function(ve,$){var Ce=$.split("="),Te=Ce[1];return"charset"===Ce[0].trim()?Te.trim():ve},"utf-8")}(Ee.headers&&Ee.headers["content-type"]);try{pe=new TextDecoder(u).decode(Te)}catch{}}else pe=String.fromCharCode.apply(null,new Uint8Array(Te));ve({cause:pe})}else ve(null,Te)}}},745:(je,Ie,H)=>{"use strict";var X=H(9226),_e=H(434),B=H(2703);Ee.httpHandler=H(3992);var we=function(Fe){var He={};return Fe&&Fe.trim().split("\n").forEach(function(it){var yt=it.indexOf(":"),se=it.slice(0,yt).trim().toLowerCase(),Le=it.slice(yt+1).trim();typeof He[se]>"u"?He[se]=Le:Array.isArray(He[se])?He[se].push(Le):He[se]=[He[se],Le]}),He};function Ce(oe,Fe,He){var it=oe;return B(Fe)?(He=Fe,"string"==typeof oe&&(it={uri:oe})):it=_e({},Fe,{uri:oe}),it.callback=He,it}function Ee(oe,Fe,He){return Te(Fe=Ce(oe,Fe,He))}function Te(oe){if(typeof oe.callback>"u")throw new Error("callback argument missing");var Fe=!1,He=function(de,le,xe){Fe||(Fe=!0,oe.callback(de,le,xe))};function yt(){var Q=void 0;if(Q=me.response?me.response:me.responseText||function pe(oe){try{if("document"===oe.responseType)return oe.responseXML;if(""===oe.responseType&&(!oe.responseXML||"parsererror"!==oe.responseXML.documentElement.nodeName))return oe.responseXML}catch{}return null}(me),D)try{Q=JSON.parse(Q)}catch{}return Q}function se(Q){return clearTimeout(V),Q instanceof Error||(Q=new Error(""+(Q||"Unknown XMLHttpRequest Error"))),Q.statusCode=0,He(Q,ee)}function Le(){if(!Ge){var Q;clearTimeout(V);var de=ee,le=null;return 0!==(Q=oe.useXDR&&void 0===me.status?200:1223===me.status?204:me.status)?(de={body:yt(),statusCode:Q,method:Ue,headers:{},url:ke,rawRequest:me},me.getAllResponseHeaders&&(de.headers=we(me.getAllResponseHeaders()))):le=new Error("Internal XMLHttpRequest Error"),He(le,de,de.body)}}var me=oe.xhr||null;me||(me=oe.cors||oe.useXDR?new Ee.XDomainRequest:new Ee.XMLHttpRequest);var Oe,Ge,V,ke=me.url=oe.uri||oe.url,Ue=me.method=oe.method||"GET",Ve=oe.body||oe.data,rt=me.headers=oe.headers||{},w=!!oe.sync,D=!1,ee={body:void 0,headers:{},statusCode:0,method:Ue,url:ke,rawRequest:me};if("json"in oe&&!1!==oe.json&&(D=!0,rt.accept||rt.Accept||(rt.Accept="application/json"),"GET"!==Ue&&"HEAD"!==Ue&&(rt["content-type"]||rt["Content-Type"]||(rt["Content-Type"]="application/json"),Ve=JSON.stringify(!0===oe.json?Ve:oe.json))),me.onreadystatechange=function it(){4===me.readyState&&setTimeout(Le,0)},me.onload=Le,me.onerror=se,me.onprogress=function(){},me.onabort=function(){Ge=!0},me.ontimeout=se,me.open(Ue,ke,!w,oe.username,oe.password),w||(me.withCredentials=!!oe.withCredentials),!w&&oe.timeout>0&&(V=setTimeout(function(){if(!Ge){Ge=!0,me.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",se(Q)}},oe.timeout)),me.setRequestHeader)for(Oe in rt)rt.hasOwnProperty(Oe)&&me.setRequestHeader(Oe,rt[Oe]);else if(oe.headers&&!function $(oe){for(var Fe in oe)if(oe.hasOwnProperty(Fe))return!1;return!0}(oe.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in oe&&(me.responseType=oe.responseType),"beforeSend"in oe&&"function"==typeof oe.beforeSend&&oe.beforeSend(me),me.send(Ve||null),me}je.exports=Ee,je.exports.default=Ee,Ee.XMLHttpRequest=X.XMLHttpRequest||function u(){},Ee.XDomainRequest="withCredentials"in new Ee.XMLHttpRequest?Ee.XMLHttpRequest:X.XDomainRequest,function ve(oe,Fe){for(var He=0;He{"use strict";function H(B,we){return void 0===we&&(we=Object),we&&"function"==typeof we.freeze?we.freeze(B):B}var X=H({HTML:"text/html",isHTML:function(B){return B===X.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_e=H({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(B){return B===_e.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ie.freeze=H,Ie.MIME_TYPE=X,Ie.NAMESPACE=_e},1991:(je,Ie,H)=>{var _e=H(9401),B=H(6853),we=H(4436),ve=H(8702),$=B.DOMImplementation,Ce=_e.NAMESPACE,Ee=ve.ParseError,Te=ve.XMLReader;function pe(se){this.options=se||{locator:{}}}function oe(){this.cdata=!1}function Fe(se,Le){Le.lineNumber=se.lineNumber,Le.columnNumber=se.columnNumber}function He(se){if(se)return"\n@"+(se.systemId||"")+"#[line:"+se.lineNumber+",col:"+se.columnNumber+"]"}function it(se,Le,me){return"string"==typeof se?se.substr(Le,me):se.length>=Le+me||Le?new java.lang.String(se,Le,me)+"":se}function yt(se,Le){se.currentElement?se.currentElement.appendChild(Le):se.doc.appendChild(Le)}pe.prototype.parseFromString=function(se,Le){var me=this.options,Oe=new Te,Ge=me.domBuilder||new oe,ke=me.errorHandler,Ue=me.locator,Ve=me.xmlns||{},rt=/\/x?html?$/.test(Le),w=rt?we.HTML_ENTITIES:we.XML_ENTITIES;return Ue&&Ge.setDocumentLocator(Ue),Oe.errorHandler=function u(se,Le,me){if(!se){if(Le instanceof oe)return Le;se=Le}var Oe={},Ge=se instanceof Function;function ke(Ue){var Ve=se[Ue];!Ve&&Ge&&(Ve=2==se.length?function(rt){se(Ue,rt)}:se),Oe[Ue]=Ve&&function(rt){Ve("[xmldom "+Ue+"]\t"+rt+He(me))}||function(){}}return me=me||{},ke("warning"),ke("error"),ke("fatalError"),Oe}(ke,Ge,Ue),Oe.domBuilder=me.domBuilder||Ge,rt&&(Ve[""]=Ce.HTML),Ve.xml=Ve.xml||Ce.XML,se&&"string"==typeof se?Oe.parse(se,Ve,w):Oe.errorHandler.error("invalid doc source"),Ge.doc},oe.prototype={startDocument:function(){this.doc=(new $).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(se,Le,me,Oe){var Ge=this.doc,ke=Ge.createElementNS(se,me||Le),Ue=Oe.length;yt(this,ke),this.currentElement=ke,this.locator&&Fe(this.locator,ke);for(var Ve=0;Ve{var _e=H(9401).NAMESPACE;function B(C){return""!==C}function ve(C,A){return C.hasOwnProperty(A)||(C[A]=!0),C}function $(C){if(!C)return[];var A=function we(C){return C?C.split(/[\t\n\f\r ]+/).filter(B):[]}(C);return Object.keys(A.reduce(ve,{}))}function Ee(C,A){for(var R in C)A[R]=C[R]}function Te(C,A){var R=C.prototype;if(!(R instanceof A)){let ce=function(){};ce.prototype=A.prototype,ce=new ce,Ee(R,ce),C.prototype=R=ce}R.constructor!=C&&("function"!=typeof C&&console.error("unknown Class:"+C),R.constructor=C)}var pe={},u=pe.ELEMENT_NODE=1,oe=pe.ATTRIBUTE_NODE=2,Fe=pe.TEXT_NODE=3,He=pe.CDATA_SECTION_NODE=4,it=pe.ENTITY_REFERENCE_NODE=5,yt=pe.ENTITY_NODE=6,se=pe.PROCESSING_INSTRUCTION_NODE=7,Le=pe.COMMENT_NODE=8,me=pe.DOCUMENT_NODE=9,Oe=pe.DOCUMENT_TYPE_NODE=10,Ge=pe.DOCUMENT_FRAGMENT_NODE=11,ke=pe.NOTATION_NODE=12,Ue={},Ve={},D=(Ue.INDEX_SIZE_ERR=(Ve[1]="Index size error",1),Ue.DOMSTRING_SIZE_ERR=(Ve[2]="DOMString size error",2),Ue.HIERARCHY_REQUEST_ERR=(Ve[3]="Hierarchy request error",3)),le=(Ue.WRONG_DOCUMENT_ERR=(Ve[4]="Wrong document",4),Ue.INVALID_CHARACTER_ERR=(Ve[5]="Invalid character",5),Ue.NO_DATA_ALLOWED_ERR=(Ve[6]="No data allowed",6),Ue.NO_MODIFICATION_ALLOWED_ERR=(Ve[7]="No modification allowed",7),Ue.NOT_FOUND_ERR=(Ve[8]="Not found",8)),te=(Ue.NOT_SUPPORTED_ERR=(Ve[9]="Not supported",9),Ue.INUSE_ATTRIBUTE_ERR=(Ve[10]="Attribute in use",10));function We(C,A){if(A instanceof Error)var R=A;else R=this,Error.call(this,Ve[C]),this.message=Ve[C],Error.captureStackTrace&&Error.captureStackTrace(this,We);return R.code=C,A&&(this.message=this.message+": "+A),R}function qe(){}function Me(C,A){this._node=C,this._refresh=A,Pt(this)}function Pt(C){var A=C._node._inc||C._node.ownerDocument._inc;if(C._inc!=A){var R=C._refresh(C._node);Ar(C,"length",R.length),Ee(R,C),C._inc=A}}function P(){}function St(C,A){for(var R=C.length;R--;)if(C[R]===A)return R}function z(C,A,R,Z){if(Z?A[St(A,Z)]=R:A[A.length++]=R,C){R.ownerElement=C;var ce=C.ownerDocument;ce&&(Z&&Yi(ce,C,Z),function Ct(C,A,R){C&&C._inc++,R.namespaceURI===_e.XMLNS&&(A._nsMap[R.prefix?R.localName:""]=R.value)}(ce,C,R))}}function gt(C,A,R){var Z=St(A,R);if(!(Z>=0))throw We(le,new Error(C.tagName+"@"+R));for(var ce=A.length-1;Z"==C&&">")||"&"==C&&"&"||'"'==C&&"""||"&#"+C.charCodeAt()+";"}function lt(C,A){if(A(C))return!0;if(C=C.firstChild)do{if(lt(C,A))return!0}while(C=C.nextSibling)}function re(){}function Yi(C,A,R,Z){C&&C._inc++,R.namespaceURI===_e.XMLNS&&delete A._nsMap[R.prefix?R.localName:""]}function $i(C,A,R){if(C&&C._inc){C._inc++;var Z=A.childNodes;if(R)Z[Z.length++]=R;else{for(var ce=A.firstChild,ze=0;ce;)Z[ze++]=ce,ce=ce.nextSibling;Z.length=ze}}}function ki(C,A){var R=A.previousSibling,Z=A.nextSibling;return R?R.nextSibling=Z:C.firstChild=Z,Z?Z.previousSibling=R:C.lastChild=R,$i(C.ownerDocument,C),A}function Qi(C,A,R){var Z=A.parentNode;if(Z&&Z.removeChild(A),A.nodeType===Ge){var ce=A.firstChild;if(null==ce)return A;var ze=A.lastChild}else ce=ze=A;var Xe=R?R.previousSibling:C.lastChild;ce.previousSibling=Xe,ze.nextSibling=R,Xe?Xe.nextSibling=ce:C.firstChild=ce,null==R?C.lastChild=ze:R.previousSibling=ze;do{ce.parentNode=C}while(ce!==ze&&(ce=ce.nextSibling));return $i(C.ownerDocument||C,C),A.nodeType==Ge&&(A.firstChild=A.lastChild=null),A}function vt(){this._nsMap={}}function oi(){}function Xi(){}function rn(){}function xr(){}function Sr(){}function Er(){}function Ji(){}function Cr(){}function nn(){}function er(){}function an(){}function Bn(){}function kr(C,A){var R=[],Z=9==this.nodeType&&this.documentElement||this,ce=Z.prefix,ze=Z.namespaceURI;if(ze&&null==ce&&null==(ce=Z.lookupPrefix(ze)))var Xe=[{namespace:ze,prefix:null}];return Vi(this,R,C,A,Xe),R.join("")}function jn(C,A,R){var Z=C.prefix||"",ce=C.namespaceURI;if(!ce||"xml"===Z&&ce===_e.XML||ce===_e.XMLNS)return!1;for(var ze=R.length;ze--;){var Xe=R[ze];if(Xe.prefix===Z)return Xe.namespace!==ce}return!0}function Ft(C,A,R){C.push(" ",A,'="',R.replace(/[<&"]/g,Ne),'"')}function Vi(C,A,R,Z,ce){if(ce||(ce=[]),Z){if(!(C=Z(C)))return;if("string"==typeof C)return void A.push(C)}switch(C.nodeType){case u:var ze=C.attributes,Xe=ze.length,At=C.firstChild,ui=C.tagName,tr=ui;if(!(R=_e.isHTML(C.namespaceURI)||R)&&!C.prefix&&C.namespaceURI){for(var li,di=0;di=0;$t--)if(""===(ii=ce[$t]).prefix&&ii.namespace===C.namespaceURI){li=ii.namespace;break}if(li!==C.namespaceURI)for($t=ce.length-1;$t>=0;$t--){var ii;if((ii=ce[$t]).namespace===C.namespaceURI){ii.prefix&&(tr=ii.prefix+":"+ui);break}}}A.push("<",tr);for(var ci=0;ci"),R&&/^script$/i.test(ui))for(;At;)At.data?A.push(At.data):Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;else for(;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;A.push("")}else A.push("/>");return;case me:case Ge:for(At=C.firstChild;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;return;case oe:return Ft(A,C.name,C.value);case Fe:return A.push(C.data.replace(/[<&]/g,Ne).replace(/]]>/g,"]]>"));case He:return A.push("");case Le:return A.push("\x3c!--",C.data,"--\x3e");case Oe:var sn=C.publicId,qi=C.systemId;if(A.push("");else if(qi&&"."!=qi)A.push(" SYSTEM ",qi,">");else{var Vn=C.internalSubset;Vn&&A.push(" [",Vn,"]"),A.push(">")}return;case se:return A.push("");case it:return A.push("&",C.nodeName,";");default:A.push("??",C.nodeName)}}function Hn(C,A,R){var Z;switch(A.nodeType){case u:(Z=A.cloneNode(!1)).ownerDocument=C;case Ge:break;case oe:R=!0}if(Z||(Z=A.cloneNode(!1)),Z.ownerDocument=C,Z.parentNode=null,R)for(var ce=A.firstChild;ce;)Z.appendChild(Hn(C,ce,R)),ce=ce.nextSibling;return Z}function _i(C,A,R){var Z=new A.constructor;for(var ce in A){var ze=A[ce];"object"!=typeof ze&&ze!=Z[ce]&&(Z[ce]=ze)}switch(A.childNodes&&(Z.childNodes=new qe),Z.ownerDocument=C,Z.nodeType){case u:var Xe=A.attributes,ui=Z.attributes=new P,tr=Xe.length;ui._ownerElement=Z;for(var li=0;li0},lookupPrefix:function(C){for(var A=this;A;){var R=A._nsMap;if(R)for(var Z in R)if(R[Z]==C)return Z;A=A.nodeType==oe?A.ownerDocument:A.parentNode}return null},lookupNamespaceURI:function(C){for(var A=this;A;){var R=A._nsMap;if(R&&C in R)return R[C];A=A.nodeType==oe?A.ownerDocument:A.parentNode}return null},isDefaultNamespace:function(C){return null==this.lookupPrefix(C)}},Ee(pe,De),Ee(pe,De.prototype),re.prototype={nodeName:"#document",nodeType:me,doctype:null,documentElement:null,_inc:1,insertBefore:function(C,A){if(C.nodeType==Ge){for(var R=C.firstChild;R;){var Z=R.nextSibling;this.insertBefore(R,A),R=Z}return C}return null==this.documentElement&&C.nodeType==u&&(this.documentElement=C),Qi(this,C,A),C.ownerDocument=this,C},removeChild:function(C){return this.documentElement==C&&(this.documentElement=null),ki(this,C)},importNode:function(C,A){return Hn(this,C,A)},getElementById:function(C){var A=null;return lt(this.documentElement,function(R){if(R.nodeType==u&&R.getAttribute("id")==C)return A=R,!0}),A},getElementsByClassName:function(C){var A=$(C);return new Me(this,function(R){var Z=[];return A.length>0&<(R.documentElement,function(ce){if(ce!==R&&ce.nodeType===u){var ze=ce.getAttribute("class");if(ze){var Xe=C===ze;if(!Xe){var ui=$(ze);Xe=A.every(function Ce(C){return function(A){return C&&-1!==C.indexOf(A)}}(ui))}Xe&&Z.push(ce)}}}),Z})},createElement:function(C){var A=new vt;return A.ownerDocument=this,A.nodeName=C,A.tagName=C,A.localName=C,A.childNodes=new qe,(A.attributes=new P)._ownerElement=A,A},createDocumentFragment:function(){var C=new er;return C.ownerDocument=this,C.childNodes=new qe,C},createTextNode:function(C){var A=new rn;return A.ownerDocument=this,A.appendData(C),A},createComment:function(C){var A=new xr;return A.ownerDocument=this,A.appendData(C),A},createCDATASection:function(C){var A=new Sr;return A.ownerDocument=this,A.appendData(C),A},createProcessingInstruction:function(C,A){var R=new an;return R.ownerDocument=this,R.tagName=R.target=C,R.nodeValue=R.data=A,R},createAttribute:function(C){var A=new oi;return A.ownerDocument=this,A.name=C,A.nodeName=C,A.localName=C,A.specified=!0,A},createEntityReference:function(C){var A=new nn;return A.ownerDocument=this,A.nodeName=C,A},createElementNS:function(C,A){var R=new vt,Z=A.split(":"),ce=R.attributes=new P;return R.childNodes=new qe,R.ownerDocument=this,R.nodeName=A,R.tagName=A,R.namespaceURI=C,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,ce._ownerElement=R,R},createAttributeNS:function(C,A){var R=new oi,Z=A.split(":");return R.ownerDocument=this,R.nodeName=A,R.name=A,R.namespaceURI=C,R.specified=!0,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,R}},Te(re,De),re.prototype.getElementsByTagName=(vt.prototype={nodeType:u,hasAttribute:function(C){return null!=this.getAttributeNode(C)},getAttribute:function(C){var A=this.getAttributeNode(C);return A&&A.value||""},getAttributeNode:function(C){return this.attributes.getNamedItem(C)},setAttribute:function(C,A){var R=this.ownerDocument.createAttribute(C);R.value=R.nodeValue=""+A,this.setAttributeNode(R)},removeAttribute:function(C){var A=this.getAttributeNode(C);A&&this.removeAttributeNode(A)},appendChild:function(C){return C.nodeType===Ge?this.insertBefore(C,null):function nt(C,A){var R=A.parentNode;if(R){var Z=C.lastChild;R.removeChild(A),Z=C.lastChild}return Z=C.lastChild,A.parentNode=C,A.previousSibling=Z,A.nextSibling=null,Z?Z.nextSibling=A:C.firstChild=A,C.lastChild=A,$i(C.ownerDocument,C,A),A}(this,C)},setAttributeNode:function(C){return this.attributes.setNamedItem(C)},setAttributeNodeNS:function(C){return this.attributes.setNamedItemNS(C)},removeAttributeNode:function(C){return this.attributes.removeNamedItem(C.nodeName)},removeAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);R&&this.removeAttributeNode(R)},hasAttributeNS:function(C,A){return null!=this.getAttributeNodeNS(C,A)},getAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);return R&&R.value||""},setAttributeNS:function(C,A,R){var Z=this.ownerDocument.createAttributeNS(C,A);Z.value=Z.nodeValue=""+R,this.setAttributeNode(Z)},getAttributeNodeNS:function(C,A){return this.attributes.getNamedItemNS(C,A)},getElementsByTagName:function(C){return new Me(this,function(A){var R=[];return lt(A,function(Z){Z!==A&&Z.nodeType==u&&("*"===C||Z.tagName==C)&&R.push(Z)}),R})},getElementsByTagNameNS:function(C,A){return new Me(this,function(R){var Z=[];return lt(R,function(ce){ce!==R&&ce.nodeType===u&&("*"===C||ce.namespaceURI===C)&&("*"===A||ce.localName==A)&&Z.push(ce)}),Z})}}).getElementsByTagName,re.prototype.getElementsByTagNameNS=vt.prototype.getElementsByTagNameNS,Te(vt,De),oi.prototype.nodeType=oe,Te(oi,De),Xi.prototype={data:"",substringData:function(C,A){return this.data.substring(C,C+A)},appendData:function(C){this.nodeValue=this.data=C=this.data+C,this.length=C.length},insertData:function(C,A){this.replaceData(C,0,A)},appendChild:function(C){throw new Error(Ve[D])},deleteData:function(C,A){this.replaceData(C,A,"")},replaceData:function(C,A,R){var Z=this.data.substring(0,C),ce=this.data.substring(C+A);this.nodeValue=this.data=R=Z+R+ce,this.length=R.length}},Te(Xi,De),rn.prototype={nodeName:"#text",nodeType:Fe,splitText:function(C){var A=this.data,R=A.substring(C);A=A.substring(0,C),this.data=this.nodeValue=A,this.length=A.length;var Z=this.ownerDocument.createTextNode(R);return this.parentNode&&this.parentNode.insertBefore(Z,this.nextSibling),Z}},Te(rn,Xi),xr.prototype={nodeName:"#comment",nodeType:Le},Te(xr,Xi),Sr.prototype={nodeName:"#cdata-section",nodeType:He},Te(Sr,Xi),Er.prototype.nodeType=Oe,Te(Er,De),Ji.prototype.nodeType=ke,Te(Ji,De),Cr.prototype.nodeType=yt,Te(Cr,De),nn.prototype.nodeType=it,Te(nn,De),er.prototype.nodeName="#document-fragment",er.prototype.nodeType=Ge,Te(er,De),an.prototype.nodeType=se,Te(an,De),Bn.prototype.serializeToString=function(C,A,R){return kr.call(C,A,R)},De.prototype.toString=kr;try{if(Object.defineProperty){let C=function(A){switch(A.nodeType){case u:case Ge:var R=[];for(A=A.firstChild;A;)7!==A.nodeType&&8!==A.nodeType&&R.push(C(A)),A=A.nextSibling;return R.join("");default:return A.nodeValue}};Object.defineProperty(Me.prototype,"length",{get:function(){return Pt(this),this.$$length}}),Object.defineProperty(De.prototype,"textContent",{get:function(){return C(this)},set:function(A){switch(this.nodeType){case u:case Ge:for(;this.firstChild;)this.removeChild(this.firstChild);(A||String(A))&&this.appendChild(this.ownerDocument.createTextNode(A));break;default:this.data=A,this.value=A,this.nodeValue=A}}}),Ar=function(A,R,Z){A["$$"+R]=Z}}}catch{}Ie.DocumentType=Er,Ie.DOMException=We,Ie.DOMImplementation=vi,Ie.Element=vt,Ie.Node=De,Ie.NodeList=qe,Ie.XMLSerializer=Bn},4436:(je,Ie,H)=>{var X=H(9401).freeze;Ie.XML_ENTITIES=X({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),Ie.HTML_ENTITIES=X({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),Ie.entityMap=Ie.HTML_ENTITIES},978:(je,Ie,H)=>{H(6853);Ie.DOMParser=H(1991).DOMParser},8702:(je,Ie,H)=>{var X=H(9401).NAMESPACE,_e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,B=new RegExp("[\\-\\.0-9"+_e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),we=new RegExp("^"+_e.source+B.source+"*(?::"+_e.source+B.source+"*)?$"),ve=0,$=1,Ce=2,Ee=3,Te=4,pe=5,u=6,oe=7;function Fe(w,D){this.message=w,this.locator=D,Error.captureStackTrace&&Error.captureStackTrace(this,Fe)}function He(){}function yt(w,D){return D.lineNumber=w.lineNumber,D.columnNumber=w.columnNumber,D}function se(w,D,V,ee,Q,de){function le(Ze,We,qe){V.attributeNames.hasOwnProperty(Ze)&&de.fatalError("Attribute "+Ze+" redefined"),V.addValue(Ze,We,qe)}for(var xe,ue=++D,J=ve;;){var ie=w.charAt(ue);switch(ie){case"=":if(J===$)xe=w.slice(D,ue),J=Ee;else{if(J!==Ce)throw new Error("attribute equal must after attrName");J=Ee}break;case"'":case'"':if(J===Ee||J===$){if(J===$&&(de.warning('attribute value must after "="'),xe=w.slice(D,ue)),!((ue=w.indexOf(ie,D=ue+1))>0))throw new Error("attribute value no end '"+ie+"' match");le(xe,te=w.slice(D,ue).replace(/&#?\w+;/g,Q),D-1),J=pe}else{if(J!=Te)throw new Error('attribute value must after "="');le(xe,te=w.slice(D,ue).replace(/&#?\w+;/g,Q),D),de.warning('attribute "'+xe+'" missed start quot('+ie+")!!"),D=ue+1,J=pe}break;case"/":switch(J){case ve:V.setTagName(w.slice(D,ue));case pe:case u:case oe:J=oe,V.closed=!0;case Te:case $:case Ce:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return de.error("unexpected end of input"),J==ve&&V.setTagName(w.slice(D,ue)),ue;case">":switch(J){case ve:V.setTagName(w.slice(D,ue));case pe:case u:case oe:break;case Te:case $:"/"===(te=w.slice(D,ue)).slice(-1)&&(V.closed=!0,te=te.slice(0,-1));case Ce:J===Ce&&(te=xe),J==Te?(de.warning('attribute "'+te+'" missed quot(")!'),le(xe,te.replace(/&#?\w+;/g,Q),D)):((!X.isHTML(ee[""])||!te.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+te+'" missed value!! "'+te+'" instead!!'),le(te,te,D));break;case Ee:throw new Error("attribute value missed!!")}return ue;case"\x80":ie=" ";default:if(ie<=" ")switch(J){case ve:V.setTagName(w.slice(D,ue)),J=u;break;case $:xe=w.slice(D,ue),J=Ce;break;case Te:var te=w.slice(D,ue).replace(/&#?\w+;/g,Q);de.warning('attribute "'+te+'" missed quot(")!!'),le(xe,te,D);case pe:J=u}else switch(J){case Ce:(!X.isHTML(ee[""])||!xe.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+xe+'" missed value!! "'+xe+'" instead2!!'),le(xe,xe,D),D=ue,J=$;break;case pe:de.warning('attribute space is required"'+xe+'"!!');case u:J=$,D=ue;break;case Ee:J=Te,D=ue;break;case oe:throw new Error("elements closed character '/' and '>' must be connected to")}}ue++}}function Le(w,D,V){for(var ee=w.tagName,Q=null,ie=w.length;ie--;){var de=w[ie],le=de.qName,xe=de.value;if((Ae=le.indexOf(":"))>0)var te=de.prefix=le.slice(0,Ae),ue=le.slice(Ae+1),J="xmlns"===te&&ue;else ue=le,te=null,J="xmlns"===le&&"";de.localName=ue,!1!==J&&(null==Q&&(Q={},Ge(V,V={})),V[J]=Q[J]=xe,de.uri=X.XMLNS,D.startPrefixMapping(J,xe))}for(ie=w.length;ie--;)(te=(de=w[ie]).prefix)&&("xml"===te&&(de.uri=X.XML),"xmlns"!==te&&(de.uri=V[te||""]));var Ae;(Ae=ee.indexOf(":"))>0?(te=w.prefix=ee.slice(0,Ae),ue=w.localName=ee.slice(Ae+1)):(te=null,ue=w.localName=ee);var Ze=w.uri=V[te||""];if(D.startElement(Ze,ue,ee,w),!w.closed)return w.currentNSMap=V,w.localNSMap=Q,!0;if(D.endElement(Ze,ue,ee),Q)for(te in Q)D.endPrefixMapping(te)}function me(w,D,V,ee,Q){if(/^(?:script|textarea)$/i.test(V)){var de=w.indexOf("",D),le=w.substring(D+1,de);if(/[&<]/.test(le))return/^script$/i.test(V)?(Q.characters(le,0,le.length),de):(le=le.replace(/&#?\w+;/g,ee),Q.characters(le,0,le.length),de)}return D+1}function Oe(w,D,V,ee){var Q=ee[V];return null==Q&&((Q=w.lastIndexOf(""))D?(V.comment(w,D+4,de-D-4),de+3):(ee.error("Unclosed comment"),-1):-1;if("CDATA["==w.substr(D+3,6)){var de=w.indexOf("]]>",D+9);return V.startCDATA(),V.characters(w,D+9,de-D-9),V.endCDATA(),de+3}var le=function rt(w,D){var V,ee=[],Q=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Q.lastIndex=D,Q.exec(w);V=Q.exec(w);)if(ee.push(V),V[1])return ee}(w,D),xe=le.length;if(xe>1&&/!doctype/i.test(le[0][0])){var te=le[1][0],ue=!1,J=!1;xe>3&&(/^public$/i.test(le[2][0])?(ue=le[3][0],J=xe>4&&le[4][0]):/^system$/i.test(le[2][0])&&(J=le[3][0]));var ie=le[xe-1];return V.startDTD(te,ue,J),V.endDTD(),ie.index+ie[0].length}return-1}function Ue(w,D,V){var ee=w.indexOf("?>",D);if(ee){var Q=w.substring(D,ee).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Q?(V.processingInstruction(Q[1],Q[2]),ee+2):-1}return-1}function Ve(){this.attributeNames={}}(Fe.prototype=new Error).name=Fe.name,He.prototype={parse:function(w,D,V){var ee=this.domBuilder;ee.startDocument(),Ge(D,D={}),function it(w,D,V,ee,Q){function le(nt){var vt=nt.slice(1,-1);return vt in V?V[vt]:"#"===vt.charAt(0)?function de(nt){return nt>65535?(nt-=65536,String.fromCharCode(55296+(nt>>10),56320+(1023&nt))):String.fromCharCode(nt)}(parseInt(vt.substr(1).replace("x","0x"))):(Q.error("entity not found:"+nt),nt)}function xe(nt){if(nt>qe){var vt=w.substring(qe,nt).replace(/&#?\w+;/g,le);Ae&&te(qe),ee.characters(vt,0,nt-qe),qe=nt}}function te(nt,vt){for(;nt>=J&&(vt=ie.exec(w));)J=(ue=vt.index)+vt[0].length,Ae.lineNumber++;Ae.columnNumber=nt-ue+1}for(var ue=0,J=0,ie=/.*(?:\r\n?|\n)|.*$/g,Ae=ee.locator,Ze=[{currentNSMap:D}],We={},qe=0;;){try{var Me=w.indexOf("<",qe);if(Me<0){if(!w.substr(qe).match(/^\s*$/)){var Pt=ee.doc,P=Pt.createTextNode(w.substr(qe));Pt.appendChild(P),ee.currentElement=P}return}switch(Me>qe&&xe(Me),w.charAt(Me+1)){case"/":var Ct=w.indexOf(">",Me+3),St=w.substring(Me+2,Ct).replace(/[ \t\n\r]+$/g,""),z=Ze.pop();Ct<0?(St=w.substring(Me+2).replace(/[\s<].*/,""),Q.error("end tag name: "+St+" is not complete:"+z.tagName),Ct=Me+1+St.length):St.match(/\sqe?qe=Ct:xe(Math.max(Me,qe)+1)}}(w,D,V,ee,this.errorHandler),ee.endDocument()}},Ve.prototype={setTagName:function(w){if(!we.test(w))throw new Error("invalid tagName:"+w);this.tagName=w},addValue:function(w,D,V){if(!we.test(w))throw new Error("invalid attribute:"+w);this.attributeNames[w]=this.length,this[this.length++]={qName:w,value:D,offset:V}},length:0,getLocalName:function(w){return this[w].localName},getLocator:function(w){return this[w].locator},getQName:function(w){return this[w].qName},getURI:function(w){return this[w].uri},getValue:function(w){return this[w].value}},Ie.XMLReader=He,Ie.ParseError=Fe},1421:(je,Ie,H)=>{var B,X=typeof global<"u"?global:typeof window<"u"?window:{},_e=H(5893);typeof document<"u"?B=document:(B=X["__GLOBAL_DOCUMENT_CACHE@4"])||(B=X["__GLOBAL_DOCUMENT_CACHE@4"]=_e),je.exports=B},9226:je=>{var Ie;Ie=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},je.exports=Ie},2703:je=>{je.exports=function H(X){if(!X)return!1;var _e=Ie.call(X);return"[object Function]"===_e||"function"==typeof X&&"[object RegExp]"!==_e||typeof window<"u"&&(X===window.setTimeout||X===window.alert||X===window.confirm||X===window.prompt)};var Ie=Object.prototype.toString},1234:(je,Ie)=>{function H($){if($&&"object"==typeof $){var Ce=$.which||$.keyCode||$.charCode;Ce&&($=Ce)}if("number"==typeof $)return we[$];var Te,Ee=String($);return(Te=X[Ee.toLowerCase()])?Te:(Te=_e[Ee.toLowerCase()])||(1===Ee.length?Ee.charCodeAt(0):void 0)}H.isEventKey=function(Ce,Ee){if(Ce&&"object"==typeof Ce){var Te=Ce.which||Ce.keyCode||Ce.charCode;if(null==Te)return!1;if("string"==typeof Ee){var pe;if(pe=X[Ee.toLowerCase()])return pe===Te;if(pe=_e[Ee.toLowerCase()])return pe===Te}else if("number"==typeof Ee)return Ee===Te;return!1}};var X=(Ie=je.exports=H).code=Ie.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},_e=Ie.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(B=97;B<123;B++)X[String.fromCharCode(B)]=B-32;for(var B=48;B<58;B++)X[B-48]=B;for(B=1;B<13;B++)X["f"+B]=B+111;for(B=0;B<10;B++)X["numpad "+B]=B+96;var we=Ie.names=Ie.title={};for(B in X)we[X[B]]=B;for(var ve in _e)X[ve]=_e[ve]},7459:(je,Ie,H)=>{var X=H(3357).getUint64;je.exports=function(B){var we=new DataView(B.buffer,B.byteOffset,B.byteLength),ve={version:B[0],flags:new Uint8Array(B.subarray(1,4)),references:[],referenceId:we.getUint32(4),timescale:we.getUint32(8)},$=12;0===ve.version?(ve.earliestPresentationTime=we.getUint32($),ve.firstOffset=we.getUint32($+4),$+=8):(ve.earliestPresentationTime=X(B.subarray($)),ve.firstOffset=X(B.subarray($+8)),$+=16);var Ce=we.getUint16($+=2);for($+=2;Ce>0;$+=12,Ce--)ve.references.push({referenceType:(128&B[$])>>>7,referencedSize:2147483647&we.getUint32($),subsegmentDuration:we.getUint32($+4),startsWithSap:!!(128&B[$+8]),sapType:(112&B[$+8])>>>4,sapDeltaTime:268435455&we.getUint32($+8)});return ve}},6277:je=>{var H,X,_e,B,we,ve,$;we=function(Ce,Ee){return H(B(Ce,Ee))},ve=function(Ce,Ee){return X(_e(Ce),Ee)},$=function(Ce,Ee,Te){return _e(Te?Ce:Ce-Ee)},je.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:H=function(Ce){return 9e4*Ce},secondsToAudioTs:X=function(Ce,Ee){return Ce*Ee},videoTsToSeconds:_e=function(Ce){return Ce/9e4},audioTsToSeconds:B=function(Ce,Ee){return Ce/Ee},audioTsToVideoTs:we,videoTsToAudioTs:ve,metadataTsToSeconds:$}},3357:je=>{var Ie=Math.pow(2,32);je.exports={getUint64:function(X){var B,_e=new DataView(X.buffer,X.byteOffset,X.byteLength);return _e.getBigUint64?(B=_e.getBigUint64(0)){je.exports=function Ie(H,X){var _e,B=null;try{_e=JSON.parse(H,X)}catch(we){B=we}return[B,_e]}},3871:function(je){var H,X,_e,B,we;H=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,X=/^(?=([^\/?#]*))\1([^]*)$/,_e=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,je.exports=we={buildAbsoluteURL:function(ve,$,Ce){if(Ce=Ce||{},ve=ve.trim(),!($=$.trim())){if(!Ce.alwaysNormalize)return ve;var Ee=we.parseURL(ve);if(!Ee)throw new Error("Error trying to parse base URL.");return Ee.path=we.normalizePath(Ee.path),we.buildURLFromParts(Ee)}var Te=we.parseURL($);if(!Te)throw new Error("Error trying to parse relative URL.");if(Te.scheme)return Ce.alwaysNormalize?(Te.path=we.normalizePath(Te.path),we.buildURLFromParts(Te)):$;var pe=we.parseURL(ve);if(!pe)throw new Error("Error trying to parse base URL.");if(!pe.netLoc&&pe.path&&"/"!==pe.path[0]){var u=X.exec(pe.path);pe.netLoc=u[1],pe.path=u[2]}pe.netLoc&&!pe.path&&(pe.path="/");var oe={scheme:pe.scheme,netLoc:Te.netLoc,path:null,params:Te.params,query:Te.query,fragment:Te.fragment};if(!Te.netLoc&&(oe.netLoc=pe.netLoc,"/"!==Te.path[0]))if(Te.path){var Fe=pe.path,He=Fe.substring(0,Fe.lastIndexOf("/")+1)+Te.path;oe.path=we.normalizePath(He)}else oe.path=pe.path,Te.params||(oe.params=pe.params,Te.query||(oe.query=pe.query));return null===oe.path&&(oe.path=Ce.alwaysNormalize?we.normalizePath(Te.path):Te.path),we.buildURLFromParts(oe)},parseURL:function(ve){var $=H.exec(ve);return $?{scheme:$[1]||"",netLoc:$[2]||"",path:$[3]||"",params:$[4]||"",query:$[5]||"",fragment:$[6]||""}:null},normalizePath:function(ve){for(ve=ve.split("").reverse().join("").replace(_e,"");ve.length!==(ve=ve.replace(B,"")).length;);return ve.split("").reverse().join("")},buildURLFromParts:function(ve){return ve.scheme+ve.netLoc+ve.path+ve.params+ve.query+ve.fragment}}},3629:(je,Ie,H)=>{var X=H(9226),_e=je.exports={WebVTT:H(8318),VTTCue:H(5713),VTTRegion:H(3872)};X.vttjs=_e,X.WebVTT=_e.WebVTT;var B=_e.VTTCue,we=_e.VTTRegion,ve=X.VTTCue,$=X.VTTRegion;_e.shim=function(){X.VTTCue=B,X.VTTRegion=we},_e.restore=function(){X.VTTCue=ve,X.VTTRegion=$},X.VTTCue||_e.shim()},8318:(je,Ie,H)=>{var X=H(1421),_e=Object.create||function(){function w(){}return function(D){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return w.prototype=D,new w}}();function B(w,D){this.name="ParsingError",this.code=w.code,this.message=D||w.message}function we(w){function D(ee,Q,de,le){return 3600*(0|ee)+60*(0|Q)+(0|de)+(0|le)/1e3}var V=w.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return V?V[3]?D(V[1],V[2],V[3].replace(":",""),V[4]):V[1]>59?D(V[1],V[2],0,V[4]):D(0,V[1],V[2],V[4]):null}function ve(){this.values=_e(null)}function $(w,D,V,ee){var Q=ee?w.split(ee):[w];for(var de in Q)if("string"==typeof Q[de]){var le=Q[de].split(V);2===le.length&&D(le[0],le[1])}}function Ce(w,D,V){var ee=w;function Q(){var xe=we(w);if(null===xe)throw new B(B.Errors.BadTimeStamp,"Malformed timestamp: "+ee);return w=w.replace(/^[^\sa-zA-Z-]+/,""),xe}function le(){w=w.replace(/^\s+/,"")}if(le(),D.startTime=Q(),le(),"--\x3e"!==w.substr(0,3))throw new B(B.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+ee);w=w.substr(3),le(),D.endTime=Q(),le(),function de(xe,te){var ue=new ve;$(xe,function(J,ie){switch(J){case"region":for(var Ae=V.length-1;Ae>=0;Ae--)if(V[Ae].id===ie){ue.set(J,V[Ae].region);break}break;case"vertical":ue.alt(J,ie,["rl","lr"]);break;case"line":var Ze=ie.split(","),We=Ze[0];ue.integer(J,We),ue.percent(J,We)&&ue.set("snapToLines",!1),ue.alt(J,We,["auto"]),2===Ze.length&&ue.alt("lineAlign",Ze[1],["start","center","end"]);break;case"position":Ze=ie.split(","),ue.percent(J,Ze[0]),2===Ze.length&&ue.alt("positionAlign",Ze[1],["start","center","end"]);break;case"size":ue.percent(J,ie);break;case"align":ue.alt(J,ie,["start","center","end","left","right"])}},/:/,/\s/),te.region=ue.get("region",null),te.vertical=ue.get("vertical","");try{te.line=ue.get("line","auto")}catch{}te.lineAlign=ue.get("lineAlign","start"),te.snapToLines=ue.get("snapToLines",!0),te.size=ue.get("size",100);try{te.align=ue.get("align","center")}catch{te.align=ue.get("align","middle")}try{te.position=ue.get("position","auto")}catch{te.position=ue.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},te.align)}te.positionAlign=ue.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},te.align)}(w,D)}(B.prototype=_e(Error.prototype)).constructor=B,B.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ve.prototype={set:function(w,D){!this.get(w)&&""!==D&&(this.values[w]=D)},get:function(w,D,V){return V?this.has(w)?this.values[w]:D[V]:this.has(w)?this.values[w]:D},has:function(w){return w in this.values},alt:function(w,D,V){for(var ee=0;ee=0&&D<=100))&&(this.set(w,D),!0)}};var Ee=X.createElement&&X.createElement("textarea"),Te={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},pe={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},u={v:"title",lang:"lang"},oe={rt:"ruby"};function Fe(w,D){function V(){if(!D)return null;var qe=D.match(/^([^<]*)(<[^>]*>?)?/);return function We(Me){return D=D.substr(Me.length),Me}(qe[1]?qe[1]:qe[2])}function ee(We){return Ee.innerHTML=We,We=Ee.textContent,Ee.textContent="",We}function de(We,qe){var Me=Te[We];if(!Me)return null;var Pt=w.document.createElement(Me),P=u[We];return P&&qe&&(Pt[P]=qe.trim()),Pt}for(var te,le=w.document.createElement("div"),xe=le,ue=[];null!==(te=V());)if("<"!==te[0])xe.appendChild(w.document.createTextNode(ee(te)));else{if("/"===te[1]){ue.length&&ue[ue.length-1]===te.substr(2).replace(">","")&&(ue.pop(),xe=xe.parentNode);continue}var ie,J=we(te.substr(1,te.length-2));if(J){ie=w.document.createProcessingInstruction("timestamp",J),xe.appendChild(ie);continue}var Ae=te.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!Ae||!(ie=de(Ae[1],Ae[3]))||oe[(qe=ie).localName]&&oe[qe.localName]!==xe.localName)continue;if(Ae[2]){var Ze=Ae[2].split(".");Ze.forEach(function(We){var qe=/^bg_/.test(We),Me=qe?We.slice(3):We;pe.hasOwnProperty(Me)&&(ie.style[qe?"background-color":"color"]=pe[Me])}),ie.className=Ze.join(" ")}ue.push(Ae[1]),xe.appendChild(ie),xe=ie}var qe;return le}var He=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function it(w){for(var D=0;D=V[0]&&w<=V[1])return!0}return!1}function yt(w){var D=[],V="";if(!w||!w.childNodes)return"ltr";function Q(xe,te){for(var ue=te.childNodes.length-1;ue>=0;ue--)xe.push(te.childNodes[ue])}function de(xe){if(!xe||!xe.length)return null;var te=xe.pop(),ue=te.textContent||te.innerText;if(ue){var J=ue.match(/^.*(\n|\r)/);return J?(xe.length=0,J[0]):ue}return"ruby"===te.tagName?de(xe):te.childNodes?(Q(xe,te),de(xe)):void 0}for(Q(D,w);V=de(D);)for(var le=0;le=0&&w.line<=100))return w.line;if(!w.track||!w.track.textTrackList||!w.track.textTrackList.mediaElement)return-1;for(var D=w.track,V=D.textTrackList,ee=0,Q=0;QAe&&(ie=ie<0?-1:1,ie*=Math.ceil(Ae/J)*J),xe<0&&(ie+=""===le.vertical?V.height:V.width,te=te.reverse()),de.move(Ze,ie)}else{var We=de.lineHeight/V.height*100;switch(le.lineAlign){case"center":xe-=We/2;break;case"end":xe-=We}switch(le.vertical){case"":D.applyStyles({top:D.formatStyle(xe,"%")});break;case"rl":D.applyStyles({left:D.formatStyle(xe,"%")});break;case"lr":D.applyStyles({right:D.formatStyle(xe,"%")})}te=["+y","-x","+x","-y"],de=new Oe(D)}var qe=function Q(Me,Pt){for(var P,St=new Oe(Me),z=1,gt=0;gtvi&&(P=new Oe(Me),z=vi),Me=new Oe(St)}return P||St}(de,te);D.move(qe.toCSSCompatValues(V))}function ke(){}Le.prototype.applyStyles=function(w,D){for(var V in D=D||this.div,w)w.hasOwnProperty(V)&&(D.style[V]=w[V])},Le.prototype.formatStyle=function(w,D){return 0===w?0:w+D},(me.prototype=_e(Le.prototype)).constructor=me,Oe.prototype.move=function(w,D){switch(D=void 0!==D?D:this.lineHeight,w){case"+x":this.left+=D,this.right+=D;break;case"-x":this.left-=D,this.right-=D;break;case"+y":this.top+=D,this.bottom+=D;break;case"-y":this.top-=D,this.bottom-=D}},Oe.prototype.overlaps=function(w){return this.leftw.left&&this.topw.top},Oe.prototype.overlapsAny=function(w){for(var D=0;D=w.top&&this.bottom<=w.bottom&&this.left>=w.left&&this.right<=w.right},Oe.prototype.overlapsOppositeAxis=function(w,D){switch(D){case"+x":return this.leftw.right;case"+y":return this.topw.bottom}},Oe.prototype.intersectPercentage=function(w){return Math.max(0,Math.min(this.right,w.right)-Math.max(this.left,w.left))*Math.max(0,Math.min(this.bottom,w.bottom)-Math.max(this.top,w.top))/(this.height*this.width)},Oe.prototype.toCSSCompatValues=function(w){return{top:this.top-w.top,bottom:w.bottom-this.bottom,left:this.left-w.left,right:w.right-this.right,height:this.height,width:this.width}},Oe.getSimpleBoxPosition=function(w){var D=w.div?w.div.offsetHeight:w.tagName?w.offsetHeight:0,V=w.div?w.div.offsetWidth:w.tagName?w.offsetWidth:0,ee=w.div?w.div.offsetTop:w.tagName?w.offsetTop:0;return{left:(w=w.div?w.div.getBoundingClientRect():w.tagName?w.getBoundingClientRect():w).left,right:w.right,top:w.top||ee,height:w.height||D,bottom:w.bottom||ee+(w.height||D),width:w.width||V}},ke.StringDecoder=function(){return{decode:function(w){if(!w)return"";if("string"!=typeof w)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(w))}}},ke.convertCueToDOMTree=function(w,D){return w&&D?Fe(w,D):null},ke.processCues=function(w,D,V){if(!w||!D||!V)return null;for(;V.firstChild;)V.removeChild(V.firstChild);var ee=w.document.createElement("div");if(ee.style.position="absolute",ee.style.left="0",ee.style.right="0",ee.style.top="0",ee.style.bottom="0",ee.style.margin="1.5%",V.appendChild(ee),function Q(J){for(var ie=0;ie{var Ie="auto",H={"":1,lr:1,rl:1},X={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function B(ve){return"string"==typeof ve&&!!X[ve.toLowerCase()]&&ve.toLowerCase()}function we(ve,$,Ce){this.hasBeenReset=!1;var Ee="",Te=!1,pe=ve,u=$,oe=Ce,Fe=null,He="",it=!0,yt="auto",se="start",Le="auto",me="auto",Oe=100,Ge="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return Ee},set:function(ke){Ee=""+ke}},pauseOnExit:{enumerable:!0,get:function(){return Te},set:function(ke){Te=!!ke}},startTime:{enumerable:!0,get:function(){return pe},set:function(ke){if("number"!=typeof ke)throw new TypeError("Start time must be set to a number.");pe=ke,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(ke){if("number"!=typeof ke)throw new TypeError("End time must be set to a number.");u=ke,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return oe},set:function(ke){oe=""+ke,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return Fe},set:function(ke){Fe=ke,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return He},set:function(ke){var Ue=function _e(ve){return"string"==typeof ve&&!!H[ve.toLowerCase()]&&ve.toLowerCase()}(ke);if(!1===Ue)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");He=Ue,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return it},set:function(ke){it=!!ke,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return yt},set:function(ke){if("number"!=typeof ke&&ke!==Ie)throw new SyntaxError("Line: an invalid number or illegal string was specified.");yt=ke,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return se},set:function(ke){var Ue=B(ke);Ue?(se=Ue,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return Le},set:function(ke){if(ke<0||ke>100)throw new Error("Position must be between 0 and 100.");Le=ke,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return me},set:function(ke){var Ue=B(ke);Ue?(me=Ue,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return Oe},set:function(ke){if(ke<0||ke>100)throw new Error("Size must be between 0 and 100.");Oe=ke,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return Ge},set:function(ke){var Ue=B(ke);if(!Ue)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");Ge=Ue,this.hasBeenReset=!0}}}),this.displayState=void 0}we.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},je.exports=we},3872:je=>{var Ie={"":!0,up:!0};function X(B){return"number"==typeof B&&B>=0&&B<=100}je.exports=function _e(){var B=100,we=3,ve=0,$=100,Ce=0,Ee=100,Te="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return B},set:function(pe){if(!X(pe))throw new Error("Width must be between 0 and 100.");B=pe}},lines:{enumerable:!0,get:function(){return we},set:function(pe){if("number"!=typeof pe)throw new TypeError("Lines must be set to a number.");we=pe}},regionAnchorY:{enumerable:!0,get:function(){return $},set:function(pe){if(!X(pe))throw new Error("RegionAnchorX must be between 0 and 100.");$=pe}},regionAnchorX:{enumerable:!0,get:function(){return ve},set:function(pe){if(!X(pe))throw new Error("RegionAnchorY must be between 0 and 100.");ve=pe}},viewportAnchorY:{enumerable:!0,get:function(){return Ee},set:function(pe){if(!X(pe))throw new Error("ViewportAnchorY must be between 0 and 100.");Ee=pe}},viewportAnchorX:{enumerable:!0,get:function(){return Ce},set:function(pe){if(!X(pe))throw new Error("ViewportAnchorX must be between 0 and 100.");Ce=pe}},scroll:{enumerable:!0,get:function(){return Te},set:function(pe){var u=function H(B){return"string"==typeof B&&!!Ie[B.toLowerCase()]&&B.toLowerCase()}(pe);!1===u?console.warn("Scroll: an invalid or illegal string was specified."):Te=u}}})}},5893:()=>{},434:je=>{function Ie(){return je.exports=Ie=Object.assign?Object.assign.bind():function(H){for(var X=1;X{c.r(y),c.d(y,{CreateModule:()=>Ca});var m=c(6895),h=c(1390),o=c(4006),C=c(7375),k=c(5128),T=c(4700),u=c(3659),p=c(1741),U=c(5816),N=c(7357),t=c(4650),f=c(9816);let Z=(()=>{class a{constructor(e,i){this.gs=e,this.router=i}canDeactivate(e){return!!this.router.getCurrentNavigation()?.extras?.state?.bypassCanDeactivate||!e.canDeactivate||e.canDeactivate()}static#t=this.\u0275fac=function(i){return new(i||a)(t.LFG(f.U),t.LFG(h.F0))};static#e=this.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var _=c(2314),I=c(3811),v=c(6319),E=c(5861),nt=c(6805),ot=c(930);function J(a,s){const e="object"==typeof s;return new Promise((i,n)=>{const r=new ot.Hp({next:l=>{i(l),r.unsubscribe()},error:n,complete:()=>{e?i(s.defaultValue):n(new nt.K)}});a.subscribe(r)})}var w=c(8372),q=c(9094),L=c(8505),O=c(3900),G=c(8746),B=c(5625),D=c(3322),rt=c(6841),st=c(642),lt=c(3719),W=c(3842),ct=c(1428),j=c(7245),X=c(2693),Y=c(80),mt=c(6493),F=c(2970),tt=c(2447),et=c(4363),A=c(9818),ut=c(4850),Q=c(7392),g=c(8455),R=c(9203),dt=c(1256),at=c(6289),it=c(7732),K=c(7462),M=c(4758),V=c(7443);function _t(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function gt(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.imageErrorText)}}function pt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",2),t._UZ(1,"img",46),t.TgZ(2,"mat-form-field",47)(3,"mat-label"),t._uU(4,"Gambar Untuk Embed SEO"),t.qZA(),t.TgZ(5,"ngx-mat-file-input",48,49),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(6),l=t.oxw(2);return t.KtG(l.uploadImage(n,r))}),t.qZA(),t._UZ(7,"mat-icon",50),t.qZA(),t.TgZ(8,"mat-error",51)(9,"small"),t.YNc(10,_t,3,3,"div",20),t.YNc(11,gt,2,1,"div",20),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("src",e.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",e.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imageErrorText)}}function ft(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",52)(1,"button",27),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",53),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function ht(a,s){1&a&&(t.TgZ(0,"div",15)(1,"mat-slide-toggle",54)(2,"i"),t._uU(3,"Private"),t.qZA(),t._uU(4," Akses Hanya Dengan URL "),t.qZA()())}function bt(a,s){if(1&a&&(t.TgZ(0,"mat-option",55),t._uU(1),t.qZA()),2&a){const e=s.$implicit;t.Q6J("value",e.id),t.xp6(1),t.Oqu(e.name)}}function vt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Jenis Tidak Boleh Kosong"),t.qZA())}function xt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Jenis Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ct(a,s){1&a&&t.GkF(0)}function Tt(a,s){1&a&&(t.TgZ(0,"mat-option",62),t._UZ(1,"mat-progress-bar",63),t.qZA())}function Zt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-option",65),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(4);return t.KtG(l.filterAnimeSelected(r))}),t._UZ(1,"img",66),t.TgZ(2,"span",67),t._uU(3),t.qZA()()}if(2&a){const e=s.$implicit;t.Q6J("value",e.id),t.xp6(1),t.s9C("src",e.image_url,t.LSH),t.xp6(2),t.lnq("",e.id," :: ",null==e.media_type?null:e.media_type.toUpperCase()," :: ",e.title,"")}}function At(a,s){if(1&a&&(t.ynx(0),t.YNc(1,Zt,4,5,"mat-option",64),t.BQk()),2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("ngForOf",e.filteredAnime)}}function kt(a,s){if(1&a&&(t.TgZ(0,"small",68),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.fg.get("anime_name").value)}}function It(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Anime Tidak Boleh Kosong"),t.qZA())}function Ut(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Anime Hanya Boleh Angka"),t.qZA())}function Et(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-form-field",56)(1,"mat-label"),t._uU(2,"Anime Terkait"),t.qZA(),t.TgZ(3,"input",57),t.NdJ("keyup",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.resetSelectedAnime())}),t.qZA(),t._UZ(4,"mat-icon",58),t.TgZ(5,"mat-autocomplete",null,59),t.YNc(7,Tt,2,0,"mat-option",60),t.YNc(8,At,2,1,"ng-container",20),t.qZA(),t.YNc(9,kt,2,1,"small",61),t.TgZ(10,"mat-error"),t.YNc(11,It,2,0,"div",20),t.YNc(12,Ut,2,0,"div",20),t.qZA()()}if(2&a){const e=t.MAs(6),i=t.oxw(2);t.Q6J("color","accent"),t.xp6(3),t.Q6J("matAutocomplete",e),t.xp6(4),t.Q6J("ngIf",i.isLoading),t.xp6(1),t.Q6J("ngIf",!i.isLoading),t.xp6(1),t.Q6J("ngIf",i.fg.get("anime_name").value),t.xp6(2),t.Q6J("ngIf",i.fg.get("anime_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("anime_id").hasError("pattern"))}}function St(a,s){1&a&&t.GkF(0)}function yt(a,s){1&a&&(t.TgZ(0,"mat-option",62),t._UZ(1,"mat-progress-bar",63),t.qZA())}function Nt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-option",65),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(5);return t.KtG(l.filterDoramaSelected(r))}),t._UZ(1,"img",66),t.TgZ(2,"span",67),t._uU(3),t.qZA()()}if(2&a){const e=s.$implicit;t.Q6J("value",e.mdl_id),t.xp6(1),t.s9C("src",e.image_url,t.LSH),t.xp6(2),t.AsE("",e.mdl_id," :: ",e.title,"")}}function Jt(a,s){if(1&a&&(t.ynx(0),t.YNc(1,Nt,4,4,"mat-option",64),t.BQk()),2&a){const e=t.oxw(4);t.xp6(1),t.Q6J("ngForOf",e.filteredDorama)}}function wt(a,s){if(1&a&&(t.TgZ(0,"small",68),t._uU(1),t.qZA()),2&a){const e=t.oxw(4);t.xp6(1),t.Oqu(e.fg.get("dorama_name").value)}}function qt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Dorama Tidak Boleh Kosong"),t.qZA())}function Bt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Dorama Hanya Boleh Angka"),t.qZA())}function Dt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-form-field",56)(1,"mat-label"),t._uU(2,"Dorama Terkait"),t.qZA(),t.TgZ(3,"input",71),t.NdJ("keyup",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.resetSelectedDorama())}),t.qZA(),t._UZ(4,"mat-icon",58),t.TgZ(5,"mat-autocomplete",null,72),t.YNc(7,yt,2,0,"mat-option",60),t.YNc(8,Jt,2,1,"ng-container",20),t.qZA(),t.YNc(9,wt,2,1,"small",61),t.TgZ(10,"mat-error"),t.YNc(11,qt,2,0,"div",20),t.YNc(12,Bt,2,0,"div",20),t.qZA()()}if(2&a){const e=t.MAs(6),i=t.oxw(3);t.Q6J("color","accent"),t.xp6(3),t.Q6J("matAutocomplete",e),t.xp6(4),t.Q6J("ngIf",i.isLoading),t.xp6(1),t.Q6J("ngIf",!i.isLoading),t.xp6(1),t.Q6J("ngIf",i.fg.get("dorama_name").value),t.xp6(2),t.Q6J("ngIf",i.fg.get("dorama_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("dorama_id").hasError("pattern"))}}function Ft(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Kode Serial Tidak Boleh Kosong"),t.qZA())}function Qt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Kode Serial Hanya Boleh Huruf Besar, Strip, Dan Angka"),t.qZA())}function Rt(a,s){if(1&a&&(t.TgZ(0,"mat-form-field",17)(1,"mat-label"),t._uU(2,"Kode / Serial Number"),t.qZA(),t._UZ(3,"input",75)(4,"mat-icon",76),t.TgZ(5,"mat-error"),t.YNc(6,Ft,2,0,"div",20),t.YNc(7,Qt,2,0,"div",20),t.qZA()()),2&a){const e=t.oxw(4);t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("sn_code").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("sn_code").hasError("pattern"))}}function Mt(a,s){1&a&&(t.TgZ(0,"div",77)(1,"small",78),t._uU(2," * Jika tidak ada kode serial isi saja - strip "),t.qZA()())}function Lt(a,s){if(1&a&&(t.YNc(0,Rt,8,3,"mat-form-field",73),t.YNc(1,Mt,3,0,"div",74)),2&a){const e=t.oxw(3);t.Q6J("ngIf",e.berkasType),t.xp6(1),t.Q6J("ngIf",e.berkasType)}}function Ot(a,s){if(1&a&&(t.YNc(0,St,1,0,"ng-container",21),t.YNc(1,Dt,13,7,"ng-template",null,69,t.W1O),t.YNc(3,Lt,2,2,"ng-template",null,70,t.W1O)),2&a){const e=t.MAs(2),i=t.MAs(4),n=t.oxw(2);t.Q6J("ngIf",n.berkasType.toLowerCase().includes("dorama_"))("ngIfThen",e)("ngIfElse",i)}}function Yt(a,s){1&a&&t._UZ(0,"mat-icon",58)}function Kt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",84),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().index,r=t.oxw(2);return t.KtG(r.removeFansub(n))}),t._UZ(1,"mat-icon",85),t.qZA()}}function Ht(a,s){1&a&&(t.TgZ(0,"mat-option",62),t._UZ(1,"mat-progress-bar",63),t.qZA())}function Gt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-option",65),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(2).index,d=t.oxw(2);return t.KtG(d.filterFansubSelected(r,l))}),t._UZ(1,"img",86),t.TgZ(2,"span",67),t._uU(3),t.qZA()()}if(2&a){const e=s.$implicit;t.Q6J("value",e.id),t.xp6(1),t.s9C("src",e.image_url,t.LSH),t.xp6(2),t.AsE("",e.slug," :: ",e.name,"")}}function jt(a,s){if(1&a&&(t.ynx(0),t.YNc(1,Gt,4,4,"mat-option",64),t.BQk()),2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("ngForOf",e.filteredFansub)}}function Vt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Fansub Tidak Boleh Kosong"),t.qZA())}function Pt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Fansub Hanya Boleh Angka"),t.qZA())}function $t(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",79)(2,"mat-form-field",56)(3,"mat-label"),t._uU(4,"Fansub Terkait"),t.qZA(),t.TgZ(5,"input",80),t.NdJ("keyup",function(){const r=t.CHM(e).index,l=t.oxw(2);return t.KtG(l.resetSelectedFansub(r))}),t.qZA(),t.YNc(6,Yt,1,0,"mat-icon",81),t.YNc(7,Kt,2,0,"button",82),t.TgZ(8,"mat-autocomplete",null,83),t.YNc(10,Ht,2,0,"mat-option",60),t.YNc(11,jt,2,1,"ng-container",20),t.qZA(),t.TgZ(12,"small",68),t._uU(13),t.qZA(),t.TgZ(14,"mat-error"),t.YNc(15,Vt,2,0,"div",20),t.YNc(16,Pt,2,0,"div",20),t.qZA()()()()}if(2&a){const e=s.$implicit,i=s.index,n=t.MAs(9),r=t.oxw(2);t.xp6(1),t.Q6J("formGroupName",i),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("matAutocomplete",n),t.xp6(1),t.Q6J("ngIf",e.get("fansub_id").value||0===i),t.xp6(1),t.Q6J("ngIf",!e.get("fansub_id").value&&i>0),t.xp6(3),t.Q6J("ngIf",r.isLoading),t.xp6(1),t.Q6J("ngIf",!r.isLoading),t.xp6(2),t.Oqu(e.get("fansub_name").value),t.xp6(2),t.Q6J("ngIf",e.get("fansub_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.get("fansub_id").hasError("pattern"))}}function zt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Berkas Tidak Boleh Kosong"),t.qZA())}function Wt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Berkas Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Xt(a,s){if(1&a&&t._UZ(0,"angular-editor",87),2&a){const e=t.oxw(2);t.Q6J("config",e.GS.angularEditorConfig)}}function te(a,s){1&a&&t.GkF(0)}function ee(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.attachmentLimitExceeded)," !")}}function ae(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.attachmentErrorText)}}function ie(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",38)(1,"div",95)(2,"div",96),t._uU(3),t.ALo(4,"bytes"),t._UZ(5,"br")(6,"mat-progress-bar",97),t.qZA()(),t.TgZ(7,"div",98)(8,"button",27),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(3);return t.KtG(l.submitAttachment(r))}),t._UZ(9,"mat-icon",99),t._uU(10," Unggah "),t.qZA()()()}if(2&a){const e=s.$implicit,i=t.oxw(3);t.xp6(3),t.HOy(" ",e.status," :: ",e.progress,"% @ ",t.lcZ(4,7,e.speed),"/s # ",e.remaining," detik "),t.xp6(3),t.Q6J("mode","determinate")("value",e.progress),t.xp6(2),t.Q6J("disabled",i.submitted||"complete"===e.status||"uploading"===e.status)}}function ne(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",77)(2,"small",78),t._uU(3," * "),t.TgZ(4,"i"),t._uU(5,"Resume-able Upload"),t.qZA(),t._uU(6," :: "),t.TgZ(7,"i"),t._uU(8,"expired"),t.qZA(),t._uU(9),t.TgZ(10,"i"),t._uU(11,"upload"),t.qZA(),t._uU(12),t.qZA()(),t.TgZ(13,"mat-form-field",88)(14,"mat-label"),t._uU(15,"Upload Lampiran Berkas -- DDL"),t.qZA(),t.TgZ(16,"ngx-mat-file-input",89,90),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(17),l=t.oxw(2);return t.KtG(l.uploadAttachment(n,r))}),t.qZA(),t._UZ(18,"mat-icon",91),t.qZA(),t.TgZ(19,"mat-error",92)(20,"small"),t.YNc(21,ee,3,3,"div",20),t.YNc(22,ae,2,1,"div",20),t.qZA()()(),t.YNc(23,ie,11,9,"div",93),t.ALo(24,"async"),t.TgZ(25,"div",10)(26,"mat-slide-toggle",94),t._uU(27," Otomatis Simpan & Kirim Setelah Selesai Upload DDL "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(9),t.hij(" 3 hari (Tidak wajib, jika sudah ada URL eksternal, misal alamat webmu gdrive mediafire mega dan lain sebagainya). Mohon ditunggu, jika ingin di tinggal dapat menyelesaikan semua isian yang diperlukan dan menyalakan 'Otomatis Simpan & Kirim' dibawah ini, berkas lampiran akan dibatalkan dan dihapus apabila tidak disimpan dalam ",e.CONSTANTS.timeoutDeleteTempAttachmentTime/60/1e3," menit setelah berhasil "),t.xp6(3),t.hij(". Lalu kemudian saat berkas berhasil dibuat, lampiran tidak akan bisa di modifikasi. Tipe file yang diperbolehkan :: ",e.extAttachment," "),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",null!==e.attachmentSelected)("accept",e.fileTypeAttachmentAllowed),t.xp6(5),t.Q6J("ngIf",e.attachmentLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.attachmentErrorText),t.xp6(1),t.Q6J("ngForOf",t.lcZ(24,9,e.uploads$)),t.xp6(3),t.Q6J("disabled",e.fg.invalid||"uploading"!==(null==e.attachmentSelected?null:e.attachmentSelected.status))}}function oe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",100),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.verify())}),t._UZ(1,"mat-icon",101),t._uU(2," Verifikasi Akun Untuk Upload DDL! "),t.qZA()}}function re(a,s){1&a&&(t.TgZ(0,"div",77)(1,"small",78),t._uU(2,"* Gunakan tombol (X) untuk menghapus URL Eksternal jika ingin hanya menggunakan lampiran "),t.TgZ(3,"i"),t._uU(4,"upload"),t.qZA(),t._uU(5," DDL saja"),t.qZA()())}function se(a,s){1&a&&t._UZ(0,"mat-icon",109)}function le(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",84),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().index,r=t.oxw(2);return t.KtG(r.removeDownloadLink(n))}),t._UZ(1,"mat-icon",85),t.qZA()}}function ce(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Web Tidak Boleh Kosong"),t.qZA())}function me(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Web Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ue(a,s){1&a&&t._UZ(0,"mat-icon",110)}function de(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",84),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().index,r=t.oxw(2);return t.KtG(r.removeDownloadLink(n))}),t._UZ(1,"mat-icon",85),t.qZA()}}function _e(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tautan Tidak Boleh Kosong"),t.qZA())}function ge(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tautan Link Tidak Valid"),t.qZA())}function pe(a,s){if(1&a&&(t.ynx(0),t.TgZ(1,"div",102),t.YNc(2,re,6,0,"div",74),t.TgZ(3,"mat-form-field",103)(4,"mat-label"),t._uU(5,"Nama Website"),t.qZA(),t._UZ(6,"input",104),t.YNc(7,se,1,0,"mat-icon",105),t.YNc(8,le,2,0,"button",82),t.TgZ(9,"mat-error"),t.YNc(10,ce,2,0,"div",20),t.YNc(11,me,2,0,"div",20),t.qZA()(),t.TgZ(12,"mat-form-field",106)(13,"mat-label"),t._uU(14,"Tautan Link"),t.qZA(),t._UZ(15,"input",107),t.YNc(16,ue,1,0,"mat-icon",108),t.YNc(17,de,2,0,"button",82),t.TgZ(18,"mat-error"),t.YNc(19,_e,2,0,"div",20),t.YNc(20,ge,2,0,"div",20),t.qZA()()(),t.BQk()),2&a){const e=s.$implicit,i=s.index,n=t.oxw(2);t.xp6(1),t.Q6J("formGroupName",i),t.xp6(1),t.Q6J("ngIf",(null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.verified)&&0===i),t.xp6(1),t.Q6J("color","accent"),t.xp6(4),t.Q6J("ngIf",e.get("name").value||0===i&&!(null!=n.AS.currentUserSubject&&null!=n.AS.currentUserSubject.value&&n.AS.currentUserSubject.value.verified)),t.xp6(1),t.Q6J("ngIf",!e.get("name").value&&(i>0||(null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.verified))),t.xp6(2),t.Q6J("ngIf",e.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(4),t.Q6J("ngIf",e.get("url").value||0===i&&!(null!=n.AS.currentUserSubject&&null!=n.AS.currentUserSubject.value&&n.AS.currentUserSubject.value.verified)),t.xp6(1),t.Q6J("ngIf",!e.get("url").value&&(i>0||(null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.verified))),t.xp6(2),t.Q6J("ngIf",e.get("url").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.get("url").hasError("pattern"))}}function fe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"span",8),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.toggleDetailMode())}),t._uU(5),t.qZA(),t.TgZ(6,"b",9),t._uU(7,"Tambah Berkas Baru"),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",10)(10,"div",11)(11,"div",10),t.YNc(12,pt,12,6,"div",12),t.YNc(13,ft,4,1,"div",13),t.YNc(14,ht,5,0,"div",14),t.TgZ(15,"div",15)(16,"mat-slide-toggle",16),t._uU(17," R-18+ Konten Eksplisit "),t.qZA()(),t.TgZ(18,"mat-form-field",17)(19,"mat-label"),t._uU(20,"Jenis Proyek"),t.qZA(),t.TgZ(21,"mat-select",18),t.YNc(22,bt,2,2,"mat-option",19),t.qZA(),t.TgZ(23,"mat-error"),t.YNc(24,vt,2,0,"div",20),t.YNc(25,xt,2,0,"div",20),t.qZA()(),t.YNc(26,Ct,1,0,"ng-container",21),t.YNc(27,Et,13,7,"ng-template",null,22,t.W1O),t.YNc(29,Ot,5,3,"ng-template",null,23,t.W1O),t.TgZ(31,"div",15),t._UZ(32,"mat-divider"),t.qZA(),t.TgZ(33,"div",24),t.YNc(34,$t,17,10,"div",25),t.qZA(),t.TgZ(35,"div",2)(36,"div",10),t._UZ(37,"div",26),t.TgZ(38,"div",26)(39,"button",27),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.addFansub())}),t._UZ(40,"mat-icon",28),t._uU(41," Tambah Fansub "),t.qZA()()()(),t.TgZ(42,"div",15)(43,"a",29),t._uU(44," * Jika pencarian tidak ditemukan, silahkan membuat halaman Fansub baru terlebih dahulu "),t.qZA()()()(),t.TgZ(45,"div",30)(46,"div",10)(47,"mat-form-field",31)(48,"mat-label"),t._uU(49,"Nama Berkas"),t.qZA(),t._UZ(50,"input",32)(51,"mat-icon",33),t.TgZ(52,"mat-error"),t.YNc(53,zt,2,0,"div",20),t.YNc(54,Wt,2,0,"div",20),t.qZA()(),t.YNc(55,Xt,1,1,"angular-editor",34),t.qZA(),t.TgZ(56,"div",10)(57,"div",15),t._UZ(58,"mat-divider"),t.qZA()(),t.YNc(59,te,1,0,"ng-container",21),t.YNc(60,ne,28,11,"ng-template",null,35,t.W1O),t.YNc(62,oe,3,0,"ng-template",null,36,t.W1O),t.TgZ(64,"div",10)(65,"div",15),t._UZ(66,"mat-divider"),t.qZA()(),t.ynx(67,37),t.YNc(68,pe,21,12,"ng-container",25),t.BQk(),t.TgZ(69,"div",38),t._UZ(70,"div",26)(71,"div",26)(72,"div",26),t.TgZ(73,"div",26)(74,"button",27),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.addDownloadLink())}),t._UZ(75,"mat-icon",28),t._uU(76," Tambah URL Eksternal "),t.qZA()()()()(),t.TgZ(77,"div",10)(78,"div",15)(79,"div",39),t._UZ(80,"div",40),t.TgZ(81,"div",41)(82,"a",42),t._UZ(83,"mat-icon",43),t._uU(84," Batal "),t.qZA()(),t.TgZ(85,"div",41)(86,"button",44),t._uU(87," Simpan "),t._UZ(88,"mat-icon",45),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(28),i=t.MAs(30),n=t.MAs(61),r=t.MAs(63),l=t.oxw();t.Q6J("formGroup",l.fg),t.xp6(5),t.hij(" ",l.detailMode?"Sederhana":"Lengkap"," "),t.xp6(7),t.Q6J("ngIf",l.detailMode),t.xp6(1),t.Q6J("ngIf",l.image&&!l.fg.value.image&&l.detailMode),t.xp6(1),t.Q6J("ngIf",null==l.AS.currentUserSubject||null==l.AS.currentUserSubject.value?null:l.AS.currentUserSubject.value.verified),t.xp6(4),t.Q6J("color","accent"),t.xp6(4),t.Q6J("ngForOf",l.projectList),t.xp6(2),t.Q6J("ngIf",l.fg.get("projectType_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",l.fg.get("projectType_id").hasError("pattern")),t.xp6(1),t.Q6J("ngIf",l.berkasType.toLowerCase().includes("anime_"))("ngIfThen",e)("ngIfElse",i),t.xp6(8),t.Q6J("ngForOf",l.getFansubControl.controls),t.xp6(5),t.Q6J("disabled",l.submitted),t.xp6(8),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",l.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",l.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("ngIf",l.detailMode),t.xp6(4),t.Q6J("ngIf",null==l.AS.currentUserSubject||null==l.AS.currentUserSubject.value?null:l.AS.currentUserSubject.value.verified)("ngIfThen",n)("ngIfElse",r),t.xp6(9),t.Q6J("ngForOf",l.getDownloadUrlControl.controls),t.xp6(6),t.Q6J("disabled",l.submitted),t.xp6(8),t.Q6J("disabled",l.submitted),t.xp6(4),t.Q6J("disabled",l.submitted||l.fg.invalid||"uploading"===(null==l.attachmentSelected?null:l.attachmentSelected.status))}}let he=(()=>{class a{constructor(e,i,n,r,l,d,b,S,$,Ta,Za,Aa,ka,Ia){this.router=e,this.fb=i,this.bs=n,this.anime=r,this.dorama=l,this.project=d,this.fansub=b,this.berkas=S,this.imgbb=$,this.toast=Ta,this.gs=Za,this.as=Aa,this.uploadService=ka,this.ds=Ia,this.detailMode=!1,this.submitted=!1,this.projectList=[],this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.filteredAnime=[],this.filteredDorama=[],this.filteredFansub=[],this.isLoading=!1,this.animeCheckOrAddResponse=null,this.doramaCheckOrAddResponse=null,this.attachmentSelected=null,this.attachmentErrorText=null,this.attachmentLimitExceeded=null,this.uploadToast=null,this.timerTimeout1=null,this.timerTimeout2=null,this.gambar=null,this.ddl=null,this.subsProject=null,this.subsFansub=null,this.subsAnimeDetail=null,this.subsDoramaDetail=null,this.subsProjectDetail=null,this.subsFansubDetail=[],this.subsAnimeNew=null,this.subsDoramaNew=null,this.subsImgbb=null,this.subsBerkasCreate=null,this.subsUpload=null,this.subsDialog=null,this.berkasType="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get CONSTANTS(){return u.t}get AS(){return this.as}get GS(){return this.gs}get extAttachment(){return u.t.extAttachment.join(", ")}get fileTypeAttachmentAllowed(){return u.t.fileTypeAttachmentAllowed.join(", ")}ngOnInit(){this.gs.isBrowser&&(this.loadProjectList(),this.initForm(),this.uploads$=this.uploadService.connect(),this.subsUpload=this.uploadService.events.subscribe({next:e=>{this.gs.log("[UPLOAD_EVENTS]",e),("uploading"===e.status||"complete"===e.status)&&(this.attachmentSelected=e),"complete"===e.status?(this.gs.log("[UPLOAD_COMPLETED]",e.response),this.fg.controls.attachment_id.patchValue(e.response.result.id),this.uploadToast=this.toast.warning("Segera Kirim Data Berkas!","Lampiran Akan Dihapus ...",{closeButton:!1,timeOut:u.t.timeoutDeleteTempAttachmentTime,disableTimeOut:"extendedTimeOut",tapToDismiss:!1,progressAnimation:"decreasing"},!0),this.timerTimeout1=setTimeout(()=>{this.gs.log("[UPLOAD_TIMEOUT]",u.t.timeoutDeleteTempAttachmentTime),this.failOrCancelUpload({info:"Expired, Silahkan Upload Ulang!"})},u.t.timeoutDeleteTempAttachmentTime),this.fg.value.auto_send&&(this.timerTimeout2=setTimeout(()=>{this.onSubmit()},2500))):"error"===e.status&&(this.gs.log("[UPLOAD_ERROR]",e.response,"error"),this.failOrCancelUpload(e.response))},error:e=>{this.gs.log("[UPLOAD_ERROR]",e,"error"),this.failOrCancelUpload(e)}}))}ngOnDestroy(){this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.timerTimeout1&&(clearTimeout(this.timerTimeout1),this.timerTimeout1=null),this.timerTimeout2&&(clearTimeout(this.timerTimeout2),this.timerTimeout2=null),this.subsProject?.unsubscribe(),this.subsFansub?.unsubscribe(),this.subsAnimeDetail?.unsubscribe(),this.subsDoramaDetail?.unsubscribe(),this.subsProjectDetail?.unsubscribe();for(const e of this.subsFansubDetail)e?.unsubscribe();this.subsAnimeNew?.unsubscribe(),this.subsDoramaNew?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsBerkasCreate?.unsubscribe(),this.uploadService.disconnect(),this.subsUpload?.unsubscribe(),this.subsDialog?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}toggleDetailMode(){this.detailMode=!this.detailMode}loadProjectList(){this.bs.busy(),this.subsProject=this.project.getProject().subscribe({next:e=>{this.gs.log("[PROJECT_LOAD_SUCCESS]",e),this.projectList=e.results,this.bs.idle()},error:e=>{this.gs.log("[PROJECT_LOAD_ERROR]",e,"error"),this.bs.idle()}})}hasRequiredField(e,i){return e.get(i).hasValidator(o.kI.required)}animeValueChanged(){this.subsAnimeDetail=this.fg.get("anime_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.isLoading=!0),(0,O.w)(e=>this.anime.searchAnime(e).pipe((0,G.x)(()=>this.isLoading=!1))),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_ANIME_RESULT_SUCCESS]",e),this.filteredAnime=e.results},error:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_ANIME_RESULT_ERROR]",e,"error"),this.animeValueChanged()}})}doramaValueChanged(){this.subsDoramaDetail=this.fg.get("dorama_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.isLoading=!0),(0,O.w)(e=>this.dorama.searchDorama(e).pipe((0,G.x)(()=>this.isLoading=!1))),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_DORAMA_RESULT_SUCCESS]",e);for(const i of e.results)i.mdl_id=i.mdl_id.split("-")[1],i.image_url=i.thumb;this.filteredDorama=e.results},error:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_DORAMA_RESULT_ERROR]",e,"error"),this.doramaValueChanged()}})}projectTypeValueChanged(){this.subsProjectDetail=this.fg.get("projectType_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_CREATE_PROJECT_CHANGED]",e),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null),this.fg.controls.sn_code.patchValue(null),this.fg.controls.anime_id.setErrors(null),this.fg.controls.anime_name.setErrors(null),this.fg.controls.dorama_id.setErrors(null),this.fg.controls.dorama_name.setErrors(null),this.fg.controls.sn_code.setErrors(null),this.fg.controls.anime_id.clearValidators(),this.fg.controls.anime_name.clearValidators(),this.fg.controls.dorama_id.clearValidators(),this.fg.controls.dorama_name.clearValidators(),this.fg.controls.sn_code.clearValidators(),this.fg.controls.anime_id.markAsPristine(),this.fg.controls.anime_name.markAsPristine(),this.fg.controls.dorama_id.markAsPristine(),this.fg.controls.dorama_name.markAsPristine(),this.fg.controls.sn_code.markAsPristine(),this.fg.controls.anime_id.markAsUntouched(),this.fg.controls.anime_name.markAsUntouched(),this.fg.controls.dorama_id.markAsUntouched(),this.fg.controls.dorama_name.markAsUntouched(),this.fg.controls.sn_code.markAsUntouched();const i=this.projectList.find(n=>n.id===e);i&&(this.berkasType=i.name,i.name.toLowerCase().includes("anime_")?(this.fg.controls.anime_id.setValidators([o.kI.required,o.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([o.kI.required]),this.subsAnimeDetail?.unsubscribe(),this.animeValueChanged()):i.name.toLowerCase().includes("dorama_")?(this.fg.controls.dorama_id.setValidators([o.kI.required,o.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([o.kI.required]),this.subsDoramaDetail?.unsubscribe(),this.doramaValueChanged()):this.fg.controls.sn_code.setValidators([o.kI.required,o.kI.pattern(/^[A-Z0-9\-]+$/)])),this.fg.controls.anime_id.updateValueAndValidity(),this.fg.controls.anime_name.updateValueAndValidity(),this.fg.controls.dorama_id.updateValueAndValidity(),this.fg.controls.dorama_name.updateValueAndValidity(),this.fg.controls.sn_code.updateValueAndValidity()}})}initForm(){this.fg=this.fb.group({name:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],description:[null,o.kI.compose([o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],projectType_id:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],anime_id:[null,o.kI.compose([])],anime_name:[null,o.kI.compose([])],dorama_id:[null,o.kI.compose([])],dorama_name:[null,o.kI.compose([])],fansub_list:this.fb.array([this.createFansub()]),image:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],sn_code:[null,o.kI.compose([])],attachment_id:[null,o.kI.compose([o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],download_url:this.fb.array([this.createDownloadLink()]),private:[!1,o.kI.compose([o.kI.required])],r18:[!1,o.kI.compose([o.kI.required])],auto_send:[!1,o.kI.compose([o.kI.required])]}),this.projectTypeValueChanged()}get getDownloadUrlControl(){return this.fg.get("download_url")}createDownloadLink(){return this.fb.group({name:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],url:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexUrl)])]})}removeDownloadLink(e){this.getDownloadUrlControl.removeAt(e)}addDownloadLink(){this.getDownloadUrlControl.push(this.createDownloadLink())}get getFansubControl(){return this.fg.get("fansub_list")}createFansub(){const e=this.fb.group({fansub_id:[null,o.kI.compose([o.kI.required,o.kI.pattern(/^\d+$/)])],fansub_name:[null,o.kI.compose([o.kI.required])]});return this.subsFansubDetail.push(e.get("fansub_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.isLoading=!0),(0,O.w)(i=>this.fansub.searchFansub(i).pipe((0,G.x)(()=>this.isLoading=!1))),(0,B.X)(-1)).subscribe({next:i=>{this.gs.log("[BERKAS_CREATE_SEARCH_FANSUB_RESULT]",i),this.filteredFansub=i.results}})),e}removeFansub(e){this.getFansubControl.removeAt(e),this.subsFansubDetail[e]?.unsubscribe(),this.subsFansubDetail.splice(e,1)}addFansub(){this.getFansubControl.push(this.createFansub())}resetSelectedAnime(){this.fg.controls.anime_name.patchValue(null)}resetSelectedDorama(){this.fg.controls.dorama_name.patchValue(null)}resetSelectedFansub(e){this.getFansubControl.controls[e].get("fansub_name").patchValue(null)}filterAnimeSelected(e){this.gs.log("[ANIME_FILTER_CLICK]",e),this.submitted=!0,this.subsAnimeNew=this.anime.addNewAnime({id:e.id,name:e.title,image_url:e.image_url,type:e.media_type?.toUpperCase()}).subscribe({next:i=>{this.gs.log("[ANIME_CHECK_ADD_SUCCESS]",i),this.animeCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.anime_id.patchValue(i.result.id),this.fg.controls.anime_name.patchValue(i.result.name)},error:i=>{this.gs.log("[ANIME_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedAnime(),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null)}})}filterDoramaSelected(e){this.gs.log("[DORAMA_FILTER_CLICK]",e),this.submitted=!0,this.subsDoramaNew=this.dorama.addNewDorama({id:parseInt(e.mdl_id,10),slug:e.slug,name:e.title,image_url:e.image_url,type:e.type}).subscribe({next:i=>{this.gs.log("[DORAMA_CHECK_ADD_SUCCESS]",i),this.doramaCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.dorama_id.patchValue(i.result.id),this.fg.controls.dorama_name.patchValue(i.result.name)},error:i=>{this.gs.log("[DORAMA_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedDorama(),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null)}})}filterFansubSelected(e,i){this.gs.log("[FANSUB_FILTER_CLICK]",e),this.getFansubControl.controls[i].get("fansub_id").patchValue(e.id),this.getFansubControl.controls[i].get("fansub_name").patchValue(e.name)}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[IMAGE_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid||"uploading"===this.attachmentSelected?.status)return this.submitted=!1,void this.bs.idle();if(null===this.fg.value.attachment_id&&0===this.fg.value.download_url.lenth)return this.submitted=!1,this.uploadToast=this.toast.warning("Lampiran DDL / URL Eksternal!","Harap Mengisi Setidaknya Salah Satu ..."),void this.bs.idle();const e=[];for(const i of this.fg.value.fansub_list)e.push(i.fansub_id);this.subsBerkasCreate=this.berkas.createBerkas({image:this.fg.value.image,name:this.fg.value.name,description:this.fg.value.description,private:this.fg.value.private,r18:this.fg.value.r18,projectType_id:this.fg.value.projectType_id,anime_id:this.fg.value.anime_id,dorama_id:this.fg.value.dorama_id,sn_code:this.fg.value.sn_code,fansub_id:e,download_url:this.fg.value.download_url,attachment_id:this.fg.value.attachment_id}).subscribe({next:i=>{this.gs.log("[BERKAS_CREATE_SUCCESS]",i),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/berkas",{state:{bypassCanDeactivate:!0}})},error:i=>{this.gs.log("[BERKAS_CREATE_ERROR]",i,"error"),this.submitted=!1,this.bs.idle()}})}uploadAttachment(e,i){var n=this;return(0,E.Z)(function*(){n.ddl=i;const r=e.target.files[0];n.attachmentLimitExceeded=null,n.attachmentErrorText=null,n.gs.log("[ATTACHMENT_SELECTED]",r),n.fg.controls.attachment_id.patchValue(null),n.uploadService.disconnect();try{r.size<=u.t.fileSizeAttachmentTotalLimit?(n.uploadService.handleFiles(r),n.subsDialog=(yield n.ds.openKonfirmasiDialog("Saran Penamaan Berkas","Apakah Ingin Mengganti Penamaan Berkas Sesuai Dengan Nama Lampiran Yang Di Unggah ?")).afterClosed().subscribe({next:l=>{n.gs.log("[INFO_DIALOG_CLOSED]",l),!0===l&&(n.fg.controls.name.patchValue(r.name),n.fg.controls.name.markAsDirty()),n.subsDialog.unsubscribe()}})):(n.attachmentLimitExceeded=u.t.fileSizeAttachmentTotalLimit,n.ddl.clear(e))}catch{n.ddl.clear(e)}})()}submitAttachment(e){const i=this.uploadService.state().find(n=>n.uploadId===e.uploadId);i&&(this.attachmentSelected=i,e.status="queue")}failOrCancelUpload(e=null){this.attachmentSelected=null,this.attachmentErrorText=e?.result?.message||e?.info||e?.error?.message||"Terjadi Kesalahan, Harap Reload Halaman!",this.uploadService.disconnect(),this.fg.controls.attachment_id.patchValue(null),this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.ddl.clear()}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]},state:{bypassCanDeactivate:!0}})}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(h.F0),t.Y36(o.QS),t.Y36(D.z),t.Y36(rt.o),t.Y36(st.X),t.Y36(lt.Y),t.Y36(W.T),t.Y36(ct.A),t.Y36(j.X),t.Y36(X.k),t.Y36(f.U),t.Y36(Y.e),t.Y36(mt.Lz),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-berkas-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"float-end","text-decoration-none","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],["class","col-12",4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],["class","col-12 py-3",4,"ngIf"],[1,"col-12","py-3"],["formControlName","r18","matTooltip","Konten Eksplisit"],["appearance","outline",1,"px-3","pt-3","col-12",3,"color"],["formControlName","projectType_id","placeholder","Anime / Drama","required",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[4,"ngIf","ngIfThen","ngIfElse"],["anime_",""],["notAnime_",""],["formArrayName","fansub_list","matTooltip","Silahkan Buat Terlebih Dahulu Jika Tidak Ada"],[4,"ngFor","ngForOf"],[1,"col","px-3"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add",1,"me-1"],["routerLink","/create/fansub",1,"text-warning","text-decoration-none"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","[Fansub] Judul Anime - 00 [BD 4K x265 FLAC][CRC32].mkv","required",""],["fontIcon","wysiwyg","matSuffix",""],["class","py-3 w-100","formControlName","description",3,"config",4,"ngIf"],["ddlVerified",""],["ddlNotVerified",""],["formArrayName","download_url"],[1,"row","mb-4"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/berkas",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[1,"col-12","mb-4"],["fontIcon","add_photo_alternate",1,"me-1"],["formControlName","private","matTooltip","Hanya Dapat Di Akses Melalui URL"],[3,"value"],["appearance","outline",1,"px-3","pt-3","w-100",3,"color"],["matInput","","formControlName","anime_id","placeholder","Full Metal Alchemist",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix",""],["autoCompleteAnime","matAutocomplete"],["class","is-loading",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"is-loading"],["mode","indeterminate"],["class","px-1",3,"value","click",4,"ngFor","ngForOf"],[1,"px-1",3,"value","click"],[1,"me-1",2,"height","40px","width","30px","object-fit","cover",3,"src"],[1,"ms-1"],[1,"text-warning"],["dorama_",""],["notDorama_",""],["matInput","","formControlName","dorama_id","placeholder","Flying Colors",3,"matAutocomplete","keyup"],["autoCompleteDorama","matAutocomplete"],["appearance","outline","class","px-3 pt-3 col-12",3,"color",4,"ngIf"],["class","col-12 px-3",4,"ngIf"],["matInput","","formControlName","sn_code","placeholder","XXX-999","required",""],["fontIcon","tag","matSuffix",""],[1,"col-12","px-3"],[1,"text-success"],[1,"row",3,"formGroupName"],["matInput","","formControlName","fansub_id","placeholder","NamaFansub","required","",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix","",4,"ngIf"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click",4,"ngIf"],["autoCompleteFansub","matAutocomplete"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click"],["fontIcon","close"],[1,"me-1",2,"height","40px","width","40px","object-fit","cover",3,"src"],["formControlName","description",1,"py-3","w-100",3,"config"],["appearance","outline",1,"px-3","pt-3","col",3,"color"],["uploadx","",1,"w-100",3,"disabled","accept","change"],["ddl",""],["fontIcon","attach_file","matSuffix",""],[1,"px-4","w-100"],["class","row mb-4",4,"ngFor","ngForOf"],["formControlName","auto_send","matTooltip","Pastikan Semua Isian Yang Dibutuhkan Sudah Terisi",1,"px-3",3,"disabled"],[1,"col"],[1,"ps-3"],[3,"mode","value"],[1,"col-6","col-lg-4","px-3"],["fontIcon","attachment",1,"me-1"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"],["fontIcon","enhanced_encryption",1,"me-1"],["matTooltip","Silahkan Isi Alamat Website Kamu Jika Ingin Mendapatkan Traffic Pengunjung",1,"row",3,"formGroupName"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","name","placeholder","Google Drive","required",""],["fontIcon","web","matSuffix","",4,"ngIf"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","url","placeholder","https://webshit.saya.com/01/02/halaman-post-download.html","required",""],["fontIcon","link","matSuffix","",4,"ngIf"],["fontIcon","web","matSuffix",""],["fontIcon","link","matSuffix",""]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,fe,89,25,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.sg,m.O5,h.rH,tt.VN,tt.QJ,et.CK,A.eB,A.Nr,ut.d,Q.Hw,g.nI,g.v_,g.$V,g.nX,R.k0,dt.eI,at.x8,it.iZ,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,o.x0,o.CE,k.Yh,M.t,C.s6,m.Ov,V.$]})}return a})();var x=c(9923),P=c(9602);function be(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function ve(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.imageErrorText)}}function xe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",6)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Ce(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Tidak Boleh Kosong"),t.qZA())}function Te(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Link Tidak Valid"),t.qZA())}function Ze(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Facebook Link Tidak Valid"),t.qZA())}function Ae(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Discord Link Tidak Valid"),t.qZA())}function ke(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Twitter Link Tidak Valid"),t.qZA())}function Ie(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.coverLimitExceeded)," !")}}function Ue(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.coverErrorText)}}function Ee(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",66)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.submitCover())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Se(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Tidak Boleh Kosong"),t.qZA())}function ye(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ne(a,s){if(1&a&&(t.TgZ(0,"small",67)(1,"div"),t._uU(2),t.qZA()()),2&a){const e=t.oxw(3);t.xp6(2),t.Oqu(e.slugInfo)}}function Je(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Tidak Boleh Kosong"),t.qZA())}function we(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Hanya Boleh Huruf Dan \u4e00"),t.qZA())}function qe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Harus Diisi Secara Valid"),t.qZA())}function Be(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function De(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function Fe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Qe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",68),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(3);return t.KtG(l.removeTag(r))}),t._uU(1),t._UZ(2,"mat-icon",69),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Re(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"RSS Link Tidak Valid"),t.qZA())}function Me(a,s){if(1&a&&(t.TgZ(0,"mat-form-field",23)(1,"mat-label"),t._uU(2,"URI / URL RSS v2.0 Feed"),t.qZA(),t._UZ(3,"input",70)(4,"mat-icon",71),t.TgZ(5,"mat-error"),t.YNc(6,Re,2,0,"div",21),t.qZA()()),2&a){const e=t.oxw(3);t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("rss_feed").hasError("pattern"))}}function Le(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",8),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.onSubmit())}),t.TgZ(1,"div",9)(2,"div",10)(3,"h2",11)(4,"b",12),t._uU(5,"Tambah Data Fansub Baru"),t.qZA()()(),t.TgZ(6,"div",6)(7,"div",13)(8,"div",14)(9,"div",13)(10,"div",6),t._UZ(11,"img",15),t.TgZ(12,"mat-form-field",16)(13,"mat-label"),t._uU(14,"Foto"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",17,18),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(16),l=t.oxw(2);return t.KtG(l.uploadImage(n,r))}),t.qZA(),t._UZ(17,"mat-icon",19),t.qZA(),t.TgZ(18,"mat-error",20)(19,"small"),t.YNc(20,be,3,3,"div",21),t.YNc(21,ve,2,1,"div",21),t.qZA()()(),t.YNc(22,xe,4,1,"div",22),t.qZA(),t.TgZ(23,"div",13)(24,"div",6)(25,"div",13)(26,"mat-form-field",23)(27,"mat-label"),t._uU(28,"Tautan Website"),t.qZA(),t._UZ(29,"input",24)(30,"mat-icon",25),t.TgZ(31,"mat-error"),t.YNc(32,Ce,2,0,"div",21),t.YNc(33,Te,2,0,"div",21),t.qZA()(),t.TgZ(34,"mat-form-field",23)(35,"mat-label"),t._uU(36,"Facebook Fanpage"),t.qZA(),t._UZ(37,"input",26)(38,"mat-icon",27),t.TgZ(39,"mat-error"),t.YNc(40,Ze,2,0,"div",21),t.qZA()(),t.TgZ(41,"mat-form-field",23)(42,"mat-label"),t._uU(43,"Tautan Discord"),t.qZA(),t._UZ(44,"input",28),t.TgZ(45,"mat-icon",29),t._UZ(46,"img",30),t.qZA(),t.TgZ(47,"mat-error"),t.YNc(48,Ae,2,0,"div",21),t.qZA()(),t.TgZ(49,"mat-form-field",23)(50,"mat-label"),t._uU(51,"Cuitan Twitter"),t.qZA(),t._UZ(52,"input",31),t.TgZ(53,"mat-icon",29),t._UZ(54,"img",30),t.qZA(),t.TgZ(55,"mat-error"),t.YNc(56,ke,2,0,"div",21),t.qZA()()()()()(),t.TgZ(57,"div",32)(58,"div",13)(59,"mat-form-field",16)(60,"mat-label"),t._uU(61,"Cover"),t.qZA(),t.TgZ(62,"ngx-mat-file-input",17,33),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(63),l=t.oxw(2);return t.KtG(l.uploadCover(n,r))}),t.qZA(),t._UZ(64,"mat-icon",19),t.qZA(),t.TgZ(65,"mat-error",20)(66,"small"),t.YNc(67,Ie,3,3,"div",21),t.YNc(68,Ue,2,1,"div",21),t.qZA()(),t.YNc(69,Ee,4,1,"div",34),t.TgZ(70,"mat-form-field",35)(71,"mat-label"),t._uU(72,"Nama Fansub"),t.qZA(),t._UZ(73,"input",36)(74,"mat-icon",37),t.TgZ(75,"mat-error"),t.YNc(76,Se,2,0,"div",21),t.YNc(77,ye,2,0,"div",21),t.qZA()(),t.TgZ(78,"mat-form-field",38)(79,"mat-label"),t._uU(80,"Singkatan"),t.qZA(),t._UZ(81,"input",39)(82,"mat-icon",40),t.YNc(83,Ne,3,1,"small",41),t.TgZ(84,"mat-error"),t.YNc(85,Je,2,0,"div",21),t.YNc(86,we,2,0,"div",21),t.qZA()(),t._UZ(87,"angular-editor",42),t.TgZ(88,"mat-form-field",43)(89,"mat-label"),t._uU(90,"Mulai Ada Sejak"),t.qZA(),t.TgZ(91,"input",44),t.NdJ("focus",function(){t.CHM(e);const n=t.MAs(95);return t.KtG(n.open())}),t.ALo(92,"date"),t.qZA(),t._UZ(93,"mat-datepicker-toggle",45)(94,"mat-datepicker",46,47),t.TgZ(96,"mat-error"),t.YNc(97,qe,2,0,"div",21),t.YNc(98,Be,2,0,"div",21),t.qZA()(),t.TgZ(99,"mat-form-field",43)(100,"mat-label"),t._uU(101,"Status"),t.qZA(),t.TgZ(102,"mat-select",48)(103,"mat-option",49),t._uU(104,"Tidak Aktif"),t.qZA(),t.TgZ(105,"mat-option",50),t._uU(106,"Aktif"),t.qZA()(),t.TgZ(107,"mat-hint",51),t._uU(108,"Status Kehidupan Fansub Saat Ini"),t.qZA(),t.TgZ(109,"mat-error"),t.YNc(110,De,2,0,"div",21),t.YNc(111,Fe,2,0,"div",21),t.qZA()(),t.TgZ(112,"mat-form-field",23)(113,"mat-label"),t._uU(114,"Tags & Kategori"),t.qZA(),t.TgZ(115,"mat-chip-list",null,52),t.YNc(117,Qe,3,2,"mat-chip",53),t.TgZ(118,"input",54),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw(2);return t.KtG(r.addTag(n))}),t.qZA(),t._UZ(119,"mat-icon",55),t.qZA(),t.TgZ(120,"mat-hint",51),t._uU(121,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t.YNc(122,Me,7,2,"mat-form-field",56),t.qZA()()(),t.TgZ(123,"div",13)(124,"div",6)(125,"div",57),t._UZ(126,"div",58),t.TgZ(127,"div",59)(128,"a",60),t._UZ(129,"mat-icon",61),t._uU(130," Batal "),t.qZA()(),t.TgZ(131,"div",59)(132,"button",62),t._uU(133," Simpan "),t._UZ(134,"mat-icon",63),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(95),i=t.MAs(116),n=t.oxw(2);t.Q6J("formGroup",n.fg),t.xp6(11),t.Q6J("src",n.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",n.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",n.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",n.imageErrorText),t.xp6(1),t.Q6J("ngIf",n.image&&!n.fg.value.image),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",n.fg.get("web").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("web").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",n.fg.get("facebook").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/discord/",n.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",n.fg.get("discord").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/twitter/",n.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",n.fg.get("twitter").hasError("pattern")),t.xp6(3),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",n.fg.value.cover)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",n.coverLimitExceeded),t.xp6(1),t.Q6J("ngIf",n.coverErrorText),t.xp6(1),t.Q6J("ngIf",n.cover&&!n.fg.value.cover),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",n.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngIf",n.slugInfo),t.xp6(2),t.Q6J("ngIf",n.fg.get("slug").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("slug").hasError("pattern")),t.xp6(1),t.Q6J("config",n.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.s9C("placeholder",t.xi3(92,50,n.currentDate,"d MMMM y")),t.Q6J("matDatepicker",e),t.xp6(2),t.Q6J("for",e),t.xp6(4),t.Q6J("ngIf",n.fg.get("born").hasError("required")||n.fg.get("born").hasError("matDatepickerParse")),t.xp6(1),t.Q6J("ngIf",n.fg.get("born").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",n.fg.get("active").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("active").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",n.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",n.GS.separatorKeysCodes)("matChipInputFor",i)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",n.rssFeedAllowed),t.xp6(6),t.Q6J("disabled",n.submitted),t.xp6(4),t.Q6J("disabled",n.submitted||n.fg.invalid)}}function Oe(a,s){if(1&a&&(t.TgZ(0,"div",1),t._UZ(1,"div",2)(2,"div",3)(3,"div",4)(4,"app-notifications"),t.TgZ(5,"div",5)(6,"div",6),t.YNc(7,Le,135,53,"form",7),t.qZA()()()),2&a){const e=t.oxw();t.xp6(1),t.Udp("background-image","url("+e.cover_url+")"),t.xp6(6),t.Q6J("ngIf",e.fg)}}let Ye=(()=>{class a{constructor(e,i,n,r,l,d,b,S,$){this.fb=e,this.router=i,this.as=n,this.bs=r,this.imgbb=l,this.fansub=d,this.toast=b,this.gs=S,this.ds=$,this.submitted=!1,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.image_url="/assets/img/form/no-image.png",this.cover=null,this.coverLimitExceeded=null,this.coverErrorText=null,this.cover_url="/assets/img/form/no-image.png",this.urls=[],this.currentDate=new Date,this.gambar=null,this.gambar_=null,this.subsImgbb=null,this.subsFansub=null,this.subsCekFansubSlug=null,this.slugInfo="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get rssFeedAllowed(){return this.as.currentUserSubject?.value?.role===p.yS.ADMIN||this.as.currentUserSubject?.value?.role===p.yS.MODERATOR||this.as.currentUserSubject?.value?.role===p.yS.FANSUBBER}ngOnDestroy(){this.subsImgbb?.unsubscribe(),this.subsFansub?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&this.initForm()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){this.fg=this.fb.group({name:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],description:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],born:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],active:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],slug:[null,o.kI.compose([o.kI.required,o.kI.pattern(/^[0-9a-zA-Z-]*$/)])],tags:[[],o.kI.compose([])],image:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],cover:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],web:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],facebook:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],discord:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],twitter:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],rss_feed:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])]}),this.slugValueChanged()}slugValueChanged(){this.subsCekFansubSlug=this.fg.get("slug").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.slugInfo="Mengecek ..."),(0,O.w)(e=>this.fansub.cekSlug({slug:e})),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_SUCCESS]",e),this.slugInfo=e.result.message},error:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_ERROR]",e,"error"),this.slugValueChanged()}})}addTag(e){const i=e.input,n=e.value;(n||"").trim()&&this.fg.value.tags.push(n.trim()),i&&(i.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeTag(e){const i=this.fg.value.tags.indexOf(e);i>=0&&this.fg.value.tags.splice(i,1)}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[IMAGE_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}uploadCover(e,i){this.gambar_=i,this.cover=null,this.coverLimitExceeded=null,this.coverErrorText=null,this.fg.controls.cover.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[COVER_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.cover=n,this.cover_url=r.result.toString()},d.src=r.result.toString()}else this.cover=null,this.cover_url="/assets/img/form/image-error.png",this.coverLimitExceeded=u.t.fileSizeImageLimit,this.gambar_.clear(e)}}catch{this.cover=null,this.cover_url="/assets/img/form/no-image.png",this.gambar_.clear(e)}}submitCover(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.cover}).subscribe({next:e=>{this.gs.log("[COVER_SUCCESS]",e),this.fg.controls.cover.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[COVER_ERROR]",e,"error"),this.fg.controls.cover.patchValue(null),this.submitted=!1,this.coverErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e={};if(this.fg.value.web&&(e.web=this.fg.value.web),this.fg.value.facebook&&(e.facebook=this.fg.value.facebook),this.fg.value.discord&&(e.discord=this.fg.value.discord),this.fg.value.twitter&&(e.twitter=this.fg.value.twitter),this.submitted=!0,this.fg.value.rss_feed&&(!this.fg.value.web||!this.fg.value.rss_feed.startsWith(this.fg.value.web)))return this.toast.warning("RSS Feed Tidak Sesuai Dengan Alamat Web","URL RSS Feed & WEB",null,!0),this.submitted=!1,void this.bs.idle();const i=Object.keys(e).length;if(this.fg.invalid||0===i)return 0===i&&this.toast.warning("Harap Isi Salah Satu URL","Form Tidak lengkap (Web/FB/DC)",null,!0),this.submitted=!1,void this.bs.idle();this.subsFansub=this.fansub.createFansub({image:this.fg.value.image,cover:this.fg.value.cover,name:this.fg.value.name,description:this.fg.value.description,born:this.fg.value.born.getTime(),active:this.fg.value.active,tags:this.fg.value.tags,slug:this.fg.value.slug,urls:e,rss_feed:this.fg.value.rss_feed}).subscribe({next:n=>{this.gs.log("[FANSUB_CREATE_SUCCESS]",n),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/fansub",{state:{bypassCanDeactivate:!0}})},error:n=>{this.gs.log("[FANSUB_CREATE_ERROR]",n,"error"),this.submitted=!1,this.bs.idle()}})}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(o.QS),t.Y36(h.F0),t.Y36(Y.e),t.Y36(D.z),t.Y36(j.X),t.Y36(W.T),t.Y36(X.k),t.Y36(f.U),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-create"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"fansub-banner","fansub-banner-1","align-items-center"],[1,"fansub-banner","fansub-banner-2","align-items-center"],[2,"padding-top","160px"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","web","placeholder","http://www.domain.id"],["fontIcon","web","matSuffix",""],["matInput","","formControlName","facebook","placeholder","http://www.facebook.com"],["fontIcon","facebook","matSuffix",""],["matInput","","formControlName","discord","placeholder","http://www.discord.gg"],["matSuffix",""],["height","24px",2,"vertical-align","baseline",3,"src"],["matInput","","formControlName","twitter","placeholder","http://www.twitter.com"],[1,"col-12","col-md-7","col-xl-8","p-3"],["gambar_",""],["class","col-12 py-3",4,"ngIf"],["appearance","outline",1,"py-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","name","placeholder","Fansub Jalanan","required",""],["fontIcon","wysiwyg","matSuffix",""],["appearance","outline","matTooltip","Digunakan Juga Untuk Sub-Domain",1,"py-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","slug","placeholder","Jalsub","required",""],["fontIcon","short_text","matSuffix",""],["class","text-info",4,"ngIf"],["formControlName","description","required","",1,"py-3","w-100",3,"config"],["appearance","outline",1,"py-3","col-12","col-md-6",3,"color"],["matInput","","formControlName","born","required","",3,"matDatepicker","placeholder","focus"],["matSuffix","",3,"for"],["disabled","false"],["kalender",""],["formControlName","active","placeholder","Aktif / Non-Aktif","required",""],["value","0"],["value","1"],["align","end"],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["appearance","outline","class","py-3 col-12",3,"color",4,"ngIf"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/fansub",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],[1,"col-12","py-3"],[1,"text-info"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""],["matInput","","formControlName","rss_feed","placeholder","http://my-site.blogspot.com/feeds/posts/default?alt=rss"],["fontIcon","rss_feed","matSuffix",""]],template:function(i,n){1&i&&t.YNc(0,Oe,8,3,"div",0),2&i&&t.Q6J("ngIf",n.fg)},dependencies:[m.sg,m.O5,h.rH,et.CK,A.eB,A.Nr,x.ir,x.lw,x.IP,x.Y6,P.Mq,P.hl,P.nW,Q.Hw,g.nI,g.v_,g.pH,g.$V,g.nX,R.k0,at.x8,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,k.Yh,M.t,C.s6,m.uU,V.$],styles:[".fansub-banner[_ngcontent-%COMP%]{height:128px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;filter:blur(5px) brightness(100%);opacity:.5}.fansub-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.fansub-banner-2[_ngcontent-%COMP%]{position:absolute;top:128px;left:0}.fansub-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}"]})}return a})();var H=c(4674),Ke=c(217);function He(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",34),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeTo(r))}),t._uU(1),t._UZ(2,"mat-icon",35),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Ge(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Boleh Kosong"),t.qZA())}function je(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Valid"),t.qZA())}function Ve(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",34),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeCc(r))}),t._uU(1),t._UZ(2,"mat-icon",35),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Pe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Valid"),t.qZA())}function $e(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",34),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeBcc(r))}),t._uU(1),t._UZ(2,"mat-icon",35),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function ze(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Valid"),t.qZA())}function We(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",36)(1,"mat-slide-toggle",37),t.NdJ("change",function(n){t.CHM(e);const r=t.oxw(2);return t.KtG(r.noReplyMode(n))}),t._uU(2),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.MGl("matTooltip","Kirim sebagai noreply@",e.ENV.domain,""),t.xp6(1),t.hij(" Kirim sebagai noreply@",e.ENV.domain," ")}}function Xe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Pesan Tidak Boleh Kosong"),t.qZA())}function ta(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Pesan Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ea(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Buat Email Baru & Kirim"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"mat-form-field",11)(11,"mat-label"),t._uU(12,"Penerima"),t.qZA(),t.TgZ(13,"mat-chip-list",null,12),t.YNc(15,He,3,2,"mat-chip",13),t.qZA(),t.TgZ(16,"input",14),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addTo(n))}),t.qZA(),t._UZ(17,"mat-icon",15),t.TgZ(18,"mat-hint",16)(19,"mat-error"),t.YNc(20,Ge,2,0,"div",17),t.YNc(21,je,2,0,"div",17),t.qZA()()(),t.TgZ(22,"mat-form-field",11)(23,"mat-label"),t._uU(24,"Carbon Copy"),t.qZA(),t.TgZ(25,"mat-chip-list",null,18),t.YNc(27,Ve,3,2,"mat-chip",13),t.qZA(),t.TgZ(28,"input",19),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addCc(n))}),t.qZA(),t._UZ(29,"mat-icon",15),t.TgZ(30,"mat-hint",16)(31,"mat-error"),t.YNc(32,Pe,2,0,"div",17),t.qZA()()(),t.TgZ(33,"mat-form-field",11)(34,"mat-label"),t._uU(35,"Blind Carbon Copy"),t.qZA(),t.TgZ(36,"mat-chip-list",null,20),t.YNc(38,$e,3,2,"mat-chip",13),t.qZA(),t.TgZ(39,"input",19),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addBcc(n))}),t.qZA(),t._UZ(40,"mat-icon",15),t.TgZ(41,"mat-hint",16)(42,"mat-error"),t.YNc(43,ze,2,0,"div",17),t.qZA()()(),t.YNc(44,We,3,2,"div",21),t.qZA()(),t.TgZ(45,"div",22)(46,"div",9)(47,"mat-form-field",23)(48,"mat-label"),t._uU(49,"Judul"),t.qZA(),t._UZ(50,"input",24)(51,"mat-icon",25),t.TgZ(52,"mat-error"),t.YNc(53,Xe,2,0,"div",17),t.YNc(54,ta,2,0,"div",17),t.qZA()(),t._UZ(55,"angular-editor",26),t.qZA()()(),t.TgZ(56,"div",9)(57,"div",2)(58,"div",27),t._UZ(59,"div",28),t.TgZ(60,"div",29)(61,"a",30),t._UZ(62,"mat-icon",31),t._uU(63," Batal "),t.qZA()(),t.TgZ(64,"div",29)(65,"button",32),t._uU(66," Simpan "),t._UZ(67,"mat-icon",33),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(14),i=t.MAs(26),n=t.MAs(37),r=t.oxw();t.Q6J("formGroup",r.fg),t.xp6(10),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",r.fg.value.to),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",r.GS.separatorKeysCodes)("matChipInputFor",e)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",r.fg.get("to").hasError("required")),t.xp6(1),t.Q6J("ngIf",r.fg.get("to").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",r.fg.value.cc),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",r.GS.separatorKeysCodes)("matChipInputFor",i)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",r.fg.get("cc").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",r.fg.value.bcc),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",r.GS.separatorKeysCodes)("matChipInputFor",n)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",r.fg.get("bcc").hasError("pattern")),t.xp6(1),t.Q6J("ngIf",r.canSendAsNoReply),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",r.fg.get("subject").hasError("required")),t.xp6(1),t.Q6J("ngIf",r.fg.get("subject").hasError("pattern")),t.xp6(1),t.Q6J("config",r.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",r.submitted),t.xp6(4),t.Q6J("disabled",r.submitted||r.fg.invalid)}}let aa=(()=>{class a{constructor(e,i,n,r,l,d,b,S){this.activatedRoute=e,this.fb=i,this.router=n,this.bs=r,this.gs=l,this.as=d,this.ms=b,this.ds=S,this.submitted=!1,this.subsMail=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get ENV(){return H.N}get GS(){return this.gs}get canSendAsNoReply(){const e=this.as.currentUserSubject?.value?.role;return e===p.yS.ADMIN||e===p.yS.MODERATOR}ngOnInit(){this.gs.isBrowser&&this.initForm()}ngOnDestroy(){this.subsMail?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){const e=this.activatedRoute.snapshot.queryParamMap.get("to")?.split(",").map(l=>l.toLowerCase().trim())||[],i=this.activatedRoute.snapshot.queryParamMap.get("cc")?.split(",").map(l=>l.toLowerCase().trim())||[],n=this.activatedRoute.snapshot.queryParamMap.get("bcc")?.split(",").map(l=>l.toLowerCase().trim())||[];this.as.currentUserSubject?.value&&(n.includes(`${this.as.currentUserSubject.value._email.toLowerCase().trim()}`)||n.push(`${this.as.currentUserSubject.value._email.toLowerCase().trim()}`));const r=this.activatedRoute.snapshot.queryParamMap.get("subject")||"";this.fg=this.fb.group({to:[e,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEmailMulti)])],cc:[i,o.kI.compose([o.kI.pattern(u.t.regexEmailMulti)])],bcc:[n,o.kI.compose([o.kI.pattern(u.t.regexEmailMulti)])],subject:[r,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],message:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],no_reply:[!1,o.kI.compose([o.kI.required])]})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsMail=this.ms.sendMail(this.fg.value).subscribe({next:e=>{this.gs.log("[MAIL_SEND_SUCCESS]",e),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/mailbox",{state:{bypassCanDeactivate:!0}})},error:e=>{this.gs.log("[MAIL_SEND_ERROR]",e,"error"),this.submitted=!1,this.bs.idle()}})}addTo(e){const i=e.chipInput.inputElement,n=e.value;(n||"").toLowerCase().trim()&&this.fg.value.to.push(n.toLowerCase().trim()),i&&(i.value=""),this.fg.controls.to.patchValue(this.fg.value.to.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeTo(e){const i=this.fg.value.to.indexOf(e);i>=0&&this.fg.value.to.splice(i,1)}addCc(e){const i=e.chipInput.inputElement,n=e.value;(n||"").toLowerCase().trim()&&this.fg.value.cc.push(n.toLowerCase().trim()),i&&(i.value=""),this.fg.controls.cc.patchValue(this.fg.value.cc.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeCc(e){const i=this.fg.value.cc.indexOf(e);i>=0&&this.fg.value.cc.splice(i,1)}addBcc(e){const i=e.chipInput.inputElement,n=e.value;(n||"").toLowerCase().trim()&&this.fg.value.bcc.push(n.toLowerCase().trim()),i&&(i.value=""),this.fg.controls.bcc.patchValue(this.fg.value.bcc.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeBcc(e){const i=this.fg.value.bcc.indexOf(e);i>=0&&this.fg.value.bcc.splice(i,1)}noReplyMode(e){e.checked?(this.fg.controls.subject.patchValue(`${H.N.siteName} | Informasi`),this.fg.controls.subject.disable()):this.fg.controls.subject.enable()}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(h.gz),t.Y36(o.QS),t.Y36(h.F0),t.Y36(D.z),t.Y36(f.U),t.Y36(Y.e),t.Y36(Ke.Y),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-mailbox-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],["hintLabel","Gunakan , Jika Lebih Dari 1","appearance","outline",1,"py-3","col-12",3,"color"],["to",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","user@domain.tld","required","",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","short_text","matSuffix",""],["align","end"],[4,"ngIf"],["cc",""],["placeholder","user@domain.tld",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["bcc",""],["class","col-12 py-3",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","subject","placeholder","Judul Pesan Blablabla ...","required",""],["fontIcon","wysiwyg","matSuffix",""],["formControlName","message","required","",1,"py-3","w-100",3,"config"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/mailbox",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""],[1,"col-12","py-3"],["formControlName","no_reply",3,"matTooltip","change"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,ea,68,27,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.sg,m.O5,h.rH,A.eB,A.Nr,x.ir,x.lw,x.IP,x.Y6,Q.Hw,g.nI,g.v_,g.pH,g.$V,g.nX,R.k0,it.iZ,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,M.t,C.s6]})}return a})();var ia=c(8111);function na(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function oa(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageErrorText)}}function ra(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",2)(1,"button",36),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",37),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function sa(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Tidak Boleh Kosong"),t.qZA())}function la(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ca(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",38),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeTag(r))}),t._uU(1),t._UZ(2,"mat-icon",39),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function ma(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Tambah Data Berita & Informasi Baru"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),t._UZ(11,"img",11),t.TgZ(12,"mat-form-field",12)(13,"mat-label"),t._uU(14,"Gambar"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",13,14),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(16),l=t.oxw();return t.KtG(l.uploadImage(n,r))}),t.qZA(),t._UZ(17,"mat-icon",15),t.qZA(),t.TgZ(18,"mat-error",16)(19,"small"),t.YNc(20,na,3,3,"div",17),t.YNc(21,oa,2,1,"div",17),t.qZA()()(),t.YNc(22,ra,4,1,"div",18),t.qZA()(),t.TgZ(23,"div",19)(24,"div",9)(25,"mat-form-field",20)(26,"mat-label"),t._uU(27,"Judul"),t.qZA(),t._UZ(28,"input",21)(29,"mat-icon",22),t.TgZ(30,"mat-error"),t.YNc(31,sa,2,0,"div",17),t.YNc(32,la,2,0,"div",17),t.qZA()(),t.TgZ(33,"mat-form-field",20)(34,"mat-label"),t._uU(35,"Tags & Kategori"),t.qZA(),t.TgZ(36,"mat-chip-list",null,23),t.YNc(38,ca,3,2,"mat-chip",24),t.TgZ(39,"input",25),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addTag(n))}),t.qZA(),t._UZ(40,"mat-icon",26),t.qZA(),t.TgZ(41,"mat-hint",27),t._uU(42,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t._UZ(43,"angular-editor",28),t.qZA()()(),t.TgZ(44,"div",9)(45,"div",2)(46,"div",29),t._UZ(47,"div",30),t.TgZ(48,"div",31)(49,"a",32),t._UZ(50,"mat-icon",33),t._uU(51," Batal "),t.qZA()(),t.TgZ(52,"div",31)(53,"button",34),t._uU(54," Simpan "),t._UZ(55,"mat-icon",35),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(37),i=t.oxw();t.Q6J("formGroup",i.fg),t.xp6(11),t.Q6J("src",i.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.imageErrorText),t.xp6(1),t.Q6J("ngIf",i.image&&!i.fg.value.image),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("title").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",i.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",i.GS.separatorKeysCodes)("matChipInputFor",e)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("config",i.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",i.submitted),t.xp6(4),t.Q6J("disabled",i.submitted||i.fg.invalid)}}let ua=(()=>{class a{constructor(e,i,n,r,l,d,b){this.fb=e,this.router=i,this.bs=n,this.imgbb=r,this.news=l,this.gs=d,this.ds=b,this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.gambar=null,this.subsNews=null,this.subsImgbb=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}ngOnInit(){this.gs.isBrowser&&this.initForm()}ngOnDestroy(){this.subsImgbb?.unsubscribe(),this.subsNews?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){this.fg=this.fb.group({title:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],content:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],image:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],tags:[[],o.kI.compose([])]})}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[IMAGE_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNews=this.news.createNews({image:this.fg.value.image,title:this.fg.value.title,content:this.fg.value.content,tags:this.fg.value.tags}).subscribe({next:e=>{this.gs.log("[NEWS_CREATE_SUCCESS]",e),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/news",{state:{bypassCanDeactivate:!0}})},error:e=>{this.gs.log("[NEWS_CREATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle()}})}addTag(e){const i=e.input,n=e.value;(n||"").trim()&&this.fg.value.tags.push(n.trim()),i&&(i.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeTag(e){const i=this.fg.value.tags.indexOf(e);i>=0&&this.fg.value.tags.splice(i,1)}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(o.QS),t.Y36(h.F0),t.Y36(D.z),t.Y36(j.X),t.Y36(ia.Y),t.Y36(f.U),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","title","placeholder","Berita Terkini Blablabla ...","required",""],["fontIcon","wysiwyg","matSuffix",""],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["align","end"],["formControlName","content","required","",1,"py-3","w-100",3,"config"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/news",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,ma,56,19,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.sg,m.O5,h.rH,A.eB,A.Nr,x.ir,x.lw,x.IP,x.Y6,Q.Hw,g.nI,g.v_,g.pH,g.$V,g.nX,R.k0,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,k.Yh,M.t,C.s6,V.$]})}return a})();var da=c(3201);function _a(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat URL Tidak Boleh Kosong"),t.qZA())}function ga(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Format Alamat URL Salah"),t.qZA())}function pa(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Ekspektasi Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function fa(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Boleh Kosong"),t.qZA())}function ha(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Format Alamat Surel Salah"),t.qZA())}function ba(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Buat Laporan Pelanggaran Penyalahgunaan"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"mat-form-field",11)(11,"mat-label"),t._uU(12,"URL Link Tautan Yang Di Laporkan"),t.qZA(),t._UZ(13,"input",12)(14,"mat-icon",13),t.TgZ(15,"mat-error"),t.YNc(16,_a,2,0,"div",14),t.YNc(17,ga,2,0,"div",14),t.qZA()(),t._UZ(18,"angular-editor",15),t.TgZ(19,"mat-form-field",11)(20,"mat-label"),t._uU(21,"Ekspektasi Hasil Yang Diharapkan"),t.qZA(),t._UZ(22,"input",16)(23,"mat-icon",13),t.TgZ(24,"mat-error"),t.YNc(25,pa,2,0,"div",14),t.qZA()()()(),t.TgZ(26,"div",17)(27,"div",9)(28,"mat-form-field",11)(29,"mat-label"),t._uU(30,"Surel Informasi Proses Hasil Tindak Lanjut"),t.qZA(),t._UZ(31,"input",18)(32,"mat-icon",19),t.TgZ(33,"mat-error"),t.YNc(34,fa,2,0,"div",14),t.YNc(35,ha,2,0,"div",14),t.qZA()(),t.TgZ(36,"div",20)(37,"re-captcha",21,22),t.NdJ("resolved",function(n){t.CHM(e);const r=t.MAs(38),l=t.oxw();return t.KtG(l.captcha(n,r))}),t.qZA()()()()(),t.TgZ(39,"div",9)(40,"div",2)(41,"div",23),t._UZ(42,"div",24),t.TgZ(43,"div",25)(44,"a",26),t._UZ(45,"mat-icon",27),t._uU(46," Batal "),t.qZA()(),t.TgZ(47,"div",25)(48,"button",28),t._uU(49," Simpan "),t._UZ(50,"mat-icon",29),t.qZA()()()()()()()()}if(2&a){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(10),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("url").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("url").hasError("pattern")),t.xp6(1),t.Q6J("config",e.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("expected_solution").hasError("pattern")),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("contact_email").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("contact_email").hasError("pattern")),t.xp6(2),t.Q6J("siteKey",e.G_CAPTCHA_SITE_KEY),t.xp6(7),t.Q6J("disabled",e.submitted),t.xp6(4),t.Q6J("disabled",e.submitted||e.fg.invalid)}}const xa=[{path:"",pathMatch:"full",redirectTo:"/home"},{path:"berkas",component:he,canActivate:[U.t],canDeactivate:[Z],data:{title:"Berkas - Buat Baru",description:"Halaman Unggah Berkas Baru",keywords:"Tambah Berkas Baru",[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR,p.yS.FANSUBBER,p.yS.USER]}},{path:"fansub",component:Ye,canActivate:[N.H,U.t],canDeactivate:[Z],data:{title:"Fansub - Buat Baru",description:"Halaman Menambahkan Fansub Baru",keywords:"Create Fansub",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR,p.yS.FANSUBBER,p.yS.USER]}},{path:"mailbox",component:aa,canActivate:[N.H,U.t],canDeactivate:[Z],data:{title:"Surel - Buat Baru",description:"Halaman Kirim Surel Baru",keywords:"Buat Surel Baru",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR,p.yS.FANSUBBER,p.yS.USER]}},{path:"news",component:ua,canActivate:[N.H,U.t],canDeactivate:[Z],data:{title:"Berita - Buat Baru",description:"Halaman Unggah Berita Baru",keywords:"Tambah Berita Baru",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR]}},{path:"ticket",component:(()=>{class a{constructor(e,i,n,r,l,d,b,S){this.activatedRoute=e,this.fb=i,this.router=n,this.as=r,this.bs=l,this.ticket=d,this.gs=b,this.ds=S,this.captchaRef=null,this.submitted=!1,this.subsUser=null,this.subsDialog=null,this.subsTicket=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get G_CAPTCHA_SITE_KEY(){return u.t.gCaptchaSiteKey}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.subsUser=this.as.currentUser.subscribe({next:e=>{e&&this.fg?.controls.contact_email?.patchValue(e._email)}}))}ngOnDestroy(){this.subsUser?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsTicket?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){const e=this.activatedRoute.snapshot.queryParamMap.get("url")||null;this.fg=this.fb.group({url:[e,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexUrl)])],contact_email:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEmail)])],reported_issue:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],expected_solution:[null,o.kI.compose([o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],"g-recaptcha-response":[null,[o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)]]})}captcha(e,i){this.gs.log(`[GOOGLE_CAPTCHA] ${e}`),e?(this.captchaRef=i,this.fg.controls["g-recaptcha-response"].patchValue(e)):this.fg.value["g-recaptcha-response"]&&this.fg.controls["g-recaptcha-response"].patchValue(null)}showInfo(e){this.subsDialog=this.ds.openInfoDialog({data:{title:"Pembuatan Laporan",htmlMessage:e,confirmText:"Tutup"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INFO_DIALOG_CLOSED]",i),this.subsDialog.unsubscribe()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsTicket=this.ticket.createTicket({url:this.fg.value.url,contact_email:this.fg.value.contact_email,reported_issue:this.fg.value.reported_issue,expected_solution:this.fg.value.expected_solution,"g-recaptcha-response":this.fg.value["g-recaptcha-response"]}).subscribe({next:e=>{this.gs.log("[NEWS_CREATE_SUCCESS]",e);const i=`${H.N.baseUrl}/ticket/${e.result.id}?secret=${e.result.secret}`;this.showInfo(`\n Terima kasih telah turut ikut serta dalam menjaga dan mengawasi ${H.N.siteName}.\n Harap simpan URL dan gunakan untuk melihat progressnya ::\n ${i}\n `),this.submitted=!1,this.bs.idle(),this.router.navigate([`/ticket/${e.result.id}`],{state:{bypassCanDeactivate:!0},queryParams:{secret:e.result.secret}})},error:e=>{this.gs.log("[NEWS_CREATE_ERROR]",e,"error"),this.showInfo(e.result?.message||e.info),this.submitted=!1,this.bs.idle()}})}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(h.gz),t.Y36(o.QS),t.Y36(h.F0),t.Y36(Y.e),t.Y36(D.z),t.Y36(da.w),t.Y36(f.U),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-ticket-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","url","placeholder","https://sub-domain.fansub.id/berkas/konten-melanggar.html","required","","matTooltip","Alamat URL yang ingin kamu laporkan"],["fontIcon","wysiwyg","matSuffix",""],[4,"ngIf"],["formControlName","reported_issue","required","",1,"py-3","w-100",3,"config"],["matInput","","formControlName","expected_solution","placeholder","Harap kontent tersebut di hapus dan akun yang bersangkutan segera di tangguhkan ..."],[1,"col-12","col-md-5","col-xl-4","p-3"],["matInput","","formControlName","contact_email","placeholder","email-untuk-info-update@example.com","required","","matTooltip","Kami akan mengirimkan informasi jika laporanmu sudah selesai ditangani melalui surel ini"],["fontIcon","alternate_email","matSuffix",""],[1,"py-3","col-12"],["formControlName","g-recaptcha-response",3,"siteKey","resolved"],["captchaRef",""],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/news",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,ba,51,13,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.O5,h.rH,A.eB,A.Nr,Q.Hw,g.nI,g.v_,g.$V,g.nX,R.k0,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,M.t,C.s6,T.wT,T.Vd]})}return a})(),canDeactivate:[Z],data:{title:"Ticket - Permintaan Baru",description:"Halaman Permohonan Baru",keywords:"Ajukan Permintaan Permohonan"}}];let Ca=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.oAB({type:a});static#a=this.\u0275inj=t.cJS({imports:[m.ez,h.Bz.forChild(xa),_.m,o.u5,o.UX,k.Ad,v.F,C.UM,I.T,T.a,T.lQ]})}return a})()},4758:(z,y,c)=>{c.d(y,{t:()=>t});var m=c(4650),h=c(1390),o=c(9816),C=c(8598),k=c(6895),T=c(5882);function u(f,Z){if(1&f&&m._UZ(0,"div",4),2&f){const _=m.oxw();m.Udp("background-size",_.GS.sizeContain?"contain":"cover")("background-image","url("+_.GS.bannerImg+")")("background-repeat",_.GS.bgRepeat?"repeat-x":"no-repeat")("height",_.ROUTER.url.startsWith("/news")||_.ROUTER.url.startsWith("/berkas")||_.ROUTER.url.startsWith("/fansub")?"192px":"128px")("background-position-y",_.ROUTER.url.startsWith("/berkas")?"22.5%":"")}}function p(f,Z){if(1&f&&(m.TgZ(0,"strong",10),m._uU(1," -- "),m.TgZ(2,"i")(3,"a",11),m._uU(4),m.qZA()()()),2&f){const _=m.oxw().$implicit;m.xp6(3),m.MGl("routerLink","/user/",_.notifCreator,""),m.xp6(1),m.hij(" ",_.notifCreator," ")}}function U(f,Z){if(1&f){const _=m.EpF();m.TgZ(0,"button",12),m.NdJ("click",function(){m.CHM(_);const v=m.oxw().$implicit,E=m.oxw();return m.KtG(E.removeNotif(v.notifData.id))}),m.qZA()}}function N(f,Z){if(1&f&&(m.TgZ(0,"div",5)(1,"div")(2,"strong",6),m._uU(3),m.qZA(),m._UZ(4,"span",7),m.ALo(5,"safeInnerHtml"),m.YNc(6,p,5,2,"strong",8),m.YNc(7,U,1,0,"button",9),m.qZA()()),2&f){const _=Z.$implicit;m.xp6(1),m.Gre("alert alert-",_.notifData.type," alert-dismissible fade show"),m.xp6(2),m.Oqu(_.notifData.title),m.xp6(1),m.Q6J("innerHTML",m.lcZ(5,7,_.notifData.content),m.oJD),m.xp6(2),m.Q6J("ngIf",_.notifCreator),m.xp6(1),m.Q6J("ngIf",_.notifData.dismissible)}}let t=(()=>{class f{constructor(_,I,v){this.router=_,this.gs=I,this.notif=v}ngOnInit(){}get GS(){return this.gs}get ROUTER(){return this.router}get NOTIF(){return this.notif}removeNotif(_){this.notif.removeNotif(_)}static#t=this.\u0275fac=function(I){return new(I||f)(m.Y36(h.F0),m.Y36(o.U),m.Y36(C.T))};static#e=this.\u0275cmp=m.Xpm({type:f,selectors:[["app-notifications"]],decls:4,vars:2,consts:[["class","container-fluid notif-banner align-items-center",3,"background-size","background-image","background-repeat","height","background-position-y",4,"ngIf"],[1,"container"],[1,"row","pt-3"],["class","col-12",4,"ngFor","ngForOf"],[1,"container-fluid","notif-banner","align-items-center"],[1,"col-12"],[1,"me-1"],[3,"innerHTML"],["class","ms-1",4,"ngIf"],["type","button","class","btn-close","data-dismiss","alert",3,"click",4,"ngIf"],[1,"ms-1"],[1,"text-decoration-none",3,"routerLink"],["type","button","data-dismiss","alert",1,"btn-close",3,"click"]],template:function(I,v){1&I&&(m.YNc(0,u,1,10,"div",0),m.TgZ(1,"div",1)(2,"div",2),m.YNc(3,N,8,9,"div",3),m.qZA()()),2&I&&(m.Q6J("ngIf",v.GS.bannerImg&&(v.ROUTER.url.startsWith("/news")||v.ROUTER.url.startsWith("/berkas")||v.ROUTER.url.startsWith("/fansub")||v.ROUTER.url.startsWith("/anime")||v.ROUTER.url.startsWith("/dorama"))),m.xp6(3),m.Q6J("ngForOf",v.NOTIF.notifications))},dependencies:[k.sg,k.O5,h.rH,T.H],styles:[".notif-banner[_ngcontent-%COMP%]{width:100%;background-size:cover;background-position:75% 50%}"]})}return f})()},6319:(z,y,c)=>{c.d(y,{F:()=>k});var m=c(6895),h=c(1390),o=c(3811),C=c(4650);let k=(()=>{class T{static#t=this.\u0275fac=function(U){return new(U||T)};static#e=this.\u0275mod=C.oAB({type:T});static#a=this.\u0275inj=C.cJS({imports:[m.ez,h.Bz,o.T]})}return T})()}}]); \ No newline at end of file diff --git a/dist/main-site/browser/541.eb1aab9a62c2acda.js b/dist/main-site/browser/541.eb1aab9a62c2acda.js new file mode 100644 index 00000000..96245a57 --- /dev/null +++ b/dist/main-site/browser/541.eb1aab9a62c2acda.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[541],{4541:(z,y,c)=>{c.r(y),c.d(y,{CreateModule:()=>Ca});var m=c(6895),h=c(1390),o=c(4006),C=c(7375),k=c(5128),T=c(4700),u=c(3659),p=c(1741),U=c(5816),N=c(7357),t=c(4650),f=c(9816);let Z=(()=>{class a{constructor(e,i){this.gs=e,this.router=i}canDeactivate(e){return!!this.router.getCurrentNavigation()?.extras?.state?.bypassCanDeactivate||!e.canDeactivate||e.canDeactivate()}static#t=this.\u0275fac=function(i){return new(i||a)(t.LFG(f.U),t.LFG(h.F0))};static#e=this.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var _=c(2314),I=c(3811),v=c(6319),E=c(5861),nt=c(6805),ot=c(930);function J(a,s){const e="object"==typeof s;return new Promise((i,n)=>{const r=new ot.Hp({next:l=>{i(l),r.unsubscribe()},error:n,complete:()=>{e?i(s.defaultValue):n(new nt.K)}});a.subscribe(r)})}var w=c(8372),q=c(9094),L=c(8505),O=c(3900),G=c(8746),B=c(5625),D=c(3322),rt=c(6841),st=c(642),lt=c(3719),W=c(3842),ct=c(1428),j=c(7245),X=c(2693),Y=c(80),mt=c(6493),F=c(2970),tt=c(2447),et=c(4363),A=c(9818),ut=c(4850),Q=c(7392),g=c(8455),R=c(9203),dt=c(1256),at=c(6289),it=c(7732),K=c(7462),M=c(4758),V=c(7443);function _t(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function gt(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.imageErrorText)}}function pt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",2),t._UZ(1,"img",46),t.TgZ(2,"mat-form-field",47)(3,"mat-label"),t._uU(4,"Gambar Untuk Embed SEO"),t.qZA(),t.TgZ(5,"ngx-mat-file-input",48,49),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(6),l=t.oxw(2);return t.KtG(l.uploadImage(n,r))}),t.qZA(),t._UZ(7,"mat-icon",50),t.qZA(),t.TgZ(8,"mat-error",51)(9,"small"),t.YNc(10,_t,3,3,"div",20),t.YNc(11,gt,2,1,"div",20),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("src",e.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",e.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",e.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.imageErrorText)}}function ft(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",52)(1,"button",27),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",53),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function ht(a,s){1&a&&(t.TgZ(0,"div",15)(1,"mat-slide-toggle",54)(2,"i"),t._uU(3,"Private"),t.qZA(),t._uU(4," Akses Hanya Dengan URL "),t.qZA()())}function bt(a,s){if(1&a&&(t.TgZ(0,"mat-option",55),t._uU(1),t.qZA()),2&a){const e=s.$implicit;t.Q6J("value",e.id),t.xp6(1),t.Oqu(e.name)}}function vt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Jenis Tidak Boleh Kosong"),t.qZA())}function xt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Jenis Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ct(a,s){1&a&&t.GkF(0)}function Tt(a,s){1&a&&(t.TgZ(0,"mat-option",62),t._UZ(1,"mat-progress-bar",63),t.qZA())}function Zt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-option",65),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(4);return t.KtG(l.filterAnimeSelected(r))}),t._UZ(1,"img",66),t.TgZ(2,"span",67),t._uU(3),t.qZA()()}if(2&a){const e=s.$implicit;t.Q6J("value",e.id),t.xp6(1),t.s9C("src",e.image_url,t.LSH),t.xp6(2),t.lnq("",e.id," :: ",null==e.media_type?null:e.media_type.toUpperCase()," :: ",e.title,"")}}function At(a,s){if(1&a&&(t.ynx(0),t.YNc(1,Zt,4,5,"mat-option",64),t.BQk()),2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("ngForOf",e.filteredAnime)}}function kt(a,s){if(1&a&&(t.TgZ(0,"small",68),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.fg.get("anime_name").value)}}function It(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Anime Tidak Boleh Kosong"),t.qZA())}function Ut(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Anime Hanya Boleh Angka"),t.qZA())}function Et(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-form-field",56)(1,"mat-label"),t._uU(2,"Anime Terkait"),t.qZA(),t.TgZ(3,"input",57),t.NdJ("keyup",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.resetSelectedAnime())}),t.qZA(),t._UZ(4,"mat-icon",58),t.TgZ(5,"mat-autocomplete",null,59),t.YNc(7,Tt,2,0,"mat-option",60),t.YNc(8,At,2,1,"ng-container",20),t.qZA(),t.YNc(9,kt,2,1,"small",61),t.TgZ(10,"mat-error"),t.YNc(11,It,2,0,"div",20),t.YNc(12,Ut,2,0,"div",20),t.qZA()()}if(2&a){const e=t.MAs(6),i=t.oxw(2);t.Q6J("color","accent"),t.xp6(3),t.Q6J("matAutocomplete",e),t.xp6(4),t.Q6J("ngIf",i.isLoading),t.xp6(1),t.Q6J("ngIf",!i.isLoading),t.xp6(1),t.Q6J("ngIf",i.fg.get("anime_name").value),t.xp6(2),t.Q6J("ngIf",i.fg.get("anime_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("anime_id").hasError("pattern"))}}function St(a,s){1&a&&t.GkF(0)}function yt(a,s){1&a&&(t.TgZ(0,"mat-option",62),t._UZ(1,"mat-progress-bar",63),t.qZA())}function Nt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-option",65),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(5);return t.KtG(l.filterDoramaSelected(r))}),t._UZ(1,"img",66),t.TgZ(2,"span",67),t._uU(3),t.qZA()()}if(2&a){const e=s.$implicit;t.Q6J("value",e.mdl_id),t.xp6(1),t.s9C("src",e.image_url,t.LSH),t.xp6(2),t.AsE("",e.mdl_id," :: ",e.title,"")}}function Jt(a,s){if(1&a&&(t.ynx(0),t.YNc(1,Nt,4,4,"mat-option",64),t.BQk()),2&a){const e=t.oxw(4);t.xp6(1),t.Q6J("ngForOf",e.filteredDorama)}}function wt(a,s){if(1&a&&(t.TgZ(0,"small",68),t._uU(1),t.qZA()),2&a){const e=t.oxw(4);t.xp6(1),t.Oqu(e.fg.get("dorama_name").value)}}function qt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Dorama Tidak Boleh Kosong"),t.qZA())}function Bt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Dorama Hanya Boleh Angka"),t.qZA())}function Dt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-form-field",56)(1,"mat-label"),t._uU(2,"Dorama Terkait"),t.qZA(),t.TgZ(3,"input",71),t.NdJ("keyup",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.resetSelectedDorama())}),t.qZA(),t._UZ(4,"mat-icon",58),t.TgZ(5,"mat-autocomplete",null,72),t.YNc(7,yt,2,0,"mat-option",60),t.YNc(8,Jt,2,1,"ng-container",20),t.qZA(),t.YNc(9,wt,2,1,"small",61),t.TgZ(10,"mat-error"),t.YNc(11,qt,2,0,"div",20),t.YNc(12,Bt,2,0,"div",20),t.qZA()()}if(2&a){const e=t.MAs(6),i=t.oxw(3);t.Q6J("color","accent"),t.xp6(3),t.Q6J("matAutocomplete",e),t.xp6(4),t.Q6J("ngIf",i.isLoading),t.xp6(1),t.Q6J("ngIf",!i.isLoading),t.xp6(1),t.Q6J("ngIf",i.fg.get("dorama_name").value),t.xp6(2),t.Q6J("ngIf",i.fg.get("dorama_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("dorama_id").hasError("pattern"))}}function Ft(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Kode Serial Tidak Boleh Kosong"),t.qZA())}function Qt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Kode Serial Hanya Boleh Huruf Besar, Strip, Dan Angka"),t.qZA())}function Rt(a,s){if(1&a&&(t.TgZ(0,"mat-form-field",17)(1,"mat-label"),t._uU(2,"Kode / Serial Number"),t.qZA(),t._UZ(3,"input",75)(4,"mat-icon",76),t.TgZ(5,"mat-error"),t.YNc(6,Ft,2,0,"div",20),t.YNc(7,Qt,2,0,"div",20),t.qZA()()),2&a){const e=t.oxw(4);t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("sn_code").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("sn_code").hasError("pattern"))}}function Mt(a,s){1&a&&(t.TgZ(0,"div",77)(1,"small",78),t._uU(2," * Jika tidak ada kode serial isi saja - strip "),t.qZA()())}function Lt(a,s){if(1&a&&(t.YNc(0,Rt,8,3,"mat-form-field",73),t.YNc(1,Mt,3,0,"div",74)),2&a){const e=t.oxw(3);t.Q6J("ngIf",e.berkasType),t.xp6(1),t.Q6J("ngIf",e.berkasType)}}function Ot(a,s){if(1&a&&(t.YNc(0,St,1,0,"ng-container",21),t.YNc(1,Dt,13,7,"ng-template",null,69,t.W1O),t.YNc(3,Lt,2,2,"ng-template",null,70,t.W1O)),2&a){const e=t.MAs(2),i=t.MAs(4),n=t.oxw(2);t.Q6J("ngIf",n.berkasType.toLowerCase().includes("dorama_"))("ngIfThen",e)("ngIfElse",i)}}function Yt(a,s){1&a&&t._UZ(0,"mat-icon",58)}function Kt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",84),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().index,r=t.oxw(2);return t.KtG(r.removeFansub(n))}),t._UZ(1,"mat-icon",85),t.qZA()}}function Ht(a,s){1&a&&(t.TgZ(0,"mat-option",62),t._UZ(1,"mat-progress-bar",63),t.qZA())}function Gt(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-option",65),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(2).index,d=t.oxw(2);return t.KtG(d.filterFansubSelected(r,l))}),t._UZ(1,"img",86),t.TgZ(2,"span",67),t._uU(3),t.qZA()()}if(2&a){const e=s.$implicit;t.Q6J("value",e.id),t.xp6(1),t.s9C("src",e.image_url,t.LSH),t.xp6(2),t.AsE("",e.slug," :: ",e.name,"")}}function jt(a,s){if(1&a&&(t.ynx(0),t.YNc(1,Gt,4,4,"mat-option",64),t.BQk()),2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("ngForOf",e.filteredFansub)}}function Vt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Fansub Tidak Boleh Kosong"),t.qZA())}function Pt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"ID Fansub Hanya Boleh Angka"),t.qZA())}function $t(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",79)(2,"mat-form-field",56)(3,"mat-label"),t._uU(4,"Fansub Terkait"),t.qZA(),t.TgZ(5,"input",80),t.NdJ("keyup",function(){const r=t.CHM(e).index,l=t.oxw(2);return t.KtG(l.resetSelectedFansub(r))}),t.qZA(),t.YNc(6,Yt,1,0,"mat-icon",81),t.YNc(7,Kt,2,0,"button",82),t.TgZ(8,"mat-autocomplete",null,83),t.YNc(10,Ht,2,0,"mat-option",60),t.YNc(11,jt,2,1,"ng-container",20),t.qZA(),t.TgZ(12,"small",68),t._uU(13),t.qZA(),t.TgZ(14,"mat-error"),t.YNc(15,Vt,2,0,"div",20),t.YNc(16,Pt,2,0,"div",20),t.qZA()()()()}if(2&a){const e=s.$implicit,i=s.index,n=t.MAs(9),r=t.oxw(2);t.xp6(1),t.Q6J("formGroupName",i),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("matAutocomplete",n),t.xp6(1),t.Q6J("ngIf",e.get("fansub_id").value||0===i),t.xp6(1),t.Q6J("ngIf",!e.get("fansub_id").value&&i>0),t.xp6(3),t.Q6J("ngIf",r.isLoading),t.xp6(1),t.Q6J("ngIf",!r.isLoading),t.xp6(2),t.Oqu(e.get("fansub_name").value),t.xp6(2),t.Q6J("ngIf",e.get("fansub_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.get("fansub_id").hasError("pattern"))}}function zt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Berkas Tidak Boleh Kosong"),t.qZA())}function Wt(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Berkas Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Xt(a,s){if(1&a&&t._UZ(0,"angular-editor",87),2&a){const e=t.oxw(2);t.Q6J("config",e.GS.angularEditorConfig)}}function te(a,s){1&a&&t.GkF(0)}function ee(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.attachmentLimitExceeded)," !")}}function ae(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.attachmentErrorText)}}function ie(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",38)(1,"div",95)(2,"div",96),t._uU(3),t.ALo(4,"bytes"),t._UZ(5,"br")(6,"mat-progress-bar",97),t.qZA()(),t.TgZ(7,"div",98)(8,"button",27),t.NdJ("click",function(){const r=t.CHM(e).$implicit,l=t.oxw(3);return t.KtG(l.submitAttachment(r))}),t._UZ(9,"mat-icon",99),t._uU(10," Unggah "),t.qZA()()()}if(2&a){const e=s.$implicit,i=t.oxw(3);t.xp6(3),t.HOy(" ",e.status," :: ",e.progress,"% @ ",t.lcZ(4,7,e.speed),"/s # ",e.remaining," detik "),t.xp6(3),t.Q6J("mode","determinate")("value",e.progress),t.xp6(2),t.Q6J("disabled",i.submitted||"complete"===e.status||"uploading"===e.status)}}function ne(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",77)(2,"small",78),t._uU(3," * "),t.TgZ(4,"i"),t._uU(5,"Resume-able Upload"),t.qZA(),t._uU(6," :: "),t.TgZ(7,"i"),t._uU(8,"expired"),t.qZA(),t._uU(9),t.TgZ(10,"i"),t._uU(11,"upload"),t.qZA(),t._uU(12),t.qZA()(),t.TgZ(13,"mat-form-field",88)(14,"mat-label"),t._uU(15,"Upload Lampiran Berkas -- DDL"),t.qZA(),t.TgZ(16,"ngx-mat-file-input",89,90),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(17),l=t.oxw(2);return t.KtG(l.uploadAttachment(n,r))}),t.qZA(),t._UZ(18,"mat-icon",91),t.qZA(),t.TgZ(19,"mat-error",92)(20,"small"),t.YNc(21,ee,3,3,"div",20),t.YNc(22,ae,2,1,"div",20),t.qZA()()(),t.YNc(23,ie,11,9,"div",93),t.ALo(24,"async"),t.TgZ(25,"div",10)(26,"mat-slide-toggle",94),t._uU(27," Otomatis Simpan & Kirim Setelah Selesai Upload DDL "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(9),t.hij(" 3 hari (Tidak wajib, jika sudah ada URL eksternal, misal alamat webmu gdrive mediafire mega dan lain sebagainya). Mohon ditunggu, jika ingin di tinggal dapat menyelesaikan semua isian yang diperlukan dan menyalakan 'Otomatis Simpan & Kirim' dibawah ini, berkas lampiran akan dibatalkan dan dihapus apabila tidak disimpan dalam ",e.CONSTANTS.timeoutDeleteTempAttachmentTime/60/1e3," menit setelah berhasil "),t.xp6(3),t.hij(". Lalu kemudian saat berkas berhasil dibuat, lampiran tidak akan bisa di modifikasi. Tipe file yang diperbolehkan :: ",e.extAttachment," "),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",null!==e.attachmentSelected)("accept",e.fileTypeAttachmentAllowed),t.xp6(5),t.Q6J("ngIf",e.attachmentLimitExceeded),t.xp6(1),t.Q6J("ngIf",e.attachmentErrorText),t.xp6(1),t.Q6J("ngForOf",t.lcZ(24,9,e.uploads$)),t.xp6(3),t.Q6J("disabled",e.fg.invalid||"uploading"!==(null==e.attachmentSelected?null:e.attachmentSelected.status))}}function oe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",100),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.verify())}),t._UZ(1,"mat-icon",101),t._uU(2," Verifikasi Akun Untuk Upload DDL! "),t.qZA()}}function re(a,s){1&a&&(t.TgZ(0,"div",77)(1,"small",78),t._uU(2,"* Gunakan tombol (X) untuk menghapus URL Eksternal jika ingin hanya menggunakan lampiran "),t.TgZ(3,"i"),t._uU(4,"upload"),t.qZA(),t._uU(5," DDL saja"),t.qZA()())}function se(a,s){1&a&&t._UZ(0,"mat-icon",109)}function le(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",84),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().index,r=t.oxw(2);return t.KtG(r.removeDownloadLink(n))}),t._UZ(1,"mat-icon",85),t.qZA()}}function ce(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Web Tidak Boleh Kosong"),t.qZA())}function me(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Web Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ue(a,s){1&a&&t._UZ(0,"mat-icon",110)}function de(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"button",84),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().index,r=t.oxw(2);return t.KtG(r.removeDownloadLink(n))}),t._UZ(1,"mat-icon",85),t.qZA()}}function _e(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tautan Tidak Boleh Kosong"),t.qZA())}function ge(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tautan Link Tidak Valid"),t.qZA())}function pe(a,s){if(1&a&&(t.ynx(0),t.TgZ(1,"div",102),t.YNc(2,re,6,0,"div",74),t.TgZ(3,"mat-form-field",103)(4,"mat-label"),t._uU(5,"Nama Website"),t.qZA(),t._UZ(6,"input",104),t.YNc(7,se,1,0,"mat-icon",105),t.YNc(8,le,2,0,"button",82),t.TgZ(9,"mat-error"),t.YNc(10,ce,2,0,"div",20),t.YNc(11,me,2,0,"div",20),t.qZA()(),t.TgZ(12,"mat-form-field",106)(13,"mat-label"),t._uU(14,"Tautan Link"),t.qZA(),t._UZ(15,"input",107),t.YNc(16,ue,1,0,"mat-icon",108),t.YNc(17,de,2,0,"button",82),t.TgZ(18,"mat-error"),t.YNc(19,_e,2,0,"div",20),t.YNc(20,ge,2,0,"div",20),t.qZA()()(),t.BQk()),2&a){const e=s.$implicit,i=s.index,n=t.oxw(2);t.xp6(1),t.Q6J("formGroupName",i),t.xp6(1),t.Q6J("ngIf",(null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.verified)&&0===i),t.xp6(1),t.Q6J("color","accent"),t.xp6(4),t.Q6J("ngIf",e.get("name").value||0===i&&!(null!=n.AS.currentUserSubject&&null!=n.AS.currentUserSubject.value&&n.AS.currentUserSubject.value.verified)),t.xp6(1),t.Q6J("ngIf",!e.get("name").value&&(i>0||(null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.verified))),t.xp6(2),t.Q6J("ngIf",e.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(4),t.Q6J("ngIf",e.get("url").value||0===i&&!(null!=n.AS.currentUserSubject&&null!=n.AS.currentUserSubject.value&&n.AS.currentUserSubject.value.verified)),t.xp6(1),t.Q6J("ngIf",!e.get("url").value&&(i>0||(null==n.AS.currentUserSubject||null==n.AS.currentUserSubject.value?null:n.AS.currentUserSubject.value.verified))),t.xp6(2),t.Q6J("ngIf",e.get("url").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.get("url").hasError("pattern"))}}function fe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"span",8),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.toggleDetailMode())}),t._uU(5),t.qZA(),t.TgZ(6,"b",9),t._uU(7,"Tambah Berkas Baru"),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",10)(10,"div",11)(11,"div",10),t.YNc(12,pt,12,6,"div",12),t.YNc(13,ft,4,1,"div",13),t.YNc(14,ht,5,0,"div",14),t.TgZ(15,"div",15)(16,"mat-slide-toggle",16),t._uU(17," R-18+ Konten Eksplisit "),t.qZA()(),t.TgZ(18,"mat-form-field",17)(19,"mat-label"),t._uU(20,"Jenis Proyek"),t.qZA(),t.TgZ(21,"mat-select",18),t.YNc(22,bt,2,2,"mat-option",19),t.qZA(),t.TgZ(23,"mat-error"),t.YNc(24,vt,2,0,"div",20),t.YNc(25,xt,2,0,"div",20),t.qZA()(),t.YNc(26,Ct,1,0,"ng-container",21),t.YNc(27,Et,13,7,"ng-template",null,22,t.W1O),t.YNc(29,Ot,5,3,"ng-template",null,23,t.W1O),t.TgZ(31,"div",15),t._UZ(32,"mat-divider"),t.qZA(),t.TgZ(33,"div",24),t.YNc(34,$t,17,10,"div",25),t.qZA(),t.TgZ(35,"div",2)(36,"div",10),t._UZ(37,"div",26),t.TgZ(38,"div",26)(39,"button",27),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.addFansub())}),t._UZ(40,"mat-icon",28),t._uU(41," Tambah Fansub "),t.qZA()()()(),t.TgZ(42,"div",15)(43,"a",29),t._uU(44," * Jika pencarian tidak ditemukan, silahkan membuat halaman Fansub baru terlebih dahulu "),t.qZA()()()(),t.TgZ(45,"div",30)(46,"div",10)(47,"mat-form-field",31)(48,"mat-label"),t._uU(49,"Nama Berkas"),t.qZA(),t._UZ(50,"input",32)(51,"mat-icon",33),t.TgZ(52,"mat-error"),t.YNc(53,zt,2,0,"div",20),t.YNc(54,Wt,2,0,"div",20),t.qZA()(),t.YNc(55,Xt,1,1,"angular-editor",34),t.qZA(),t.TgZ(56,"div",10)(57,"div",15),t._UZ(58,"mat-divider"),t.qZA()(),t.YNc(59,te,1,0,"ng-container",21),t.YNc(60,ne,28,11,"ng-template",null,35,t.W1O),t.YNc(62,oe,3,0,"ng-template",null,36,t.W1O),t.TgZ(64,"div",10)(65,"div",15),t._UZ(66,"mat-divider"),t.qZA()(),t.ynx(67,37),t.YNc(68,pe,21,12,"ng-container",25),t.BQk(),t.TgZ(69,"div",38),t._UZ(70,"div",26)(71,"div",26)(72,"div",26),t.TgZ(73,"div",26)(74,"button",27),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.addDownloadLink())}),t._UZ(75,"mat-icon",28),t._uU(76," Tambah URL Eksternal "),t.qZA()()()()(),t.TgZ(77,"div",10)(78,"div",15)(79,"div",39),t._UZ(80,"div",40),t.TgZ(81,"div",41)(82,"a",42),t._UZ(83,"mat-icon",43),t._uU(84," Batal "),t.qZA()(),t.TgZ(85,"div",41)(86,"button",44),t._uU(87," Simpan "),t._UZ(88,"mat-icon",45),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(28),i=t.MAs(30),n=t.MAs(61),r=t.MAs(63),l=t.oxw();t.Q6J("formGroup",l.fg),t.xp6(5),t.hij(" ",l.detailMode?"Sederhana":"Lengkap"," "),t.xp6(7),t.Q6J("ngIf",l.detailMode),t.xp6(1),t.Q6J("ngIf",l.image&&!l.fg.value.image&&l.detailMode),t.xp6(1),t.Q6J("ngIf",null==l.AS.currentUserSubject||null==l.AS.currentUserSubject.value?null:l.AS.currentUserSubject.value.verified),t.xp6(4),t.Q6J("color","accent"),t.xp6(4),t.Q6J("ngForOf",l.projectList),t.xp6(2),t.Q6J("ngIf",l.fg.get("projectType_id").hasError("required")),t.xp6(1),t.Q6J("ngIf",l.fg.get("projectType_id").hasError("pattern")),t.xp6(1),t.Q6J("ngIf",l.berkasType.toLowerCase().includes("anime_"))("ngIfThen",e)("ngIfElse",i),t.xp6(8),t.Q6J("ngForOf",l.getFansubControl.controls),t.xp6(5),t.Q6J("disabled",l.submitted),t.xp6(8),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",l.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",l.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("ngIf",l.detailMode),t.xp6(4),t.Q6J("ngIf",null==l.AS.currentUserSubject||null==l.AS.currentUserSubject.value?null:l.AS.currentUserSubject.value.verified)("ngIfThen",n)("ngIfElse",r),t.xp6(9),t.Q6J("ngForOf",l.getDownloadUrlControl.controls),t.xp6(6),t.Q6J("disabled",l.submitted),t.xp6(8),t.Q6J("disabled",l.submitted),t.xp6(4),t.Q6J("disabled",l.submitted||l.fg.invalid||"uploading"===(null==l.attachmentSelected?null:l.attachmentSelected.status))}}let he=(()=>{class a{constructor(e,i,n,r,l,d,b,S,$,Ta,Za,Aa,ka,Ia){this.router=e,this.fb=i,this.bs=n,this.anime=r,this.dorama=l,this.project=d,this.fansub=b,this.berkas=S,this.imgbb=$,this.toast=Ta,this.gs=Za,this.as=Aa,this.uploadService=ka,this.ds=Ia,this.detailMode=!1,this.submitted=!1,this.projectList=[],this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.filteredAnime=[],this.filteredDorama=[],this.filteredFansub=[],this.isLoading=!1,this.animeCheckOrAddResponse=null,this.doramaCheckOrAddResponse=null,this.attachmentSelected=null,this.attachmentErrorText=null,this.attachmentLimitExceeded=null,this.uploadToast=null,this.timerTimeout1=null,this.timerTimeout2=null,this.gambar=null,this.ddl=null,this.subsProject=null,this.subsFansub=null,this.subsAnimeDetail=null,this.subsDoramaDetail=null,this.subsProjectDetail=null,this.subsFansubDetail=[],this.subsAnimeNew=null,this.subsDoramaNew=null,this.subsImgbb=null,this.subsBerkasCreate=null,this.subsUpload=null,this.subsDialog=null,this.berkasType="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get CONSTANTS(){return u.t}get AS(){return this.as}get GS(){return this.gs}get extAttachment(){return u.t.extAttachment.join(", ")}get fileTypeAttachmentAllowed(){return u.t.fileTypeAttachmentAllowed.join(", ")}ngOnInit(){this.gs.isBrowser&&(this.loadProjectList(),this.initForm(),this.uploads$=this.uploadService.connect(),this.subsUpload=this.uploadService.events.subscribe({next:e=>{this.gs.log("[UPLOAD_EVENTS]",e),("uploading"===e.status||"complete"===e.status)&&(this.attachmentSelected=e),"complete"===e.status?(this.gs.log("[UPLOAD_COMPLETED]",e.response),this.fg.controls.attachment_id.patchValue(e.response.result.id),this.uploadToast=this.toast.warning("Segera Kirim Data Berkas!","Lampiran Akan Dihapus ...",{closeButton:!1,timeOut:u.t.timeoutDeleteTempAttachmentTime,disableTimeOut:"extendedTimeOut",tapToDismiss:!1,progressAnimation:"decreasing"},!0),this.timerTimeout1=setTimeout(()=>{this.gs.log("[UPLOAD_TIMEOUT]",u.t.timeoutDeleteTempAttachmentTime),this.failOrCancelUpload({info:"Expired, Silahkan Upload Ulang!"})},u.t.timeoutDeleteTempAttachmentTime),this.fg.value.auto_send&&(this.timerTimeout2=setTimeout(()=>{this.onSubmit()},2500))):"error"===e.status&&(this.gs.log("[UPLOAD_ERROR]",e.response,"error"),this.failOrCancelUpload(e.response))},error:e=>{this.gs.log("[UPLOAD_ERROR]",e,"error"),this.failOrCancelUpload(e)}}))}ngOnDestroy(){this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.timerTimeout1&&(clearTimeout(this.timerTimeout1),this.timerTimeout1=null),this.timerTimeout2&&(clearTimeout(this.timerTimeout2),this.timerTimeout2=null),this.subsProject?.unsubscribe(),this.subsFansub?.unsubscribe(),this.subsAnimeDetail?.unsubscribe(),this.subsDoramaDetail?.unsubscribe(),this.subsProjectDetail?.unsubscribe();for(const e of this.subsFansubDetail)e?.unsubscribe();this.subsAnimeNew?.unsubscribe(),this.subsDoramaNew?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsBerkasCreate?.unsubscribe(),this.uploadService.disconnect(),this.subsUpload?.unsubscribe(),this.subsDialog?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}toggleDetailMode(){this.detailMode=!this.detailMode}loadProjectList(){this.bs.busy(),this.subsProject=this.project.getProject().subscribe({next:e=>{this.gs.log("[PROJECT_LOAD_SUCCESS]",e),this.projectList=e.results,this.bs.idle()},error:e=>{this.gs.log("[PROJECT_LOAD_ERROR]",e,"error"),this.bs.idle()}})}hasRequiredField(e,i){return e.get(i).hasValidator(o.kI.required)}animeValueChanged(){this.subsAnimeDetail=this.fg.get("anime_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.isLoading=!0),(0,O.w)(e=>this.anime.searchAnime(e).pipe((0,G.x)(()=>this.isLoading=!1))),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_ANIME_RESULT_SUCCESS]",e),this.filteredAnime=e.results},error:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_ANIME_RESULT_ERROR]",e,"error"),this.animeValueChanged()}})}doramaValueChanged(){this.subsDoramaDetail=this.fg.get("dorama_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.isLoading=!0),(0,O.w)(e=>this.dorama.searchDorama(e).pipe((0,G.x)(()=>this.isLoading=!1))),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_DORAMA_RESULT_SUCCESS]",e);for(const i of e.results)i.mdl_id=i.mdl_id.split("-")[1],i.image_url=i.thumb;this.filteredDorama=e.results},error:e=>{this.gs.log("[BERKAS_CREATE_SEARCH_DORAMA_RESULT_ERROR]",e,"error"),this.doramaValueChanged()}})}projectTypeValueChanged(){this.subsProjectDetail=this.fg.get("projectType_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_CREATE_PROJECT_CHANGED]",e),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null),this.fg.controls.sn_code.patchValue(null),this.fg.controls.anime_id.setErrors(null),this.fg.controls.anime_name.setErrors(null),this.fg.controls.dorama_id.setErrors(null),this.fg.controls.dorama_name.setErrors(null),this.fg.controls.sn_code.setErrors(null),this.fg.controls.anime_id.clearValidators(),this.fg.controls.anime_name.clearValidators(),this.fg.controls.dorama_id.clearValidators(),this.fg.controls.dorama_name.clearValidators(),this.fg.controls.sn_code.clearValidators(),this.fg.controls.anime_id.markAsPristine(),this.fg.controls.anime_name.markAsPristine(),this.fg.controls.dorama_id.markAsPristine(),this.fg.controls.dorama_name.markAsPristine(),this.fg.controls.sn_code.markAsPristine(),this.fg.controls.anime_id.markAsUntouched(),this.fg.controls.anime_name.markAsUntouched(),this.fg.controls.dorama_id.markAsUntouched(),this.fg.controls.dorama_name.markAsUntouched(),this.fg.controls.sn_code.markAsUntouched();const i=this.projectList.find(n=>n.id===e);i&&(this.berkasType=i.name,i.name.toLowerCase().includes("anime_")?(this.fg.controls.anime_id.setValidators([o.kI.required,o.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([o.kI.required]),this.subsAnimeDetail?.unsubscribe(),this.animeValueChanged()):i.name.toLowerCase().includes("dorama_")?(this.fg.controls.dorama_id.setValidators([o.kI.required,o.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([o.kI.required]),this.subsDoramaDetail?.unsubscribe(),this.doramaValueChanged()):this.fg.controls.sn_code.setValidators([o.kI.required,o.kI.pattern(/^[A-Z0-9\-]+$/)])),this.fg.controls.anime_id.updateValueAndValidity(),this.fg.controls.anime_name.updateValueAndValidity(),this.fg.controls.dorama_id.updateValueAndValidity(),this.fg.controls.dorama_name.updateValueAndValidity(),this.fg.controls.sn_code.updateValueAndValidity()}})}initForm(){this.fg=this.fb.group({name:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],description:[null,o.kI.compose([o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],projectType_id:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],anime_id:[null,o.kI.compose([])],anime_name:[null,o.kI.compose([])],dorama_id:[null,o.kI.compose([])],dorama_name:[null,o.kI.compose([])],fansub_list:this.fb.array([this.createFansub()]),image:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],sn_code:[null,o.kI.compose([])],attachment_id:[null,o.kI.compose([o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],download_url:this.fb.array([this.createDownloadLink()]),private:[!1,o.kI.compose([o.kI.required])],r18:[!1,o.kI.compose([o.kI.required])],auto_send:[!1,o.kI.compose([o.kI.required])]}),this.projectTypeValueChanged()}get getDownloadUrlControl(){return this.fg.get("download_url")}createDownloadLink(){return this.fb.group({name:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],url:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexUrl)])]})}removeDownloadLink(e){this.getDownloadUrlControl.removeAt(e)}addDownloadLink(){this.getDownloadUrlControl.push(this.createDownloadLink())}get getFansubControl(){return this.fg.get("fansub_list")}createFansub(){const e=this.fb.group({fansub_id:[null,o.kI.compose([o.kI.required,o.kI.pattern(/^\d+$/)])],fansub_name:[null,o.kI.compose([o.kI.required])]});return this.subsFansubDetail.push(e.get("fansub_id").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.isLoading=!0),(0,O.w)(i=>this.fansub.searchFansub(i).pipe((0,G.x)(()=>this.isLoading=!1))),(0,B.X)(-1)).subscribe({next:i=>{this.gs.log("[BERKAS_CREATE_SEARCH_FANSUB_RESULT]",i),this.filteredFansub=i.results}})),e}removeFansub(e){this.getFansubControl.removeAt(e),this.subsFansubDetail[e]?.unsubscribe(),this.subsFansubDetail.splice(e,1)}addFansub(){this.getFansubControl.push(this.createFansub())}resetSelectedAnime(){this.fg.controls.anime_name.patchValue(null)}resetSelectedDorama(){this.fg.controls.dorama_name.patchValue(null)}resetSelectedFansub(e){this.getFansubControl.controls[e].get("fansub_name").patchValue(null)}filterAnimeSelected(e){this.gs.log("[ANIME_FILTER_CLICK]",e),this.submitted=!0,this.subsAnimeNew=this.anime.addNewAnime({id:e.id,name:e.title,image_url:e.image_url,type:e.media_type?.toUpperCase()}).subscribe({next:i=>{this.gs.log("[ANIME_CHECK_ADD_SUCCESS]",i),this.animeCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.anime_id.patchValue(i.result.id),this.fg.controls.anime_name.patchValue(i.result.name)},error:i=>{this.gs.log("[ANIME_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedAnime(),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null)}})}filterDoramaSelected(e){this.gs.log("[DORAMA_FILTER_CLICK]",e),this.submitted=!0,this.subsDoramaNew=this.dorama.addNewDorama({id:parseInt(e.mdl_id,10),slug:e.slug,name:e.title,image_url:e.image_url,type:e.type}).subscribe({next:i=>{this.gs.log("[DORAMA_CHECK_ADD_SUCCESS]",i),this.doramaCheckOrAddResponse=i.result,this.submitted=!1,this.fg.controls.dorama_id.patchValue(i.result.id),this.fg.controls.dorama_name.patchValue(i.result.name)},error:i=>{this.gs.log("[DORAMA_CHECK_ADD_ERROR]",i,"error"),this.submitted=!1,this.resetSelectedDorama(),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null)}})}filterFansubSelected(e,i){this.gs.log("[FANSUB_FILTER_CLICK]",e),this.getFansubControl.controls[i].get("fansub_id").patchValue(e.id),this.getFansubControl.controls[i].get("fansub_name").patchValue(e.name)}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[IMAGE_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid||"uploading"===this.attachmentSelected?.status)return this.submitted=!1,void this.bs.idle();if(null===this.fg.value.attachment_id&&0===this.fg.value.download_url.lenth)return this.submitted=!1,this.uploadToast=this.toast.warning("Lampiran DDL / URL Eksternal!","Harap Mengisi Setidaknya Salah Satu ..."),void this.bs.idle();const e=[];for(const i of this.fg.value.fansub_list)e.push(i.fansub_id);this.subsBerkasCreate=this.berkas.createBerkas({image:this.fg.value.image,name:this.fg.value.name,description:this.fg.value.description,private:this.fg.value.private,r18:this.fg.value.r18,projectType_id:this.fg.value.projectType_id,anime_id:this.fg.value.anime_id,dorama_id:this.fg.value.dorama_id,sn_code:this.fg.value.sn_code,fansub_id:e,download_url:this.fg.value.download_url,attachment_id:this.fg.value.attachment_id}).subscribe({next:i=>{this.gs.log("[BERKAS_CREATE_SUCCESS]",i),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/berkas",{state:{bypassCanDeactivate:!0}})},error:i=>{this.gs.log("[BERKAS_CREATE_ERROR]",i,"error"),this.submitted=!1,this.bs.idle()}})}uploadAttachment(e,i){var n=this;return(0,E.Z)(function*(){n.ddl=i;const r=e.target.files[0];n.attachmentLimitExceeded=null,n.attachmentErrorText=null,n.gs.log("[ATTACHMENT_SELECTED]",r),n.fg.controls.attachment_id.patchValue(null),n.uploadService.disconnect();try{r.size<=u.t.fileSizeAttachmentTotalLimit?(n.uploadService.handleFiles(r),n.subsDialog=(yield n.ds.openKonfirmasiDialog("Saran Penamaan Berkas","Apakah Ingin Mengganti Penamaan Berkas Sesuai Dengan Nama Lampiran Yang Di Unggah ?")).afterClosed().subscribe({next:l=>{n.gs.log("[INFO_DIALOG_CLOSED]",l),!0===l&&(n.fg.controls.name.patchValue(r.name),n.fg.controls.name.markAsDirty()),n.subsDialog.unsubscribe()}})):(n.attachmentLimitExceeded=u.t.fileSizeAttachmentTotalLimit,n.ddl.clear(e))}catch{n.ddl.clear(e)}})()}submitAttachment(e){const i=this.uploadService.state().find(n=>n.uploadId===e.uploadId);i&&(this.attachmentSelected=i,e.status="queue")}failOrCancelUpload(e=null){this.attachmentSelected=null,this.attachmentErrorText=e?.result?.message||e?.info||e?.error?.message||"Terjadi Kesalahan, Harap Reload Halaman!",this.uploadService.disconnect(),this.fg.controls.attachment_id.patchValue(null),this.uploadToast&&this.toast.remove(this.uploadToast.toastId),this.ddl.clear()}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]},state:{bypassCanDeactivate:!0}})}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(h.F0),t.Y36(o.QS),t.Y36(D.z),t.Y36(rt.o),t.Y36(st.X),t.Y36(lt.Y),t.Y36(W.T),t.Y36(ct.A),t.Y36(j.X),t.Y36(X.k),t.Y36(f.U),t.Y36(Y.e),t.Y36(mt.Lz),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-berkas-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"float-end","text-decoration-none","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],["class","col-12",4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],["class","col-12 py-3",4,"ngIf"],[1,"col-12","py-3"],["formControlName","r18","matTooltip","Konten Eksplisit"],["appearance","outline",1,"px-3","pt-3","col-12",3,"color"],["formControlName","projectType_id","placeholder","Anime / Drama","required",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],[4,"ngIf","ngIfThen","ngIfElse"],["anime_",""],["notAnime_",""],["formArrayName","fansub_list","matTooltip","Silahkan Buat Terlebih Dahulu Jika Tidak Ada"],[4,"ngFor","ngForOf"],[1,"col","px-3"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add",1,"me-1"],["routerLink","/create/fansub",1,"text-warning","text-decoration-none"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","[Fansub] Judul Anime - 00 [BD 4K x265 FLAC][CRC32].mkv","required",""],["fontIcon","wysiwyg","matSuffix",""],["class","py-3 w-100","formControlName","description",3,"config",4,"ngIf"],["ddlVerified",""],["ddlNotVerified",""],["formArrayName","download_url"],[1,"row","mb-4"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/berkas",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[1,"col-12","mb-4"],["fontIcon","add_photo_alternate",1,"me-1"],["formControlName","private","matTooltip","Hanya Dapat Di Akses Melalui URL"],[3,"value"],["appearance","outline",1,"px-3","pt-3","w-100",3,"color"],["matInput","","formControlName","anime_id","placeholder","Full Metal Alchemist",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix",""],["autoCompleteAnime","matAutocomplete"],["class","is-loading",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"is-loading"],["mode","indeterminate"],["class","px-1",3,"value","click",4,"ngFor","ngForOf"],[1,"px-1",3,"value","click"],[1,"me-1",2,"height","40px","width","30px","object-fit","cover",3,"src"],[1,"ms-1"],[1,"text-warning"],["dorama_",""],["notDorama_",""],["matInput","","formControlName","dorama_id","placeholder","Flying Colors",3,"matAutocomplete","keyup"],["autoCompleteDorama","matAutocomplete"],["appearance","outline","class","px-3 pt-3 col-12",3,"color",4,"ngIf"],["class","col-12 px-3",4,"ngIf"],["matInput","","formControlName","sn_code","placeholder","XXX-999","required",""],["fontIcon","tag","matSuffix",""],[1,"col-12","px-3"],[1,"text-success"],[1,"row",3,"formGroupName"],["matInput","","formControlName","fansub_id","placeholder","NamaFansub","required","",3,"matAutocomplete","keyup"],["fontIcon","short_text","matSuffix","",4,"ngIf"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click",4,"ngIf"],["autoCompleteFansub","matAutocomplete"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click"],["fontIcon","close"],[1,"me-1",2,"height","40px","width","40px","object-fit","cover",3,"src"],["formControlName","description",1,"py-3","w-100",3,"config"],["appearance","outline",1,"px-3","pt-3","col",3,"color"],["uploadx","",1,"w-100",3,"disabled","accept","change"],["ddl",""],["fontIcon","attach_file","matSuffix",""],[1,"px-4","pb-4","w-100"],["class","row mb-4",4,"ngFor","ngForOf"],["formControlName","auto_send","matTooltip","Pastikan Semua Isian Yang Dibutuhkan Sudah Terisi",1,"px-3",3,"disabled"],[1,"col"],[1,"ps-3"],[3,"mode","value"],[1,"col-6","col-lg-4","px-3"],["fontIcon","attachment",1,"me-1"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"],["fontIcon","enhanced_encryption",1,"me-1"],["matTooltip","Silahkan Isi Alamat Website Kamu Jika Ingin Mendapatkan Traffic Pengunjung",1,"row",3,"formGroupName"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","name","placeholder","Google Drive","required",""],["fontIcon","web","matSuffix","",4,"ngIf"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","url","placeholder","https://webshit.saya.com/01/02/halaman-post-download.html","required",""],["fontIcon","link","matSuffix","",4,"ngIf"],["fontIcon","web","matSuffix",""],["fontIcon","link","matSuffix",""]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,fe,89,25,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.sg,m.O5,h.rH,tt.VN,tt.QJ,et.CK,A.eB,A.Nr,ut.d,Q.Hw,g.nI,g.v_,g.$V,g.nX,R.k0,dt.eI,at.x8,it.iZ,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,o.x0,o.CE,k.Yh,M.t,C.s6,m.Ov,V.$]})}return a})();var x=c(9923),P=c(9602);function be(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function ve(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.imageErrorText)}}function xe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",6)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Ce(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Tidak Boleh Kosong"),t.qZA())}function Te(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Link Tidak Valid"),t.qZA())}function Ze(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Facebook Link Tidak Valid"),t.qZA())}function Ae(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Discord Link Tidak Valid"),t.qZA())}function ke(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Twitter Link Tidak Valid"),t.qZA())}function Ie(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.coverLimitExceeded)," !")}}function Ue(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.coverErrorText)}}function Ee(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",66)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.submitCover())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Se(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Tidak Boleh Kosong"),t.qZA())}function ye(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Ne(a,s){if(1&a&&(t.TgZ(0,"small",67)(1,"div"),t._uU(2),t.qZA()()),2&a){const e=t.oxw(3);t.xp6(2),t.Oqu(e.slugInfo)}}function Je(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Tidak Boleh Kosong"),t.qZA())}function we(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Hanya Boleh Huruf Dan \u4e00"),t.qZA())}function qe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Harus Diisi Secara Valid"),t.qZA())}function Be(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function De(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function Fe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Qe(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",68),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(3);return t.KtG(l.removeTag(r))}),t._uU(1),t._UZ(2,"mat-icon",69),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Re(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"RSS Link Tidak Valid"),t.qZA())}function Me(a,s){if(1&a&&(t.TgZ(0,"mat-form-field",23)(1,"mat-label"),t._uU(2,"URI / URL RSS v2.0 Feed"),t.qZA(),t._UZ(3,"input",70)(4,"mat-icon",71),t.TgZ(5,"mat-error"),t.YNc(6,Re,2,0,"div",21),t.qZA()()),2&a){const e=t.oxw(3);t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("rss_feed").hasError("pattern"))}}function Le(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",8),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.onSubmit())}),t.TgZ(1,"div",9)(2,"div",10)(3,"h2",11)(4,"b",12),t._uU(5,"Tambah Data Fansub Baru"),t.qZA()()(),t.TgZ(6,"div",6)(7,"div",13)(8,"div",14)(9,"div",13)(10,"div",6),t._UZ(11,"img",15),t.TgZ(12,"mat-form-field",16)(13,"mat-label"),t._uU(14,"Foto"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",17,18),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(16),l=t.oxw(2);return t.KtG(l.uploadImage(n,r))}),t.qZA(),t._UZ(17,"mat-icon",19),t.qZA(),t.TgZ(18,"mat-error",20)(19,"small"),t.YNc(20,be,3,3,"div",21),t.YNc(21,ve,2,1,"div",21),t.qZA()()(),t.YNc(22,xe,4,1,"div",22),t.qZA(),t.TgZ(23,"div",13)(24,"div",6)(25,"div",13)(26,"mat-form-field",23)(27,"mat-label"),t._uU(28,"Tautan Website"),t.qZA(),t._UZ(29,"input",24)(30,"mat-icon",25),t.TgZ(31,"mat-error"),t.YNc(32,Ce,2,0,"div",21),t.YNc(33,Te,2,0,"div",21),t.qZA()(),t.TgZ(34,"mat-form-field",23)(35,"mat-label"),t._uU(36,"Facebook Fanpage"),t.qZA(),t._UZ(37,"input",26)(38,"mat-icon",27),t.TgZ(39,"mat-error"),t.YNc(40,Ze,2,0,"div",21),t.qZA()(),t.TgZ(41,"mat-form-field",23)(42,"mat-label"),t._uU(43,"Tautan Discord"),t.qZA(),t._UZ(44,"input",28),t.TgZ(45,"mat-icon",29),t._UZ(46,"img",30),t.qZA(),t.TgZ(47,"mat-error"),t.YNc(48,Ae,2,0,"div",21),t.qZA()(),t.TgZ(49,"mat-form-field",23)(50,"mat-label"),t._uU(51,"Cuitan Twitter"),t.qZA(),t._UZ(52,"input",31),t.TgZ(53,"mat-icon",29),t._UZ(54,"img",30),t.qZA(),t.TgZ(55,"mat-error"),t.YNc(56,ke,2,0,"div",21),t.qZA()()()()()(),t.TgZ(57,"div",32)(58,"div",13)(59,"mat-form-field",16)(60,"mat-label"),t._uU(61,"Cover"),t.qZA(),t.TgZ(62,"ngx-mat-file-input",17,33),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(63),l=t.oxw(2);return t.KtG(l.uploadCover(n,r))}),t.qZA(),t._UZ(64,"mat-icon",19),t.qZA(),t.TgZ(65,"mat-error",20)(66,"small"),t.YNc(67,Ie,3,3,"div",21),t.YNc(68,Ue,2,1,"div",21),t.qZA()(),t.YNc(69,Ee,4,1,"div",34),t.TgZ(70,"mat-form-field",35)(71,"mat-label"),t._uU(72,"Nama Fansub"),t.qZA(),t._UZ(73,"input",36)(74,"mat-icon",37),t.TgZ(75,"mat-error"),t.YNc(76,Se,2,0,"div",21),t.YNc(77,ye,2,0,"div",21),t.qZA()(),t.TgZ(78,"mat-form-field",38)(79,"mat-label"),t._uU(80,"Singkatan"),t.qZA(),t._UZ(81,"input",39)(82,"mat-icon",40),t.YNc(83,Ne,3,1,"small",41),t.TgZ(84,"mat-error"),t.YNc(85,Je,2,0,"div",21),t.YNc(86,we,2,0,"div",21),t.qZA()(),t._UZ(87,"angular-editor",42),t.TgZ(88,"mat-form-field",43)(89,"mat-label"),t._uU(90,"Mulai Ada Sejak"),t.qZA(),t.TgZ(91,"input",44),t.NdJ("focus",function(){t.CHM(e);const n=t.MAs(95);return t.KtG(n.open())}),t.ALo(92,"date"),t.qZA(),t._UZ(93,"mat-datepicker-toggle",45)(94,"mat-datepicker",46,47),t.TgZ(96,"mat-error"),t.YNc(97,qe,2,0,"div",21),t.YNc(98,Be,2,0,"div",21),t.qZA()(),t.TgZ(99,"mat-form-field",43)(100,"mat-label"),t._uU(101,"Status"),t.qZA(),t.TgZ(102,"mat-select",48)(103,"mat-option",49),t._uU(104,"Tidak Aktif"),t.qZA(),t.TgZ(105,"mat-option",50),t._uU(106,"Aktif"),t.qZA()(),t.TgZ(107,"mat-hint",51),t._uU(108,"Status Kehidupan Fansub Saat Ini"),t.qZA(),t.TgZ(109,"mat-error"),t.YNc(110,De,2,0,"div",21),t.YNc(111,Fe,2,0,"div",21),t.qZA()(),t.TgZ(112,"mat-form-field",23)(113,"mat-label"),t._uU(114,"Tags & Kategori"),t.qZA(),t.TgZ(115,"mat-chip-list",null,52),t.YNc(117,Qe,3,2,"mat-chip",53),t.TgZ(118,"input",54),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw(2);return t.KtG(r.addTag(n))}),t.qZA(),t._UZ(119,"mat-icon",55),t.qZA(),t.TgZ(120,"mat-hint",51),t._uU(121,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t.YNc(122,Me,7,2,"mat-form-field",56),t.qZA()()(),t.TgZ(123,"div",13)(124,"div",6)(125,"div",57),t._UZ(126,"div",58),t.TgZ(127,"div",59)(128,"a",60),t._UZ(129,"mat-icon",61),t._uU(130," Batal "),t.qZA()(),t.TgZ(131,"div",59)(132,"button",62),t._uU(133," Simpan "),t._UZ(134,"mat-icon",63),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(95),i=t.MAs(116),n=t.oxw(2);t.Q6J("formGroup",n.fg),t.xp6(11),t.Q6J("src",n.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",n.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",n.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",n.imageErrorText),t.xp6(1),t.Q6J("ngIf",n.image&&!n.fg.value.image),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",n.fg.get("web").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("web").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",n.fg.get("facebook").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/discord/",n.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",n.fg.get("discord").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/twitter/",n.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",n.fg.get("twitter").hasError("pattern")),t.xp6(3),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",n.fg.value.cover)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",n.coverLimitExceeded),t.xp6(1),t.Q6J("ngIf",n.coverErrorText),t.xp6(1),t.Q6J("ngIf",n.cover&&!n.fg.value.cover),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",n.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngIf",n.slugInfo),t.xp6(2),t.Q6J("ngIf",n.fg.get("slug").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("slug").hasError("pattern")),t.xp6(1),t.Q6J("config",n.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.s9C("placeholder",t.xi3(92,50,n.currentDate,"d MMMM y")),t.Q6J("matDatepicker",e),t.xp6(2),t.Q6J("for",e),t.xp6(4),t.Q6J("ngIf",n.fg.get("born").hasError("required")||n.fg.get("born").hasError("matDatepickerParse")),t.xp6(1),t.Q6J("ngIf",n.fg.get("born").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",n.fg.get("active").hasError("required")),t.xp6(1),t.Q6J("ngIf",n.fg.get("active").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",n.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",n.GS.separatorKeysCodes)("matChipInputFor",i)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",n.rssFeedAllowed),t.xp6(6),t.Q6J("disabled",n.submitted),t.xp6(4),t.Q6J("disabled",n.submitted||n.fg.invalid)}}function Oe(a,s){if(1&a&&(t.TgZ(0,"div",1),t._UZ(1,"div",2)(2,"div",3)(3,"div",4)(4,"app-notifications"),t.TgZ(5,"div",5)(6,"div",6),t.YNc(7,Le,135,53,"form",7),t.qZA()()()),2&a){const e=t.oxw();t.xp6(1),t.Udp("background-image","url("+e.cover_url+")"),t.xp6(6),t.Q6J("ngIf",e.fg)}}let Ye=(()=>{class a{constructor(e,i,n,r,l,d,b,S,$){this.fb=e,this.router=i,this.as=n,this.bs=r,this.imgbb=l,this.fansub=d,this.toast=b,this.gs=S,this.ds=$,this.submitted=!1,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.image_url="/assets/img/form/no-image.png",this.cover=null,this.coverLimitExceeded=null,this.coverErrorText=null,this.cover_url="/assets/img/form/no-image.png",this.urls=[],this.currentDate=new Date,this.gambar=null,this.gambar_=null,this.subsImgbb=null,this.subsFansub=null,this.subsCekFansubSlug=null,this.slugInfo="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get rssFeedAllowed(){return this.as.currentUserSubject?.value?.role===p.yS.ADMIN||this.as.currentUserSubject?.value?.role===p.yS.MODERATOR||this.as.currentUserSubject?.value?.role===p.yS.FANSUBBER}ngOnDestroy(){this.subsImgbb?.unsubscribe(),this.subsFansub?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&this.initForm()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){this.fg=this.fb.group({name:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],description:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],born:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],active:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],slug:[null,o.kI.compose([o.kI.required,o.kI.pattern(/^[0-9a-zA-Z-]*$/)])],tags:[[],o.kI.compose([])],image:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],cover:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],web:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],facebook:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],discord:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],twitter:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],rss_feed:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])]}),this.slugValueChanged()}slugValueChanged(){this.subsCekFansubSlug=this.fg.get("slug").valueChanges.pipe((0,w.b)(500),(0,q.x)(),(0,L.b)(()=>this.slugInfo="Mengecek ..."),(0,O.w)(e=>this.fansub.cekSlug({slug:e})),(0,B.X)(-1)).subscribe({next:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_SUCCESS]",e),this.slugInfo=e.result.message},error:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_ERROR]",e,"error"),this.slugValueChanged()}})}addTag(e){const i=e.input,n=e.value;(n||"").trim()&&this.fg.value.tags.push(n.trim()),i&&(i.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeTag(e){const i=this.fg.value.tags.indexOf(e);i>=0&&this.fg.value.tags.splice(i,1)}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[IMAGE_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}uploadCover(e,i){this.gambar_=i,this.cover=null,this.coverLimitExceeded=null,this.coverErrorText=null,this.fg.controls.cover.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[COVER_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.cover=n,this.cover_url=r.result.toString()},d.src=r.result.toString()}else this.cover=null,this.cover_url="/assets/img/form/image-error.png",this.coverLimitExceeded=u.t.fileSizeImageLimit,this.gambar_.clear(e)}}catch{this.cover=null,this.cover_url="/assets/img/form/no-image.png",this.gambar_.clear(e)}}submitCover(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.cover}).subscribe({next:e=>{this.gs.log("[COVER_SUCCESS]",e),this.fg.controls.cover.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[COVER_ERROR]",e,"error"),this.fg.controls.cover.patchValue(null),this.submitted=!1,this.coverErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e={};if(this.fg.value.web&&(e.web=this.fg.value.web),this.fg.value.facebook&&(e.facebook=this.fg.value.facebook),this.fg.value.discord&&(e.discord=this.fg.value.discord),this.fg.value.twitter&&(e.twitter=this.fg.value.twitter),this.submitted=!0,this.fg.value.rss_feed&&(!this.fg.value.web||!this.fg.value.rss_feed.startsWith(this.fg.value.web)))return this.toast.warning("RSS Feed Tidak Sesuai Dengan Alamat Web","URL RSS Feed & WEB",null,!0),this.submitted=!1,void this.bs.idle();const i=Object.keys(e).length;if(this.fg.invalid||0===i)return 0===i&&this.toast.warning("Harap Isi Salah Satu URL","Form Tidak lengkap (Web/FB/DC)",null,!0),this.submitted=!1,void this.bs.idle();this.subsFansub=this.fansub.createFansub({image:this.fg.value.image,cover:this.fg.value.cover,name:this.fg.value.name,description:this.fg.value.description,born:this.fg.value.born.getTime(),active:this.fg.value.active,tags:this.fg.value.tags,slug:this.fg.value.slug,urls:e,rss_feed:this.fg.value.rss_feed}).subscribe({next:n=>{this.gs.log("[FANSUB_CREATE_SUCCESS]",n),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/fansub",{state:{bypassCanDeactivate:!0}})},error:n=>{this.gs.log("[FANSUB_CREATE_ERROR]",n,"error"),this.submitted=!1,this.bs.idle()}})}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(o.QS),t.Y36(h.F0),t.Y36(Y.e),t.Y36(D.z),t.Y36(j.X),t.Y36(W.T),t.Y36(X.k),t.Y36(f.U),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-create"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"fansub-banner","fansub-banner-1","align-items-center"],[1,"fansub-banner","fansub-banner-2","align-items-center"],[2,"padding-top","160px"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","web","placeholder","http://www.domain.id"],["fontIcon","web","matSuffix",""],["matInput","","formControlName","facebook","placeholder","http://www.facebook.com"],["fontIcon","facebook","matSuffix",""],["matInput","","formControlName","discord","placeholder","http://www.discord.gg"],["matSuffix",""],["height","24px",2,"vertical-align","baseline",3,"src"],["matInput","","formControlName","twitter","placeholder","http://www.twitter.com"],[1,"col-12","col-md-7","col-xl-8","p-3"],["gambar_",""],["class","col-12 py-3",4,"ngIf"],["appearance","outline",1,"py-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","name","placeholder","Fansub Jalanan","required",""],["fontIcon","wysiwyg","matSuffix",""],["appearance","outline","matTooltip","Digunakan Juga Untuk Sub-Domain",1,"py-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","slug","placeholder","Jalsub","required",""],["fontIcon","short_text","matSuffix",""],["class","text-info",4,"ngIf"],["formControlName","description","required","",1,"py-3","w-100",3,"config"],["appearance","outline",1,"py-3","col-12","col-md-6",3,"color"],["matInput","","formControlName","born","required","",3,"matDatepicker","placeholder","focus"],["matSuffix","",3,"for"],["disabled","false"],["kalender",""],["formControlName","active","placeholder","Aktif / Non-Aktif","required",""],["value","0"],["value","1"],["align","end"],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["appearance","outline","class","py-3 col-12",3,"color",4,"ngIf"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/fansub",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],[1,"col-12","py-3"],[1,"text-info"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""],["matInput","","formControlName","rss_feed","placeholder","http://my-site.blogspot.com/feeds/posts/default?alt=rss"],["fontIcon","rss_feed","matSuffix",""]],template:function(i,n){1&i&&t.YNc(0,Oe,8,3,"div",0),2&i&&t.Q6J("ngIf",n.fg)},dependencies:[m.sg,m.O5,h.rH,et.CK,A.eB,A.Nr,x.ir,x.lw,x.IP,x.Y6,P.Mq,P.hl,P.nW,Q.Hw,g.nI,g.v_,g.pH,g.$V,g.nX,R.k0,at.x8,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,k.Yh,M.t,C.s6,m.uU,V.$],styles:[".fansub-banner[_ngcontent-%COMP%]{height:128px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;filter:blur(5px) brightness(100%);opacity:.5}.fansub-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.fansub-banner-2[_ngcontent-%COMP%]{position:absolute;top:128px;left:0}.fansub-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}"]})}return a})();var H=c(4674),Ke=c(217);function He(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",34),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeTo(r))}),t._uU(1),t._UZ(2,"mat-icon",35),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Ge(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Boleh Kosong"),t.qZA())}function je(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Valid"),t.qZA())}function Ve(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",34),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeCc(r))}),t._uU(1),t._UZ(2,"mat-icon",35),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Pe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Valid"),t.qZA())}function $e(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",34),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeBcc(r))}),t._uU(1),t._UZ(2,"mat-icon",35),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function ze(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Valid"),t.qZA())}function We(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",36)(1,"mat-slide-toggle",37),t.NdJ("change",function(n){t.CHM(e);const r=t.oxw(2);return t.KtG(r.noReplyMode(n))}),t._uU(2),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.MGl("matTooltip","Kirim sebagai noreply@",e.ENV.domain,""),t.xp6(1),t.hij(" Kirim sebagai noreply@",e.ENV.domain," ")}}function Xe(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Pesan Tidak Boleh Kosong"),t.qZA())}function ta(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Pesan Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ea(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Buat Email Baru & Kirim"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"mat-form-field",11)(11,"mat-label"),t._uU(12,"Penerima"),t.qZA(),t.TgZ(13,"mat-chip-list",null,12),t.YNc(15,He,3,2,"mat-chip",13),t.qZA(),t.TgZ(16,"input",14),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addTo(n))}),t.qZA(),t._UZ(17,"mat-icon",15),t.TgZ(18,"mat-hint",16)(19,"mat-error"),t.YNc(20,Ge,2,0,"div",17),t.YNc(21,je,2,0,"div",17),t.qZA()()(),t.TgZ(22,"mat-form-field",11)(23,"mat-label"),t._uU(24,"Carbon Copy"),t.qZA(),t.TgZ(25,"mat-chip-list",null,18),t.YNc(27,Ve,3,2,"mat-chip",13),t.qZA(),t.TgZ(28,"input",19),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addCc(n))}),t.qZA(),t._UZ(29,"mat-icon",15),t.TgZ(30,"mat-hint",16)(31,"mat-error"),t.YNc(32,Pe,2,0,"div",17),t.qZA()()(),t.TgZ(33,"mat-form-field",11)(34,"mat-label"),t._uU(35,"Blind Carbon Copy"),t.qZA(),t.TgZ(36,"mat-chip-list",null,20),t.YNc(38,$e,3,2,"mat-chip",13),t.qZA(),t.TgZ(39,"input",19),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addBcc(n))}),t.qZA(),t._UZ(40,"mat-icon",15),t.TgZ(41,"mat-hint",16)(42,"mat-error"),t.YNc(43,ze,2,0,"div",17),t.qZA()()(),t.YNc(44,We,3,2,"div",21),t.qZA()(),t.TgZ(45,"div",22)(46,"div",9)(47,"mat-form-field",23)(48,"mat-label"),t._uU(49,"Judul"),t.qZA(),t._UZ(50,"input",24)(51,"mat-icon",25),t.TgZ(52,"mat-error"),t.YNc(53,Xe,2,0,"div",17),t.YNc(54,ta,2,0,"div",17),t.qZA()(),t._UZ(55,"angular-editor",26),t.qZA()()(),t.TgZ(56,"div",9)(57,"div",2)(58,"div",27),t._UZ(59,"div",28),t.TgZ(60,"div",29)(61,"a",30),t._UZ(62,"mat-icon",31),t._uU(63," Batal "),t.qZA()(),t.TgZ(64,"div",29)(65,"button",32),t._uU(66," Simpan "),t._UZ(67,"mat-icon",33),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(14),i=t.MAs(26),n=t.MAs(37),r=t.oxw();t.Q6J("formGroup",r.fg),t.xp6(10),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",r.fg.value.to),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",r.GS.separatorKeysCodes)("matChipInputFor",e)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",r.fg.get("to").hasError("required")),t.xp6(1),t.Q6J("ngIf",r.fg.get("to").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",r.fg.value.cc),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",r.GS.separatorKeysCodes)("matChipInputFor",i)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",r.fg.get("cc").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",r.fg.value.bcc),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",r.GS.separatorKeysCodes)("matChipInputFor",n)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",r.fg.get("bcc").hasError("pattern")),t.xp6(1),t.Q6J("ngIf",r.canSendAsNoReply),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",r.fg.get("subject").hasError("required")),t.xp6(1),t.Q6J("ngIf",r.fg.get("subject").hasError("pattern")),t.xp6(1),t.Q6J("config",r.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",r.submitted),t.xp6(4),t.Q6J("disabled",r.submitted||r.fg.invalid)}}let aa=(()=>{class a{constructor(e,i,n,r,l,d,b,S){this.activatedRoute=e,this.fb=i,this.router=n,this.bs=r,this.gs=l,this.as=d,this.ms=b,this.ds=S,this.submitted=!1,this.subsMail=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get ENV(){return H.N}get GS(){return this.gs}get canSendAsNoReply(){const e=this.as.currentUserSubject?.value?.role;return e===p.yS.ADMIN||e===p.yS.MODERATOR}ngOnInit(){this.gs.isBrowser&&this.initForm()}ngOnDestroy(){this.subsMail?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){const e=this.activatedRoute.snapshot.queryParamMap.get("to")?.split(",").map(l=>l.toLowerCase().trim())||[],i=this.activatedRoute.snapshot.queryParamMap.get("cc")?.split(",").map(l=>l.toLowerCase().trim())||[],n=this.activatedRoute.snapshot.queryParamMap.get("bcc")?.split(",").map(l=>l.toLowerCase().trim())||[];this.as.currentUserSubject?.value&&(n.includes(`${this.as.currentUserSubject.value._email.toLowerCase().trim()}`)||n.push(`${this.as.currentUserSubject.value._email.toLowerCase().trim()}`));const r=this.activatedRoute.snapshot.queryParamMap.get("subject")||"";this.fg=this.fb.group({to:[e,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEmailMulti)])],cc:[i,o.kI.compose([o.kI.pattern(u.t.regexEmailMulti)])],bcc:[n,o.kI.compose([o.kI.pattern(u.t.regexEmailMulti)])],subject:[r,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],message:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],no_reply:[!1,o.kI.compose([o.kI.required])]})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsMail=this.ms.sendMail(this.fg.value).subscribe({next:e=>{this.gs.log("[MAIL_SEND_SUCCESS]",e),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/mailbox",{state:{bypassCanDeactivate:!0}})},error:e=>{this.gs.log("[MAIL_SEND_ERROR]",e,"error"),this.submitted=!1,this.bs.idle()}})}addTo(e){const i=e.chipInput.inputElement,n=e.value;(n||"").toLowerCase().trim()&&this.fg.value.to.push(n.toLowerCase().trim()),i&&(i.value=""),this.fg.controls.to.patchValue(this.fg.value.to.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeTo(e){const i=this.fg.value.to.indexOf(e);i>=0&&this.fg.value.to.splice(i,1)}addCc(e){const i=e.chipInput.inputElement,n=e.value;(n||"").toLowerCase().trim()&&this.fg.value.cc.push(n.toLowerCase().trim()),i&&(i.value=""),this.fg.controls.cc.patchValue(this.fg.value.cc.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeCc(e){const i=this.fg.value.cc.indexOf(e);i>=0&&this.fg.value.cc.splice(i,1)}addBcc(e){const i=e.chipInput.inputElement,n=e.value;(n||"").toLowerCase().trim()&&this.fg.value.bcc.push(n.toLowerCase().trim()),i&&(i.value=""),this.fg.controls.bcc.patchValue(this.fg.value.bcc.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeBcc(e){const i=this.fg.value.bcc.indexOf(e);i>=0&&this.fg.value.bcc.splice(i,1)}noReplyMode(e){e.checked?(this.fg.controls.subject.patchValue(`${H.N.siteName} | Informasi`),this.fg.controls.subject.disable()):this.fg.controls.subject.enable()}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(h.gz),t.Y36(o.QS),t.Y36(h.F0),t.Y36(D.z),t.Y36(f.U),t.Y36(Y.e),t.Y36(Ke.Y),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-mailbox-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],["hintLabel","Gunakan , Jika Lebih Dari 1","appearance","outline",1,"py-3","col-12",3,"color"],["to",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","user@domain.tld","required","",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","short_text","matSuffix",""],["align","end"],[4,"ngIf"],["cc",""],["placeholder","user@domain.tld",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["bcc",""],["class","col-12 py-3",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","subject","placeholder","Judul Pesan Blablabla ...","required",""],["fontIcon","wysiwyg","matSuffix",""],["formControlName","message","required","",1,"py-3","w-100",3,"config"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/mailbox",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""],[1,"col-12","py-3"],["formControlName","no_reply",3,"matTooltip","change"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,ea,68,27,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.sg,m.O5,h.rH,A.eB,A.Nr,x.ir,x.lw,x.IP,x.Y6,Q.Hw,g.nI,g.v_,g.pH,g.$V,g.nX,R.k0,it.iZ,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,M.t,C.s6]})}return a})();var ia=c(8111);function na(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function oa(a,s){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageErrorText)}}function ra(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",2)(1,"button",36),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",37),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function sa(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Tidak Boleh Kosong"),t.qZA())}function la(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ca(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",38),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,l=t.oxw(2);return t.KtG(l.removeTag(r))}),t._uU(1),t._UZ(2,"mat-icon",39),t.qZA()}if(2&a){const e=s.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function ma(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Tambah Data Berita & Informasi Baru"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),t._UZ(11,"img",11),t.TgZ(12,"mat-form-field",12)(13,"mat-label"),t._uU(14,"Gambar"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",13,14),t.NdJ("change",function(n){t.CHM(e);const r=t.MAs(16),l=t.oxw();return t.KtG(l.uploadImage(n,r))}),t.qZA(),t._UZ(17,"mat-icon",15),t.qZA(),t.TgZ(18,"mat-error",16)(19,"small"),t.YNc(20,na,3,3,"div",17),t.YNc(21,oa,2,1,"div",17),t.qZA()()(),t.YNc(22,ra,4,1,"div",18),t.qZA()(),t.TgZ(23,"div",19)(24,"div",9)(25,"mat-form-field",20)(26,"mat-label"),t._uU(27,"Judul"),t.qZA(),t._UZ(28,"input",21)(29,"mat-icon",22),t.TgZ(30,"mat-error"),t.YNc(31,sa,2,0,"div",17),t.YNc(32,la,2,0,"div",17),t.qZA()(),t.TgZ(33,"mat-form-field",20)(34,"mat-label"),t._uU(35,"Tags & Kategori"),t.qZA(),t.TgZ(36,"mat-chip-list",null,23),t.YNc(38,ca,3,2,"mat-chip",24),t.TgZ(39,"input",25),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const r=t.oxw();return t.KtG(r.addTag(n))}),t.qZA(),t._UZ(40,"mat-icon",26),t.qZA(),t.TgZ(41,"mat-hint",27),t._uU(42,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t._UZ(43,"angular-editor",28),t.qZA()()(),t.TgZ(44,"div",9)(45,"div",2)(46,"div",29),t._UZ(47,"div",30),t.TgZ(48,"div",31)(49,"a",32),t._UZ(50,"mat-icon",33),t._uU(51," Batal "),t.qZA()(),t.TgZ(52,"div",31)(53,"button",34),t._uU(54," Simpan "),t._UZ(55,"mat-icon",35),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(37),i=t.oxw();t.Q6J("formGroup",i.fg),t.xp6(11),t.Q6J("src",i.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.imageErrorText),t.xp6(1),t.Q6J("ngIf",i.image&&!i.fg.value.image),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("title").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",i.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",i.GS.separatorKeysCodes)("matChipInputFor",e)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("config",i.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",i.submitted),t.xp6(4),t.Q6J("disabled",i.submitted||i.fg.invalid)}}let ua=(()=>{class a{constructor(e,i,n,r,l,d,b){this.fb=e,this.router=i,this.bs=n,this.imgbb=r,this.news=l,this.gs=d,this.ds=b,this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.gambar=null,this.subsNews=null,this.subsImgbb=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}ngOnInit(){this.gs.isBrowser&&this.initForm()}ngOnDestroy(){this.subsImgbb?.unsubscribe(),this.subsNews?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){this.fg=this.fb.group({title:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],content:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],image:[null,o.kI.compose([o.kI.pattern(u.t.regexUrl)])],tags:[[],o.kI.compose([])]})}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null);const n=e.target.files[0];try{const r=new FileReader;r.readAsDataURL(n),r.onload=l=>{if(this.gs.log("[IMAGE_SELECTED]",l),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=r.result.toString()},d.src=r.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url="/assets/img/form/no-image.png",this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNews=this.news.createNews({image:this.fg.value.image,title:this.fg.value.title,content:this.fg.value.content,tags:this.fg.value.tags}).subscribe({next:e=>{this.gs.log("[NEWS_CREATE_SUCCESS]",e),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl("/news",{state:{bypassCanDeactivate:!0}})},error:e=>{this.gs.log("[NEWS_CREATE_ERROR]",e,"error"),this.submitted=!1,this.bs.idle()}})}addTag(e){const i=e.input,n=e.value;(n||"").trim()&&this.fg.value.tags.push(n.trim()),i&&(i.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((r,l,d)=>d.findIndex(b=>b===r)===l))}removeTag(e){const i=this.fg.value.tags.indexOf(e);i>=0&&this.fg.value.tags.splice(i,1)}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(o.QS),t.Y36(h.F0),t.Y36(D.z),t.Y36(j.X),t.Y36(ia.Y),t.Y36(f.U),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","title","placeholder","Berita Terkini Blablabla ...","required",""],["fontIcon","wysiwyg","matSuffix",""],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["align","end"],["formControlName","content","required","",1,"py-3","w-100",3,"config"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/news",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,ma,56,19,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.sg,m.O5,h.rH,A.eB,A.Nr,x.ir,x.lw,x.IP,x.Y6,Q.Hw,g.nI,g.v_,g.pH,g.$V,g.nX,R.k0,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,k.Yh,M.t,C.s6,V.$]})}return a})();var da=c(3201);function _a(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat URL Tidak Boleh Kosong"),t.qZA())}function ga(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Format Alamat URL Salah"),t.qZA())}function pa(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Ekspektasi Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function fa(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Alamat Surel Tidak Boleh Kosong"),t.qZA())}function ha(a,s){1&a&&(t.TgZ(0,"div"),t._uU(1,"Format Alamat Surel Salah"),t.qZA())}function ba(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Buat Laporan Pelanggaran Penyalahgunaan"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"mat-form-field",11)(11,"mat-label"),t._uU(12,"URL Link Tautan Yang Di Laporkan"),t.qZA(),t._UZ(13,"input",12)(14,"mat-icon",13),t.TgZ(15,"mat-error"),t.YNc(16,_a,2,0,"div",14),t.YNc(17,ga,2,0,"div",14),t.qZA()(),t._UZ(18,"angular-editor",15),t.TgZ(19,"mat-form-field",11)(20,"mat-label"),t._uU(21,"Ekspektasi Hasil Yang Diharapkan"),t.qZA(),t._UZ(22,"input",16)(23,"mat-icon",13),t.TgZ(24,"mat-error"),t.YNc(25,pa,2,0,"div",14),t.qZA()()()(),t.TgZ(26,"div",17)(27,"div",9)(28,"mat-form-field",11)(29,"mat-label"),t._uU(30,"Surel Informasi Proses Hasil Tindak Lanjut"),t.qZA(),t._UZ(31,"input",18)(32,"mat-icon",19),t.TgZ(33,"mat-error"),t.YNc(34,fa,2,0,"div",14),t.YNc(35,ha,2,0,"div",14),t.qZA()(),t.TgZ(36,"div",20)(37,"re-captcha",21,22),t.NdJ("resolved",function(n){t.CHM(e);const r=t.MAs(38),l=t.oxw();return t.KtG(l.captcha(n,r))}),t.qZA()()()()(),t.TgZ(39,"div",9)(40,"div",2)(41,"div",23),t._UZ(42,"div",24),t.TgZ(43,"div",25)(44,"a",26),t._UZ(45,"mat-icon",27),t._uU(46," Batal "),t.qZA()(),t.TgZ(47,"div",25)(48,"button",28),t._uU(49," Simpan "),t._UZ(50,"mat-icon",29),t.qZA()()()()()()()()}if(2&a){const e=t.oxw();t.Q6J("formGroup",e.fg),t.xp6(10),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("url").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("url").hasError("pattern")),t.xp6(1),t.Q6J("config",e.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("expected_solution").hasError("pattern")),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("contact_email").hasError("required")),t.xp6(1),t.Q6J("ngIf",e.fg.get("contact_email").hasError("pattern")),t.xp6(2),t.Q6J("siteKey",e.G_CAPTCHA_SITE_KEY),t.xp6(7),t.Q6J("disabled",e.submitted),t.xp6(4),t.Q6J("disabled",e.submitted||e.fg.invalid)}}const xa=[{path:"",pathMatch:"full",redirectTo:"/home"},{path:"berkas",component:he,canActivate:[U.t],canDeactivate:[Z],data:{title:"Berkas - Buat Baru",description:"Halaman Unggah Berkas Baru",keywords:"Tambah Berkas Baru",[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR,p.yS.FANSUBBER,p.yS.USER]}},{path:"fansub",component:Ye,canActivate:[N.H,U.t],canDeactivate:[Z],data:{title:"Fansub - Buat Baru",description:"Halaman Menambahkan Fansub Baru",keywords:"Create Fansub",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR,p.yS.FANSUBBER,p.yS.USER]}},{path:"mailbox",component:aa,canActivate:[N.H,U.t],canDeactivate:[Z],data:{title:"Surel - Buat Baru",description:"Halaman Kirim Surel Baru",keywords:"Buat Surel Baru",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR,p.yS.FANSUBBER,p.yS.USER]}},{path:"news",component:ua,canActivate:[N.H,U.t],canDeactivate:[Z],data:{title:"Berita - Buat Baru",description:"Halaman Unggah Berita Baru",keywords:"Tambah Berita Baru",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[p.yS.ADMIN,p.yS.MODERATOR]}},{path:"ticket",component:(()=>{class a{constructor(e,i,n,r,l,d,b,S){this.activatedRoute=e,this.fb=i,this.router=n,this.as=r,this.bs=l,this.ticket=d,this.gs=b,this.ds=S,this.captchaRef=null,this.submitted=!1,this.subsUser=null,this.subsDialog=null,this.subsTicket=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get G_CAPTCHA_SITE_KEY(){return u.t.gCaptchaSiteKey}ngOnInit(){this.gs.isBrowser&&(this.initForm(),this.subsUser=this.as.currentUser.subscribe({next:e=>{e&&this.fg?.controls.contact_email?.patchValue(e._email)}}))}ngOnDestroy(){this.subsUser?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsTicket?.unsubscribe()}canDeactivate(){var e=this;return(0,E.Z)(function*(){const i=yield e.ds.leavePageDialog();return yield J(i)})()}initForm(){const e=this.activatedRoute.snapshot.queryParamMap.get("url")||null;this.fg=this.fb.group({url:[e,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexUrl)])],contact_email:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEmail)])],reported_issue:[null,o.kI.compose([o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],expected_solution:[null,o.kI.compose([o.kI.pattern(u.t.regexEnglishKeyboardKeys)])],"g-recaptcha-response":[null,[o.kI.required,o.kI.pattern(u.t.regexEnglishKeyboardKeys)]]})}captcha(e,i){this.gs.log(`[GOOGLE_CAPTCHA] ${e}`),e?(this.captchaRef=i,this.fg.controls["g-recaptcha-response"].patchValue(e)):this.fg.value["g-recaptcha-response"]&&this.fg.controls["g-recaptcha-response"].patchValue(null)}showInfo(e){this.subsDialog=this.ds.openInfoDialog({data:{title:"Pembuatan Laporan",htmlMessage:e,confirmText:"Tutup"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INFO_DIALOG_CLOSED]",i),this.subsDialog.unsubscribe()}})}onSubmit(){if(this.bs.busy(),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsTicket=this.ticket.createTicket({url:this.fg.value.url,contact_email:this.fg.value.contact_email,reported_issue:this.fg.value.reported_issue,expected_solution:this.fg.value.expected_solution,"g-recaptcha-response":this.fg.value["g-recaptcha-response"]}).subscribe({next:e=>{this.gs.log("[NEWS_CREATE_SUCCESS]",e);const i=`${H.N.baseUrl}/ticket/${e.result.id}?secret=${e.result.secret}`;this.showInfo(`\n Terima kasih telah turut ikut serta dalam menjaga dan mengawasi ${H.N.siteName}.\n Harap simpan URL dan gunakan untuk melihat progressnya ::\n ${i}\n `),this.submitted=!1,this.bs.idle(),this.router.navigate([`/ticket/${e.result.id}`],{state:{bypassCanDeactivate:!0},queryParams:{secret:e.result.secret}})},error:e=>{this.gs.log("[NEWS_CREATE_ERROR]",e,"error"),this.showInfo(e.result?.message||e.info),this.submitted=!1,this.bs.idle()}})}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(h.gz),t.Y36(o.QS),t.Y36(h.F0),t.Y36(Y.e),t.Y36(D.z),t.Y36(da.w),t.Y36(f.U),t.Y36(F.x))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-ticket-create"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","url","placeholder","https://sub-domain.fansub.id/berkas/konten-melanggar.html","required","","matTooltip","Alamat URL yang ingin kamu laporkan"],["fontIcon","wysiwyg","matSuffix",""],[4,"ngIf"],["formControlName","reported_issue","required","",1,"py-3","w-100",3,"config"],["matInput","","formControlName","expected_solution","placeholder","Harap kontent tersebut di hapus dan akun yang bersangkutan segera di tangguhkan ..."],[1,"col-12","col-md-5","col-xl-4","p-3"],["matInput","","formControlName","contact_email","placeholder","email-untuk-info-update@example.com","required","","matTooltip","Kami akan mengirimkan informasi jika laporanmu sudah selesai ditangani melalui surel ini"],["fontIcon","alternate_email","matSuffix",""],[1,"py-3","col-12"],["formControlName","g-recaptcha-response",3,"siteKey","resolved"],["captchaRef",""],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","/news",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,ba,51,13,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[m.O5,h.rH,A.eB,A.Nr,Q.Hw,g.nI,g.v_,g.$V,g.nX,R.k0,K.Kd,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,M.t,C.s6,T.wT,T.Vd]})}return a})(),canDeactivate:[Z],data:{title:"Ticket - Permintaan Baru",description:"Halaman Permohonan Baru",keywords:"Ajukan Permintaan Permohonan"}}];let Ca=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.oAB({type:a});static#a=this.\u0275inj=t.cJS({imports:[m.ez,h.Bz.forChild(xa),_.m,o.u5,o.UX,k.Ad,v.F,C.UM,I.T,T.a,T.lQ]})}return a})()},4758:(z,y,c)=>{c.d(y,{t:()=>t});var m=c(4650),h=c(1390),o=c(9816),C=c(8598),k=c(6895),T=c(5882);function u(f,Z){if(1&f&&m._UZ(0,"div",4),2&f){const _=m.oxw();m.Udp("background-size",_.GS.sizeContain?"contain":"cover")("background-image","url("+_.GS.bannerImg+")")("background-repeat",_.GS.bgRepeat?"repeat-x":"no-repeat")("height",_.ROUTER.url.startsWith("/news")||_.ROUTER.url.startsWith("/berkas")||_.ROUTER.url.startsWith("/fansub")?"192px":"128px")("background-position-y",_.ROUTER.url.startsWith("/berkas")?"22.5%":"")}}function p(f,Z){if(1&f&&(m.TgZ(0,"strong",10),m._uU(1," -- "),m.TgZ(2,"i")(3,"a",11),m._uU(4),m.qZA()()()),2&f){const _=m.oxw().$implicit;m.xp6(3),m.MGl("routerLink","/user/",_.notifCreator,""),m.xp6(1),m.hij(" ",_.notifCreator," ")}}function U(f,Z){if(1&f){const _=m.EpF();m.TgZ(0,"button",12),m.NdJ("click",function(){m.CHM(_);const v=m.oxw().$implicit,E=m.oxw();return m.KtG(E.removeNotif(v.notifData.id))}),m.qZA()}}function N(f,Z){if(1&f&&(m.TgZ(0,"div",5)(1,"div")(2,"strong",6),m._uU(3),m.qZA(),m._UZ(4,"span",7),m.ALo(5,"safeInnerHtml"),m.YNc(6,p,5,2,"strong",8),m.YNc(7,U,1,0,"button",9),m.qZA()()),2&f){const _=Z.$implicit;m.xp6(1),m.Gre("alert alert-",_.notifData.type," alert-dismissible fade show"),m.xp6(2),m.Oqu(_.notifData.title),m.xp6(1),m.Q6J("innerHTML",m.lcZ(5,7,_.notifData.content),m.oJD),m.xp6(2),m.Q6J("ngIf",_.notifCreator),m.xp6(1),m.Q6J("ngIf",_.notifData.dismissible)}}let t=(()=>{class f{constructor(_,I,v){this.router=_,this.gs=I,this.notif=v}ngOnInit(){}get GS(){return this.gs}get ROUTER(){return this.router}get NOTIF(){return this.notif}removeNotif(_){this.notif.removeNotif(_)}static#t=this.\u0275fac=function(I){return new(I||f)(m.Y36(h.F0),m.Y36(o.U),m.Y36(C.T))};static#e=this.\u0275cmp=m.Xpm({type:f,selectors:[["app-notifications"]],decls:4,vars:2,consts:[["class","container-fluid notif-banner align-items-center",3,"background-size","background-image","background-repeat","height","background-position-y",4,"ngIf"],[1,"container"],[1,"row","pt-3"],["class","col-12",4,"ngFor","ngForOf"],[1,"container-fluid","notif-banner","align-items-center"],[1,"col-12"],[1,"me-1"],[3,"innerHTML"],["class","ms-1",4,"ngIf"],["type","button","class","btn-close","data-dismiss","alert",3,"click",4,"ngIf"],[1,"ms-1"],[1,"text-decoration-none",3,"routerLink"],["type","button","data-dismiss","alert",1,"btn-close",3,"click"]],template:function(I,v){1&I&&(m.YNc(0,u,1,10,"div",0),m.TgZ(1,"div",1)(2,"div",2),m.YNc(3,N,8,9,"div",3),m.qZA()()),2&I&&(m.Q6J("ngIf",v.GS.bannerImg&&(v.ROUTER.url.startsWith("/news")||v.ROUTER.url.startsWith("/berkas")||v.ROUTER.url.startsWith("/fansub")||v.ROUTER.url.startsWith("/anime")||v.ROUTER.url.startsWith("/dorama"))),m.xp6(3),m.Q6J("ngForOf",v.NOTIF.notifications))},dependencies:[k.sg,k.O5,h.rH,T.H],styles:[".notif-banner[_ngcontent-%COMP%]{width:100%;background-size:cover;background-position:75% 50%}"]})}return f})()},6319:(z,y,c)=>{c.d(y,{F:()=>k});var m=c(6895),h=c(1390),o=c(3811),C=c(4650);let k=(()=>{class T{static#t=this.\u0275fac=function(U){return new(U||T)};static#e=this.\u0275mod=C.oAB({type:T});static#a=this.\u0275inj=C.cJS({imports:[m.ez,h.Bz,o.T]})}return T})()}}]); \ No newline at end of file diff --git a/dist/main-site/browser/655.4f87da37c01c6228.js b/dist/main-site/browser/655.01059e76a32a5cfb.js similarity index 69% rename from dist/main-site/browser/655.4f87da37c01c6228.js rename to dist/main-site/browser/655.01059e76a32a5cfb.js index 25402b98..b3a5d7d3 100644 --- a/dist/main-site/browser/655.4f87da37c01c6228.js +++ b/dist/main-site/browser/655.01059e76a32a5cfb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[655],{8438:(E,f,s)=>{s.r(f),s.d(f,{NewsModule:()=>ct});var g=s(6895),l=s(1390),m=s(4006),x=s(5128),_=s(7375),u=s(3659),N=s(1741),S=s(5816),y=s(7357),U=s(2314),D=s(3811),A=s(6533),L=s(9736),R=s(6319),J=s(7032),O=s(859),F=s(4529),Y=s(6356),B=s(4520),t=s(4650),v=s(3322),w=s(9816),C=s(5312),M=s(5141),I=s(8111),T=s(4758),P=s(291),Q=s(8124),K=s(5882);function H(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",5),t._UZ(7,"img",7),t.qZA(),t.TgZ(8,"div",8)(9,"app-material-chip",9),t.NdJ("chipClicked",function(n){t.CHM(e);const o=t.oxw();return t.KtG(o.openTag(n))}),t.qZA()()()()()(),t.TgZ(10,"div",10)(11,"div",6)(12,"div",11)(13,"div",5)(14,"h2",12)(15,"b",13),t._uU(16),t.qZA()()(),t.TgZ(17,"div",5),t._UZ(18,"hr",14),t.qZA(),t.TgZ(19,"div",5)(20,"h5",15),t._uU(21," .: "),t.TgZ(22,"a",16),t._uU(23),t.qZA(),t._uU(24),t.ALo(25,"date"),t.qZA()()(),t._UZ(26,"div",17),t.ALo(27,"safeInnerHtml"),t.qZA()()(),t.TgZ(28,"div",18)(29,"div",19)(30,"h2",20)(31,"b",13),t._uU(32,"Komentar"),t.qZA()()(),t.TgZ(33,"div",5)(34,"div",21),t._UZ(35,"app-discussion"),t.qZA()()()()}if(2&a){const e=t.oxw();t.xp6(7),t.s9C("src",e.newsData.image_url,t.LSH),t.xp6(2),t.Q6J("chipData",e.chipData),t.xp6(7),t.Oqu(e.newsData.title),t.xp6(6),t.MGl("routerLink","/user/",e.newsData.user_.username,""),t.xp6(1),t.hij(" ",e.newsData.user_.username," "),t.xp6(1),t.hij(" :: ",t.xi3(25,7,e.newsData.created_at,"d MMMM y, hh:mm:ss a z")," :. "),t.xp6(2),t.Q6J("innerHTML",t.lcZ(27,10,e.newsData.content),t.oJD)}}let G=(()=>{class a{constructor(e,i,n,o,r,d,p){this.activatedRoute=e,this.router=i,this.bs=n,this.gs=o,this.fs=r,this.pi=d,this.news=p,this.newsId=0,this.newsData=null,this.chipData=[],this.subsActRoute=null,this.subsNews=null,this.subsParam=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsNews?.unsubscribe(),this.subsParam?.unsubscribe()}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:e=>{this.newsId=Number(e.newsId),this.bs.busy(),this.subsNews=this.news.getNews(this.newsId).subscribe({next:i=>{if(this.gs.log("[NEWS_DETAIL_SUCCESS]",i),this.newsData=i.result,this.pi.updatePageMetaData(this.newsData.title,this.newsData.content,Array.isArray(this.newsData.tags)?this.newsData.tags.join(", "):this.newsData.title,this.newsData.image_url,this.newsData.user_.username),this.bs.idle(),this.gs.isBrowser){if(Array.isArray(this.newsData.tags))for(let n=0;n{this.gs.log("[NEWS_DETAIL_ERROR]",i,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/news"}})}})}})}openTag(e){this.gs.log("[FANSUB_DETAIL_OPEN_TAG]",e)}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(l.gz),t.Y36(l.F0),t.Y36(v.z),t.Y36(w.U),t.Y36(C.r),t.Y36(M.Z),t.Y36(I.Y))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-detail"]],decls:2,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","pb-3","px-0"],[1,"col-lg-4","col-xl-3"],[1,"row","sticky-top","pt-3"],[1,"col-12"],[1,"row"],[1,"w-100",3,"src"],[1,"col-12","p-3"],[3,"chipData","chipClicked"],[1,"col-lg-8","col-xl-9"],[1,"sticky-top","bg-bifeldy"],[1,"pt-3","m-0"],[1,"text-bifeldy"],[1,"my-1","border-bottom-dotted",2,"height","4px","background","url('/assets/img/stripe.png')"],[1,"pb-3","m-0","text-bifeldy"],[1,"text-warning","text-decoration-none",3,"routerLink"],[1,"col-12","pt-3","mt-3",3,"innerHTML"],[1,"row","pt-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"p-3"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.YNc(1,H,36,12,"div",0)),2&i&&(t.xp6(1),t.Q6J("ngIf",n.newsData))},dependencies:[g.O5,l.rH,T.t,P.G,Q.S,g.uU,K.H]})}return a})();var z=s(7245),k=s(2693),j=s(80),Z=s(9818),b=s(9923),$=s(7392),h=s(8455),W=s(9203),V=s(7443);function X(a,c){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function q(a,c){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageErrorText)}}function tt(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"div",2)(1,"button",36),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",37),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function et(a,c){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Tidak Boleh Kosong"),t.qZA())}function it(a,c){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function st(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",38),t.NdJ("removed",function(){const o=t.CHM(e).$implicit,r=t.oxw(2);return t.KtG(r.removeTag(o))}),t._uU(1),t._UZ(2,"mat-icon",39),t.qZA()}if(2&a){const e=c.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function at(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Perbaharui Data Berita & Informasi Baru"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),t._UZ(11,"img",11),t.TgZ(12,"mat-form-field",12)(13,"mat-label"),t._uU(14,"Gambar"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",13,14),t.NdJ("change",function(n){t.CHM(e);const o=t.MAs(16),r=t.oxw();return t.KtG(r.uploadImage(n,o))}),t.qZA(),t._UZ(17,"mat-icon",15),t.qZA(),t.TgZ(18,"mat-error",16)(19,"small"),t.YNc(20,X,3,3,"div",17),t.YNc(21,q,2,1,"div",17),t.qZA()()(),t.YNc(22,tt,4,1,"div",18),t.qZA()(),t.TgZ(23,"div",19)(24,"div",9)(25,"mat-form-field",20)(26,"mat-label"),t._uU(27,"Judul"),t.qZA(),t._UZ(28,"input",21)(29,"mat-icon",22),t.TgZ(30,"mat-error"),t.YNc(31,et,2,0,"div",17),t.YNc(32,it,2,0,"div",17),t.qZA()(),t.TgZ(33,"mat-form-field",20)(34,"mat-label"),t._uU(35,"Tags & Kategori"),t.qZA(),t.TgZ(36,"mat-chip-list",null,23),t.YNc(38,st,3,2,"mat-chip",24),t.TgZ(39,"input",25),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const o=t.oxw();return t.KtG(o.addTag(n))}),t.qZA(),t._UZ(40,"mat-icon",26),t.qZA(),t.TgZ(41,"mat-hint",27),t._uU(42,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t._UZ(43,"angular-editor",28),t.qZA()()(),t.TgZ(44,"div",9)(45,"div",2)(46,"div",29),t._UZ(47,"div",30),t.TgZ(48,"div",31)(49,"a",32),t._UZ(50,"mat-icon",33),t._uU(51," Batal "),t.qZA()(),t.TgZ(52,"div",31)(53,"button",34),t._uU(54," Simpan "),t._UZ(55,"mat-icon",35),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(37),i=t.oxw();t.Q6J("formGroup",i.fg),t.xp6(11),t.Q6J("src",i.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.imageErrorText),t.xp6(1),t.Q6J("ngIf",i.image&&!i.fg.value.image),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("title").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",i.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",i.GS.separatorKeysCodes)("matChipInputFor",e)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("config",i.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",i.submitted),t.xp6(4),t.Q6J("disabled",i.submitted||i.fg.invalid)}}let nt=(()=>{class a{constructor(e,i,n,o,r,d,p,dt,ut){this.fb=e,this.router=i,this.bs=n,this.activatedRoute=o,this.imgbb=r,this.news=d,this.toast=p,this.gs=dt,this.as=ut,this.newsId=0,this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.gambar=null,this.subsActRoute=null,this.subsNewsUpdate=null,this.subsNewsDetail=null,this.subsImgbb=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}ngOnInit(){this.gs.isBrowser&&(this.newsId=Number(this.activatedRoute.snapshot.paramMap.get("newsId")),this.bs.busy(),this.subsNewsDetail=this.news.getNews(this.newsId).subscribe({next:e=>{this.gs.log("[NEWS_DETAIL_SUCCESS]",e),this.bs.idle(),this.as.currentUserSubject?.value?.id!==e.result.user_.id?(this.toast.warning("Berita Ini Milik Orang Lain","Whoops!",null,!0),this.router.navigateByUrl(`/news/${this.newsId}`)):this.initForm(e.result)},error:e=>{this.gs.log("[NEWS_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/news/${this.newsId}`}})}}))}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsNewsUpdate?.unsubscribe(),this.subsNewsDetail?.unsubscribe(),this.subsImgbb?.unsubscribe()}initForm(e){this.image_url=e.image_url,this.image_url_original=this.image_url,this.fg=this.fb.group({title:[e.title,m.kI.compose([m.kI.required,m.kI.pattern(u.t.regexEnglishKeyboardKeys)])],content:[e.content,m.kI.compose([m.kI.required,m.kI.pattern(u.t.regexEnglishKeyboardKeys)])],image:[null,m.kI.compose([m.kI.pattern(u.t.regexUrl)])],tags:[e.tags,m.kI.compose([])]})}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const n=e.target.files[0];try{const o=new FileReader;o.readAsDataURL(n),o.onload=r=>{if(this.gs.log("[IMAGE_SELECTED]",r),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=o.result.toString()},d.src=o.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url=this.image_url_original,this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e=this.gs.getDirtyValues(this.fg);if(this.gs.log("[NEWS_EDIT_DIRTY]",e),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNewsUpdate=this.news.updateNews(this.newsId,{...e}).subscribe({next:i=>{this.gs.log("[NEWS_EDIT_SUCCESS]",i),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/news/${this.newsId}`)},error:i=>{this.gs.log("[NEWS_EDIT_ERROR]",i,"error"),this.submitted=!1,this.bs.idle()}})}addTag(e){const i=e.input,n=e.value;(n||"").trim()&&this.fg.value.tags.push(n.trim()),i&&(i.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((o,r,d)=>d.findIndex(p=>p===o)===r)),this.fg.controls.tags.markAsDirty()}removeTag(e){const i=this.fg.value.tags.indexOf(e);i>=0&&this.fg.value.tags.splice(i,1)}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(m.QS),t.Y36(l.F0),t.Y36(v.z),t.Y36(l.gz),t.Y36(z.X),t.Y36(I.Y),t.Y36(k.k),t.Y36(w.U),t.Y36(j.e))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-edit"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","title","placeholder","Berita Terkini Blablabla ..."],["fontIcon","wysiwyg","matSuffix",""],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["align","end"],["formControlName","content",1,"py-3","w-100",3,"config"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,at,56,19,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[g.sg,g.O5,l.rH,Z.eB,Z.Nr,b.ir,b.lw,b.IP,b.Y6,$.Hw,h.nI,h.v_,h.pH,h.$V,h.nX,W.k0,m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,x.Yh,T.t,_.s6,V.$]})}return a})();var ot=s(4272),rt=s(1338),lt=s(2510),mt=s(183);const gt=[{path:"",pathMatch:"full",component:(()=>{class a{constructor(e,i,n,o,r){this.router=e,this.gs=i,this.bs=n,this.news=o,this.fs=r,this.newsData=[],this.tabData=[{name:"Semua Berita & Informasi",icon:"file_copy",type:"table",data:{column:["Tanggal","Image","Topik","Penulis"],row:[]}}],this.count=0,this.page=1,this.row=25,this.tablePageSizeOptions=[25,50,75,100,125],this.q="",this.sort="",this.order="",this.subsNews=null,this.gs.bannerImg="/assets/img/banner/news.png",this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnDestroy(){this.subsNews?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&this.getNews()}getNews(){this.bs.busy(),this.subsNews&&(this.subsNews.unsubscribe(),this.bs.idle()),this.subsNews=this.news.getAllNews(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[NEWS_LIST_SUCCESS]",e),this.count=e.count,this.newsData=[];for(const i of e.results)this.newsData.push({id:i.id,Topik:i.title,Image:i.image_url,Tanggal:i.created_at,Penulis:i.user_.username,foto:i.user_.image_url});this.tabData[0].data.row=this.newsData,this.fs.initializeFab("add",null,"Tambah Berita Baru","/create/news",!1),this.bs.idle()},error:e=>{this.gs.log("[NEWS_LIST_ERROR]",e,"error"),this.bs.idle()}})}openNews(e){this.gs.log("[NEWS_LIST_CLICK_NEWS]",e),this.router.navigateByUrl(`/news/${e.id}`)}onPaginatorClicked(e){this.gs.log("[NEWS_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getNews()}onServerSideFilter(e){this.gs.log("[NEWS_LIST_ENTER_FILTER]",e),this.q=e,this.getNews()}onServerSideOrder(e){this.gs.log("[NEWS_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getNews()}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(l.F0),t.Y36(w.U),t.Y36(v.z),t.Y36(I.Y),t.Y36(C.r))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-list"]],decls:12,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-lg-8","col-xl-9"],[1,"row"],[3,"tablePageSizeOptions","tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"col-lg-4","col-xl-3"],[1,"row","sticky-top"],[1,"col-12"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"app-material-tab",4),t.NdJ("tableRowClicked",function(r){return n.openNews(r)})("paginatorClicked",function(r){return n.onPaginatorClicked(r)})("serverSideFilter",function(r){return n.onServerSideFilter(r)})("serverSideOrder",function(r){return n.onServerSideOrder(r)}),t.qZA()()(),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7),t._UZ(9,"app-banner-donasi")(10,"app-stats-server")(11,"app-banner-discord"),t.qZA()()()()()),2&i&&(t.xp6(5),t.Q6J("tablePageSizeOptions",n.tablePageSizeOptions)("tabData",n.tabData)("count",n.count)("serverSide",!0))},dependencies:[ot.u,rt.H,T.t,lt.B,mt.X]})}return a})()},{path:":newsId",children:[{path:"",pathMatch:"full",component:G},{path:"edit",component:nt,canActivate:[y.H,S.t],data:{title:"Berita - Ubah Data",description:"Halaman Pembaharuan Data Berita",keywords:"Ubah Berita",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[N.yS.ADMIN,N.yS.MODERATOR]}}]}];let ct=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.oAB({type:a});static#i=this.\u0275inj=t.cJS({imports:[g.ez,l.Bz.forChild(gt),Y.R,U.m,L.L,m.u5,m.UX,x.Ad,R.F,_.UM,O.R,J.A,A.P,F.R,D.T]})}return a})()},4520:(E,f,s)=>{s.d(f,{Q:()=>g});var g=(()=>{return(l=g||(g={})).BIRU="#7289DA",l.UNGU="#3F51B5",l.HITAM="#343A40",l.ABU="#A9A9A9",l.MERAH="#DC3545",l.PINK="#FF4081",l.OREN="#F44336",l.KUNING="#FFC107",l.HIJAU="#28A745",g;var l})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[655],{8438:(E,f,s)=>{s.r(f),s.d(f,{NewsModule:()=>ct});var g=s(6895),l=s(1390),m=s(4006),x=s(5128),_=s(7375),u=s(3659),N=s(1741),S=s(5816),y=s(7357),U=s(2314),D=s(3811),A=s(6533),L=s(9736),R=s(6319),J=s(7032),O=s(859),F=s(4529),Y=s(6356),B=s(4520),t=s(4650),v=s(3322),w=s(9816),C=s(5312),M=s(5141),I=s(8111),T=s(4758),P=s(291),Q=s(8124),K=s(5882);function H(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"div",5),t._UZ(7,"img",7),t.qZA(),t.TgZ(8,"div",8)(9,"app-material-chip",9),t.NdJ("chipClicked",function(n){t.CHM(e);const o=t.oxw();return t.KtG(o.openTag(n))}),t.qZA()()()()()(),t.TgZ(10,"div",10)(11,"div",6)(12,"div",11)(13,"div",5)(14,"h2",12)(15,"b",13),t._uU(16),t.qZA()()(),t.TgZ(17,"div",5),t._UZ(18,"hr",14),t.qZA(),t.TgZ(19,"div",5)(20,"h5",15),t._uU(21," .: "),t.TgZ(22,"a",16),t._uU(23),t.qZA(),t._uU(24),t.ALo(25,"date"),t.qZA()()(),t._UZ(26,"div",17),t.ALo(27,"safeInnerHtml"),t.qZA()()(),t.TgZ(28,"div",18)(29,"div",19)(30,"h2",20)(31,"b",13),t._uU(32,"Komentar"),t.qZA()()(),t.TgZ(33,"div",5)(34,"div",21),t._UZ(35,"app-discussion"),t.qZA()()()()}if(2&a){const e=t.oxw();t.xp6(7),t.s9C("src",e.newsData.image_url,t.LSH),t.xp6(2),t.Q6J("chipData",e.chipData),t.xp6(7),t.Oqu(e.newsData.title),t.xp6(6),t.MGl("routerLink","/user/",e.newsData.user_.username,""),t.xp6(1),t.hij(" ",e.newsData.user_.username," "),t.xp6(1),t.hij(" :: ",t.xi3(25,7,e.newsData.created_at,"d MMMM y, hh:mm:ss a z")," :. "),t.xp6(2),t.Q6J("innerHTML",t.lcZ(27,10,e.newsData.content),t.oJD)}}let G=(()=>{class a{constructor(e,i,n,o,r,d,p){this.activatedRoute=e,this.router=i,this.bs=n,this.gs=o,this.fs=r,this.pi=d,this.news=p,this.newsId=0,this.newsData=null,this.chipData=[],this.subsActRoute=null,this.subsNews=null,this.subsParam=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsNews?.unsubscribe(),this.subsParam?.unsubscribe()}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:e=>{this.newsId=Number(e.newsId),this.bs.busy(),this.subsNews=this.news.getNews(this.newsId).subscribe({next:i=>{if(this.gs.log("[NEWS_DETAIL_SUCCESS]",i),this.newsData=i.result,this.pi.updatePageMetaData(this.newsData.title,this.newsData.content,Array.isArray(this.newsData.tags)?this.newsData.tags.join(", "):this.newsData.title,this.newsData.image_url,this.newsData.user_.username),this.bs.idle(),this.gs.isBrowser){if(Array.isArray(this.newsData.tags))for(let n=0;n{this.gs.log("[NEWS_DETAIL_ERROR]",i,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/news"}})}})}})}openTag(e){this.gs.log("[FANSUB_DETAIL_OPEN_TAG]",e)}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(l.gz),t.Y36(l.F0),t.Y36(v.z),t.Y36(w.U),t.Y36(C.r),t.Y36(M.Z),t.Y36(I.Y))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-detail"]],decls:2,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","pb-3","px-0"],[1,"col-lg-4","col-xl-3"],[1,"row","sticky-top","pt-3"],[1,"col-12"],[1,"row"],[1,"w-100",3,"src"],[1,"col-12","p-3"],[3,"chipData","chipClicked"],[1,"col-lg-8","col-xl-9"],[1,"sticky-top","bg-bifeldy"],[1,"pt-3","m-0"],[1,"text-bifeldy"],[1,"my-1","border-bottom-dotted",2,"height","4px","background","url('/assets/img/stripe.png')"],[1,"pb-3","m-0","text-bifeldy"],[1,"text-warning","text-decoration-none",3,"routerLink"],[1,"col-12","pt-3","mt-3",3,"innerHTML"],[1,"row","pt-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"p-3"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.YNc(1,H,36,12,"div",0)),2&i&&(t.xp6(1),t.Q6J("ngIf",n.newsData))},dependencies:[g.O5,l.rH,T.t,P.G,Q.S,g.uU,K.H]})}return a})();var z=s(7245),k=s(2693),j=s(80),Z=s(9818),b=s(9923),$=s(7392),h=s(8455),W=s(9203),V=s(7443);function X(a,c){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function q(a,c){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.Oqu(e.imageErrorText)}}function tt(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"div",2)(1,"button",36),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.submitImage())}),t._UZ(2,"mat-icon",37),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("disabled",e.submitted)}}function et(a,c){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Tidak Boleh Kosong"),t.qZA())}function it(a,c){1&a&&(t.TgZ(0,"div"),t._uU(1,"Judul Berita Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function st(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",38),t.NdJ("removed",function(){const o=t.CHM(e).$implicit,r=t.oxw(2);return t.KtG(r.removeTag(o))}),t._uU(1),t._UZ(2,"mat-icon",39),t.qZA()}if(2&a){const e=c.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function at(a,c){if(1&a){const e=t.EpF();t.TgZ(0,"form",4),t.NdJ("submit",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.onSubmit())}),t.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),t._uU(5,"Perbaharui Data Berita & Informasi Baru"),t.qZA()()(),t.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),t._UZ(11,"img",11),t.TgZ(12,"mat-form-field",12)(13,"mat-label"),t._uU(14,"Gambar"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",13,14),t.NdJ("change",function(n){t.CHM(e);const o=t.MAs(16),r=t.oxw();return t.KtG(r.uploadImage(n,o))}),t.qZA(),t._UZ(17,"mat-icon",15),t.qZA(),t.TgZ(18,"mat-error",16)(19,"small"),t.YNc(20,X,3,3,"div",17),t.YNc(21,q,2,1,"div",17),t.qZA()()(),t.YNc(22,tt,4,1,"div",18),t.qZA()(),t.TgZ(23,"div",19)(24,"div",9)(25,"mat-form-field",20)(26,"mat-label"),t._uU(27,"Judul"),t.qZA(),t._UZ(28,"input",21)(29,"mat-icon",22),t.TgZ(30,"mat-error"),t.YNc(31,et,2,0,"div",17),t.YNc(32,it,2,0,"div",17),t.qZA()(),t.TgZ(33,"mat-form-field",20)(34,"mat-label"),t._uU(35,"Tags & Kategori"),t.qZA(),t.TgZ(36,"mat-chip-list",null,23),t.YNc(38,st,3,2,"mat-chip",24),t.TgZ(39,"input",25),t.NdJ("matChipInputTokenEnd",function(n){t.CHM(e);const o=t.oxw();return t.KtG(o.addTag(n))}),t.qZA(),t._UZ(40,"mat-icon",26),t.qZA(),t.TgZ(41,"mat-hint",27),t._uU(42,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t._UZ(43,"angular-editor",28),t.qZA()()(),t.TgZ(44,"div",9)(45,"div",2)(46,"div",29),t._UZ(47,"div",30),t.TgZ(48,"div",31)(49,"a",32),t._UZ(50,"mat-icon",33),t._uU(51," Batal "),t.qZA()(),t.TgZ(52,"div",31)(53,"button",34),t._uU(54," Simpan "),t._UZ(55,"mat-icon",35),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(37),i=t.oxw();t.Q6J("formGroup",i.fg),t.xp6(11),t.Q6J("src",i.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.imageErrorText),t.xp6(1),t.Q6J("ngIf",i.image&&!i.fg.value.image),t.xp6(3),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("title").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("title").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",i.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",i.GS.separatorKeysCodes)("matChipInputFor",e)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("config",i.GS.angularEditorConfig),t.xp6(6),t.Q6J("disabled",i.submitted),t.xp6(4),t.Q6J("disabled",i.submitted||i.fg.invalid)}}let nt=(()=>{class a{constructor(e,i,n,o,r,d,p,dt,ut){this.fb=e,this.router=i,this.bs=n,this.activatedRoute=o,this.imgbb=r,this.news=d,this.toast=p,this.gs=dt,this.as=ut,this.newsId=0,this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.gambar=null,this.subsActRoute=null,this.subsNewsUpdate=null,this.subsNewsDetail=null,this.subsImgbb=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}ngOnInit(){this.gs.isBrowser&&(this.newsId=Number(this.activatedRoute.snapshot.paramMap.get("newsId")),this.bs.busy(),this.subsNewsDetail=this.news.getNews(this.newsId).subscribe({next:e=>{this.gs.log("[NEWS_DETAIL_SUCCESS]",e),this.bs.idle(),this.as.currentUserSubject?.value?.id!==e.result.user_.id?(this.toast.warning("Berita Ini Milik Orang Lain","Whoops!",null,!0),this.router.navigateByUrl(`/news/${this.newsId}`)):this.initForm(e.result)},error:e=>{this.gs.log("[NEWS_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/news/${this.newsId}`}})}}))}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsNewsUpdate?.unsubscribe(),this.subsNewsDetail?.unsubscribe(),this.subsImgbb?.unsubscribe()}initForm(e){this.image_url=e.image_url,this.image_url_original=this.image_url,this.fg=this.fb.group({title:[e.title,m.kI.compose([m.kI.required,m.kI.pattern(u.t.regexEnglishKeyboardKeys)])],content:[e.content,m.kI.compose([m.kI.required,m.kI.pattern(u.t.regexEnglishKeyboardKeys)])],image:[null,m.kI.compose([m.kI.pattern(u.t.regexUrl)])],tags:[e.tags,m.kI.compose([])]})}uploadImage(e,i){this.gambar=i,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const n=e.target.files[0];try{const o=new FileReader;o.readAsDataURL(n),o.onload=r=>{if(this.gs.log("[IMAGE_SELECTED]",r),n.size<=u.t.fileSizeImageLimit){const d=this.gs.document.createElement("img");d.onload=()=>{this.image=n,this.image_url=o.result.toString()},d.src=o.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=u.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url=this.image_url_original,this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e=this.gs.getDirtyValues(this.fg);if(this.gs.log("[NEWS_EDIT_DIRTY]",e),this.submitted=!0,this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNewsUpdate=this.news.updateNews(this.newsId,{...e}).subscribe({next:i=>{this.gs.log("[NEWS_EDIT_SUCCESS]",i),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/news/${this.newsId}`)},error:i=>{this.gs.log("[NEWS_EDIT_ERROR]",i,"error"),this.submitted=!1,this.bs.idle()}})}addTag(e){const i=e.input,n=e.value;(n||"").trim()&&this.fg.value.tags.push(n.trim()),i&&(i.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((o,r,d)=>d.findIndex(p=>p===o)===r)),this.fg.controls.tags.markAsDirty()}removeTag(e){const i=this.fg.value.tags.indexOf(e);i>=0&&this.fg.value.tags.splice(i,1)}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(m.QS),t.Y36(l.F0),t.Y36(v.z),t.Y36(l.gz),t.Y36(z.X),t.Y36(I.Y),t.Y36(k.k),t.Y36(w.U),t.Y36(j.e))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-edit"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","p-3"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","title","placeholder","Berita Terkini Blablabla ..."],["fontIcon","wysiwyg","matSuffix",""],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["align","end"],["formControlName","content",1,"py-3","w-100",3,"config"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,at,56,19,"form",3),t.qZA()()()),2&i&&(t.xp6(4),t.Q6J("ngIf",n.fg))},dependencies:[g.sg,g.O5,l.rH,Z.eB,Z.Nr,b.ir,b.lw,b.IP,b.Y6,$.Hw,h.nI,h.v_,h.pH,h.$V,h.nX,W.k0,m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,x.Yh,T.t,_.s6,V.$]})}return a})();var ot=s(4272),rt=s(1338),lt=s(2510),mt=s(183);const gt=[{path:"",pathMatch:"full",component:(()=>{class a{constructor(e,i,n,o,r){this.router=e,this.gs=i,this.bs=n,this.news=o,this.fs=r,this.newsData=[],this.tabData=[{name:"Semua Berita & Informasi",icon:"file_copy",type:"table",data:{column:["Tanggal","Image","Topik","Penulis"],row:[]}}],this.count=0,this.page=1,this.row=25,this.tablePageSizeOptions=[25,50,75,100,125],this.q="",this.sort="",this.order="",this.subsNews=null,this.gs.bannerImg="/assets/img/banner/news.png",this.gs.sizeContain=!1,this.gs.bgRepeat=!1}ngOnDestroy(){this.subsNews?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&this.getNews()}getNews(){this.bs.busy(),this.subsNews&&(this.subsNews.unsubscribe(),this.bs.idle()),this.subsNews=this.news.getAllNews(this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[NEWS_LIST_SUCCESS]",e),this.count=e.count,this.newsData=[];for(const i of e.results)this.newsData.push({id:i.id,Topik:i.title,Image:i.image_url,Tanggal:i.created_at,Penulis:i.user_.username,foto:i.user_.image_url});this.tabData[0].data.row=this.newsData,this.fs.initializeFab("add",null,"Tambah Berita Baru","/create/news",!1),this.bs.idle()},error:e=>{this.gs.log("[NEWS_LIST_ERROR]",e,"error"),this.bs.idle()}})}openNews(e){this.gs.log("[NEWS_LIST_CLICK_NEWS]",e),this.router.navigateByUrl(`/news/${e.id}`)}onPaginatorClicked(e){this.gs.log("[NEWS_LIST_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getNews()}onServerSideFilter(e){this.gs.log("[NEWS_LIST_ENTER_FILTER]",e),this.q=e,this.getNews()}onServerSideOrder(e){this.gs.log("[NEWS_LIST_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getNews()}static#t=this.\u0275fac=function(i){return new(i||a)(t.Y36(l.F0),t.Y36(w.U),t.Y36(v.z),t.Y36(I.Y),t.Y36(C.r))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-news-list"]],decls:12,vars:4,consts:[[1,"container"],[1,"row","pb-3","px-0"],[1,"col-lg-8","col-xl-9"],[1,"row"],[3,"tablePageSizeOptions","tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"col-lg-4","col-xl-3"],[1,"row","sticky-top"],[1,"col-12"]],template:function(i,n){1&i&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1)(3,"div",2)(4,"div",3)(5,"app-material-tab",4),t.NdJ("tableRowClicked",function(r){return n.openNews(r)})("paginatorClicked",function(r){return n.onPaginatorClicked(r)})("serverSideFilter",function(r){return n.onServerSideFilter(r)})("serverSideOrder",function(r){return n.onServerSideOrder(r)}),t.qZA()()(),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7),t._UZ(9,"app-banner-donasi")(10,"app-stats-server")(11,"app-banner-discord"),t.qZA()()()()()),2&i&&(t.xp6(5),t.Q6J("tablePageSizeOptions",n.tablePageSizeOptions)("tabData",n.tabData)("count",n.count)("serverSide",!0))},dependencies:[ot.u,rt.H,T.t,lt.B,mt.X]})}return a})()},{path:":newsId",children:[{path:"",pathMatch:"full",component:G},{path:"edit",component:nt,canActivate:[y.H,S.t],data:{title:"Berita - Ubah Data",description:"Halaman Pembaharuan Data Berita",keywords:"Ubah Berita",[u.t.decoratorVerifiedOnly]:!0,[u.t.decoratorRoles]:[N.yS.ADMIN,N.yS.MODERATOR]}}]}];let ct=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.oAB({type:a});static#i=this.\u0275inj=t.cJS({imports:[g.ez,l.Bz.forChild(gt),Y.R,U.m,L.L,m.u5,m.UX,x.Ad,R.F,_.UM,O.R,J.A,A.P,F.R,D.T]})}return a})()},4520:(E,f,s)=>{s.d(f,{Q:()=>g});var g=(()=>{return(l=g||(g={})).BIRU="#7289DA",l.UNGU="#3F51B5",l.HITAM="#343A40",l.ABU="#A9A9A9",l.MERAH="#DC3545",l.PINK="#FF4081",l.OREN="#F44336",l.KUNING="#FFC107",l.HIJAU="#28A745",g;var l})()}}]); \ No newline at end of file diff --git a/dist/main-site/browser/745.2cff08e60a2e91a2.js b/dist/main-site/browser/745.2a3a9ae260159e1e.js similarity index 89% rename from dist/main-site/browser/745.2cff08e60a2e91a2.js rename to dist/main-site/browser/745.2a3a9ae260159e1e.js index 5166dd44..277abde2 100644 --- a/dist/main-site/browser/745.2cff08e60a2e91a2.js +++ b/dist/main-site/browser/745.2a3a9ae260159e1e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[745],{1745:(M,x,o)=>{o.r(x),o.d(x,{FansubModule:()=>be});var b=o(6895),r=o(1390),u=o(4006),T=o(7375),f=o(4561),S=o(5128),g=o(3659),h=o(1741),k=o(5816),y=o(7357),d=o(2314),F=o(3811),m=o(9736),_=o(6533),v=o(6319),C=o(9560),R=o(8866),$=o(5208),z=o(7272),t=o(4650),N=o(9816),L=o(3322),Q=o(5312),P=o(3842),K=o(8151),G=o(1338),O=o(4758);function V(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.barChartAnimeData)("labels",e.barChartAnimeLabels)("chartType",e.barChartType)("options",e.barChartAnimeOptions)("plugins",e.chartPlugins)("legend",!1)}}function W(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.barChartDoramaData)("labels",e.barChartDoramaLabels)("chartType",e.barChartType)("options",e.barChartDoramaOptions)("plugins",e.chartPlugins)("legend",!1)}}function X(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.pieChartStatusData)("labels",e.pieChartStatusLabels)("chartType",e.pieChartType)("options",e.pieChartStatusOptions)("plugins",e.chartPlugins)("legend",!0)}}function tt(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.doughnutChartGarapanData)("labels",e.doughnutChartGarapanLabels)("chartType",e.doughnutChartType)("options",e.doughnutChartGarapanOptions)("plugins",e.chartPlugins)("legend",!0)}}let et=(()=>{class a{constructor(e,s,i,n,c,p,A){this.activatedRoute=e,this.router=s,this.gs=i,this.bs=n,this.fs=c,this.fansub=p,this.wb=A,this.allFansubId=[],this.fansubData=[],this.tabData=[{name:"Katalog Fansub",icon:"closed_caption",type:"table",data:{column:["Status","Logo","Nama Fansub","Anime","Dorama","Tautan Komunitas"],row:[]}}],this.pieChartStatusOptions={title:{display:!0,text:"Kondisi Fansub Terkini"},responsive:!0,legend:{position:"right"}},this.doughnutChartGarapanOptions={title:{display:!0,text:"Total Garapan Fansub"},responsive:!0,legend:{position:"right"}},this.barChartAnimeOptions={title:{display:!0,text:"Garapan Anime Terbanyak"},responsive:!0,legend:{position:"right"},scales:{xAxes:[{ticks:{beginAtZero:!0},gridLines:{color:"rgba(92,92,92,1)"}}],yAxes:[{gridLines:{color:"rgba(92,92,92,1)"}}]}},this.barChartDoramaOptions={title:{display:!0,text:"Garapan Dorama Terbanyak"},responsive:!0,legend:{position:"right"},scales:{xAxes:[{ticks:{beginAtZero:!0},gridLines:{color:"rgba(92,92,92,1)"}}],yAxes:[{gridLines:{color:"rgba(92,92,92,1)"}}]}},this.chartPlugins=[],this.pieChartStatusData=[],this.pieChartStatusLabels=[],this.doughnutChartGarapanData=[],this.doughnutChartGarapanLabels=[],this.barChartAnimeData=[],this.barChartAnimeLabels=[],this.barChartDoramaData=[],this.barChartDoramaLabels=[],this.pieChartType="pie",this.doughnutChartType="doughnut",this.barChartType="horizontalBar",this.fansubActive=0,this.fansubInActive=0,this.subsFansub=null,this.subsAnime=null,this.subsDorama=null,this.subsQueryParam=null,this.subsInternetPositif=null,this.gs.bannerImg="/assets/img/banner/fansub.png",this.gs.sizeContain=!1,this.gs.bgRepeat=!1,this.gs.isBrowser&&((0,f.Dy)(),(0,f.bF)())}ngOnDestroy(){this.subsFansub?.unsubscribe(),this.subsAnime?.unsubscribe(),this.subsQueryParam?.unsubscribe(),this.subsInternetPositif?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&this.watchUrlRoute()}watchUrlRoute(){this.subsQueryParam=this.activatedRoute.queryParams.subscribe({next:e=>{this.bs.busy(),this.allFansubId=[],this.fansubData=[],this.fansubActive=0,this.fansubInActive=0,this.doughnutChartGarapanLabels=[],this.doughnutChartGarapanData=[],this.barChartAnimeLabels=[],this.barChartAnimeData=[],this.barChartDoramaLabels=[],this.barChartDoramaData=[],this.bs.idle(),this.getFansubData()}})}getFansubData(){this.bs.busy(),this.subsFansub=this.fansub.getAllFansub().subscribe({next:e=>{this.gs.log("[FANSUB_LIST_SUCCESS]",e);for(const s of e.results){this.allFansubId.push(s.id);const i=[];if(Object.keys(s.urls).length>0)for(const[c,p]of Object.entries(s.urls))i.push({type:"button",icon:"discord"===c||"twitter"===c?void 0:c,image:"discord"===c?"/assets/img/discord/blue.png":"twitter"===c?"/assets/img/twitter/blue.png":void 0,url:p,name:c});this.fansubData.push({id:s.id,slug:s.slug,Logo:s.image_url,Status:s.active?"AKTIF":"TIDAK AKTIF","Nama Fansub":s.name,"Tautan Komunitas":i}),s.active?this.fansubActive++:s.active||this.fansubInActive++}this.pieChartStatusLabels=["Aktif","Tidak Aktif"],this.pieChartStatusData=[this.fansubActive,this.fansubInActive],this.tabData[0].data.row=this.fansubData,this.allFansubId.length>0&&(this.getAnimeFansub(),this.getDoramaFansub(),this.checkInternetPositif()),this.fs.initializeFab("add",null,"Tambahkan Fansub Baru","/create/fansub",!1),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_LIST_ERROR]",e,"error"),this.bs.idle()}})}checkInternetPositif(){this.bs.busy();const s=[];for(let i=0;i{this.gs.log("[FANSUB_KOMINFO_SUCCESS]",i);for(const n of this.fansubData)i.results[n.id]&&(n.internet_positif=i.results[n.id])},error:i=>{this.gs.log("[FANSUB_KOMINFO_ERROR]",i,"error"),this.bs.idle()},complete:()=>{this.bs.idle()}})}getAnimeFansub(){this.bs.busy(),this.subsAnime=this.fansub.getAnimeFansub(this.allFansubId).subscribe({next:e=>{this.gs.log("[FANSUB_ANIME_SUCCESS]",e);for(const i of this.fansubData)i.Anime=e.results[i.id];this.doughnutChartGarapanLabels.push("Anime"),this.doughnutChartGarapanData.push(e.count);const s=[...this.fansubData].sort((i,n)=>n.Anime-i.Anime).slice(0,10);for(const i of s)this.barChartAnimeLabels.push(i["Nama Fansub"]),this.barChartAnimeData.push(i.Anime);this.bs.idle()},error:e=>{this.gs.log("[FANSUB_ANIME_ERROR]",e,"error"),this.bs.idle()}})}getDoramaFansub(){this.bs.busy(),this.subsDorama=this.fansub.getDoramaFansub(this.allFansubId).subscribe({next:e=>{this.gs.log("[FANSUB_DORAMA_SUCCESS]",e);for(const i of this.fansubData)i.Dorama=e.results[i.id];this.doughnutChartGarapanLabels.push("Dorama"),this.doughnutChartGarapanData.push(e.count);const s=[...this.fansubData].sort((i,n)=>n.Dorama-i.Dorama).slice(0,10);for(const i of s)this.barChartDoramaLabels.push(i["Nama Fansub"]),this.barChartDoramaData.push(i.Dorama);this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DORAMA_ERROR]",e,"error"),this.bs.idle()}})}openFansub(e){this.gs.log("[FANSUB_LIST_OPEN_FANSUB]",e),this.router.navigateByUrl(`/fansub/${e.slug}`)}openUrl(e){this.gs.log("[FANSUB_LIST_OPEN_URL]",e),this.wb.winboxOpenUri(e.url)}static#t=this.\u0275fac=function(s){return new(s||a)(t.Y36(r.gz),t.Y36(r.F0),t.Y36(N.U),t.Y36(L.z),t.Y36(Q.r),t.Y36(P.T),t.Y36(K.N))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-list"]],decls:13,vars:5,consts:[[1,"container"],[1,"row","p-3"],["class","col-12 col-md-6 py-1 bg-bifeldy",4,"ngIf"],[1,"row","my-4"],[1,"col-12"],[1,"text-success","text-end"],[1,"row"],[3,"tabData","tableRowClicked","buttonClicked"],[1,"col-12","col-md-6","py-1","bg-bifeldy"],["baseChart","",3,"data","labels","chartType","options","plugins","legend"]],template:function(s,i){1&s&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1),t.YNc(3,V,2,6,"div",2),t.YNc(4,W,2,6,"div",2),t.YNc(5,X,2,6,"div",2),t.YNc(6,tt,2,6,"div",2),t.qZA(),t.TgZ(7,"div",3)(8,"div",4)(9,"div",5),t._uU(10," * Internet Positif => Warna Abu-Abu "),t.qZA()()(),t.TgZ(11,"div",6)(12,"app-material-tab",7),t.NdJ("tableRowClicked",function(c){return i.openFansub(c)})("buttonClicked",function(c){return i.openUrl(c)}),t.qZA()()()),2&s&&(t.xp6(3),t.Q6J("ngIf",i.barChartAnimeData.length>0&&i.barChartAnimeLabels.length>0),t.xp6(1),t.Q6J("ngIf",i.barChartDoramaData.length>0&&i.barChartDoramaLabels.length>0),t.xp6(1),t.Q6J("ngIf",2===i.pieChartStatusData.length&&2===i.pieChartStatusLabels.length),t.xp6(1),t.Q6J("ngIf",2===i.doughnutChartGarapanData.length&&2===i.doughnutChartGarapanLabels.length),t.xp6(6),t.Q6J("tabData",i.tabData))},dependencies:[b.O5,G.H,f.jh,O.t]})}return a})();var E=o(4674),it=o(4520),Y=o(80),st=o(2970),at=o(5141),nt=o(7396),q=o(2693),ot=o(1428),rt=o(8598),I=o(9818),H=o(7392),U=o(9982),j=o(7462),lt=o(801),ut=o(291),ct=o(3710),bt=o(7397),gt=o(1105);function mt(a,l){if(1&a&&(t.TgZ(0,"div",8)(1,"a",38),t._UZ(2,"mat-icon",39),t._uU(3," Facebook Fanpage "),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("href",e.fansubData.urls.facebook,t.LSH)}}function ht(a,l){if(1&a&&(t.TgZ(0,"div",8)(1,"a",40),t._UZ(2,"img",41),t._uU(3," Ruang Obrolan Discord "),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("href",e.fansubData.urls.discord,t.LSH)}}function dt(a,l){if(1&a&&(t.TgZ(0,"div",8)(1,"a",42),t._UZ(2,"img",43),t._uU(3," Cuitan Twitter "),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("href",e.fansubData.urls.twitter,t.LSH)}}function pt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"a",44),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.joinLeaveMember())}),t._uU(1),t.qZA()}if(2&a){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.joinedAsMember?"Keluar":"Gabung"," ")}}function _t(a,l){1&a&&t._UZ(0,"app-no-data")}function ft(a,l){if(1&a&&(t.TgZ(0,"mat-list-option",47),t._UZ(1,"img",48),t.TgZ(2,"a",49)(3,"span",50),t._uU(4),t.qZA(),t.TgZ(5,"span",51),t._uU(6),t.qZA()()()),2&a){const e=l.$implicit;t.MGl("routerLink","/user/",e.user_.username,""),t.xp6(1),t.s9C("src",e.user_.image_url,t.LSH),t.xp6(3),t.hij(" ",e.keterangan," "),t.xp6(2),t.Oqu(e.user_.username)}}function vt(a,l){if(1&a&&(t.TgZ(0,"mat-selection-list",45),t.YNc(1,ft,7,4,"mat-list-option",46),t.qZA()),2&a){const e=t.oxw(2);t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.approvedMembers)}}function xt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"mat-list-option",53),t._UZ(1,"img",48),t.TgZ(2,"a",49)(3,"span",54)(4,"small",55),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.approveMember(n))}),t._uU(5," Terima "),t.qZA(),t._uU(6," | "),t.TgZ(7,"small",56),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.rejectMember(n))}),t._uU(8," Tolak "),t.qZA()(),t.TgZ(9,"span",57),t._uU(10),t.qZA()()()}if(2&a){const e=l.$implicit;t.xp6(1),t.s9C("src",e.user_.image_url,t.LSH),t.xp6(8),t.MGl("routerLink","/user/",e.user_.username,""),t.xp6(1),t.hij(" ",e.user_.username," ")}}function Tt(a,l){if(1&a&&(t.TgZ(0,"mat-selection-list",45),t.YNc(1,xt,11,3,"mat-list-option",52),t.qZA()),2&a){const e=t.oxw(2);t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.pendingMembers)}}function At(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",8)(1,"button",58),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getSubDomain())}),t._UZ(2,"mat-icon",59),t._uU(3),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(3),t.AsE(" 'https://",e.fansubData.slug,".",e.ENV.domain,"' ")}}function Ft(a,l){if(1&a&&(t.TgZ(0,"div",17),t._UZ(1,"app-material-expansion-panel",60),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("panelData",e.panelData)}}function Ct(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"mat-list-option",53),t._UZ(1,"mat-icon",65),t.TgZ(2,"a",66),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.openRssFeed(n.fansub_,n.link))}),t.TgZ(3,"span",67),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t._UZ(6,"span",68),t.qZA()()}if(2&a){const e=l.$implicit;t.xp6(4),t.Oqu(t.lcZ(5,2,e.created_at)),t.xp6(2),t.Q6J("innerHTML",e.title,t.oJD)}}function Dt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",61)(2,"h2",62)(3,"span",63)(4,"a",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getRssFeed())}),t._uU(5," Refresh "),t.qZA(),t._uU(6," | "),t.TgZ(7,"a",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.showAllRssFeed())}),t._uU(8," Lainnya "),t.qZA()(),t.TgZ(9,"b",21),t._uU(10,"RSS Feed Fansub"),t.qZA()()(),t.TgZ(11,"div",16)(12,"mat-selection-list",45),t.YNc(13,Ct,7,4,"mat-list-option",52),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(12),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.rssFeedData)}}function St(a,l){1&a&&(t.TgZ(0,"div",17)(1,"div",16),t._UZ(2,"app-report"),t.qZA()())}function Et(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),t._UZ(6,"img",7),t.qZA(),t.TgZ(7,"div",8)(8,"button",9),t._UZ(9,"mat-icon",10),t._uU(10),t.ALo(11,"date"),t.qZA(),t.TgZ(12,"button",11),t._UZ(13,"mat-icon",12),t._uU(14),t.qZA()(),t.YNc(15,mt,4,1,"div",13),t.YNc(16,ht,4,1,"div",13),t.YNc(17,dt,4,1,"div",13),t.TgZ(18,"div",8)(19,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.editFansubData())}),t._UZ(20,"mat-icon",15),t._uU(21," Perbaharui Informasi "),t.qZA()(),t.TgZ(22,"div",16)(23,"div",17)(24,"div",18)(25,"h2",19),t.YNc(26,pt,2,1,"a",20),t.TgZ(27,"b",21),t._uU(28),t.qZA()()(),t.TgZ(29,"div",22)(30,"div",23),t.YNc(31,_t,1,0,"app-no-data",24),t.YNc(32,vt,2,2,"mat-selection-list",25),t.YNc(33,Tt,2,2,"mat-selection-list",25),t.qZA()(),t.TgZ(34,"div",8)(35,"button",26),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.togglePendingMembers())}),t._UZ(36,"mat-icon",27),t._uU(37),t.qZA()()()(),t.YNc(38,At,4,2,"div",13),t.qZA()(),t.TgZ(39,"div",28)(40,"div",29)(41,"h1",30)(42,"b"),t._uU(43),t.qZA()()(),t.TgZ(44,"div",17)(45,"app-material-chip",31),t.NdJ("chipClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openTag(i))}),t.qZA()(),t.TgZ(46,"div",32),t._UZ(47,"app-notifications",33),t.qZA(),t.YNc(48,Ft,2,1,"div",34),t.YNc(49,Dt,14,2,"div",34),t.YNc(50,St,3,0,"div",34),t.qZA()(),t.TgZ(51,"div",32)(52,"div",16)(53,"app-material-tab",35),t.NdJ("listClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openAnime(i))})("gridClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openDorama(i))})("tableRowClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openFile(i))})("paginatorClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.onPaginatorClicked(i))})("serverSideFilter",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.onServerSideFilter(i))})("serverSideOrder",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.onServerSideOrder(i))})("gridLoadNextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onDoramaLoadNextPage())})("listLoadNextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onAnimeLoadNextPage())}),t.qZA()()()(),t._UZ(54,"div",36)(55,"div",37),t.qZA()}if(2&a){const e=t.oxw();t.xp6(6),t.Q6J("src",e.fansubData.image_url,t.LSH),t.xp6(4),t.hij(" ",t.xi3(11,26,e.fansubData.born,"d MMMM y")," "),t.xp6(4),t.hij(" ",e.fansubData.active?"Aktif":"Tidak Aktif"," "),t.xp6(1),t.Q6J("ngIf",e.fansubData.urls.facebook),t.xp6(1),t.Q6J("ngIf",e.fansubData.urls.discord),t.xp6(1),t.Q6J("ngIf",e.fansubData.urls.twitter),t.xp6(2),t.s9C("matTooltip",e.fansubData.user_?"Terakhir Di Ubah Oleh :: "+e.fansubData.user_.username:"Perbaharui Data Fansub"),t.xp6(7),t.Q6J("ngIf",!e.showPendingMember),t.xp6(2),t.hij(" ",e.showPendingMember?"Permintaan Gabung":"Anggota"," "),t.xp6(3),t.Q6J("ngIf",!e.showPendingMember&&e.approvedMembers.length<=0||e.showPendingMember&&e.pendingMembers.length<=0),t.xp6(1),t.Q6J("ngIf",!e.showPendingMember&&e.approvedMembers.length>0),t.xp6(1),t.Q6J("ngIf",e.showPendingMember&&e.pendingMembers.length>0),t.xp6(4),t.hij(" Lihat ",e.showPendingMember?"Anggota":"Permintaan Gabung"," "),t.xp6(1),t.Q6J("ngIf",!e.fansubData.dns_id),t.xp6(5),t.Oqu(e.fansubData.name),t.xp6(2),t.Q6J("chipData",e.chipData),t.xp6(3),t.Q6J("ngIf",e.panelData.length>0),t.xp6(1),t.Q6J("ngIf",e.rssFeedData.length>0),t.xp6(1),t.Q6J("ngIf",null==e.SS.mySocket?null:e.SS.mySocket.id),t.xp6(3),t.Q6J("tabData",e.tabData)("count",e.count)("serverSide",!0)("gridPageFinished",e.doramaPageFinished)("listPageFinished",e.animePageFinished),t.xp6(1),t.Udp("background-image","url("+e.fansubData.cover_url+")")}}let It=(()=>{class a{constructor(e,s,i,n,c,p,A,B,J,ge,me,he,de,pe){this.activatedRoute=e,this.router=s,this.bs=i,this.as=n,this.ds=c,this.gs=p,this.fs=A,this.pi=B,this.fansub=J,this.ss=ge,this.toast=me,this.wb=he,this.berkas=de,this.notif=pe,this.fansubSlug="",this.fansubData=null,this.rssFeedData=[],this.approvedMembers=[],this.pendingMembers=[],this.joinedAsMember=null,this.showPendingMember=!1,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.animeFansub=[],this.doramaFansub=[],this.berkasFansub=[],this.allBerkasFansubId=[],this.animePageFinished=!1,this.doramaPageFinished=!1,this.animePage=1,this.doramaPage=1,this.chipData=[],this.panelData=[],this.tabData=[{name:"Anime",icon:"live_tv",type:"list",data:[]},{name:"Dorama",icon:"movie",type:"grid",data:[]},{name:"Berkas Terkait",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Pemilik"],row:[]}}],this.subsActRoute=null,this.subsFansub=null,this.subsBerkas=null,this.subsAnime=null,this.subsDorama=null,this.subsParam=null,this.subsRssFeed=null,this.subsFansubMemberGet=null,this.subsFansubMemberJoin=null,this.subsFansubMemberApproveReject=null,this.subsFansubMemberLeave=null,this.subsDialog=null,this.subsClaimSubDomain=null,this.subsTrusted=null,this.subsInternetPositif=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get SS(){return this.ss}get ENV(){return E.N}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsFansub?.unsubscribe(),this.subsBerkas?.unsubscribe(),this.subsAnime?.unsubscribe(),this.subsDorama?.unsubscribe(),this.subsParam?.unsubscribe(),this.subsRssFeed?.unsubscribe(),this.subsFansubMemberGet?.unsubscribe(),this.subsFansubMemberJoin?.unsubscribe(),this.subsFansubMemberApproveReject?.unsubscribe(),this.subsFansubMemberLeave?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsClaimSubDomain?.unsubscribe(),this.subsTrusted?.unsubscribe(),this.subsInternetPositif?.unsubscribe(),this.fansubData&&this.notif.removeNotif(`${E.N.siteName.toUpperCase()}_FANSUB#${this.fansubData.id}`)}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:e=>{this.fansubSlug=e.fansubSlug,this.getFansubDetail()}})}getFansubDetail(){this.bs.busy(),this.subsFansub=this.fansub.getFansub(this.fansubSlug).subscribe({next:e=>{if(this.gs.log("[FANSUB_DETAIL_SUCCESS]",e),this.fansubData=e.result,this.pi.updatePageMetaData(this.fansubData.name,this.fansubData.description,Array.isArray(this.fansubData.tags)?this.fansubData.tags.join(", "):this.fansubData.name,this.fansubData.image_url,this.fansubData.user_.username),this.bs.idle(),this.gs.isBrowser){if(Array.isArray(this.fansubData.tags))for(let s=0;s{this.gs.log("[FANSUB_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/fansub"}})}})}checkInternetPositif(){this.bs.busy(),this.subsInternetPositif=this.fansub.checkInternetPositif([this.fansubData.id]).subscribe({next:e=>{this.gs.log("[FANSUB_KOMINFO_SUCCESS]",e),e.results[this.fansubData.id]&&this.notif.addNotif(null,`${E.N.siteName.toUpperCase()}_FANSUB#${this.fansubData.id}`,"secondary","Internet Positif","Halaman website Fansub ini ada di dalam daftar situs yang diblokir oleh Kominfo ~",!1)},error:e=>{this.gs.log("[FANSUB_KOMINFO_ERROR]",e,"error"),this.bs.idle()},complete:()=>{this.bs.idle()}})}getRssFeed(){this.bs.busy(),this.subsRssFeed=this.fansub.getRssFeedFansub(this.fansubSlug).subscribe({next:e=>{this.gs.log("[RSS_FEED_LIST_SUCCESS]",e),this.rssFeedData=e.results,this.bs.idle()},error:e=>{this.gs.log("[RSS_FEED_LIST_ERROR]",e,"error"),this.bs.idle()}})}showAllRssFeed(){this.router.navigate(["/rss-feed"],{queryParams:{q:this.fansubSlug}})}openRssFeed(e,s){const i=e.urls.web;if(i){const n=new URL(i);let c=`${n.protocol}//${n.host}`;s.startsWith("/")||(c+="/"),c+=s,this.wb.winboxOpenUri(c)}}getBerkasFansub(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.fansub.getBerkasFansub([this.fansubData.id],this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[BERKAS_ANIME_SUCCESS]",e),this.count=e.count,this.berkasFansub=[];for(const s of e.results[this.fansubData.id])this.allBerkasFansubId.push(s.id),this.berkasFansub.push({id:s.id,private:s.private,foto:s.user_.image_url,Pemilik:s.user_.username,Proyek:s.project_type_.name,Tanggal:s.created_at,"Nama Berkas":s.name});this.tabData[2].data.row=this.berkasFansub,this.allBerkasFansubId.length>0&&this.checkTrusted(),this.bs.idle()},error:e=>{this.gs.log("[BERKAS_FANSUB_ERROR]",e,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted&&(this.subsTrusted.unsubscribe(),this.bs.idle()),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasFansubId).subscribe({next:e=>{this.gs.log("[ANIME_BERKAS_TRUSTED_SUCCESS]",e);for(const s of this.berkasFansub)s.trusted=e.results[s.id];this.bs.idle()},error:e=>{this.gs.log("[ANIME_BERKAS_TRUSTED_ERROR]",e,"error"),this.bs.idle()}})}getAnimeFansub(){this.bs.busy(),this.subsAnime=this.fansub.getAnimeFansub([this.fansubData.id],this.animePage).subscribe({next:e=>{this.gs.log("[FANSUB_ANIME_SUCCESS]",e);for(const s of e.results[this.fansubData.id])this.animeFansub.push({id:s.id,image:s.image_url,title:s.name});this.tabData[0].data=this.animeFansub,e.results[this.fansubData.id].length<=0&&(this.animePageFinished=!0),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_ANIME_ERROR]",e,"error"),this.bs.idle()}})}getDoramaFansub(){this.bs.busy(),this.subsDorama=this.fansub.getDoramaFansub([this.fansubData.id],this.doramaPage).subscribe({next:e=>{this.gs.log("[FANSUB_DORAMA_SUCCESS]",e);for(const s of e.results[this.fansubData.id])this.doramaFansub.push({id:s.id,image:s.image_url,title:s.name,slug:s.slug});this.tabData[1].data=this.doramaFansub,e.results[this.fansubData.id].length<=0&&(this.doramaPageFinished=!0),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DORAMA_ERROR]",e,"error"),this.bs.idle()}})}editFansubData(){this.router.navigateByUrl(`/fansub/${this.fansubSlug}/edit`)}onServerSideFilter(e){this.gs.log("[BERKAS_FANSUB_ENTER_FILTER]",e),this.q=e,this.getBerkasFansub()}onServerSideOrder(e){this.gs.log("[BERKAS_FANSUB_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getBerkasFansub()}onPaginatorClicked(e){this.gs.log("[FANSUB_DETAIL_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getBerkasFansub()}openFile(e){this.gs.log("[FANSUB_DETAIL_OPEN_FILE]",e),this.router.navigateByUrl(`/berkas/${e.id}`)}openAnime(e){this.gs.log("[FANSUB_DETAIL_OPEN_ANIME]",e);const s=e.title.replace(/[^a-zA-Z0-9]/g,"-");this.router.navigateByUrl(`/anime/${e.id}-${s}`)}openDorama(e){this.gs.log("[FANSUB_DETAIL_OPEN_DORAMA]",e),this.router.navigateByUrl(`/dorama/${e.slug}`)}openTag(e){this.gs.log("[FANSUB_DETAIL_OPEN_TAG]",e)}onAnimeLoadNextPage(){this.animePageFinished||(this.animePage++,this.getAnimeFansub())}onDoramaLoadNextPage(){this.doramaPageFinished||(this.doramaPage++,this.getDoramaFansub())}togglePendingMembers(){this.showPendingMember=!this.showPendingMember,this.getFansubMember()}getFansubMember(){this.bs.busy(),this.subsFansubMemberGet=this.fansub.getFansubMember(this.fansubSlug).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LIST_SUCCESS]",e),this.approvedMembers=[],this.pendingMembers=[];for(const s of e.results)s.approved?this.approvedMembers.push(s):this.pendingMembers.push(s);if(this.as.currentUserSubject?.value){const s=this.approvedMembers.findIndex(i=>i.user_.id===this.as.currentUserSubject?.value?.id);this.joinedAsMember=s>=0?this.approvedMembers[s]:null}this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LIST_ERROR]",e,"error"),this.bs.idle()}})}joinLeaveMember(){this.bs.busy(),this.joinedAsMember?this.subsFansubMemberLeave=this.fansub.leaveFansubMember(this.joinedAsMember.id).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LEAVE_SUCCESS]",e),this.getFansubMember(),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LEAVE_ERROR]",e,"error"),this.getFansubMember(),this.bs.idle()}}):this.subsFansubMemberJoin=this.fansub.requestJoinFansubMember({slug:this.fansubSlug}).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_JOIN_SUCCESS]",e),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:"Permintaan Gabung Berhasil",htmlMessage:"Silahkan Menghubungi Anggota Yang Sudah Tergabung / Admin / Moderator Fansub Untuk Menerima Permintaan Gabung.",confirmText:"Tutup"}}).afterClosed().subscribe({next:s=>{this.gs.log("[INFO_DIALOG_CLOSED]",s),this.getFansubMember(),this.subsDialog.unsubscribe()}})},error:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_JOIN_ERROR]",e,"error"),this.getFansubMember(),this.bs.idle()}})}approveOrRejectFansubMember(e,s){this.subsDialog=this.ds.openInputDialog({data:{title:`Keterangan ${s?"Approve":"Reject"} '${e.user_.username}' :: '${e.fansub_.slug}'`,input:{keterangan:{inputLabel:"Keterangan",inputPlaceholder:"Pemilik, Translator, Timer, QA / QC, TypeSetter, dll.",inputValue:null,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Max. 10 Huruf"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INPUT_DIALOG_CLOSED]",i),i?(this.bs.busy(),this.subsFansubMemberApproveReject=this.fansub.approveRejectFansubMember(e.id,{approved:s,keterangan:i.keterangan?.substring(0,10)}).subscribe({next:n=>{this.gs.log("[FANSUB_DETAIL_MEMBER_APPROVE_REJECT_SUCCESS]",n),this.getFansubMember(),this.bs.idle()},error:n=>{this.gs.log("[FANSUB_DETAIL_MEMBER_APPROVE_REJECT_ERROR]",n,"error"),this.getFansubMember(),this.bs.idle()}})):!1===i&&this.getFansubMember(),this.subsDialog.unsubscribe()}})}approveMember(e){this.approveOrRejectFansubMember(e,!0)}rejectMember(e){this.approveOrRejectFansubMember(e,!1)}getSubDomain(){this.as.currentUserSubject?.value?this.joinedAsMember||this.as.currentUserSubject?.value?.role===h.yS.ADMIN||this.as.currentUserSubject?.value?.role===h.yS.MODERATOR?this.subsDialog=this.ds.openInputDialog({data:{title:`Buat CNAME / A Record IP v4 v6 :: '${this.fansubSlug}'`,input:{server_target:{inputLabel:"Server Target Domain IP Publik",inputPlaceholder:"127.0.0.1 | ghs.google.com | blablabla.id.repl.co",inputValue:null,inputRequired:!0},verification_name:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-name | slug-fs",inputValue:null,inputRequired:!1},verification_target:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-target.dv.googlehosted.com | replit-verify=blablabla",inputValue:null,inputRequired:!1}},confirmText:"OK",cancelText:"Batal",infoText:"Abaikan 2 Input Terakhir Jika Bukan Blogger / Replit"}}).afterClosed().subscribe({next:e=>{this.gs.log("[INPUT_DIALOG_CLOSED]",e),e&&(this.bs.busy(),this.subsClaimSubDomain=this.fansub.claimSubDomain({slug:this.fansubSlug,server_target:e.server_target,verification_name:e.verification_name,verification_target:e.verification_target}).subscribe({next:s=>{this.gs.log("[FANSUB_CLAIM_SUBDOMAIN_SUCCESS]",s),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:"Klaim Berhasil",htmlMessage:`\n Domain '${this.fansubSlug}.${this.ENV.domain}' Selesai Didaftarkan.\n Silahkan Tunggu Hingga Propagasi Dns Selesai.\n Untuk Mengubah, Silahkan Menuju Halaman User\n Apabila Ada Pertanyaan Dapat Langsung Menghubungi Admin / Moderator.\n Terima Kasih.\n `,confirmText:"Tutup"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INFO_DIALOG_CLOSED]",i),this.getFansubDetail(),this.subsDialog.unsubscribe()}})},error:s=>{this.gs.log("[FANSUB_CLAIM_SUBDOMAIN_ERROR]",s,"error"),this.bs.idle(),this.getFansubDetail()}})),this.subsDialog.unsubscribe()}}):this.toast.warning("Harus Menjadi Anggota Untuk Klaim Sub-Domain!","Whoops!",null,!0):this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}static#t=this.\u0275fac=function(s){return new(s||a)(t.Y36(r.gz),t.Y36(r.F0),t.Y36(L.z),t.Y36(Y.e),t.Y36(st.x),t.Y36(N.U),t.Y36(Q.r),t.Y36(at.Z),t.Y36(P.T),t.Y36(nt.R),t.Y36(q.k),t.Y36(K.N),t.Y36(ot.A),t.Y36(rt.T))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-detail"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"fansub-info","align-items-center"],[1,"row","py-3","px-2"],[1,"col-md-4","col-xl-3","px-3"],[1,"row","sticky-top","pt-3"],[1,"col-12","pt-4"],[1,"fansub-image",3,"src"],[1,"col-12","text-center","pt-3"],["type","button","mat-button","","color","warn","matTooltip","Berdiri Sejak",1,"w-100"],["fontIcon","calendar_today",1,"me-1"],["type","button","mat-button","","color","accent","matTooltip","Status Fansub",1,"w-100"],["fontIcon","history",1,"me-1"],["class","col-12 text-center pt-3",4,"ngIf"],["type","button","mat-button","",1,"w-100","text-success",2,"color","rgb(255, 64, 129) !important",3,"matTooltip","click"],["fontIcon","edit",1,"me-1"],[1,"col-12"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],["class","float-end text-decoration-none text-warning","style","font-size: small; cursor: pointer;",3,"click",4,"ngIf"],[1,"text-bifeldy"],[1,"col-12",2,"max-height","288px"],[1,"h-100",2,"overflow-y","auto"],[4,"ngIf"],[3,"multiple",4,"ngIf"],["type","button","mat-button","","color","accent",1,"w-100",3,"click"],["fontIcon","manage_accounts",1,"me-1"],[1,"col-md-8","col-xl-9","pt-3"],[1,"row","py-3","px-0","mt-auto"],[1,"m-0"],[3,"chipData","chipClicked"],[1,"row"],[1,"px-0"],["class","row py-3",4,"ngIf"],[3,"tabData","count","serverSide","gridPageFinished","listPageFinished","listClicked","gridClicked","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder","gridLoadNextPage","listLoadNextPage"],[1,"fansub-banner","fansub-banner-1","align-items-center"],[1,"fansub-banner","fansub-banner-2","align-items-center"],["mat-stroked-button","","matTooltip","Kunjungi Halaman Fanpage",1,"w-100",2,"color","rgb(114, 137, 218)",3,"href"],["fontIcon","facebook",1,"me-1"],["mat-stroked-button","","matTooltip","Kunjungi Ruang Obrolan",1,"w-100",2,"color","rgb(114, 137, 218)",3,"href"],["src","/assets/img/discord/blue.png","height","24px"],["mat-stroked-button","","matTooltip","Lihat Cuitan",1,"w-100",2,"color","rgb(114, 137, 218)",3,"href"],["src","/assets/img/twitter/blue.png","height","24px"],[1,"float-end","text-decoration-none","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[3,"multiple"],["class","h-100",3,"routerLink",4,"ngFor","ngForOf"],[1,"h-100",3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],[1,"text-truncate","text-decoration-none"],[1,"bg-bifeldy","px-2","me-1","text-warning",2,"position","absolute","right","0"],[1,"text-success"],["class","h-100",4,"ngFor","ngForOf"],[1,"h-100"],[1,"bg-bifeldy","px-2","me-1",2,"position","absolute","right","0"],[1,"text-success",2,"cursor","pointer",3,"click"],[1,"text-danger",2,"cursor","pointer",3,"click"],[1,"text-warning",3,"routerLink"],["type","button","mat-button","","color","accent","matTooltip","Ambil / Klaim / Dapatkan Sub-Domain Ini",1,"w-100","shiny",3,"click"],["fontIcon","dns",1,"me-1"],[3,"panelData"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"float-end","text-bifeldy",2,"font-size","small"],[1,"text-warning","text-decoration-none",2,"cursor","pointer",3,"click"],["fontIcon","rss_feed","mat-list-icon","",1,"ps-3"],[1,"text-truncate","text-decoration-none",3,"click"],[1,"bg-bifeldy","px-2","me-1","text-danger",2,"position","absolute","right","0"],[1,"text-success",3,"innerHTML"]],template:function(s,i){1&s&&t.YNc(0,Et,56,29,"div",0),2&s&&t.Q6J("ngIf",i.fansubData)},dependencies:[b.sg,b.O5,r.rH,I.eB,I.Nr,H.Hw,U.Wx,U.ap,U.kh,U.O$,j.Kd,G.H,lt.Q,ut.G,O.t,ct.Y,bt.d,b.uU,gt.R],styles:[".fansub-banner[_ngcontent-%COMP%]{height:128px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;filter:blur(5px) brightness(100%);opacity:.5}.fansub-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.fansub-banner-2[_ngcontent-%COMP%]{position:absolute;top:128px;left:0}.fansub-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}.fansub-image[_ngcontent-%COMP%]{width:100%}"]})}return a})();var Ut=o(8372),Zt=o(9094),Mt=o(8505),kt=o(3900),yt=o(5625),Rt=o(7245),Nt=o(4363),Z=o(9923),w=o(9602),D=o(8455),Lt=o(9203),Pt=o(6289),Ot=o(7443);function wt(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function Bt(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.imageErrorText)}}function Jt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",6)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.submitImage())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Qt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Tidak Boleh Kosong"),t.qZA())}function Kt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Link Tidak Valid"),t.qZA())}function Gt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Facebook Link Tidak Valid"),t.qZA())}function Yt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Discord Link Tidak Valid"),t.qZA())}function qt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Twitter Link Tidak Valid"),t.qZA())}function Ht(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.coverLimitExceeded)," !")}}function jt(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.coverErrorText)}}function $t(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",66)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.submitCover())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function zt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Tidak Boleh Kosong"),t.qZA())}function Vt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Wt(a,l){if(1&a&&(t.TgZ(0,"small",67)(1,"div"),t._uU(2),t.qZA()()),2&a){const e=t.oxw(3);t.xp6(2),t.Oqu(e.slugInfo)}}function Xt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Tidak Boleh Kosong"),t.qZA())}function te(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Hanya Boleh Huruf Dan \u4e00"),t.qZA())}function ee(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Harus Diisi Secara Valid"),t.qZA())}function ie(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function se(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function ae(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ne(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",68),t.NdJ("removed",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.removeTag(n))}),t._uU(1),t._UZ(2,"mat-icon",69),t.qZA()}if(2&a){const e=l.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function oe(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Discord Link Tidak Valid"),t.qZA())}function re(a,l){if(1&a&&(t.TgZ(0,"mat-form-field",23)(1,"mat-label"),t._uU(2,"URI / URL RSS v2.0 Feed"),t.qZA(),t._UZ(3,"input",70)(4,"mat-icon",71),t.TgZ(5,"mat-error"),t.YNc(6,oe,2,0,"div",21),t.qZA()()),2&a){const e=t.oxw(3);t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("rss_feed").hasError("pattern"))}}function le(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"form",8),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onSubmit())}),t.TgZ(1,"div",9)(2,"div",10)(3,"h2",11)(4,"b",12),t._uU(5,"Perbaharui Data Fansub"),t.qZA()()(),t.TgZ(6,"div",6)(7,"div",13)(8,"div",14)(9,"div",13)(10,"div",6),t._UZ(11,"img",15),t.TgZ(12,"mat-form-field",16)(13,"mat-label"),t._uU(14,"Foto"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",17,18),t.NdJ("change",function(i){t.CHM(e);const n=t.MAs(16),c=t.oxw(2);return t.KtG(c.uploadImage(i,n))}),t.qZA(),t._UZ(17,"mat-icon",19),t.qZA(),t.TgZ(18,"mat-error",20)(19,"small"),t.YNc(20,wt,3,3,"div",21),t.YNc(21,Bt,2,1,"div",21),t.qZA()()(),t.YNc(22,Jt,4,1,"div",22),t.qZA(),t.TgZ(23,"div",13)(24,"div",6)(25,"div",13)(26,"mat-form-field",23)(27,"mat-label"),t._uU(28,"Tautan Website"),t.qZA(),t._UZ(29,"input",24)(30,"mat-icon",25),t.TgZ(31,"mat-error"),t.YNc(32,Qt,2,0,"div",21),t.YNc(33,Kt,2,0,"div",21),t.qZA()(),t.TgZ(34,"mat-form-field",23)(35,"mat-label"),t._uU(36,"Facebook Fanpage"),t.qZA(),t._UZ(37,"input",26)(38,"mat-icon",27),t.TgZ(39,"mat-error"),t.YNc(40,Gt,2,0,"div",21),t.qZA()(),t.TgZ(41,"mat-form-field",23)(42,"mat-label"),t._uU(43,"Tautan Discord"),t.qZA(),t._UZ(44,"input",28),t.TgZ(45,"mat-icon",29),t._UZ(46,"img",30),t.qZA(),t.TgZ(47,"mat-error"),t.YNc(48,Yt,2,0,"div",21),t.qZA()(),t.TgZ(49,"mat-form-field",23)(50,"mat-label"),t._uU(51,"Cuitan Twitter"),t.qZA(),t._UZ(52,"input",31),t.TgZ(53,"mat-icon",29),t._UZ(54,"img",30),t.qZA(),t.TgZ(55,"mat-error"),t.YNc(56,qt,2,0,"div",21),t.qZA()()()()()(),t.TgZ(57,"div",32)(58,"div",13)(59,"mat-form-field",16)(60,"mat-label"),t._uU(61,"Cover"),t.qZA(),t.TgZ(62,"ngx-mat-file-input",17,33),t.NdJ("change",function(i){t.CHM(e);const n=t.MAs(63),c=t.oxw(2);return t.KtG(c.uploadCover(i,n))}),t.qZA(),t._UZ(64,"mat-icon",19),t.qZA(),t.TgZ(65,"mat-error",20)(66,"small"),t.YNc(67,Ht,3,3,"div",21),t.YNc(68,jt,2,1,"div",21),t.qZA()(),t.YNc(69,$t,4,1,"div",34),t.TgZ(70,"mat-form-field",35)(71,"mat-label"),t._uU(72,"Nama Fansub"),t.qZA(),t._UZ(73,"input",36)(74,"mat-icon",37),t.TgZ(75,"mat-error"),t.YNc(76,zt,2,0,"div",21),t.YNc(77,Vt,2,0,"div",21),t.qZA()(),t.TgZ(78,"mat-form-field",38)(79,"mat-label"),t._uU(80,"Singkatan"),t.qZA(),t._UZ(81,"input",39)(82,"mat-icon",40),t.YNc(83,Wt,3,1,"small",41),t.TgZ(84,"mat-error"),t.YNc(85,Xt,2,0,"div",21),t.YNc(86,te,2,0,"div",21),t.qZA()(),t._UZ(87,"angular-editor",42),t.TgZ(88,"mat-form-field",43)(89,"mat-label"),t._uU(90,"Mulai Ada Sejak"),t.qZA(),t.TgZ(91,"input",44),t.NdJ("focus",function(){t.CHM(e);const i=t.MAs(95);return t.KtG(i.open())}),t.ALo(92,"date"),t.qZA(),t._UZ(93,"mat-datepicker-toggle",45)(94,"mat-datepicker",46,47),t.TgZ(96,"mat-error"),t.YNc(97,ee,2,0,"div",21),t.YNc(98,ie,2,0,"div",21),t.qZA()(),t.TgZ(99,"mat-form-field",43)(100,"mat-label"),t._uU(101,"Status"),t.qZA(),t.TgZ(102,"mat-select",48)(103,"mat-option",49),t._uU(104,"Tidak Aktif"),t.qZA(),t.TgZ(105,"mat-option",50),t._uU(106,"Aktif"),t.qZA()(),t.TgZ(107,"mat-hint",51),t._uU(108,"Status Kehidupan Fansub Saat Ini"),t.qZA(),t.TgZ(109,"mat-error"),t.YNc(110,se,2,0,"div",21),t.YNc(111,ae,2,0,"div",21),t.qZA()(),t.TgZ(112,"mat-form-field",23)(113,"mat-label"),t._uU(114,"Tags & Kategori"),t.qZA(),t.TgZ(115,"mat-chip-list",null,52),t.YNc(117,ne,3,2,"mat-chip",53),t.TgZ(118,"input",54),t.NdJ("matChipInputTokenEnd",function(i){t.CHM(e);const n=t.oxw(2);return t.KtG(n.addTag(i))}),t.qZA(),t._UZ(119,"mat-icon",55),t.qZA(),t.TgZ(120,"mat-hint",51),t._uU(121,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t.YNc(122,re,7,2,"mat-form-field",56),t.qZA()()(),t.TgZ(123,"div",13)(124,"div",6)(125,"div",57),t._UZ(126,"div",58),t.TgZ(127,"div",59)(128,"a",60),t._UZ(129,"mat-icon",61),t._uU(130," Batal "),t.qZA()(),t.TgZ(131,"div",59)(132,"button",62),t._uU(133," Simpan "),t._UZ(134,"mat-icon",63),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(95),s=t.MAs(116),i=t.oxw(2);t.Q6J("formGroup",i.fg),t.xp6(11),t.Q6J("src",i.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.imageErrorText),t.xp6(1),t.Q6J("ngIf",i.image&&!i.fg.value.image),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("web").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("web").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("facebook").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/discord/",i.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",i.fg.get("discord").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/twitter/",i.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",i.fg.get("twitter").hasError("pattern")),t.xp6(3),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.cover)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.coverLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.coverErrorText),t.xp6(1),t.Q6J("ngIf",i.cover&&!i.fg.value.cover),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngIf",i.slugInfo),t.xp6(2),t.Q6J("ngIf",i.fg.get("slug").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("slug").hasError("pattern")),t.xp6(1),t.Q6J("config",i.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.s9C("placeholder",t.xi3(92,50,i.currentDate,"d MMMM y")),t.Q6J("matDatepicker",e),t.xp6(2),t.Q6J("for",e),t.xp6(4),t.Q6J("ngIf",i.fg.get("born").hasError("required")||i.fg.get("born").hasError("matDatepickerParse")),t.xp6(1),t.Q6J("ngIf",i.fg.get("born").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",i.fg.get("active").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("active").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",i.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",i.GS.separatorKeysCodes)("matChipInputFor",s)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",i.rssFeedAllowed),t.xp6(6),t.Q6J("disabled",i.submitted),t.xp6(4),t.Q6J("disabled",i.submitted||i.fg.invalid||!i.fg.dirty)}}function ue(a,l){if(1&a&&(t.TgZ(0,"div",1),t._UZ(1,"div",2)(2,"div",3)(3,"div",4)(4,"app-notifications"),t.TgZ(5,"div",5)(6,"div",6),t.YNc(7,le,135,53,"form",7),t.qZA()()()),2&a){const e=t.oxw();t.xp6(1),t.Udp("background-image","url("+e.cover_url+")"),t.xp6(6),t.Q6J("ngIf",e.fg)}}const ce=[{path:"",pathMatch:"full",component:et},{path:":fansubSlug",children:[{path:"",pathMatch:"full",component:It},{path:"edit",component:(()=>{class a{constructor(e,s,i,n,c,p,A,B,J){this.fb=e,this.router=s,this.bs=i,this.activatedRoute=n,this.imgbb=c,this.fansub=p,this.toast=A,this.as=B,this.gs=J,this.fansubSlug="",this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.cover=null,this.coverErrorText=null,this.coverLimitExceeded=null,this.cover_url="/assets/img/form/no-image.png",this.cover_url_original=null,this.urls=[],this.currentDate=new Date,this.gambar=null,this.gambar_=null,this.subsActRoute=null,this.subsFansubUpdate=null,this.subsFansubDetail=null,this.subsImgbb=null,this.subsCekFansubSlug=null,this.subsFansubMemberGet=null,this.slugInfo="",this.editable=!0,this.approvedMembers=[],this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get rssFeedAllowed(){return this.as.currentUserSubject?.value?.role===h.yS.ADMIN||this.as.currentUserSubject?.value?.role===h.yS.MODERATOR||this.as.currentUserSubject?.value?.role===h.yS.FANSUBBER}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsFansubUpdate?.unsubscribe(),this.subsFansubDetail?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsFansubMemberGet?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.fansubSlug=this.activatedRoute.snapshot.paramMap.get("fansubSlug"),this.bs.busy(),this.subsFansubDetail=this.fansub.getFansub(this.fansubSlug).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_SUCCESS]",e),this.bs.idle(),this.editable=e.result.editable,this.editable?(this.bs.busy(),this.subsFansubMemberGet=this.fansub.getFansubMember(this.fansubSlug).subscribe({next:s=>{this.gs.log("[FANSUB_EDIT_MEMBER_LIST_SUCCESS]",s),this.bs.idle(),this.approvedMembers=[];for(const n of s.results)n.approved&&this.approvedMembers.push(n);this.approvedMembers.findIndex(n=>n.user_.id===this.as.currentUserSubject?.value?.id)>=0||this.as.currentUserSubject?.value?.role===h.yS.ADMIN||this.as.currentUserSubject?.value?.role===h.yS.MODERATOR||this.as.currentUserSubject?.value?.id===e.result.user_.id?this.initForm(e.result):(this.toast.warning("Harus Menjadi Anggota Untuk Mengubah Data!","Whoops!",null,!0),this.router.navigateByUrl(`/fansub/${this.fansubSlug}`))},error:s=>{this.gs.log("[FANSUB_EDIT_MEMBER_LIST_ERROR]",s,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/fansub/${this.fansubSlug}`}})}})):(this.toast.warning("Data Fansub Ini Tidak Dapat Diubah","Whoops!",null,!0),this.router.navigateByUrl(`/fansub/${this.fansubSlug}`))},error:e=>{this.gs.log("[FANSUB_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/fansub/${this.fansubSlug}`}})}}))}initForm(e){this.image_url=e.image_url,this.image_url_original=this.image_url,this.cover_url=e.cover_url,this.cover_url_original=this.cover_url,this.fg=this.fb.group({name:[e.name,u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],description:[e.description,u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],born:[e.born,u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],active:[!0===e.active?"1":"0",u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],slug:[{value:e.slug,disabled:e.dns_id},u.kI.compose([u.kI.required,u.kI.pattern(/^[0-9a-zA-Z-]*$/)])],tags:[e.tags,u.kI.compose([])],image:[null,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],cover:[null,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],web:[e.urls.web,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],facebook:[e.urls.facebook,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],discord:[e.urls.discord,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],twitter:[e.urls.twitter,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],rss_feed:[e.rss_feed,u.kI.compose([u.kI.pattern(g.t.regexUrl)])]}),this.slugValueChanged()}slugValueChanged(){this.subsCekFansubSlug=this.fg.get("slug").valueChanges.pipe((0,Ut.b)(500),(0,Zt.x)(),(0,Mt.b)(()=>this.slugInfo="Mengecek ..."),(0,kt.w)(e=>this.fansub.cekSlug({slug:e})),(0,yt.X)(-1)).subscribe({next:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_SUCCESS]",e),this.slugInfo=e.result.message},error:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_ERROR]",e,"error"),this.slugValueChanged()}})}addTag(e){const s=e.input,i=e.value;(i||"").trim()&&this.fg.value.tags.push(i.trim()),s&&(s.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((n,c,p)=>p.findIndex(A=>A===n)===c)),this.fg.controls.tags.markAsDirty()}removeTag(e){const s=this.fg.value.tags.indexOf(e);s>=0&&this.fg.value.tags.splice(s,1)}uploadImage(e,s){this.gambar=s,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const i=e.target.files[0];try{const n=new FileReader;n.readAsDataURL(i),n.onload=c=>{if(this.gs.log("[IMAGE_SELECTED]",c),i.size<=g.t.fileSizeImageLimit){const p=this.gs.document.createElement("img");p.onload=()=>{this.image=i,this.image_url=n.result.toString()},p.src=n.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=g.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url=this.image_url_original,this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}uploadCover(e,s){this.gambar_=s,this.cover=null,this.coverLimitExceeded=null,this.coverErrorText=null,this.fg.controls.cover.patchValue(null),this.fg.controls.cover.markAsPristine();const i=e.target.files[0];try{const n=new FileReader;n.readAsDataURL(i),n.onload=c=>{if(this.gs.log("[COVER_SELECTED]",c),i.size<=g.t.fileSizeImageLimit){const p=this.gs.document.createElement("img");p.onload=()=>{this.cover=i,this.cover_url=n.result.toString()},p.src=n.result.toString()}else this.cover=null,this.cover_url="/assets/img/form/image-error.png",this.coverLimitExceeded=g.t.fileSizeImageLimit,this.gambar_.clear(e)}}catch{this.cover=null,this.cover_url=this.cover_url_original,this.gambar_.clear(e)}}submitCover(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.cover}).subscribe({next:e=>{this.gs.log("[COVER_SUCCESS]",e),this.fg.controls.cover.patchValue(e.result.url),this.fg.controls.cover.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[COVER_ERROR]",e,"error"),this.fg.controls.cover.patchValue(null),this.fg.controls.cover.markAsPristine(),this.submitted=!1,this.coverErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e={};this.fg.value.web&&(e.web=this.fg.value.web),this.fg.value.facebook&&(e.facebook=this.fg.value.facebook),this.fg.value.discord&&(e.discord=this.fg.value.discord),this.fg.value.twitter&&(e.twitter=this.fg.value.twitter);const s=this.gs.getDirtyValues(this.fg);if("web"in s&&delete s.web,"facebook"in s&&delete s.facebook,"discord"in s&&delete s.discord,"twitter"in s&&delete s.twitter,s.urls=e,this.gs.log("[FANSUB_EDIT_DIRTY]",s),this.submitted=!0,this.fg.value.rss_feed&&(!this.fg.value.web||!this.fg.value.rss_feed.startsWith(this.fg.value.web)))return this.toast.warning("RSS Feed Tidak Sesuai Dengan Alamat Web","URL RSS Feed & WEB",null,!0),this.submitted=!1,void this.bs.idle();const i=Object.keys(e).length;if(this.fg.invalid||0===i)return 0===i&&this.toast.warning("Harap Isi Salah Satu URL","Form Tidak lengkap (Web/FB/DC)",null,!0),this.submitted=!1,void this.bs.idle();this.subsFansubUpdate=this.fansub.updateFansub(this.fansubSlug,{...s}).subscribe({next:n=>{this.gs.log("[FANSUB_EDIT_SUCCESS]",n),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/fansub/${n.result.slug}`)},error:n=>{this.gs.log("[FANSUB_EDIT_ERROR]",n,"error"),this.submitted=!1,this.bs.idle()}})}static#t=this.\u0275fac=function(s){return new(s||a)(t.Y36(u.QS),t.Y36(r.F0),t.Y36(L.z),t.Y36(r.gz),t.Y36(Rt.X),t.Y36(P.T),t.Y36(q.k),t.Y36(Y.e),t.Y36(N.U))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-edit"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"fansub-banner","fansub-banner-1","align-items-center"],[1,"fansub-banner","fansub-banner-2","align-items-center"],[2,"padding-top","160px"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","web","placeholder","http://www.domain.id"],["fontIcon","web","matSuffix",""],["matInput","","formControlName","facebook","placeholder","http://www.facebook.com"],["fontIcon","facebook","matSuffix",""],["matInput","","formControlName","discord","placeholder","http://www.discord.gg"],["matSuffix",""],["height","24px",2,"vertical-align","baseline",3,"src"],["matInput","","formControlName","twitter","placeholder","http://www.twitter.com"],[1,"col-12","col-md-7","col-xl-8","p-3"],["gambar_",""],["class","col-12 py-3",4,"ngIf"],["appearance","outline",1,"py-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","name","placeholder","Fansub Jalanan"],["fontIcon","wysiwyg","matSuffix",""],["appearance","outline","matTooltip","Digunakan Juga Untuk Sub-Domain",1,"py-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","slug","placeholder","Jalsub"],["fontIcon","short_text","matSuffix",""],["class","text-info",4,"ngIf"],["formControlName","description",1,"py-3","w-100",3,"config"],["appearance","outline",1,"py-3","col-12","col-md-6",3,"color"],["matInput","","formControlName","born",3,"matDatepicker","placeholder","focus"],["matSuffix","",3,"for"],["disabled","false"],["kalender",""],["formControlName","active","placeholder","Aktif / Non-Aktif"],["value","0"],["value","1"],["align","end"],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["appearance","outline","class","py-3 col-12",3,"color",4,"ngIf"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],[1,"col-12","py-3"],[1,"text-info"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""],["matInput","","formControlName","rss_feed","placeholder","http://my-site.blogspot.com/feeds/posts/default?alt=rss"],["fontIcon","rss_feed","matSuffix",""]],template:function(s,i){1&s&&t.YNc(0,ue,8,3,"div",0),2&s&&t.Q6J("ngIf",i.fg)},dependencies:[b.sg,b.O5,r.rH,Nt.CK,I.eB,I.Nr,Z.ir,Z.lw,Z.IP,Z.Y6,w.Mq,w.hl,w.nW,H.Hw,D.nI,D.v_,D.pH,D.$V,D.nX,Lt.k0,Pt.x8,j.Kd,O.t,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.Yh,T.s6,b.uU,Ot.$],styles:[".fansub-banner[_ngcontent-%COMP%]{height:128px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;filter:blur(5px) brightness(100%);opacity:.5}.fansub-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.fansub-banner-2[_ngcontent-%COMP%]{position:absolute;top:128px;left:0}.fansub-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}"]})}return a})(),canActivate:[y.H,k.t],data:{title:"Fansub - Ubah Data",description:"Halaman Pembaharuan Data Fansub",keywords:"Ubah Fansub",[g.t.decoratorVerifiedOnly]:!0,[g.t.decoratorRoles]:[h.yS.ADMIN,h.yS.MODERATOR,h.yS.FANSUBBER,h.yS.USER]}}]}];let be=(()=>{class a{static#t=this.\u0275fac=function(s){return new(s||a)};static#e=this.\u0275mod=t.oAB({type:a});static#i=this.\u0275inj=t.cJS({imports:[b.ez,r.Bz.forChild(ce),d.m,m.L,C.$,_.P,f.m9,v.F,u.u5,u.UX,S.Ad,T.UM,R.b,F.T,$.d]})}return a})()},801:(M,x,o)=>{o.d(x,{Q:()=>y});var b=o(7084),r=o(4650),u=o(9816),T=o(6895),f=o(7392),S=o(7462);function g(d,F){if(1&d&&r._UZ(0,"h3",8),2&d){const m=r.oxw().$implicit;r.Q6J("innerHTML",m.text,r.oJD)}}function h(d,F){if(1&d&&(r.TgZ(0,"mat-expansion-panel",3)(1,"mat-expansion-panel-header")(2,"mat-panel-title",4)(3,"span",5),r._uU(4),r.qZA()(),r.TgZ(5,"mat-panel-description"),r._UZ(6,"mat-icon",6),r.qZA()(),r.YNc(7,g,1,1,"ng-template",7),r.qZA()),2&d){const m=F.$implicit,_=F.first,v=r.oxw(2);r.Q6J("expanded",v.GS.isDesktop&&_),r.xp6(3),r.s9C("matTooltip",m.tooltip),r.Q6J("matTooltipPosition","above"),r.xp6(1),r.hij(" ",m.title," "),r.xp6(2),r.Q6J("fontIcon",m.icon)}}function k(d,F){if(1&d&&(r.TgZ(0,"mat-accordion",1),r.YNc(1,h,8,5,"mat-expansion-panel",2),r.qZA()),2&d){const m=r.oxw();r.xp6(1),r.Q6J("ngForOf",m.panelData)}}let y=(()=>{class d{onResize(m){this.gs.onResize(m,"MATERIAL_EXPANSION_PANEL"),this.gs.isDesktop?this.accordion.openAll():this.accordion.closeAll()}constructor(m){this.gs=m,this.panelData=[{title:"Title",icon:"warning",text:"Lorem ipsum ...",tooltip:"Info"}]}get GS(){return this.gs}ngOnInit(){}static#t=this.\u0275fac=function(_){return new(_||d)(r.Y36(u.U))};static#e=this.\u0275cmp=r.Xpm({type:d,selectors:[["app-material-expansion-panel"]],viewQuery:function(_,v){if(1&_&&r.Gf(b.pp,5),2&_){let C;r.iGM(C=r.CRH())&&(v.accordion=C.first)}},hostBindings:function(_,v){1&_&&r.NdJ("resize",function(R){return v.onResize(R)},!1,r.Jf7)},inputs:{panelData:"panelData"},decls:1,vars:1,consts:[["class","example-headers-align","multi","",4,"ngIf"],["multi","",1,"example-headers-align"],[3,"expanded",4,"ngFor","ngForOf"],[3,"expanded"],[1,"font-weight-bold"],[3,"matTooltip","matTooltipPosition"],[1,"ms-auto",3,"fontIcon"],["matExpansionPanelContent",""],[1,"m-0","text-justify",2,"white-space","pre-line !important",3,"innerHTML"]],template:function(_,v){1&_&&r.YNc(0,k,2,1,"mat-accordion",0),2&_&&r.Q6J("ngIf",v.panelData.length>0)},dependencies:[T.sg,T.O5,b.pp,b.ib,b.yz,b.yK,b.u4,b.HS,f.Hw,S.Kd]})}return d})()},9560:(M,x,o)=>{o.d(x,{$:()=>T});var b=o(6895),r=o(2314),u=o(4650);let T=(()=>{class f{static#t=this.\u0275fac=function(h){return new(h||f)};static#e=this.\u0275mod=u.oAB({type:f});static#i=this.\u0275inj=u.cJS({imports:[b.ez,r.m]})}return f})()},4520:(M,x,o)=>{o.d(x,{Q:()=>b});var b=(()=>{return(r=b||(b={})).BIRU="#7289DA",r.UNGU="#3F51B5",r.HITAM="#343A40",r.ABU="#A9A9A9",r.MERAH="#DC3545",r.PINK="#FF4081",r.OREN="#F44336",r.KUNING="#FFC107",r.HIJAU="#28A745",b;var r})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkmain_site=self.webpackChunkmain_site||[]).push([[745],{1745:(M,x,o)=>{o.r(x),o.d(x,{FansubModule:()=>be});var b=o(6895),r=o(1390),u=o(4006),T=o(7375),f=o(4561),S=o(5128),g=o(3659),h=o(1741),k=o(5816),y=o(7357),d=o(2314),F=o(3811),m=o(9736),_=o(6533),v=o(6319),C=o(9560),R=o(8866),$=o(5208),z=o(7272),t=o(4650),N=o(9816),L=o(3322),Q=o(5312),P=o(3842),K=o(8151),G=o(1338),O=o(4758);function V(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.barChartAnimeData)("labels",e.barChartAnimeLabels)("chartType",e.barChartType)("options",e.barChartAnimeOptions)("plugins",e.chartPlugins)("legend",!1)}}function W(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.barChartDoramaData)("labels",e.barChartDoramaLabels)("chartType",e.barChartType)("options",e.barChartDoramaOptions)("plugins",e.chartPlugins)("legend",!1)}}function X(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.pieChartStatusData)("labels",e.pieChartStatusLabels)("chartType",e.pieChartType)("options",e.pieChartStatusOptions)("plugins",e.chartPlugins)("legend",!0)}}function tt(a,l){if(1&a&&(t.TgZ(0,"div",8),t._UZ(1,"canvas",9),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Q6J("data",e.doughnutChartGarapanData)("labels",e.doughnutChartGarapanLabels)("chartType",e.doughnutChartType)("options",e.doughnutChartGarapanOptions)("plugins",e.chartPlugins)("legend",!0)}}let et=(()=>{class a{constructor(e,s,i,n,c,p,A){this.activatedRoute=e,this.router=s,this.gs=i,this.bs=n,this.fs=c,this.fansub=p,this.wb=A,this.allFansubId=[],this.fansubData=[],this.tabData=[{name:"Katalog Fansub",icon:"closed_caption",type:"table",data:{column:["Status","Logo","Nama Fansub","Anime","Dorama","Tautan Komunitas"],row:[]}}],this.pieChartStatusOptions={title:{display:!0,text:"Kondisi Fansub Terkini"},responsive:!0,legend:{position:"right"}},this.doughnutChartGarapanOptions={title:{display:!0,text:"Total Garapan Fansub"},responsive:!0,legend:{position:"right"}},this.barChartAnimeOptions={title:{display:!0,text:"Garapan Anime Terbanyak"},responsive:!0,legend:{position:"right"},scales:{xAxes:[{ticks:{beginAtZero:!0},gridLines:{color:"rgba(92,92,92,1)"}}],yAxes:[{gridLines:{color:"rgba(92,92,92,1)"}}]}},this.barChartDoramaOptions={title:{display:!0,text:"Garapan Dorama Terbanyak"},responsive:!0,legend:{position:"right"},scales:{xAxes:[{ticks:{beginAtZero:!0},gridLines:{color:"rgba(92,92,92,1)"}}],yAxes:[{gridLines:{color:"rgba(92,92,92,1)"}}]}},this.chartPlugins=[],this.pieChartStatusData=[],this.pieChartStatusLabels=[],this.doughnutChartGarapanData=[],this.doughnutChartGarapanLabels=[],this.barChartAnimeData=[],this.barChartAnimeLabels=[],this.barChartDoramaData=[],this.barChartDoramaLabels=[],this.pieChartType="pie",this.doughnutChartType="doughnut",this.barChartType="horizontalBar",this.fansubActive=0,this.fansubInActive=0,this.subsFansub=null,this.subsAnime=null,this.subsDorama=null,this.subsQueryParam=null,this.subsInternetPositif=null,this.gs.bannerImg="/assets/img/banner/fansub.png",this.gs.sizeContain=!1,this.gs.bgRepeat=!1,this.gs.isBrowser&&((0,f.Dy)(),(0,f.bF)())}ngOnDestroy(){this.subsFansub?.unsubscribe(),this.subsAnime?.unsubscribe(),this.subsQueryParam?.unsubscribe(),this.subsInternetPositif?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&this.watchUrlRoute()}watchUrlRoute(){this.subsQueryParam=this.activatedRoute.queryParams.subscribe({next:e=>{this.bs.busy(),this.allFansubId=[],this.fansubData=[],this.fansubActive=0,this.fansubInActive=0,this.doughnutChartGarapanLabels=[],this.doughnutChartGarapanData=[],this.barChartAnimeLabels=[],this.barChartAnimeData=[],this.barChartDoramaLabels=[],this.barChartDoramaData=[],this.bs.idle(),this.getFansubData()}})}getFansubData(){this.bs.busy(),this.subsFansub=this.fansub.getAllFansub().subscribe({next:e=>{this.gs.log("[FANSUB_LIST_SUCCESS]",e);for(const s of e.results){this.allFansubId.push(s.id);const i=[];if(Object.keys(s.urls).length>0)for(const[c,p]of Object.entries(s.urls))i.push({type:"button",icon:"discord"===c||"twitter"===c?void 0:c,image:"discord"===c?"/assets/img/discord/blue.png":"twitter"===c?"/assets/img/twitter/blue.png":void 0,url:p,name:c});this.fansubData.push({id:s.id,slug:s.slug,Logo:s.image_url,Status:s.active?"AKTIF":"TIDAK AKTIF","Nama Fansub":s.name,"Tautan Komunitas":i}),s.active?this.fansubActive++:s.active||this.fansubInActive++}this.pieChartStatusLabels=["Aktif","Tidak Aktif"],this.pieChartStatusData=[this.fansubActive,this.fansubInActive],this.tabData[0].data.row=this.fansubData,this.allFansubId.length>0&&(this.getAnimeFansub(),this.getDoramaFansub(),this.checkInternetPositif()),this.fs.initializeFab("add",null,"Tambahkan Fansub Baru","/create/fansub",!1),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_LIST_ERROR]",e,"error"),this.bs.idle()}})}checkInternetPositif(){this.bs.busy();const s=[];for(let i=0;i{this.gs.log("[FANSUB_KOMINFO_SUCCESS]",i);for(const n of this.fansubData)i.results[n.id]&&(n.internet_positif=i.results[n.id])},error:i=>{this.gs.log("[FANSUB_KOMINFO_ERROR]",i,"error"),this.bs.idle()},complete:()=>{this.bs.idle()}})}getAnimeFansub(){this.bs.busy(),this.subsAnime=this.fansub.getAnimeFansub(this.allFansubId).subscribe({next:e=>{this.gs.log("[FANSUB_ANIME_SUCCESS]",e);for(const i of this.fansubData)i.Anime=e.results[i.id];this.doughnutChartGarapanLabels.push("Anime"),this.doughnutChartGarapanData.push(e.count);const s=[...this.fansubData].sort((i,n)=>n.Anime-i.Anime).slice(0,10);for(const i of s)this.barChartAnimeLabels.push(i["Nama Fansub"]),this.barChartAnimeData.push(i.Anime);this.bs.idle()},error:e=>{this.gs.log("[FANSUB_ANIME_ERROR]",e,"error"),this.bs.idle()}})}getDoramaFansub(){this.bs.busy(),this.subsDorama=this.fansub.getDoramaFansub(this.allFansubId).subscribe({next:e=>{this.gs.log("[FANSUB_DORAMA_SUCCESS]",e);for(const i of this.fansubData)i.Dorama=e.results[i.id];this.doughnutChartGarapanLabels.push("Dorama"),this.doughnutChartGarapanData.push(e.count);const s=[...this.fansubData].sort((i,n)=>n.Dorama-i.Dorama).slice(0,10);for(const i of s)this.barChartDoramaLabels.push(i["Nama Fansub"]),this.barChartDoramaData.push(i.Dorama);this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DORAMA_ERROR]",e,"error"),this.bs.idle()}})}openFansub(e){this.gs.log("[FANSUB_LIST_OPEN_FANSUB]",e),this.router.navigateByUrl(`/fansub/${e.slug}`)}openUrl(e){this.gs.log("[FANSUB_LIST_OPEN_URL]",e),this.wb.winboxOpenUri(e.url)}static#t=this.\u0275fac=function(s){return new(s||a)(t.Y36(r.gz),t.Y36(r.F0),t.Y36(N.U),t.Y36(L.z),t.Y36(Q.r),t.Y36(P.T),t.Y36(K.N))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-list"]],decls:13,vars:5,consts:[[1,"container"],[1,"row","p-3"],["class","col-12 col-md-6 py-1 bg-bifeldy",4,"ngIf"],[1,"row","my-4"],[1,"col-12"],[1,"text-success","text-end"],[1,"row"],[3,"tabData","tableRowClicked","buttonClicked"],[1,"col-12","col-md-6","py-1","bg-bifeldy"],["baseChart","",3,"data","labels","chartType","options","plugins","legend"]],template:function(s,i){1&s&&(t._UZ(0,"app-notifications"),t.TgZ(1,"div",0)(2,"div",1),t.YNc(3,V,2,6,"div",2),t.YNc(4,W,2,6,"div",2),t.YNc(5,X,2,6,"div",2),t.YNc(6,tt,2,6,"div",2),t.qZA(),t.TgZ(7,"div",3)(8,"div",4)(9,"div",5),t._uU(10," * Internet Positif => Warna Abu-Abu "),t.qZA()()(),t.TgZ(11,"div",6)(12,"app-material-tab",7),t.NdJ("tableRowClicked",function(c){return i.openFansub(c)})("buttonClicked",function(c){return i.openUrl(c)}),t.qZA()()()),2&s&&(t.xp6(3),t.Q6J("ngIf",i.barChartAnimeData.length>0&&i.barChartAnimeLabels.length>0),t.xp6(1),t.Q6J("ngIf",i.barChartDoramaData.length>0&&i.barChartDoramaLabels.length>0),t.xp6(1),t.Q6J("ngIf",2===i.pieChartStatusData.length&&2===i.pieChartStatusLabels.length),t.xp6(1),t.Q6J("ngIf",2===i.doughnutChartGarapanData.length&&2===i.doughnutChartGarapanLabels.length),t.xp6(6),t.Q6J("tabData",i.tabData))},dependencies:[b.O5,G.H,f.jh,O.t]})}return a})();var E=o(4674),it=o(4520),Y=o(80),st=o(2970),at=o(5141),nt=o(7396),q=o(2693),ot=o(1428),rt=o(8598),I=o(9818),H=o(7392),U=o(9982),j=o(7462),lt=o(801),ut=o(291),ct=o(3710),bt=o(7397),gt=o(1105);function mt(a,l){if(1&a&&(t.TgZ(0,"div",8)(1,"a",38),t._UZ(2,"mat-icon",39),t._uU(3," Facebook Fanpage "),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("href",e.fansubData.urls.facebook,t.LSH)}}function ht(a,l){if(1&a&&(t.TgZ(0,"div",8)(1,"a",40),t._UZ(2,"img",41),t._uU(3," Ruang Obrolan Discord "),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("href",e.fansubData.urls.discord,t.LSH)}}function dt(a,l){if(1&a&&(t.TgZ(0,"div",8)(1,"a",42),t._UZ(2,"img",43),t._uU(3," Cuitan Twitter "),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("href",e.fansubData.urls.twitter,t.LSH)}}function pt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"a",44),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.joinLeaveMember())}),t._uU(1),t.qZA()}if(2&a){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.joinedAsMember?"Keluar":"Gabung"," ")}}function _t(a,l){1&a&&t._UZ(0,"app-no-data")}function ft(a,l){if(1&a&&(t.TgZ(0,"mat-list-option",47),t._UZ(1,"img",48),t.TgZ(2,"a",49)(3,"span",50),t._uU(4),t.qZA(),t.TgZ(5,"span",51),t._uU(6),t.qZA()()()),2&a){const e=l.$implicit;t.MGl("routerLink","/user/",e.user_.username,""),t.xp6(1),t.s9C("src",e.user_.image_url,t.LSH),t.xp6(3),t.hij(" ",e.keterangan," "),t.xp6(2),t.Oqu(e.user_.username)}}function vt(a,l){if(1&a&&(t.TgZ(0,"mat-selection-list",45),t.YNc(1,ft,7,4,"mat-list-option",46),t.qZA()),2&a){const e=t.oxw(2);t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.approvedMembers)}}function xt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"mat-list-option",53),t._UZ(1,"img",48),t.TgZ(2,"a",49)(3,"span",54)(4,"small",55),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.approveMember(n))}),t._uU(5," Terima "),t.qZA(),t._uU(6," | "),t.TgZ(7,"small",56),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.rejectMember(n))}),t._uU(8," Tolak "),t.qZA()(),t.TgZ(9,"span",57),t._uU(10),t.qZA()()()}if(2&a){const e=l.$implicit;t.xp6(1),t.s9C("src",e.user_.image_url,t.LSH),t.xp6(8),t.MGl("routerLink","/user/",e.user_.username,""),t.xp6(1),t.hij(" ",e.user_.username," ")}}function Tt(a,l){if(1&a&&(t.TgZ(0,"mat-selection-list",45),t.YNc(1,xt,11,3,"mat-list-option",52),t.qZA()),2&a){const e=t.oxw(2);t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.pendingMembers)}}function At(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",8)(1,"button",58),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getSubDomain())}),t._UZ(2,"mat-icon",59),t._uU(3),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(3),t.AsE(" 'https://",e.fansubData.slug,".",e.ENV.domain,"' ")}}function Ft(a,l){if(1&a&&(t.TgZ(0,"div",17),t._UZ(1,"app-material-expansion-panel",60),t.qZA()),2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("panelData",e.panelData)}}function Ct(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"mat-list-option",53),t._UZ(1,"mat-icon",65),t.TgZ(2,"a",66),t.NdJ("click",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.openRssFeed(n.fansub_,n.link))}),t.TgZ(3,"span",67),t._uU(4),t.ALo(5,"dateAgo"),t.qZA(),t._UZ(6,"span",68),t.qZA()()}if(2&a){const e=l.$implicit;t.xp6(4),t.Oqu(t.lcZ(5,2,e.created_at)),t.xp6(2),t.Q6J("innerHTML",e.title,t.oJD)}}function Dt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",61)(2,"h2",62)(3,"span",63)(4,"a",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getRssFeed())}),t._uU(5," Refresh "),t.qZA(),t._uU(6," | "),t.TgZ(7,"a",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.showAllRssFeed())}),t._uU(8," Lainnya "),t.qZA()(),t.TgZ(9,"b",21),t._uU(10,"RSS Feed Fansub"),t.qZA()()(),t.TgZ(11,"div",16)(12,"mat-selection-list",45),t.YNc(13,Ct,7,4,"mat-list-option",52),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(12),t.Q6J("multiple",!1),t.xp6(1),t.Q6J("ngForOf",e.rssFeedData)}}function St(a,l){1&a&&(t.TgZ(0,"div",17)(1,"div",16),t._UZ(2,"app-report"),t.qZA()())}function Et(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6),t._UZ(6,"img",7),t.qZA(),t.TgZ(7,"div",8)(8,"button",9),t._UZ(9,"mat-icon",10),t._uU(10),t.ALo(11,"date"),t.qZA(),t.TgZ(12,"button",11),t._UZ(13,"mat-icon",12),t._uU(14),t.qZA()(),t.YNc(15,mt,4,1,"div",13),t.YNc(16,ht,4,1,"div",13),t.YNc(17,dt,4,1,"div",13),t.TgZ(18,"div",8)(19,"button",14),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.editFansubData())}),t._UZ(20,"mat-icon",15),t._uU(21," Perbaharui Informasi "),t.qZA()(),t.TgZ(22,"div",16)(23,"div",17)(24,"div",18)(25,"h2",19),t.YNc(26,pt,2,1,"a",20),t.TgZ(27,"b",21),t._uU(28),t.qZA()()(),t.TgZ(29,"div",22)(30,"div",23),t.YNc(31,_t,1,0,"app-no-data",24),t.YNc(32,vt,2,2,"mat-selection-list",25),t.YNc(33,Tt,2,2,"mat-selection-list",25),t.qZA()(),t.TgZ(34,"div",8)(35,"button",26),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.togglePendingMembers())}),t._UZ(36,"mat-icon",27),t._uU(37),t.qZA()()()(),t.YNc(38,At,4,2,"div",13),t.qZA()(),t.TgZ(39,"div",28)(40,"div",29)(41,"h1",30)(42,"b"),t._uU(43),t.qZA()()(),t.TgZ(44,"div",17)(45,"app-material-chip",31),t.NdJ("chipClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openTag(i))}),t.qZA()(),t.TgZ(46,"div",32),t._UZ(47,"app-notifications",33),t.qZA(),t.YNc(48,Ft,2,1,"div",34),t.YNc(49,Dt,14,2,"div",34),t.YNc(50,St,3,0,"div",34),t.qZA()(),t.TgZ(51,"div",32)(52,"div",16)(53,"app-material-tab",35),t.NdJ("listClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openAnime(i))})("gridClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openDorama(i))})("tableRowClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.openFile(i))})("paginatorClicked",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.onPaginatorClicked(i))})("serverSideFilter",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.onServerSideFilter(i))})("serverSideOrder",function(i){t.CHM(e);const n=t.oxw();return t.KtG(n.onServerSideOrder(i))})("gridLoadNextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onDoramaLoadNextPage())})("listLoadNextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onAnimeLoadNextPage())}),t.qZA()()()(),t._UZ(54,"div",36)(55,"div",37),t.qZA()}if(2&a){const e=t.oxw();t.xp6(6),t.Q6J("src",e.fansubData.image_url,t.LSH),t.xp6(4),t.hij(" ",t.xi3(11,26,e.fansubData.born,"d MMMM y")," "),t.xp6(4),t.hij(" ",e.fansubData.active?"Aktif":"Tidak Aktif"," "),t.xp6(1),t.Q6J("ngIf",e.fansubData.urls.facebook),t.xp6(1),t.Q6J("ngIf",e.fansubData.urls.discord),t.xp6(1),t.Q6J("ngIf",e.fansubData.urls.twitter),t.xp6(2),t.s9C("matTooltip",e.fansubData.user_?"Terakhir Di Ubah Oleh :: "+e.fansubData.user_.username:"Perbaharui Data Fansub"),t.xp6(7),t.Q6J("ngIf",!e.showPendingMember),t.xp6(2),t.hij(" ",e.showPendingMember?"Permintaan Gabung":"Anggota"," "),t.xp6(3),t.Q6J("ngIf",!e.showPendingMember&&e.approvedMembers.length<=0||e.showPendingMember&&e.pendingMembers.length<=0),t.xp6(1),t.Q6J("ngIf",!e.showPendingMember&&e.approvedMembers.length>0),t.xp6(1),t.Q6J("ngIf",e.showPendingMember&&e.pendingMembers.length>0),t.xp6(4),t.hij(" Lihat ",e.showPendingMember?"Anggota":"Permintaan Gabung"," "),t.xp6(1),t.Q6J("ngIf",!e.fansubData.dns_id),t.xp6(5),t.Oqu(e.fansubData.name),t.xp6(2),t.Q6J("chipData",e.chipData),t.xp6(3),t.Q6J("ngIf",e.panelData.length>0),t.xp6(1),t.Q6J("ngIf",e.rssFeedData.length>0),t.xp6(1),t.Q6J("ngIf",null==e.SS.mySocket?null:e.SS.mySocket.id),t.xp6(3),t.Q6J("tabData",e.tabData)("count",e.count)("serverSide",!0)("gridPageFinished",e.doramaPageFinished)("listPageFinished",e.animePageFinished),t.xp6(1),t.Udp("background-image","url("+e.fansubData.cover_url+")")}}let It=(()=>{class a{constructor(e,s,i,n,c,p,A,B,J,ge,me,he,de,pe){this.activatedRoute=e,this.router=s,this.bs=i,this.as=n,this.ds=c,this.gs=p,this.fs=A,this.pi=B,this.fansub=J,this.ss=ge,this.toast=me,this.wb=he,this.berkas=de,this.notif=pe,this.fansubSlug="",this.fansubData=null,this.rssFeedData=[],this.approvedMembers=[],this.pendingMembers=[],this.joinedAsMember=null,this.showPendingMember=!1,this.count=0,this.page=1,this.row=10,this.q="",this.sort="",this.order="",this.animeFansub=[],this.doramaFansub=[],this.berkasFansub=[],this.allBerkasFansubId=[],this.animePageFinished=!1,this.doramaPageFinished=!1,this.animePage=1,this.doramaPage=1,this.chipData=[],this.panelData=[],this.tabData=[{name:"Anime",icon:"live_tv",type:"list",data:[]},{name:"Dorama",icon:"movie",type:"grid",data:[]},{name:"Berkas Terkait",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Pemilik"],row:[]}}],this.subsActRoute=null,this.subsFansub=null,this.subsBerkas=null,this.subsAnime=null,this.subsDorama=null,this.subsParam=null,this.subsRssFeed=null,this.subsFansubMemberGet=null,this.subsFansubMemberJoin=null,this.subsFansubMemberApproveReject=null,this.subsFansubMemberLeave=null,this.subsDialog=null,this.subsClaimSubDomain=null,this.subsTrusted=null,this.subsInternetPositif=null,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get SS(){return this.ss}get ENV(){return E.N}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsFansub?.unsubscribe(),this.subsBerkas?.unsubscribe(),this.subsAnime?.unsubscribe(),this.subsDorama?.unsubscribe(),this.subsParam?.unsubscribe(),this.subsRssFeed?.unsubscribe(),this.subsFansubMemberGet?.unsubscribe(),this.subsFansubMemberJoin?.unsubscribe(),this.subsFansubMemberApproveReject?.unsubscribe(),this.subsFansubMemberLeave?.unsubscribe(),this.subsDialog?.unsubscribe(),this.subsClaimSubDomain?.unsubscribe(),this.subsTrusted?.unsubscribe(),this.subsInternetPositif?.unsubscribe(),this.fansubData&&this.notif.removeNotif(`${E.N.siteName.toUpperCase()}_FANSUB#${this.fansubData.id}`)}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:e=>{this.fansubSlug=e.fansubSlug,this.getFansubDetail()}})}getFansubDetail(){this.bs.busy(),this.subsFansub=this.fansub.getFansub(this.fansubSlug).subscribe({next:e=>{if(this.gs.log("[FANSUB_DETAIL_SUCCESS]",e),this.fansubData=e.result,this.pi.updatePageMetaData(this.fansubData.name,this.fansubData.description,Array.isArray(this.fansubData.tags)?this.fansubData.tags.join(", "):this.fansubData.name,this.fansubData.image_url,this.fansubData.user_.username),this.bs.idle(),this.gs.isBrowser){if(Array.isArray(this.fansubData.tags))for(let s=0;s{this.gs.log("[FANSUB_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/fansub"}})}})}checkInternetPositif(){this.bs.busy(),this.subsInternetPositif=this.fansub.checkInternetPositif([this.fansubData.id]).subscribe({next:e=>{this.gs.log("[FANSUB_KOMINFO_SUCCESS]",e),e.results[this.fansubData.id]&&this.notif.addNotif(null,`${E.N.siteName.toUpperCase()}_FANSUB#${this.fansubData.id}`,"secondary","Internet Positif","Halaman website Fansub ini ada di dalam daftar situs yang diblokir oleh Kominfo ~",!1)},error:e=>{this.gs.log("[FANSUB_KOMINFO_ERROR]",e,"error"),this.bs.idle()},complete:()=>{this.bs.idle()}})}getRssFeed(){this.bs.busy(),this.subsRssFeed=this.fansub.getRssFeedFansub(this.fansubSlug).subscribe({next:e=>{this.gs.log("[RSS_FEED_LIST_SUCCESS]",e),this.rssFeedData=e.results,this.bs.idle()},error:e=>{this.gs.log("[RSS_FEED_LIST_ERROR]",e,"error"),this.bs.idle()}})}showAllRssFeed(){this.router.navigate(["/rss-feed"],{queryParams:{q:this.fansubSlug}})}openRssFeed(e,s){const i=e.urls.web;if(i){const n=new URL(i);let c=`${n.protocol}//${n.host}`;s.startsWith("/")||(c+="/"),c+=s,this.wb.winboxOpenUri(c)}}getBerkasFansub(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.fansub.getBerkasFansub([this.fansubData.id],this.q,this.page,this.row,this.sort,this.order).subscribe({next:e=>{this.gs.log("[BERKAS_ANIME_SUCCESS]",e),this.count=e.count,this.berkasFansub=[];for(const s of e.results[this.fansubData.id])this.allBerkasFansubId.push(s.id),this.berkasFansub.push({id:s.id,private:s.private,foto:s.user_.image_url,Pemilik:s.user_.username,Proyek:s.project_type_.name,Tanggal:s.created_at,"Nama Berkas":s.name});this.tabData[2].data.row=this.berkasFansub,this.allBerkasFansubId.length>0&&this.checkTrusted(),this.bs.idle()},error:e=>{this.gs.log("[BERKAS_FANSUB_ERROR]",e,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted&&(this.subsTrusted.unsubscribe(),this.bs.idle()),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasFansubId).subscribe({next:e=>{this.gs.log("[ANIME_BERKAS_TRUSTED_SUCCESS]",e);for(const s of this.berkasFansub)s.trusted=e.results[s.id];this.bs.idle()},error:e=>{this.gs.log("[ANIME_BERKAS_TRUSTED_ERROR]",e,"error"),this.bs.idle()}})}getAnimeFansub(){this.bs.busy(),this.subsAnime=this.fansub.getAnimeFansub([this.fansubData.id],this.animePage).subscribe({next:e=>{this.gs.log("[FANSUB_ANIME_SUCCESS]",e);for(const s of e.results[this.fansubData.id])this.animeFansub.push({id:s.id,image:s.image_url,title:s.name});this.tabData[0].data=this.animeFansub,e.results[this.fansubData.id].length<=0&&(this.animePageFinished=!0),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_ANIME_ERROR]",e,"error"),this.bs.idle()}})}getDoramaFansub(){this.bs.busy(),this.subsDorama=this.fansub.getDoramaFansub([this.fansubData.id],this.doramaPage).subscribe({next:e=>{this.gs.log("[FANSUB_DORAMA_SUCCESS]",e);for(const s of e.results[this.fansubData.id])this.doramaFansub.push({id:s.id,image:s.image_url,title:s.name,slug:s.slug});this.tabData[1].data=this.doramaFansub,e.results[this.fansubData.id].length<=0&&(this.doramaPageFinished=!0),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DORAMA_ERROR]",e,"error"),this.bs.idle()}})}editFansubData(){this.router.navigateByUrl(`/fansub/${this.fansubSlug}/edit`)}onServerSideFilter(e){this.gs.log("[BERKAS_FANSUB_ENTER_FILTER]",e),this.q=e,this.getBerkasFansub()}onServerSideOrder(e){this.gs.log("[BERKAS_FANSUB_CLICK_ORDER]",e),this.q=e.q,this.sort=e.active,this.order=e.direction,this.getBerkasFansub()}onPaginatorClicked(e){this.gs.log("[FANSUB_DETAIL_CLICK_PAGINATOR]",e),this.page=e.pageIndex+1,this.row=e.pageSize,this.getBerkasFansub()}openFile(e){this.gs.log("[FANSUB_DETAIL_OPEN_FILE]",e),this.router.navigateByUrl(`/berkas/${e.id}`)}openAnime(e){this.gs.log("[FANSUB_DETAIL_OPEN_ANIME]",e);const s=e.title.replace(/[^a-zA-Z0-9]/g,"-");this.router.navigateByUrl(`/anime/${e.id}-${s}`)}openDorama(e){this.gs.log("[FANSUB_DETAIL_OPEN_DORAMA]",e),this.router.navigateByUrl(`/dorama/${e.slug}`)}openTag(e){this.gs.log("[FANSUB_DETAIL_OPEN_TAG]",e)}onAnimeLoadNextPage(){this.animePageFinished||(this.animePage++,this.getAnimeFansub())}onDoramaLoadNextPage(){this.doramaPageFinished||(this.doramaPage++,this.getDoramaFansub())}togglePendingMembers(){this.showPendingMember=!this.showPendingMember,this.getFansubMember()}getFansubMember(){this.bs.busy(),this.subsFansubMemberGet=this.fansub.getFansubMember(this.fansubSlug).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LIST_SUCCESS]",e),this.approvedMembers=[],this.pendingMembers=[];for(const s of e.results)s.approved?this.approvedMembers.push(s):this.pendingMembers.push(s);if(this.as.currentUserSubject?.value){const s=this.approvedMembers.findIndex(i=>i.user_.id===this.as.currentUserSubject?.value?.id);this.joinedAsMember=s>=0?this.approvedMembers[s]:null}this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LIST_ERROR]",e,"error"),this.bs.idle()}})}joinLeaveMember(){this.bs.busy(),this.joinedAsMember?this.subsFansubMemberLeave=this.fansub.leaveFansubMember(this.joinedAsMember.id).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LEAVE_SUCCESS]",e),this.getFansubMember(),this.bs.idle()},error:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_LEAVE_ERROR]",e,"error"),this.getFansubMember(),this.bs.idle()}}):this.subsFansubMemberJoin=this.fansub.requestJoinFansubMember({slug:this.fansubSlug}).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_JOIN_SUCCESS]",e),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:"Permintaan Gabung Berhasil",htmlMessage:"Silahkan Menghubungi Anggota Yang Sudah Tergabung / Admin / Moderator Fansub Untuk Menerima Permintaan Gabung.",confirmText:"Tutup"}}).afterClosed().subscribe({next:s=>{this.gs.log("[INFO_DIALOG_CLOSED]",s),this.getFansubMember(),this.subsDialog.unsubscribe()}})},error:e=>{this.gs.log("[FANSUB_DETAIL_MEMBER_JOIN_ERROR]",e,"error"),this.getFansubMember(),this.bs.idle()}})}approveOrRejectFansubMember(e,s){this.subsDialog=this.ds.openInputDialog({data:{title:`Keterangan ${s?"Approve":"Reject"} '${e.user_.username}' :: '${e.fansub_.slug}'`,input:{keterangan:{inputLabel:"Keterangan",inputPlaceholder:"Pemilik, Translator, Timer, QA / QC, TypeSetter, dll.",inputValue:null,inputRequired:!0}},confirmText:"OK",cancelText:"Batal",infoText:"Max. 10 Huruf"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INPUT_DIALOG_CLOSED]",i),i?(this.bs.busy(),this.subsFansubMemberApproveReject=this.fansub.approveRejectFansubMember(e.id,{approved:s,keterangan:i.keterangan?.substring(0,10)}).subscribe({next:n=>{this.gs.log("[FANSUB_DETAIL_MEMBER_APPROVE_REJECT_SUCCESS]",n),this.getFansubMember(),this.bs.idle()},error:n=>{this.gs.log("[FANSUB_DETAIL_MEMBER_APPROVE_REJECT_ERROR]",n,"error"),this.getFansubMember(),this.bs.idle()}})):!1===i&&this.getFansubMember(),this.subsDialog.unsubscribe()}})}approveMember(e){this.approveOrRejectFansubMember(e,!0)}rejectMember(e){this.approveOrRejectFansubMember(e,!1)}getSubDomain(){this.as.currentUserSubject?.value?this.joinedAsMember||this.as.currentUserSubject?.value?.role===h.yS.ADMIN||this.as.currentUserSubject?.value?.role===h.yS.MODERATOR?this.subsDialog=this.ds.openInputDialog({data:{title:`Buat CNAME / A Record IP v4 v6 :: '${this.fansubSlug}'`,input:{server_target:{inputLabel:"Server Target Domain IP Publik",inputPlaceholder:"127.0.0.1 | ghs.google.com | blablabla.id.repl.co",inputValue:null,inputRequired:!0},verification_name:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-name | slug-fs",inputValue:null,inputRequired:!1},verification_target:{inputLabel:"Tambahan Khusus Blogger / Replit",inputPlaceholder:"blablabla-target.dv.googlehosted.com | replit-verify=blablabla",inputValue:null,inputRequired:!1}},confirmText:"OK",cancelText:"Batal",infoText:"Abaikan 2 Input Terakhir Jika Bukan Blogger / Replit"}}).afterClosed().subscribe({next:e=>{this.gs.log("[INPUT_DIALOG_CLOSED]",e),e&&(this.bs.busy(),this.subsClaimSubDomain=this.fansub.claimSubDomain({slug:this.fansubSlug,server_target:e.server_target,verification_name:e.verification_name,verification_target:e.verification_target}).subscribe({next:s=>{this.gs.log("[FANSUB_CLAIM_SUBDOMAIN_SUCCESS]",s),this.bs.idle(),this.subsDialog=this.ds.openInfoDialog({data:{title:"Klaim Berhasil",htmlMessage:`\n Domain '${this.fansubSlug}.${this.ENV.domain}' Selesai Didaftarkan.\n Silahkan Tunggu Hingga Propagasi Dns Selesai.\n Untuk Mengubah, Silahkan Menuju Halaman User\n Apabila Ada Pertanyaan Dapat Langsung Menghubungi Admin / Moderator.\n Terima Kasih.\n `,confirmText:"Tutup"}}).afterClosed().subscribe({next:i=>{this.gs.log("[INFO_DIALOG_CLOSED]",i),this.getFansubDetail(),this.subsDialog.unsubscribe()}})},error:s=>{this.gs.log("[FANSUB_CLAIM_SUBDOMAIN_ERROR]",s,"error"),this.bs.idle(),this.getFansubDetail()}})),this.subsDialog.unsubscribe()}}):this.toast.warning("Harus Menjadi Anggota Untuk Klaim Sub-Domain!","Whoops!",null,!0):this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}static#t=this.\u0275fac=function(s){return new(s||a)(t.Y36(r.gz),t.Y36(r.F0),t.Y36(L.z),t.Y36(Y.e),t.Y36(st.x),t.Y36(N.U),t.Y36(Q.r),t.Y36(at.Z),t.Y36(P.T),t.Y36(nt.R),t.Y36(q.k),t.Y36(K.N),t.Y36(ot.A),t.Y36(rt.T))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-detail"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"fansub-info","align-items-center"],[1,"row","py-3","px-2"],[1,"col-md-4","col-xl-3","px-3"],[1,"row","sticky-top","pt-3"],[1,"col-12","pt-4"],[1,"fansub-image",3,"src"],[1,"col-12","text-center","pt-3"],["type","button","mat-button","","color","warn","matTooltip","Berdiri Sejak",1,"w-100"],["fontIcon","calendar_today",1,"me-1"],["type","button","mat-button","","color","accent","matTooltip","Status Fansub",1,"w-100"],["fontIcon","history",1,"me-1"],["class","col-12 text-center pt-3",4,"ngIf"],["type","button","mat-button","",1,"w-100","text-success",2,"color","rgb(255, 64, 129) !important",3,"matTooltip","click"],["fontIcon","edit",1,"me-1"],[1,"col-12"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],["class","float-end text-decoration-none text-warning","style","font-size: small; cursor: pointer;",3,"click",4,"ngIf"],[1,"text-bifeldy"],[1,"col-12",2,"max-height","288px"],[1,"h-100",2,"overflow-y","auto"],[4,"ngIf"],[3,"multiple",4,"ngIf"],["type","button","mat-button","","color","accent",1,"w-100",3,"click"],["fontIcon","manage_accounts",1,"me-1"],[1,"col-md-8","col-xl-9","pt-3"],[1,"row","py-3","px-0","mt-auto"],[1,"m-0"],[3,"chipData","chipClicked"],[1,"row"],[1,"px-0"],["class","row py-3",4,"ngIf"],[3,"tabData","count","serverSide","gridPageFinished","listPageFinished","listClicked","gridClicked","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder","gridLoadNextPage","listLoadNextPage"],[1,"fansub-banner","fansub-banner-1","align-items-center"],[1,"fansub-banner","fansub-banner-2","align-items-center"],["mat-stroked-button","","matTooltip","Kunjungi Halaman Fanpage",1,"w-100",2,"color","rgb(114, 137, 218)",3,"href"],["fontIcon","facebook",1,"me-1"],["mat-stroked-button","","matTooltip","Kunjungi Ruang Obrolan",1,"w-100",2,"color","rgb(114, 137, 218)",3,"href"],["src","/assets/img/discord/blue.png","height","24px"],["mat-stroked-button","","matTooltip","Lihat Cuitan",1,"w-100",2,"color","rgb(114, 137, 218)",3,"href"],["src","/assets/img/twitter/blue.png","height","24px"],[1,"float-end","text-decoration-none","text-warning",2,"font-size","small","cursor","pointer",3,"click"],[3,"multiple"],["class","h-100",3,"routerLink",4,"ngFor","ngForOf"],[1,"h-100",3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],[1,"text-truncate","text-decoration-none"],[1,"bg-bifeldy","px-2","me-1","text-warning",2,"position","absolute","right","0"],[1,"text-success"],["class","h-100",4,"ngFor","ngForOf"],[1,"h-100"],[1,"bg-bifeldy","px-2","me-1",2,"position","absolute","right","0"],[1,"text-success",2,"cursor","pointer",3,"click"],[1,"text-danger",2,"cursor","pointer",3,"click"],[1,"text-warning",3,"routerLink"],["type","button","mat-button","","color","accent","matTooltip","Ambil / Klaim / Dapatkan Sub-Domain Ini",1,"w-100","shiny",3,"click"],["fontIcon","dns",1,"me-1"],[3,"panelData"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"float-end","text-bifeldy",2,"font-size","small"],[1,"text-warning","text-decoration-none",2,"cursor","pointer",3,"click"],["fontIcon","rss_feed","mat-list-icon","",1,"ps-3"],[1,"text-truncate","text-decoration-none",3,"click"],[1,"bg-bifeldy","px-2","me-1","text-danger",2,"position","absolute","right","0"],[1,"text-success",3,"innerHTML"]],template:function(s,i){1&s&&t.YNc(0,Et,56,29,"div",0),2&s&&t.Q6J("ngIf",i.fansubData)},dependencies:[b.sg,b.O5,r.rH,I.eB,I.Nr,H.Hw,U.Wx,U.ap,U.kh,U.O$,j.Kd,G.H,lt.Q,ut.G,O.t,ct.Y,bt.d,b.uU,gt.R],styles:[".fansub-banner[_ngcontent-%COMP%]{height:128px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;filter:blur(5px) brightness(100%);opacity:.5}.fansub-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.fansub-banner-2[_ngcontent-%COMP%]{position:absolute;top:128px;left:0}.fansub-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}.fansub-image[_ngcontent-%COMP%]{width:100%}"]})}return a})();var Ut=o(8372),Zt=o(9094),Mt=o(8505),kt=o(3900),yt=o(5625),Rt=o(7245),Nt=o(4363),Z=o(9923),w=o(9602),D=o(8455),Lt=o(9203),Pt=o(6289),Ot=o(7443);function wt(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.imageLimitExceeded)," !")}}function Bt(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.imageErrorText)}}function Jt(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",6)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.submitImage())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function Qt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Tidak Boleh Kosong"),t.qZA())}function Kt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Website Link Tidak Valid"),t.qZA())}function Gt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Facebook Link Tidak Valid"),t.qZA())}function Yt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Discord Link Tidak Valid"),t.qZA())}function qt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Twitter Link Tidak Valid"),t.qZA())}function Ht(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"bytes"),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij("Ukuran Upload Melebihi Batas ",t.lcZ(2,1,e.coverLimitExceeded)," !")}}function jt(a,l){if(1&a&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.Oqu(e.coverErrorText)}}function $t(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"div",66)(1,"button",64),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.submitCover())}),t._UZ(2,"mat-icon",65),t._uU(3," Unggah "),t.qZA()()}if(2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("disabled",e.submitted)}}function zt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Tidak Boleh Kosong"),t.qZA())}function Vt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Nama Fansub Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function Wt(a,l){if(1&a&&(t.TgZ(0,"small",67)(1,"div"),t._uU(2),t.qZA()()),2&a){const e=t.oxw(3);t.xp6(2),t.Oqu(e.slugInfo)}}function Xt(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Tidak Boleh Kosong"),t.qZA())}function te(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Singkatan Hanya Boleh Huruf Dan \u4e00"),t.qZA())}function ee(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Harus Diisi Secara Valid"),t.qZA())}function ie(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Tanggal Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function se(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Mohon Pilih Salah Satu"),t.qZA())}function ae(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Status Hanya Boleh Huruf Standar Papan Ketik"),t.qZA())}function ne(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"mat-chip",68),t.NdJ("removed",function(){const n=t.CHM(e).$implicit,c=t.oxw(3);return t.KtG(c.removeTag(n))}),t._uU(1),t._UZ(2,"mat-icon",69),t.qZA()}if(2&a){const e=l.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function oe(a,l){1&a&&(t.TgZ(0,"div"),t._uU(1,"Discord Link Tidak Valid"),t.qZA())}function re(a,l){if(1&a&&(t.TgZ(0,"mat-form-field",23)(1,"mat-label"),t._uU(2,"URI / URL RSS v2.0 Feed"),t.qZA(),t._UZ(3,"input",70)(4,"mat-icon",71),t.TgZ(5,"mat-error"),t.YNc(6,oe,2,0,"div",21),t.qZA()()),2&a){const e=t.oxw(3);t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",e.fg.get("rss_feed").hasError("pattern"))}}function le(a,l){if(1&a){const e=t.EpF();t.TgZ(0,"form",8),t.NdJ("submit",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onSubmit())}),t.TgZ(1,"div",9)(2,"div",10)(3,"h2",11)(4,"b",12),t._uU(5,"Perbaharui Data Fansub"),t.qZA()()(),t.TgZ(6,"div",6)(7,"div",13)(8,"div",14)(9,"div",13)(10,"div",6),t._UZ(11,"img",15),t.TgZ(12,"mat-form-field",16)(13,"mat-label"),t._uU(14,"Foto"),t.qZA(),t.TgZ(15,"ngx-mat-file-input",17,18),t.NdJ("change",function(i){t.CHM(e);const n=t.MAs(16),c=t.oxw(2);return t.KtG(c.uploadImage(i,n))}),t.qZA(),t._UZ(17,"mat-icon",19),t.qZA(),t.TgZ(18,"mat-error",20)(19,"small"),t.YNc(20,wt,3,3,"div",21),t.YNc(21,Bt,2,1,"div",21),t.qZA()()(),t.YNc(22,Jt,4,1,"div",22),t.qZA(),t.TgZ(23,"div",13)(24,"div",6)(25,"div",13)(26,"mat-form-field",23)(27,"mat-label"),t._uU(28,"Tautan Website"),t.qZA(),t._UZ(29,"input",24)(30,"mat-icon",25),t.TgZ(31,"mat-error"),t.YNc(32,Qt,2,0,"div",21),t.YNc(33,Kt,2,0,"div",21),t.qZA()(),t.TgZ(34,"mat-form-field",23)(35,"mat-label"),t._uU(36,"Facebook Fanpage"),t.qZA(),t._UZ(37,"input",26)(38,"mat-icon",27),t.TgZ(39,"mat-error"),t.YNc(40,Gt,2,0,"div",21),t.qZA()(),t.TgZ(41,"mat-form-field",23)(42,"mat-label"),t._uU(43,"Tautan Discord"),t.qZA(),t._UZ(44,"input",28),t.TgZ(45,"mat-icon",29),t._UZ(46,"img",30),t.qZA(),t.TgZ(47,"mat-error"),t.YNc(48,Yt,2,0,"div",21),t.qZA()(),t.TgZ(49,"mat-form-field",23)(50,"mat-label"),t._uU(51,"Cuitan Twitter"),t.qZA(),t._UZ(52,"input",31),t.TgZ(53,"mat-icon",29),t._UZ(54,"img",30),t.qZA(),t.TgZ(55,"mat-error"),t.YNc(56,qt,2,0,"div",21),t.qZA()()()()()(),t.TgZ(57,"div",32)(58,"div",13)(59,"mat-form-field",16)(60,"mat-label"),t._uU(61,"Cover"),t.qZA(),t.TgZ(62,"ngx-mat-file-input",17,33),t.NdJ("change",function(i){t.CHM(e);const n=t.MAs(63),c=t.oxw(2);return t.KtG(c.uploadCover(i,n))}),t.qZA(),t._UZ(64,"mat-icon",19),t.qZA(),t.TgZ(65,"mat-error",20)(66,"small"),t.YNc(67,Ht,3,3,"div",21),t.YNc(68,jt,2,1,"div",21),t.qZA()(),t.YNc(69,$t,4,1,"div",34),t.TgZ(70,"mat-form-field",35)(71,"mat-label"),t._uU(72,"Nama Fansub"),t.qZA(),t._UZ(73,"input",36)(74,"mat-icon",37),t.TgZ(75,"mat-error"),t.YNc(76,zt,2,0,"div",21),t.YNc(77,Vt,2,0,"div",21),t.qZA()(),t.TgZ(78,"mat-form-field",38)(79,"mat-label"),t._uU(80,"Singkatan"),t.qZA(),t._UZ(81,"input",39)(82,"mat-icon",40),t.YNc(83,Wt,3,1,"small",41),t.TgZ(84,"mat-error"),t.YNc(85,Xt,2,0,"div",21),t.YNc(86,te,2,0,"div",21),t.qZA()(),t._UZ(87,"angular-editor",42),t.TgZ(88,"mat-form-field",43)(89,"mat-label"),t._uU(90,"Mulai Ada Sejak"),t.qZA(),t.TgZ(91,"input",44),t.NdJ("focus",function(){t.CHM(e);const i=t.MAs(95);return t.KtG(i.open())}),t.ALo(92,"date"),t.qZA(),t._UZ(93,"mat-datepicker-toggle",45)(94,"mat-datepicker",46,47),t.TgZ(96,"mat-error"),t.YNc(97,ee,2,0,"div",21),t.YNc(98,ie,2,0,"div",21),t.qZA()(),t.TgZ(99,"mat-form-field",43)(100,"mat-label"),t._uU(101,"Status"),t.qZA(),t.TgZ(102,"mat-select",48)(103,"mat-option",49),t._uU(104,"Tidak Aktif"),t.qZA(),t.TgZ(105,"mat-option",50),t._uU(106,"Aktif"),t.qZA()(),t.TgZ(107,"mat-hint",51),t._uU(108,"Status Kehidupan Fansub Saat Ini"),t.qZA(),t.TgZ(109,"mat-error"),t.YNc(110,se,2,0,"div",21),t.YNc(111,ae,2,0,"div",21),t.qZA()(),t.TgZ(112,"mat-form-field",23)(113,"mat-label"),t._uU(114,"Tags & Kategori"),t.qZA(),t.TgZ(115,"mat-chip-list",null,52),t.YNc(117,ne,3,2,"mat-chip",53),t.TgZ(118,"input",54),t.NdJ("matChipInputTokenEnd",function(i){t.CHM(e);const n=t.oxw(2);return t.KtG(n.addTag(i))}),t.qZA(),t._UZ(119,"mat-icon",55),t.qZA(),t.TgZ(120,"mat-hint",51),t._uU(121,"Isi Dengan Bebas, Pisahkan Dengan Koma"),t.qZA()(),t.YNc(122,re,7,2,"mat-form-field",56),t.qZA()()(),t.TgZ(123,"div",13)(124,"div",6)(125,"div",57),t._UZ(126,"div",58),t.TgZ(127,"div",59)(128,"a",60),t._UZ(129,"mat-icon",61),t._uU(130," Batal "),t.qZA()(),t.TgZ(131,"div",59)(132,"button",62),t._uU(133," Simpan "),t._UZ(134,"mat-icon",63),t.qZA()()()()()()()()}if(2&a){const e=t.MAs(95),s=t.MAs(116),i=t.oxw(2);t.Q6J("formGroup",i.fg),t.xp6(11),t.Q6J("src",i.image_url,t.LSH),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.imageLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.imageErrorText),t.xp6(1),t.Q6J("ngIf",i.image&&!i.fg.value.image),t.xp6(4),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("web").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("web").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("facebook").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/discord/",i.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",i.fg.get("discord").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.MGl("src","/assets/img/twitter/",i.GS.isDarkMode?"white":"black",".png",t.LSH),t.xp6(2),t.Q6J("ngIf",i.fg.get("twitter").hasError("pattern")),t.xp6(3),t.Q6J("color","accent"),t.xp6(3),t.Q6J("disabled",i.fg.value.cover)("accept","image/gif, image/jpeg, image/jpg, image/png"),t.xp6(5),t.Q6J("ngIf",i.coverLimitExceeded),t.xp6(1),t.Q6J("ngIf",i.coverErrorText),t.xp6(1),t.Q6J("ngIf",i.cover&&!i.fg.value.cover),t.xp6(1),t.Q6J("color","accent"),t.xp6(6),t.Q6J("ngIf",i.fg.get("name").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("name").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngIf",i.slugInfo),t.xp6(2),t.Q6J("ngIf",i.fg.get("slug").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("slug").hasError("pattern")),t.xp6(1),t.Q6J("config",i.GS.angularEditorConfig),t.xp6(1),t.Q6J("color","accent"),t.xp6(3),t.s9C("placeholder",t.xi3(92,50,i.currentDate,"d MMMM y")),t.Q6J("matDatepicker",e),t.xp6(2),t.Q6J("for",e),t.xp6(4),t.Q6J("ngIf",i.fg.get("born").hasError("required")||i.fg.get("born").hasError("matDatepickerParse")),t.xp6(1),t.Q6J("ngIf",i.fg.get("born").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(11),t.Q6J("ngIf",i.fg.get("active").hasError("required")),t.xp6(1),t.Q6J("ngIf",i.fg.get("active").hasError("pattern")),t.xp6(1),t.Q6J("color","accent"),t.xp6(5),t.Q6J("ngForOf",i.fg.value.tags),t.xp6(1),t.Q6J("matChipInputSeparatorKeyCodes",i.GS.separatorKeysCodes)("matChipInputFor",s)("matChipInputAddOnBlur",!0),t.xp6(4),t.Q6J("ngIf",i.rssFeedAllowed),t.xp6(6),t.Q6J("disabled",i.submitted),t.xp6(4),t.Q6J("disabled",i.submitted||i.fg.invalid||!i.fg.dirty)}}function ue(a,l){if(1&a&&(t.TgZ(0,"div",1),t._UZ(1,"div",2)(2,"div",3)(3,"div",4)(4,"app-notifications"),t.TgZ(5,"div",5)(6,"div",6),t.YNc(7,le,135,53,"form",7),t.qZA()()()),2&a){const e=t.oxw();t.xp6(1),t.Udp("background-image","url("+e.cover_url+")"),t.xp6(6),t.Q6J("ngIf",e.fg)}}const ce=[{path:"",pathMatch:"full",component:et},{path:":fansubSlug",children:[{path:"",pathMatch:"full",component:It},{path:"edit",component:(()=>{class a{constructor(e,s,i,n,c,p,A,B,J){this.fb=e,this.router=s,this.bs=i,this.activatedRoute=n,this.imgbb=c,this.fansub=p,this.toast=A,this.as=B,this.gs=J,this.fansubSlug="",this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.cover=null,this.coverErrorText=null,this.coverLimitExceeded=null,this.cover_url="/assets/img/form/no-image.png",this.cover_url_original=null,this.urls=[],this.currentDate=new Date,this.gambar=null,this.gambar_=null,this.subsActRoute=null,this.subsFansubUpdate=null,this.subsFansubDetail=null,this.subsImgbb=null,this.subsCekFansubSlug=null,this.subsFansubMemberGet=null,this.slugInfo="",this.editable=!0,this.approvedMembers=[],this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get rssFeedAllowed(){return this.as.currentUserSubject?.value?.role===h.yS.ADMIN||this.as.currentUserSubject?.value?.role===h.yS.MODERATOR||this.as.currentUserSubject?.value?.role===h.yS.FANSUBBER}ngOnDestroy(){this.subsActRoute?.unsubscribe(),this.subsFansubUpdate?.unsubscribe(),this.subsFansubDetail?.unsubscribe(),this.subsImgbb?.unsubscribe(),this.subsFansubMemberGet?.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.fansubSlug=this.activatedRoute.snapshot.paramMap.get("fansubSlug"),this.bs.busy(),this.subsFansubDetail=this.fansub.getFansub(this.fansubSlug).subscribe({next:e=>{this.gs.log("[FANSUB_DETAIL_SUCCESS]",e),this.bs.idle(),this.editable=e.result.editable,this.editable?(this.bs.busy(),this.subsFansubMemberGet=this.fansub.getFansubMember(this.fansubSlug).subscribe({next:s=>{this.gs.log("[FANSUB_EDIT_MEMBER_LIST_SUCCESS]",s),this.bs.idle(),this.approvedMembers=[];for(const n of s.results)n.approved&&this.approvedMembers.push(n);this.approvedMembers.findIndex(n=>n.user_.id===this.as.currentUserSubject?.value?.id)>=0||this.as.currentUserSubject?.value?.role===h.yS.ADMIN||this.as.currentUserSubject?.value?.role===h.yS.MODERATOR||this.as.currentUserSubject?.value?.id===e.result.user_.id?this.initForm(e.result):(this.toast.warning("Harus Menjadi Anggota Untuk Mengubah Data!","Whoops!",null,!0),this.router.navigateByUrl(`/fansub/${this.fansubSlug}`))},error:s=>{this.gs.log("[FANSUB_EDIT_MEMBER_LIST_ERROR]",s,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/fansub/${this.fansubSlug}`}})}})):(this.toast.warning("Data Fansub Ini Tidak Dapat Diubah","Whoops!",null,!0),this.router.navigateByUrl(`/fansub/${this.fansubSlug}`))},error:e=>{this.gs.log("[FANSUB_DETAIL_ERROR]",e,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/fansub/${this.fansubSlug}`}})}}))}initForm(e){this.image_url=e.image_url,this.image_url_original=this.image_url,this.cover_url=e.cover_url,this.cover_url_original=this.cover_url,this.fg=this.fb.group({name:[e.name,u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],description:[e.description,u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],born:[e.born,u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],active:[!0===e.active?"1":"0",u.kI.compose([u.kI.required,u.kI.pattern(g.t.regexEnglishKeyboardKeys)])],slug:[{value:e.slug,disabled:e.dns_id},u.kI.compose([u.kI.required,u.kI.pattern(/^[0-9a-zA-Z-]*$/)])],tags:[e.tags,u.kI.compose([])],image:[null,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],cover:[null,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],web:[e.urls.web,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],facebook:[e.urls.facebook,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],discord:[e.urls.discord,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],twitter:[e.urls.twitter,u.kI.compose([u.kI.pattern(g.t.regexUrl)])],rss_feed:[e.rss_feed,u.kI.compose([u.kI.pattern(g.t.regexUrl)])]}),this.slugValueChanged()}slugValueChanged(){this.subsCekFansubSlug=this.fg.get("slug").valueChanges.pipe((0,Ut.b)(500),(0,Zt.x)(),(0,Mt.b)(()=>this.slugInfo="Mengecek ..."),(0,kt.w)(e=>this.fansub.cekSlug({slug:e})),(0,yt.X)(-1)).subscribe({next:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_SUCCESS]",e),this.slugInfo=e.result.message},error:e=>{this.gs.log("[FANSUB_CEK_SLUG_RESULT_ERROR]",e,"error"),this.slugValueChanged()}})}addTag(e){const s=e.input,i=e.value;(i||"").trim()&&this.fg.value.tags.push(i.trim()),s&&(s.value=""),this.fg.controls.tags.patchValue(this.fg.value.tags.filter((n,c,p)=>p.findIndex(A=>A===n)===c)),this.fg.controls.tags.markAsDirty()}removeTag(e){const s=this.fg.value.tags.indexOf(e);s>=0&&this.fg.value.tags.splice(s,1)}uploadImage(e,s){this.gambar=s,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const i=e.target.files[0];try{const n=new FileReader;n.readAsDataURL(i),n.onload=c=>{if(this.gs.log("[IMAGE_SELECTED]",c),i.size<=g.t.fileSizeImageLimit){const p=this.gs.document.createElement("img");p.onload=()=>{this.image=i,this.image_url=n.result.toString()},p.src=n.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=g.t.fileSizeImageLimit,this.gambar.clear(e)}}catch{this.image=null,this.image_url=this.image_url_original,this.gambar.clear(e)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:e=>{this.gs.log("[IMAGE_SUCCESS]",e),this.fg.controls.image.patchValue(e.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[IMAGE_ERROR]",e,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=e.result?.message||e.info}})}uploadCover(e,s){this.gambar_=s,this.cover=null,this.coverLimitExceeded=null,this.coverErrorText=null,this.fg.controls.cover.patchValue(null),this.fg.controls.cover.markAsPristine();const i=e.target.files[0];try{const n=new FileReader;n.readAsDataURL(i),n.onload=c=>{if(this.gs.log("[COVER_SELECTED]",c),i.size<=g.t.fileSizeImageLimit){const p=this.gs.document.createElement("img");p.onload=()=>{this.cover=i,this.cover_url=n.result.toString()},p.src=n.result.toString()}else this.cover=null,this.cover_url="/assets/img/form/image-error.png",this.coverLimitExceeded=g.t.fileSizeImageLimit,this.gambar_.clear(e)}}catch{this.cover=null,this.cover_url=this.cover_url_original,this.gambar_.clear(e)}}submitCover(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.cover}).subscribe({next:e=>{this.gs.log("[COVER_SUCCESS]",e),this.fg.controls.cover.patchValue(e.result.url),this.fg.controls.cover.markAsDirty(),this.submitted=!1},error:e=>{this.gs.log("[COVER_ERROR]",e,"error"),this.fg.controls.cover.patchValue(null),this.fg.controls.cover.markAsPristine(),this.submitted=!1,this.coverErrorText=e.result?.message||e.info}})}onSubmit(){this.bs.busy();const e={};this.fg.value.web&&(e.web=this.fg.value.web),this.fg.value.facebook&&(e.facebook=this.fg.value.facebook),this.fg.value.discord&&(e.discord=this.fg.value.discord),this.fg.value.twitter&&(e.twitter=this.fg.value.twitter);const s=this.gs.getDirtyValues(this.fg);if("web"in s&&delete s.web,"facebook"in s&&delete s.facebook,"discord"in s&&delete s.discord,"twitter"in s&&delete s.twitter,s.urls=e,this.gs.log("[FANSUB_EDIT_DIRTY]",s),this.submitted=!0,this.fg.value.rss_feed&&(!this.fg.value.web||!this.fg.value.rss_feed.startsWith(this.fg.value.web)))return this.toast.warning("RSS Feed Tidak Sesuai Dengan Alamat Web","URL RSS Feed & WEB",null,!0),this.submitted=!1,void this.bs.idle();const i=Object.keys(e).length;if(this.fg.invalid||0===i)return 0===i&&this.toast.warning("Harap Isi Salah Satu URL","Form Tidak lengkap (Web/FB/DC)",null,!0),this.submitted=!1,void this.bs.idle();this.subsFansubUpdate=this.fansub.updateFansub(this.fansubSlug,{...s}).subscribe({next:n=>{this.gs.log("[FANSUB_EDIT_SUCCESS]",n),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/fansub/${n.result.slug}`)},error:n=>{this.gs.log("[FANSUB_EDIT_ERROR]",n,"error"),this.submitted=!1,this.bs.idle()}})}static#t=this.\u0275fac=function(s){return new(s||a)(t.Y36(u.QS),t.Y36(r.F0),t.Y36(L.z),t.Y36(r.gz),t.Y36(Rt.X),t.Y36(P.T),t.Y36(q.k),t.Y36(Y.e),t.Y36(N.U))};static#e=this.\u0275cmp=t.Xpm({type:a,selectors:[["app-fansub-edit"]],decls:1,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"fansub-banner","fansub-banner-1","align-items-center"],[1,"fansub-banner","fansub-banner-2","align-items-center"],[2,"padding-top","160px"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["fontIcon","image","matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],["appearance","outline",1,"py-3","col-12",3,"color"],["matInput","","formControlName","web","placeholder","http://www.domain.id"],["fontIcon","web","matSuffix",""],["matInput","","formControlName","facebook","placeholder","http://www.facebook.com"],["fontIcon","facebook","matSuffix",""],["matInput","","formControlName","discord","placeholder","http://www.discord.gg"],["matSuffix",""],["height","24px",2,"vertical-align","baseline",3,"src"],["matInput","","formControlName","twitter","placeholder","http://www.twitter.com"],[1,"col-12","col-md-7","col-xl-8","p-3"],["gambar_",""],["class","col-12 py-3",4,"ngIf"],["appearance","outline",1,"py-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","name","placeholder","Fansub Jalanan"],["fontIcon","wysiwyg","matSuffix",""],["appearance","outline","matTooltip","Digunakan Juga Untuk Sub-Domain",1,"py-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","slug","placeholder","Jalsub"],["fontIcon","short_text","matSuffix",""],["class","text-info",4,"ngIf"],["formControlName","description",1,"py-3","w-100",3,"config"],["appearance","outline",1,"py-3","col-12","col-md-6",3,"color"],["matInput","","formControlName","born",3,"matDatepicker","placeholder","focus"],["matSuffix","",3,"for"],["disabled","false"],["kalender",""],["formControlName","active","placeholder","Aktif / Non-Aktif"],["value","0"],["value","1"],["align","end"],["tag",""],["color","accent","selected","",3,"removable","removed",4,"ngFor","ngForOf"],["placeholder","Label Tag / Kategori",3,"matChipInputSeparatorKeyCodes","matChipInputFor","matChipInputAddOnBlur","matChipInputTokenEnd"],["fontIcon","loyalty","matSuffix",""],["appearance","outline","class","py-3 col-12",3,"color",4,"ngIf"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["fontIcon","undo",1,"me-1"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],["fontIcon","save",1,"ms-1"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],["fontIcon","add_photo_alternate",1,"me-1"],[1,"col-12","py-3"],[1,"text-info"],["color","accent","selected","",3,"removable","removed"],["fontIcon","cancel","matChipRemove",""],["matInput","","formControlName","rss_feed","placeholder","http://my-site.blogspot.com/feeds/posts/default?alt=rss"],["fontIcon","rss_feed","matSuffix",""]],template:function(s,i){1&s&&t.YNc(0,ue,8,3,"div",0),2&s&&t.Q6J("ngIf",i.fg)},dependencies:[b.sg,b.O5,r.rH,Nt.CK,I.eB,I.Nr,Z.ir,Z.lw,Z.IP,Z.Y6,w.Mq,w.hl,w.nW,H.Hw,D.nI,D.v_,D.pH,D.$V,D.nX,Lt.k0,Pt.x8,j.Kd,O.t,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.Yh,T.s6,b.uU,Ot.$],styles:[".fansub-banner[_ngcontent-%COMP%]{height:128px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat;filter:blur(5px) brightness(100%);opacity:.5}.fansub-banner-1[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.fansub-banner-2[_ngcontent-%COMP%]{position:absolute;top:128px;left:0}.fansub-info[_ngcontent-%COMP%]{position:relative;height:256px;z-index:1}"]})}return a})(),canActivate:[y.H,k.t],data:{title:"Fansub - Ubah Data",description:"Halaman Pembaharuan Data Fansub",keywords:"Ubah Fansub",[g.t.decoratorVerifiedOnly]:!0,[g.t.decoratorRoles]:[h.yS.ADMIN,h.yS.MODERATOR,h.yS.FANSUBBER,h.yS.USER]}}]}];let be=(()=>{class a{static#t=this.\u0275fac=function(s){return new(s||a)};static#e=this.\u0275mod=t.oAB({type:a});static#i=this.\u0275inj=t.cJS({imports:[b.ez,r.Bz.forChild(ce),d.m,m.L,C.$,_.P,f.m9,v.F,u.u5,u.UX,S.Ad,T.UM,R.b,F.T,$.d]})}return a})()},801:(M,x,o)=>{o.d(x,{Q:()=>y});var b=o(7084),r=o(4650),u=o(9816),T=o(6895),f=o(7392),S=o(7462);function g(d,F){if(1&d&&r._UZ(0,"h3",8),2&d){const m=r.oxw().$implicit;r.Q6J("innerHTML",m.text,r.oJD)}}function h(d,F){if(1&d&&(r.TgZ(0,"mat-expansion-panel",3)(1,"mat-expansion-panel-header")(2,"mat-panel-title",4)(3,"span",5),r._uU(4),r.qZA()(),r.TgZ(5,"mat-panel-description"),r._UZ(6,"mat-icon",6),r.qZA()(),r.YNc(7,g,1,1,"ng-template",7),r.qZA()),2&d){const m=F.$implicit,_=F.first,v=r.oxw(2);r.Q6J("expanded",v.GS.isDesktop&&_),r.xp6(3),r.s9C("matTooltip",m.tooltip),r.Q6J("matTooltipPosition","above"),r.xp6(1),r.hij(" ",m.title," "),r.xp6(2),r.Q6J("fontIcon",m.icon)}}function k(d,F){if(1&d&&(r.TgZ(0,"mat-accordion",1),r.YNc(1,h,8,5,"mat-expansion-panel",2),r.qZA()),2&d){const m=r.oxw();r.xp6(1),r.Q6J("ngForOf",m.panelData)}}let y=(()=>{class d{onResize(m){this.gs.onResize(m,"MATERIAL_EXPANSION_PANEL"),this.gs.isDesktop?this.accordion.openAll():this.accordion.closeAll()}constructor(m){this.gs=m,this.panelData=[{title:"Title",icon:"warning",text:"Lorem ipsum ...",tooltip:"Info"}]}get GS(){return this.gs}ngOnInit(){}static#t=this.\u0275fac=function(_){return new(_||d)(r.Y36(u.U))};static#e=this.\u0275cmp=r.Xpm({type:d,selectors:[["app-material-expansion-panel"]],viewQuery:function(_,v){if(1&_&&r.Gf(b.pp,5),2&_){let C;r.iGM(C=r.CRH())&&(v.accordion=C.first)}},hostBindings:function(_,v){1&_&&r.NdJ("resize",function(R){return v.onResize(R)},!1,r.Jf7)},inputs:{panelData:"panelData"},decls:1,vars:1,consts:[["class","example-headers-align","multi","",4,"ngIf"],["multi","",1,"example-headers-align"],[3,"expanded",4,"ngFor","ngForOf"],[3,"expanded"],[1,"font-weight-bold"],[3,"matTooltip","matTooltipPosition"],[1,"ms-auto",3,"fontIcon"],["matExpansionPanelContent",""],[1,"m-0","text-justify",2,"white-space","pre-line !important",3,"innerHTML"]],template:function(_,v){1&_&&r.YNc(0,k,2,1,"mat-accordion",0),2&_&&r.Q6J("ngIf",v.panelData.length>0)},dependencies:[T.sg,T.O5,b.pp,b.ib,b.yz,b.yK,b.u4,b.HS,f.Hw,S.Kd]})}return d})()},9560:(M,x,o)=>{o.d(x,{$:()=>T});var b=o(6895),r=o(2314),u=o(4650);let T=(()=>{class f{static#t=this.\u0275fac=function(h){return new(h||f)};static#e=this.\u0275mod=u.oAB({type:f});static#i=this.\u0275inj=u.cJS({imports:[b.ez,r.m]})}return f})()},4520:(M,x,o)=>{o.d(x,{Q:()=>b});var b=(()=>{return(r=b||(b={})).BIRU="#7289DA",r.UNGU="#3F51B5",r.HITAM="#343A40",r.ABU="#A9A9A9",r.MERAH="#DC3545",r.PINK="#FF4081",r.OREN="#F44336",r.KUNING="#FFC107",r.HIJAU="#28A745",b;var r})()}}]); \ No newline at end of file diff --git a/dist/main-site/browser/index.html b/dist/main-site/browser/index.html index 75683a7a..9085c740 100644 --- a/dist/main-site/browser/index.html +++ b/dist/main-site/browser/index.html @@ -63,7 +63,7 @@ - + \ No newline at end of file diff --git a/dist/main-site/browser/ngsw.json b/dist/main-site/browser/ngsw.json index 0019300f..f23cf034 100644 --- a/dist/main-site/browser/ngsw.json +++ b/dist/main-site/browser/ngsw.json @@ -1,6 +1,6 @@ { "configVersion": 1, - "timestamp": 1704603647135, + "timestamp": 1704606383803, "index": "/index.html", "assetGroups": [ { @@ -11,28 +11,28 @@ "ignoreVary": true }, "urls": [ - "/109.8584ea77f5e66aec.js", + "/109.4a02bcbb491d3d55.js", "/25.5936e0bb8274fece.js", "/268.2bf237c8f938cc19.js", "/305.c95853ace4f0bafc.js", "/31.20012e7631a4459a.js", "/338.e456b7495d3489d9.js", "/348.958bb5900865dc73.js", - "/370.1ea0a06ad8a61453.js", + "/370.00945484f5682803.js", "/375.ee4c6a4506d78add.js", "/38.598b416584995879.js", "/513.4f75c6a6a3a262a9.js", - "/526.9f52acb066a76a1d.js", - "/541.1e1c9e226cdfca50.js", + "/526.6308e06d4cee1214.js", + "/541.eb1aab9a62c2acda.js", "/570.2ef4235c32c59bc6.js", "/578.1f7e8c330d1a54fd.js", - "/655.4f87da37c01c6228.js", + "/655.01059e76a32a5cfb.js", "/679.c4e6c29eb976496b.js", "/683.ecbd9a1120e48a2f.js", "/702.65c8fa4d9b98538e.js", "/708.c3013c57d9a029b0.js", "/743.2504c93e27335cc2.js", - "/745.2cff08e60a2e91a2.js", + "/745.2a3a9ae260159e1e.js", "/748.11ebb5d76ac3aa16.js", "/76.296531d0d519977b.js", "/767.99cce3e19d19b9f7.js", @@ -45,7 +45,7 @@ "/main.4863b9fc1ddd8957.js", "/manifest.webmanifest", "/polyfills.c264b580e8a973fe.js", - "/runtime.4a5e67c9585ae934.js", + "/runtime.fc4bcaf8605ed933.js", "/scripts.6711f2f223ff3b40.js", "/styles.b849b3eb93129b2e.css" ], @@ -86,28 +86,28 @@ } ], "hashTable": { - "/109.8584ea77f5e66aec.js": "611e66eca1020b4da116449517ed6fd7e3a74f4c", + "/109.4a02bcbb491d3d55.js": "c792079d29920e7718dec0869f212545dbf00021", "/25.5936e0bb8274fece.js": "a64f839d73c21616defac610ddda0a95235e3134", "/268.2bf237c8f938cc19.js": "e4f3180086fa7d6b6a856d0c523cf175d53dd21d", "/305.c95853ace4f0bafc.js": "b2bdb5c3e6a7a706e11d123c528510fbec651bd9", "/31.20012e7631a4459a.js": "70d4807f0789648d23481539832be437cb4d1145", "/338.e456b7495d3489d9.js": "ba5f4ceaaa0119020da73cb96907406603109a7d", "/348.958bb5900865dc73.js": "eb7343f4e4ee46bdec78a0073d60a080a6df020c", - "/370.1ea0a06ad8a61453.js": "6398842541dd47dc65223b7241ad8b4e7d3fdf73", + "/370.00945484f5682803.js": "6327e7bf4a5e54fdefcbef3bfdd05be726f18208", "/375.ee4c6a4506d78add.js": "7fdd449c11040dff5461d4e5639045bc28b94cb4", "/38.598b416584995879.js": "0df1e35e7f69dc0d7d7d5964401876728e86fbb3", "/513.4f75c6a6a3a262a9.js": "68864cb4216f09f4dfb4137c24bbe2cfd56ee4d2", - "/526.9f52acb066a76a1d.js": "851ad24159dfc8134da5bb9bd5fd04d06302f7de", - "/541.1e1c9e226cdfca50.js": "3815b68466bf509aab538ec43245981a5a8d1650", + "/526.6308e06d4cee1214.js": "50733603a3d79a61e74707ed1c1c6d16bd06c8da", + "/541.eb1aab9a62c2acda.js": "d9523b5a8efb96a8889171370907ce3353965a41", "/570.2ef4235c32c59bc6.js": "2ae0047ef946ce75334514940ee9806045061b07", "/578.1f7e8c330d1a54fd.js": "176b8f41a58db6965e9d40b849425eb7eae6a40b", - "/655.4f87da37c01c6228.js": "01ddf94e0ef946ea4bfb462a431bd33f93ed56ab", + "/655.01059e76a32a5cfb.js": "57ac48860558c6b17ba15972421a3f8b7c43fb28", "/679.c4e6c29eb976496b.js": "9806bae69b34ee0aab484c6754036c322696c96b", "/683.ecbd9a1120e48a2f.js": "fcd7e589128c57a0f8a2cf9596994fe91d91aa10", "/702.65c8fa4d9b98538e.js": "84d8720eed831b725dc586d2f0dae845b8d32d37", "/708.c3013c57d9a029b0.js": "8b2b8b01273795335506264490c988884464238a", "/743.2504c93e27335cc2.js": "a1fae6fecb4a4ffdb46cf6790dc30e172e88b4d5", - "/745.2cff08e60a2e91a2.js": "e9d8874e9e83f84854fd9178cf7b73fe3221cfa7", + "/745.2a3a9ae260159e1e.js": "c7aef7725aa2c6fd543a9d51fa85a8c5ba4ea185", "/748.11ebb5d76ac3aa16.js": "2a1f17c34c960593c7ce8832320703cd3170f3b8", "/76.296531d0d519977b.js": "3c9f351c04686994b65342dffd5ea46a2e879323", "/767.99cce3e19d19b9f7.js": "9e11d147a4d4a4541bb833133a55bef50628172f", @@ -116,11 +116,11 @@ "/935.297c8ba9525ff76f.js": "baa0480d7f4c538c4c935a94f0a7577a9b23b246", "/common.2f998780ef9f2b80.js": "b5f0c1896dd8619b2f177e4815274f5bf5217187", "/favicon.ico": "071facb8fab2e4b3493dcfbb0b02d7bd21bca97e", - "/index.html": "bbbeb5804749fc189c55b707d0e59df23203c0f4", + "/index.html": "80e6ccd9c147c1224b3a3df321cce008573cc614", "/main.4863b9fc1ddd8957.js": "33cece68e6a6897c0427b9b40446132df37d452d", "/manifest.webmanifest": "2ae67e74e4dac9525adbb9e4aa4ac908fcdfa20d", "/polyfills.c264b580e8a973fe.js": "67f24a57563377058dfcd5306c56c0cd696ba2e5", - "/runtime.4a5e67c9585ae934.js": "0e6e1e727f7aa5d046db1b3907b50ab576d17469", + "/runtime.fc4bcaf8605ed933.js": "3ad437168f25e5e8805b6bb1d47cfab6103b2546", "/scripts.6711f2f223ff3b40.js": "35559a6d563d42afebd457f70894e90667cdd981", "/styles.b849b3eb93129b2e.css": "d68b5778bdca764c5297b8067a72b676f8cce12d" }, diff --git a/dist/main-site/browser/runtime.4a5e67c9585ae934.js b/dist/main-site/browser/runtime.fc4bcaf8605ed933.js similarity index 88% rename from dist/main-site/browser/runtime.4a5e67c9585ae934.js rename to dist/main-site/browser/runtime.fc4bcaf8605ed933.js index a41cf050..bdacc48f 100644 --- a/dist/main-site/browser/runtime.4a5e67c9585ae934.js +++ b/dist/main-site/browser/runtime.fc4bcaf8605ed933.js @@ -1 +1 @@ -(()=>{"use strict";var e,v={},_={};function r(e){var f=_[e];if(void 0!==f)return f.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,n,i)=>{if(!t){var a=1/0;for(d=0;d=i)&&Object.keys(r.O).every(p=>r.O[p](t[o]))?t.splice(o--,1):(s=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[t,n,i]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},(()=>{var f,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,n){if(1&n&&(t=this(t)),8&n||"object"==typeof t&&t&&(4&n&&t.__esModule||16&n&&"function"==typeof t.then))return t;var i=Object.create(null);r.r(i);var d={};f=f||[null,e({}),e([]),e(e)];for(var a=2&n&&t;"object"==typeof a&&!~f.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(s=>d[s]=()=>t[s]);return d.default=()=>t,r.d(i,d),i}})(),r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>(592===e?"common":e)+"."+{25:"5936e0bb8274fece",31:"20012e7631a4459a",38:"598b416584995879",76:"296531d0d519977b",109:"8584ea77f5e66aec",268:"2bf237c8f938cc19",305:"c95853ace4f0bafc",338:"e456b7495d3489d9",348:"958bb5900865dc73",370:"1ea0a06ad8a61453",375:"ee4c6a4506d78add",513:"4f75c6a6a3a262a9",526:"9f52acb066a76a1d",541:"1e1c9e226cdfca50",570:"2ef4235c32c59bc6",578:"1f7e8c330d1a54fd",592:"2f998780ef9f2b80",655:"4f87da37c01c6228",679:"c4e6c29eb976496b",683:"ecbd9a1120e48a2f",702:"65c8fa4d9b98538e",708:"c3013c57d9a029b0",743:"2504c93e27335cc2",745:"2cff08e60a2e91a2",748:"11ebb5d76ac3aa16",767:"99cce3e19d19b9f7",794:"fd9cc9d5f7bc84d2",797:"af3edabe38354abb",935:"297c8ba9525ff76f"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="main-site:";r.l=(t,n,i,d)=>{if(e[t])e[t].push(n);else{var a,s;if(void 0!==i)for(var o=document.getElementsByTagName("script"),b=0;b{a.onerror=a.onload=null,clearTimeout(u);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(p)),g)return g(p)},u=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(n,i)=>{var d=r.o(e,n)?e[n]:void 0;if(0!==d)if(d)i.push(d[2]);else if(666!=n){var a=new Promise((c,l)=>d=e[n]=[c,l]);i.push(d[2]=a);var s=r.p+r.u(n),o=new Error;r.l(s,c=>{if(r.o(e,n)&&(0!==(d=e[n])&&(e[n]=void 0),d)){var l=c&&("load"===c.type?"missing":c.type),u=c&&c.target&&c.target.src;o.message="Loading chunk "+n+" failed.\n("+l+": "+u+")",o.name="ChunkLoadError",o.type=l,o.request=u,d[1](o)}},"chunk-"+n,n)}else e[n]=0},r.O.j=n=>0===e[n];var f=(n,i)=>{var o,b,[d,a,s]=i,c=0;if(d.some(u=>0!==e[u])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var l=s(r)}for(n&&n(i);c{"use strict";var e,v={},_={};function r(e){var f=_[e];if(void 0!==f)return f.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,n,i)=>{if(!t){var a=1/0;for(d=0;d=i)&&Object.keys(r.O).every(p=>r.O[p](t[o]))?t.splice(o--,1):(s=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[t,n,i]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},(()=>{var f,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,n){if(1&n&&(t=this(t)),8&n||"object"==typeof t&&t&&(4&n&&t.__esModule||16&n&&"function"==typeof t.then))return t;var i=Object.create(null);r.r(i);var d={};f=f||[null,e({}),e([]),e(e)];for(var a=2&n&&t;"object"==typeof a&&!~f.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(s=>d[s]=()=>t[s]);return d.default=()=>t,r.d(i,d),i}})(),r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>(592===e?"common":e)+"."+{25:"5936e0bb8274fece",31:"20012e7631a4459a",38:"598b416584995879",76:"296531d0d519977b",109:"4a02bcbb491d3d55",268:"2bf237c8f938cc19",305:"c95853ace4f0bafc",338:"e456b7495d3489d9",348:"958bb5900865dc73",370:"00945484f5682803",375:"ee4c6a4506d78add",513:"4f75c6a6a3a262a9",526:"6308e06d4cee1214",541:"eb1aab9a62c2acda",570:"2ef4235c32c59bc6",578:"1f7e8c330d1a54fd",592:"2f998780ef9f2b80",655:"01059e76a32a5cfb",679:"c4e6c29eb976496b",683:"ecbd9a1120e48a2f",702:"65c8fa4d9b98538e",708:"c3013c57d9a029b0",743:"2504c93e27335cc2",745:"2a3a9ae260159e1e",748:"11ebb5d76ac3aa16",767:"99cce3e19d19b9f7",794:"fd9cc9d5f7bc84d2",797:"af3edabe38354abb",935:"297c8ba9525ff76f"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="main-site:";r.l=(t,n,i,d)=>{if(e[t])e[t].push(n);else{var a,s;if(void 0!==i)for(var o=document.getElementsByTagName("script"),b=0;b{a.onerror=a.onload=null,clearTimeout(u);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(p)),g)return g(p)},u=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(n,i)=>{var d=r.o(e,n)?e[n]:void 0;if(0!==d)if(d)i.push(d[2]);else if(666!=n){var a=new Promise((c,l)=>d=e[n]=[c,l]);i.push(d[2]=a);var s=r.p+r.u(n),o=new Error;r.l(s,c=>{if(r.o(e,n)&&(0!==(d=e[n])&&(e[n]=void 0),d)){var l=c&&("load"===c.type?"missing":c.type),u=c&&c.target&&c.target.src;o.message="Loading chunk "+n+" failed.\n("+l+": "+u+")",o.name="ChunkLoadError",o.type=l,o.request=u,d[1](o)}},"chunk-"+n,n)}else e[n]=0},r.O.j=n=>0===e[n];var f=(n,i)=>{var o,b,[d,a,s]=i,c=0;if(d.some(u=>0!==e[u])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var l=s(r)}for(n&&n(i);c__defProp(target,"name",{value,configurable:!0});(()=>{var __webpack_modules__={62547:(module2,__unused_webpack_exports2,__webpack_require__2)=>{"use strict";var __create=Object.create,__defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__name2=__name((target,value)=>__defProp2(target,"name",{value,configurable:!0}),"__name"),__export=__name((target,all)=>{for(var name in all)__defProp2(target,name,{get:all[name],enumerable:!0})},"__export"),__copyProps=__name((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},"__copyProps"),__reExport=__name((target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),"__reExport"),__toESM=__name((mod,isNodeMode,target)=>(target=null!=mod?__create(__getProtoOf(mod)):{},__copyProps(!isNodeMode&&mod&&mod.__esModule?target:__defProp2(target,"default",{value:mod,enumerable:!0}),mod)),"__toESM"),__toCommonJS=__name(mod=>__copyProps(__defProp2({},"__esModule",{value:!0}),mod),"__toCommonJS"),__decorateClass=__name((decorators,target,key,kind)=>{for(var decorator,result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i2=decorators.length-1;i2>=0;i2--)(decorator=decorators[i2])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),src_exports={};__export(src_exports,{ActionRowBuilder:()=>ActionRowBuilder,ApplicationCommandNumericOptionMinMaxValueMixin:()=>ApplicationCommandNumericOptionMinMaxValueMixin,ApplicationCommandOptionBase:()=>ApplicationCommandOptionBase,ApplicationCommandOptionChannelTypesMixin:()=>ApplicationCommandOptionChannelTypesMixin,ApplicationCommandOptionWithChoicesAndAutocompleteMixin:()=>ApplicationCommandOptionWithChoicesAndAutocompleteMixin,BaseSelectMenuBuilder:()=>BaseSelectMenuBuilder,ButtonBuilder:()=>ButtonBuilder,ChannelSelectMenuBuilder:()=>ChannelSelectMenuBuilder,ComponentAssertions:()=>Assertions_exports2,ComponentBuilder:()=>ComponentBuilder,ContextMenuCommandAssertions:()=>Assertions_exports6,ContextMenuCommandBuilder:()=>ContextMenuCommandBuilder,EmbedAssertions:()=>Assertions_exports,EmbedBuilder:()=>EmbedBuilder,MentionableSelectMenuBuilder:()=>MentionableSelectMenuBuilder,ModalAssertions:()=>Assertions_exports4,ModalBuilder:()=>ModalBuilder,RoleSelectMenuBuilder:()=>RoleSelectMenuBuilder,SelectMenuBuilder:()=>StringSelectMenuBuilder,SelectMenuOptionBuilder:()=>StringSelectMenuOptionBuilder,SharedNameAndDescription:()=>SharedNameAndDescription,SharedSlashCommandOptions:()=>SharedSlashCommandOptions,SlashCommandAssertions:()=>Assertions_exports5,SlashCommandAttachmentOption:()=>SlashCommandAttachmentOption,SlashCommandBooleanOption:()=>SlashCommandBooleanOption,SlashCommandBuilder:()=>SlashCommandBuilder,SlashCommandChannelOption:()=>SlashCommandChannelOption,SlashCommandIntegerOption:()=>SlashCommandIntegerOption,SlashCommandMentionableOption:()=>SlashCommandMentionableOption,SlashCommandNumberOption:()=>SlashCommandNumberOption,SlashCommandRoleOption:()=>SlashCommandRoleOption,SlashCommandStringOption:()=>SlashCommandStringOption,SlashCommandSubcommandBuilder:()=>SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder:()=>SlashCommandSubcommandGroupBuilder,SlashCommandUserOption:()=>SlashCommandUserOption,StringSelectMenuBuilder:()=>StringSelectMenuBuilder,StringSelectMenuOptionBuilder:()=>StringSelectMenuOptionBuilder,TextInputAssertions:()=>Assertions_exports3,TextInputBuilder:()=>TextInputBuilder,UserSelectMenuBuilder:()=>UserSelectMenuBuilder,createComponentBuilder:()=>createComponentBuilder,disableValidators:()=>disableValidators,embedLength:()=>embedLength,enableValidators:()=>enableValidators,isValidationEnabled:()=>isValidationEnabled,normalizeArray:()=>normalizeArray,version:()=>version}),module2.exports=__toCommonJS(src_exports);var Assertions_exports={};__export(Assertions_exports,{RGBPredicate:()=>RGBPredicate,authorNamePredicate:()=>authorNamePredicate,colorPredicate:()=>colorPredicate,descriptionPredicate:()=>descriptionPredicate,embedAuthorPredicate:()=>embedAuthorPredicate,embedFieldPredicate:()=>embedFieldPredicate,embedFieldsArrayPredicate:()=>embedFieldsArrayPredicate,embedFooterPredicate:()=>embedFooterPredicate,fieldInlinePredicate:()=>fieldInlinePredicate,fieldLengthPredicate:()=>fieldLengthPredicate,fieldNamePredicate:()=>fieldNamePredicate,fieldValuePredicate:()=>fieldValuePredicate,footerTextPredicate:()=>footerTextPredicate,imageURLPredicate:()=>imageURLPredicate,timestampPredicate:()=>timestampPredicate,titlePredicate:()=>titlePredicate,urlPredicate:()=>urlPredicate,validateFieldLength:()=>validateFieldLength});var import_shapeshift=__webpack_require__2(2409),validate=!0;function enableValidators(){return validate=!0}function disableValidators(){return validate=!1}function isValidationEnabled(){return validate}__name(enableValidators,"enableValidators"),__name2(enableValidators,"enableValidators"),__name(disableValidators,"disableValidators"),__name2(disableValidators,"disableValidators"),__name(isValidationEnabled,"isValidationEnabled"),__name2(isValidationEnabled,"isValidationEnabled");var fieldNamePredicate=import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(256).setValidationEnabled(isValidationEnabled),fieldValuePredicate=import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(1024).setValidationEnabled(isValidationEnabled),fieldInlinePredicate=import_shapeshift.s.boolean.optional,embedFieldPredicate=import_shapeshift.s.object({name:fieldNamePredicate,value:fieldValuePredicate,inline:fieldInlinePredicate}).setValidationEnabled(isValidationEnabled),embedFieldsArrayPredicate=embedFieldPredicate.array.setValidationEnabled(isValidationEnabled),fieldLengthPredicate=import_shapeshift.s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);function validateFieldLength(amountAdding,fields){fieldLengthPredicate.parse((fields?.length??0)+amountAdding)}__name(validateFieldLength,"validateFieldLength"),__name2(validateFieldLength,"validateFieldLength");var authorNamePredicate=fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled),imageURLPredicate=import_shapeshift.s.string.url({allowedProtocols:["http:","https:","attachment:"]}).nullish.setValidationEnabled(isValidationEnabled),urlPredicate=import_shapeshift.s.string.url({allowedProtocols:["http:","https:"]}).nullish.setValidationEnabled(isValidationEnabled),embedAuthorPredicate=import_shapeshift.s.object({name:authorNamePredicate,iconURL:imageURLPredicate,url:urlPredicate}).setValidationEnabled(isValidationEnabled),RGBPredicate=import_shapeshift.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(255).setValidationEnabled(isValidationEnabled),colorPredicate=import_shapeshift.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(16777215).or(import_shapeshift.s.tuple([RGBPredicate,RGBPredicate,RGBPredicate])).nullable.setValidationEnabled(isValidationEnabled),descriptionPredicate=import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(4096).nullable.setValidationEnabled(isValidationEnabled),footerTextPredicate=import_shapeshift.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(2048).nullable.setValidationEnabled(isValidationEnabled),embedFooterPredicate=import_shapeshift.s.object({text:footerTextPredicate,iconURL:imageURLPredicate}).setValidationEnabled(isValidationEnabled),timestampPredicate=import_shapeshift.s.union(import_shapeshift.s.number,import_shapeshift.s.date).nullable.setValidationEnabled(isValidationEnabled),titlePredicate=fieldNamePredicate.nullable.setValidationEnabled(isValidationEnabled);function normalizeArray(arr){return Array.isArray(arr[0])?arr[0]:arr}__name(normalizeArray,"normalizeArray"),__name2(normalizeArray,"normalizeArray");var EmbedBuilder=__name(class{static#_=__name2(this,"EmbedBuilder");data;constructor(data={}){this.data={...data},data.timestamp&&(this.data.timestamp=new Date(data.timestamp).toISOString())}addFields(...fields){const normalizedFields=normalizeArray(fields);return validateFieldLength(normalizedFields.length,this.data.fields),embedFieldsArrayPredicate.parse(normalizedFields),this.data.fields?this.data.fields.push(...normalizedFields):this.data.fields=normalizedFields,this}spliceFields(index,deleteCount,...fields){return validateFieldLength(fields.length-deleteCount,this.data.fields),embedFieldsArrayPredicate.parse(fields),this.data.fields?this.data.fields.splice(index,deleteCount,...fields):this.data.fields=fields,this}setFields(...fields){return this.spliceFields(0,this.data.fields?.length??0,...normalizeArray(fields)),this}setAuthor(options){return null===options?(this.data.author=void 0,this):(embedAuthorPredicate.parse(options),this.data.author={name:options.name,url:options.url,icon_url:options.iconURL},this)}setColor(color){if(colorPredicate.parse(color),Array.isArray(color)){const[red,green,blue]=color;return this.data.color=(red<<16)+(green<<8)+blue,this}return this.data.color=color??void 0,this}setDescription(description){return descriptionPredicate.parse(description),this.data.description=description??void 0,this}setFooter(options){return null===options?(this.data.footer=void 0,this):(embedFooterPredicate.parse(options),this.data.footer={text:options.text,icon_url:options.iconURL},this)}setImage(url){return imageURLPredicate.parse(url),this.data.image=url?{url}:void 0,this}setThumbnail(url){return imageURLPredicate.parse(url),this.data.thumbnail=url?{url}:void 0,this}setTimestamp(timestamp=Date.now()){return timestampPredicate.parse(timestamp),this.data.timestamp=timestamp?new Date(timestamp).toISOString():void 0,this}setTitle(title){return titlePredicate.parse(title),this.data.title=title??void 0,this}setURL(url){return urlPredicate.parse(url),this.data.url=url??void 0,this}toJSON(){return{...this.data}}},"EmbedBuilder");__reExport(src_exports,__webpack_require__2(5806),module2.exports);var Assertions_exports2={};__export(Assertions_exports2,{buttonLabelValidator:()=>buttonLabelValidator,buttonStyleValidator:()=>buttonStyleValidator,channelTypesValidator:()=>channelTypesValidator,customIdValidator:()=>customIdValidator,defaultValidator:()=>defaultValidator,disabledValidator:()=>disabledValidator,emojiValidator:()=>emojiValidator,jsonOptionValidator:()=>jsonOptionValidator,labelValueDescriptionValidator:()=>labelValueDescriptionValidator,minMaxValidator:()=>minMaxValidator,optionValidator:()=>optionValidator,optionsLengthValidator:()=>optionsLengthValidator,optionsValidator:()=>optionsValidator,placeholderValidator:()=>placeholderValidator,urlValidator:()=>urlValidator,validateRequiredButtonParameters:()=>validateRequiredButtonParameters,validateRequiredSelectMenuOptionParameters:()=>validateRequiredSelectMenuOptionParameters,validateRequiredSelectMenuParameters:()=>validateRequiredSelectMenuParameters});var import_shapeshift2=__webpack_require__2(2409),import_v10=__webpack_require__2(26538),StringSelectMenuOptionBuilder=__name(class{constructor(data={}){this.data=data}static#_=__name2(this,"StringSelectMenuOptionBuilder");setLabel(label){return this.data.label=labelValueDescriptionValidator.parse(label),this}setValue(value){return this.data.value=labelValueDescriptionValidator.parse(value),this}setDescription(description){return this.data.description=labelValueDescriptionValidator.parse(description),this}setDefault(isDefault=!0){return this.data.default=defaultValidator.parse(isDefault),this}setEmoji(emoji){return this.data.emoji=emojiValidator.parse(emoji),this}toJSON(){return validateRequiredSelectMenuOptionParameters(this.data.label,this.data.value),{...this.data}}},"StringSelectMenuOptionBuilder"),customIdValidator=import_shapeshift2.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled),emojiValidator=import_shapeshift2.s.object({id:import_shapeshift2.s.string,name:import_shapeshift2.s.string,animated:import_shapeshift2.s.boolean}).partial.strict.setValidationEnabled(isValidationEnabled),disabledValidator=import_shapeshift2.s.boolean,buttonLabelValidator=import_shapeshift2.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(80).setValidationEnabled(isValidationEnabled),buttonStyleValidator=import_shapeshift2.s.nativeEnum(import_v10.ButtonStyle),placeholderValidator=import_shapeshift2.s.string.lengthLessThanOrEqual(150).setValidationEnabled(isValidationEnabled),minMaxValidator=import_shapeshift2.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(25).setValidationEnabled(isValidationEnabled),labelValueDescriptionValidator=import_shapeshift2.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled),jsonOptionValidator=import_shapeshift2.s.object({label:labelValueDescriptionValidator,value:labelValueDescriptionValidator,description:labelValueDescriptionValidator.optional,emoji:emojiValidator.optional,default:import_shapeshift2.s.boolean.optional}).setValidationEnabled(isValidationEnabled),optionValidator=import_shapeshift2.s.instance(StringSelectMenuOptionBuilder).setValidationEnabled(isValidationEnabled),optionsValidator=optionValidator.array.lengthGreaterThanOrEqual(0).setValidationEnabled(isValidationEnabled),optionsLengthValidator=import_shapeshift2.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);function validateRequiredSelectMenuParameters(options,customId){customIdValidator.parse(customId),optionsValidator.parse(options)}__name(validateRequiredSelectMenuParameters,"validateRequiredSelectMenuParameters"),__name2(validateRequiredSelectMenuParameters,"validateRequiredSelectMenuParameters");var defaultValidator=import_shapeshift2.s.boolean;function validateRequiredSelectMenuOptionParameters(label,value){labelValueDescriptionValidator.parse(label),labelValueDescriptionValidator.parse(value)}__name(validateRequiredSelectMenuOptionParameters,"validateRequiredSelectMenuOptionParameters"),__name2(validateRequiredSelectMenuOptionParameters,"validateRequiredSelectMenuOptionParameters");var channelTypesValidator=import_shapeshift2.s.nativeEnum(import_v10.ChannelType).array.setValidationEnabled(isValidationEnabled),urlValidator=import_shapeshift2.s.string.url({allowedProtocols:["http:","https:","discord:"]}).setValidationEnabled(isValidationEnabled);function validateRequiredButtonParameters(style,label,emoji,customId,url){if(url&&customId)throw new RangeError("URL and custom id are mutually exclusive");if(!label&&!emoji)throw new RangeError("Buttons must have a label and/or an emoji");if(style===import_v10.ButtonStyle.Link){if(!url)throw new RangeError("Link buttons must have a url")}else if(url)throw new RangeError("Non-link buttons cannot have a url")}__name(validateRequiredButtonParameters,"validateRequiredButtonParameters"),__name2(validateRequiredButtonParameters,"validateRequiredButtonParameters");var import_v1011=__webpack_require__2(26538),ComponentBuilder=__name(class{static#_=__name2(this,"ComponentBuilder");data;constructor(data){this.data=data}},"ComponentBuilder"),import_v1010=__webpack_require__2(26538),import_v102=__webpack_require__2(26538),ButtonBuilder=__name(class extends ComponentBuilder{static#_=__name2(this,"ButtonBuilder");constructor(data){super({type:import_v102.ComponentType.Button,...data})}setStyle(style){return this.data.style=buttonStyleValidator.parse(style),this}setURL(url){return this.data.url=urlValidator.parse(url),this}setCustomId(customId){return this.data.custom_id=customIdValidator.parse(customId),this}setEmoji(emoji){return this.data.emoji=emojiValidator.parse(emoji),this}setDisabled(disabled=!0){return this.data.disabled=disabledValidator.parse(disabled),this}setLabel(label){return this.data.label=buttonLabelValidator.parse(label),this}toJSON(){return validateRequiredButtonParameters(this.data.style,this.data.label,this.data.emoji,this.data.custom_id,this.data.url),{...this.data}}},"ButtonBuilder"),import_v103=__webpack_require__2(26538),BaseSelectMenuBuilder=__name(class extends ComponentBuilder{static#_=__name2(this,"BaseSelectMenuBuilder");setPlaceholder(placeholder){return this.data.placeholder=placeholderValidator.parse(placeholder),this}setMinValues(minValues){return this.data.min_values=minMaxValidator.parse(minValues),this}setMaxValues(maxValues){return this.data.max_values=minMaxValidator.parse(maxValues),this}setCustomId(customId){return this.data.custom_id=customIdValidator.parse(customId),this}setDisabled(disabled=!0){return this.data.disabled=disabledValidator.parse(disabled),this}toJSON(){return customIdValidator.parse(this.data.custom_id),{...this.data}}},"BaseSelectMenuBuilder"),ChannelSelectMenuBuilder=__name(class extends BaseSelectMenuBuilder{static#_=__name2(this,"ChannelSelectMenuBuilder");constructor(data){super({...data,type:import_v103.ComponentType.ChannelSelect})}addChannelTypes(...types){const normalizedTypes=normalizeArray(types);return this.data.channel_types??=[],this.data.channel_types.push(...channelTypesValidator.parse(normalizedTypes)),this}setChannelTypes(...types){const normalizedTypes=normalizeArray(types);return this.data.channel_types??=[],this.data.channel_types.splice(0,this.data.channel_types.length,...channelTypesValidator.parse(normalizedTypes)),this}toJSON(){return customIdValidator.parse(this.data.custom_id),{...this.data}}},"ChannelSelectMenuBuilder"),import_v104=__webpack_require__2(26538),MentionableSelectMenuBuilder=__name(class extends BaseSelectMenuBuilder{static#_=__name2(this,"MentionableSelectMenuBuilder");constructor(data){super({...data,type:import_v104.ComponentType.MentionableSelect})}},"MentionableSelectMenuBuilder"),import_v105=__webpack_require__2(26538),RoleSelectMenuBuilder=__name(class extends BaseSelectMenuBuilder{static#_=__name2(this,"RoleSelectMenuBuilder");constructor(data){super({...data,type:import_v105.ComponentType.RoleSelect})}},"RoleSelectMenuBuilder"),import_v106=__webpack_require__2(26538),StringSelectMenuBuilder=__name(class extends BaseSelectMenuBuilder{static#_=__name2(this,"StringSelectMenuBuilder");options;constructor(data){const{options,...initData}=data??{};super({...initData,type:import_v106.ComponentType.StringSelect}),this.options=options?.map(option=>new StringSelectMenuOptionBuilder(option))??[]}addOptions(...options){const normalizedOptions=normalizeArray(options);return optionsLengthValidator.parse(this.options.length+normalizedOptions.length),this.options.push(...normalizedOptions.map(normalizedOption=>normalizedOption instanceof StringSelectMenuOptionBuilder?normalizedOption:new StringSelectMenuOptionBuilder(jsonOptionValidator.parse(normalizedOption)))),this}setOptions(...options){return this.spliceOptions(0,this.options.length,...options)}spliceOptions(index,deleteCount,...options){const normalizedOptions=normalizeArray(options),clone=[...this.options];return clone.splice(index,deleteCount,...normalizedOptions.map(normalizedOption=>normalizedOption instanceof StringSelectMenuOptionBuilder?normalizedOption:new StringSelectMenuOptionBuilder(jsonOptionValidator.parse(normalizedOption)))),optionsLengthValidator.parse(clone.length),this.options.splice(0,this.options.length,...clone),this}toJSON(){return validateRequiredSelectMenuParameters(this.options,this.data.custom_id),{...this.data,options:this.options.map(option=>option.toJSON())}}},"StringSelectMenuBuilder"),import_v107=__webpack_require__2(26538),UserSelectMenuBuilder=__name(class extends BaseSelectMenuBuilder{static#_=__name2(this,"UserSelectMenuBuilder");constructor(data){super({...data,type:import_v107.ComponentType.UserSelect})}},"UserSelectMenuBuilder"),import_util=__webpack_require__2(43985),import_v109=__webpack_require__2(26538),import_fast_deep_equal=__toESM(__webpack_require__2(21385)),Assertions_exports3={};__export(Assertions_exports3,{labelValidator:()=>labelValidator,maxLengthValidator:()=>maxLengthValidator,minLengthValidator:()=>minLengthValidator,placeholderValidator:()=>placeholderValidator2,requiredValidator:()=>requiredValidator,textInputStyleValidator:()=>textInputStyleValidator,validateRequiredParameters:()=>validateRequiredParameters,valueValidator:()=>valueValidator});var import_shapeshift3=__webpack_require__2(2409),import_v108=__webpack_require__2(26538),textInputStyleValidator=import_shapeshift3.s.nativeEnum(import_v108.TextInputStyle),minLengthValidator=import_shapeshift3.s.number.int.greaterThanOrEqual(0).lessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled),maxLengthValidator=import_shapeshift3.s.number.int.greaterThanOrEqual(1).lessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled),requiredValidator=import_shapeshift3.s.boolean,valueValidator=import_shapeshift3.s.string.lengthLessThanOrEqual(4e3).setValidationEnabled(isValidationEnabled),placeholderValidator2=import_shapeshift3.s.string.lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled),labelValidator=import_shapeshift3.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled);function validateRequiredParameters(customId,style,label){customIdValidator.parse(customId),textInputStyleValidator.parse(style),labelValidator.parse(label)}__name(validateRequiredParameters,"validateRequiredParameters"),__name2(validateRequiredParameters,"validateRequiredParameters");var TextInputBuilder=__name(class extends ComponentBuilder{static#_=__name2(this,"TextInputBuilder");constructor(data){super({type:import_v109.ComponentType.TextInput,...data})}setCustomId(customId){return this.data.custom_id=customIdValidator.parse(customId),this}setLabel(label){return this.data.label=labelValidator.parse(label),this}setStyle(style){return this.data.style=textInputStyleValidator.parse(style),this}setMinLength(minLength){return this.data.min_length=minLengthValidator.parse(minLength),this}setMaxLength(maxLength){return this.data.max_length=maxLengthValidator.parse(maxLength),this}setPlaceholder(placeholder){return this.data.placeholder=placeholderValidator2.parse(placeholder),this}setValue(value){return this.data.value=valueValidator.parse(value),this}setRequired(required=!0){return this.data.required=requiredValidator.parse(required),this}toJSON(){return validateRequiredParameters(this.data.custom_id,this.data.style,this.data.label),{...this.data}}equals(other){return(0,import_util.isJSONEncodable)(other)?(0,import_fast_deep_equal.default)(other.toJSON(),this.data):(0,import_fast_deep_equal.default)(other,this.data)}},"TextInputBuilder");function createComponentBuilder(data){if(data instanceof ComponentBuilder)return data;switch(data.type){case import_v1010.ComponentType.ActionRow:return new ActionRowBuilder(data);case import_v1010.ComponentType.Button:return new ButtonBuilder(data);case import_v1010.ComponentType.StringSelect:return new StringSelectMenuBuilder(data);case import_v1010.ComponentType.TextInput:return new TextInputBuilder(data);case import_v1010.ComponentType.UserSelect:return new UserSelectMenuBuilder(data);case import_v1010.ComponentType.RoleSelect:return new RoleSelectMenuBuilder(data);case import_v1010.ComponentType.MentionableSelect:return new MentionableSelectMenuBuilder(data);case import_v1010.ComponentType.ChannelSelect:return new ChannelSelectMenuBuilder(data);default:throw new Error(`Cannot properly serialize component type: ${data.type}`)}}__name(createComponentBuilder,"createComponentBuilder"),__name2(createComponentBuilder,"createComponentBuilder");var ActionRowBuilder=__name(class extends ComponentBuilder{static#_=__name2(this,"ActionRowBuilder");components;constructor({components,...data}={}){super({type:import_v1011.ComponentType.ActionRow,...data}),this.components=components?.map(component=>createComponentBuilder(component))??[]}addComponents(...components){return this.components.push(...normalizeArray(components)),this}setComponents(...components){return this.components.splice(0,this.components.length,...normalizeArray(components)),this}toJSON(){return{...this.data,components:this.components.map(component=>component.toJSON())}}},"ActionRowBuilder"),Assertions_exports4={};__export(Assertions_exports4,{componentsValidator:()=>componentsValidator,titleValidator:()=>titleValidator,validateRequiredParameters:()=>validateRequiredParameters2});var import_shapeshift4=__webpack_require__2(2409),titleValidator=import_shapeshift4.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45).setValidationEnabled(isValidationEnabled),componentsValidator=import_shapeshift4.s.instance(ActionRowBuilder).array.lengthGreaterThanOrEqual(1).setValidationEnabled(isValidationEnabled);function validateRequiredParameters2(customId,title,components){customIdValidator.parse(customId),titleValidator.parse(title),componentsValidator.parse(components)}__name(validateRequiredParameters2,"validateRequiredParameters2"),__name2(validateRequiredParameters2,"validateRequiredParameters");var ModalBuilder=__name(class{static#_=__name2(this,"ModalBuilder");data;components=[];constructor({components,...data}={}){this.data={...data},this.components=components?.map(component=>createComponentBuilder(component))??[]}setTitle(title){return this.data.title=titleValidator.parse(title),this}setCustomId(customId){return this.data.custom_id=customIdValidator.parse(customId),this}addComponents(...components){return this.components.push(...normalizeArray(components).map(component=>component instanceof ActionRowBuilder?component:new ActionRowBuilder(component))),this}setComponents(...components){return this.components.splice(0,this.components.length,...normalizeArray(components)),this}toJSON(){return validateRequiredParameters2(this.data.custom_id,this.data.title,this.components),{...this.data,components:this.components.map(component=>component.toJSON())}}},"ModalBuilder"),Assertions_exports5={};__export(Assertions_exports5,{assertReturnOfBuilder:()=>assertReturnOfBuilder,localizationMapPredicate:()=>localizationMapPredicate,validateChoicesLength:()=>validateChoicesLength,validateDMPermission:()=>validateDMPermission,validateDefaultMemberPermissions:()=>validateDefaultMemberPermissions,validateDefaultPermission:()=>validateDefaultPermission,validateDescription:()=>validateDescription,validateLocale:()=>validateLocale,validateLocalizationMap:()=>validateLocalizationMap,validateMaxOptionsLength:()=>validateMaxOptionsLength,validateNSFW:()=>validateNSFW,validateName:()=>validateName,validateRequired:()=>validateRequired,validateRequiredParameters:()=>validateRequiredParameters3});var import_shapeshift5=__webpack_require__2(2409),import_v1012=__webpack_require__2(26538),namePredicate=import_shapeshift5.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^[\p{Ll}\p{Lm}\p{Lo}\p{N}\p{sc=Devanagari}\p{sc=Thai}_-]+$/u).setValidationEnabled(isValidationEnabled);function validateName(name){namePredicate.parse(name)}__name(validateName,"validateName"),__name2(validateName,"validateName");var descriptionPredicate2=import_shapeshift5.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled),localePredicate=import_shapeshift5.s.nativeEnum(import_v1012.Locale);function validateDescription(description){descriptionPredicate2.parse(description)}__name(validateDescription,"validateDescription"),__name2(validateDescription,"validateDescription");var maxArrayLengthPredicate=import_shapeshift5.s.unknown.array.lengthLessThanOrEqual(25).setValidationEnabled(isValidationEnabled);function validateLocale(locale){return localePredicate.parse(locale)}function validateMaxOptionsLength(options){maxArrayLengthPredicate.parse(options)}function validateRequiredParameters3(name,description,options){validateName(name),validateDescription(description),validateMaxOptionsLength(options)}__name(validateLocale,"validateLocale"),__name2(validateLocale,"validateLocale"),__name(validateMaxOptionsLength,"validateMaxOptionsLength"),__name2(validateMaxOptionsLength,"validateMaxOptionsLength"),__name(validateRequiredParameters3,"validateRequiredParameters3"),__name2(validateRequiredParameters3,"validateRequiredParameters");var booleanPredicate=import_shapeshift5.s.boolean;function validateDefaultPermission(value){booleanPredicate.parse(value)}function validateRequired(required){booleanPredicate.parse(required)}__name(validateDefaultPermission,"validateDefaultPermission"),__name2(validateDefaultPermission,"validateDefaultPermission"),__name(validateRequired,"validateRequired"),__name2(validateRequired,"validateRequired");var choicesLengthPredicate=import_shapeshift5.s.number.lessThanOrEqual(25).setValidationEnabled(isValidationEnabled);function validateChoicesLength(amountAdding,choices){choicesLengthPredicate.parse((choices?.length??0)+amountAdding)}function assertReturnOfBuilder(input,ExpectedInstanceOf){import_shapeshift5.s.instance(ExpectedInstanceOf).parse(input)}__name(validateChoicesLength,"validateChoicesLength"),__name2(validateChoicesLength,"validateChoicesLength"),__name(assertReturnOfBuilder,"assertReturnOfBuilder"),__name2(assertReturnOfBuilder,"assertReturnOfBuilder");var localizationMapPredicate=import_shapeshift5.s.object(Object.fromEntries(Object.values(import_v1012.Locale).map(locale=>[locale,import_shapeshift5.s.string.nullish]))).strict.nullish.setValidationEnabled(isValidationEnabled);function validateLocalizationMap(value){localizationMapPredicate.parse(value)}__name(validateLocalizationMap,"validateLocalizationMap"),__name2(validateLocalizationMap,"validateLocalizationMap");var dmPermissionPredicate=import_shapeshift5.s.boolean.nullish;function validateDMPermission(value){dmPermissionPredicate.parse(value)}__name(validateDMPermission,"validateDMPermission"),__name2(validateDMPermission,"validateDMPermission");var memberPermissionPredicate=import_shapeshift5.s.union(import_shapeshift5.s.bigint.transform(value=>value.toString()),import_shapeshift5.s.number.safeInt.transform(value=>value.toString()),import_shapeshift5.s.string.regex(/^\d+$/)).nullish;function validateDefaultMemberPermissions(permissions){return memberPermissionPredicate.parse(permissions)}function validateNSFW(value){booleanPredicate.parse(value)}__name(validateDefaultMemberPermissions,"validateDefaultMemberPermissions"),__name2(validateDefaultMemberPermissions,"validateDefaultMemberPermissions"),__name(validateNSFW,"validateNSFW"),__name2(validateNSFW,"validateNSFW");var import_ts_mixer6=__webpack_require__2(92688),import_v1024=__webpack_require__2(26538),import_ts_mixer5=__webpack_require__2(92688),SharedNameAndDescription=__name(class{static#_=__name2(this,"SharedNameAndDescription");name;name_localizations;description;description_localizations;setName(name){return validateName(name),Reflect.set(this,"name",name),this}setDescription(description){return validateDescription(description),Reflect.set(this,"description",description),this}setNameLocalization(locale,localizedName){this.name_localizations||Reflect.set(this,"name_localizations",{});const parsedLocale=validateLocale(locale);return null===localizedName?(this.name_localizations[parsedLocale]=null,this):(validateName(localizedName),this.name_localizations[parsedLocale]=localizedName,this)}setNameLocalizations(localizedNames){if(null===localizedNames)return Reflect.set(this,"name_localizations",null),this;Reflect.set(this,"name_localizations",{});for(const args2 of Object.entries(localizedNames))this.setNameLocalization(...args2);return this}setDescriptionLocalization(locale,localizedDescription){this.description_localizations||Reflect.set(this,"description_localizations",{});const parsedLocale=validateLocale(locale);return null===localizedDescription?(this.description_localizations[parsedLocale]=null,this):(validateDescription(localizedDescription),this.description_localizations[parsedLocale]=localizedDescription,this)}setDescriptionLocalizations(localizedDescriptions){if(null===localizedDescriptions)return Reflect.set(this,"description_localizations",null),this;Reflect.set(this,"description_localizations",{});for(const args2 of Object.entries(localizedDescriptions))this.setDescriptionLocalization(...args2);return this}},"SharedNameAndDescription"),import_v1013=__webpack_require__2(26538),ApplicationCommandOptionBase=__name(class extends SharedNameAndDescription{static#_=__name2(this,"ApplicationCommandOptionBase");required=!1;setRequired(required){return validateRequired(required),Reflect.set(this,"required",required),this}runRequiredValidations(){validateRequiredParameters3(this.name,this.description,[]),validateLocalizationMap(this.name_localizations),validateLocalizationMap(this.description_localizations),validateRequired(this.required)}},"ApplicationCommandOptionBase"),SlashCommandAttachmentOption=__name(class extends ApplicationCommandOptionBase{static#_=__name2(this,"SlashCommandAttachmentOption");type=import_v1013.ApplicationCommandOptionType.Attachment;toJSON(){return this.runRequiredValidations(),{...this}}},"SlashCommandAttachmentOption"),import_v1014=__webpack_require__2(26538),SlashCommandBooleanOption=__name(class extends ApplicationCommandOptionBase{static#_=__name2(this,"SlashCommandBooleanOption");type=import_v1014.ApplicationCommandOptionType.Boolean;toJSON(){return this.runRequiredValidations(),{...this}}},"SlashCommandBooleanOption"),import_v1016=__webpack_require__2(26538),import_ts_mixer=__webpack_require__2(92688),import_shapeshift6=__webpack_require__2(2409),import_v1015=__webpack_require__2(26538),allowedChannelTypes=[import_v1015.ChannelType.GuildText,import_v1015.ChannelType.GuildVoice,import_v1015.ChannelType.GuildCategory,import_v1015.ChannelType.GuildAnnouncement,import_v1015.ChannelType.AnnouncementThread,import_v1015.ChannelType.PublicThread,import_v1015.ChannelType.PrivateThread,import_v1015.ChannelType.GuildStageVoice,import_v1015.ChannelType.GuildForum],channelTypesPredicate=import_shapeshift6.s.array(import_shapeshift6.s.union(...allowedChannelTypes.map(type=>import_shapeshift6.s.literal(type)))),ApplicationCommandOptionChannelTypesMixin=__name(class{static#_=__name2(this,"ApplicationCommandOptionChannelTypesMixin");channel_types;addChannelTypes(...channelTypes){return void 0===this.channel_types&&Reflect.set(this,"channel_types",[]),this.channel_types.push(...channelTypesPredicate.parse(channelTypes)),this}},"ApplicationCommandOptionChannelTypesMixin"),SlashCommandChannelOption=__name(class extends ApplicationCommandOptionBase{type=import_v1016.ApplicationCommandOptionType.Channel;toJSON(){return this.runRequiredValidations(),{...this}}},"SlashCommandChannelOption");__name2(SlashCommandChannelOption,"SlashCommandChannelOption"),SlashCommandChannelOption=__decorateClass([(0,import_ts_mixer.mix)(ApplicationCommandOptionChannelTypesMixin)],SlashCommandChannelOption);var import_shapeshift8=__webpack_require__2(2409),import_v1018=__webpack_require__2(26538),import_ts_mixer2=__webpack_require__2(92688),ApplicationCommandNumericOptionMinMaxValueMixin=__name(class{static#_=__name2(this,"ApplicationCommandNumericOptionMinMaxValueMixin");max_value;min_value},"ApplicationCommandNumericOptionMinMaxValueMixin"),import_shapeshift7=__webpack_require__2(2409),import_v1017=__webpack_require__2(26538),stringPredicate=import_shapeshift7.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100),numberPredicate=import_shapeshift7.s.number.greaterThan(Number.NEGATIVE_INFINITY).lessThan(Number.POSITIVE_INFINITY),choicesPredicate=import_shapeshift7.s.object({name:stringPredicate,name_localizations:localizationMapPredicate,value:import_shapeshift7.s.union(stringPredicate,numberPredicate)}).array,booleanPredicate2=import_shapeshift7.s.boolean,ApplicationCommandOptionWithChoicesAndAutocompleteMixin=__name(class{static#_=__name2(this,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");choices;autocomplete;type;addChoices(...choices){if(choices.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");choicesPredicate.parse(choices),void 0===this.choices&&Reflect.set(this,"choices",[]),validateChoicesLength(choices.length,this.choices);for(const{name,name_localizations,value}of choices)this.type===import_v1017.ApplicationCommandOptionType.String?stringPredicate.parse(value):numberPredicate.parse(value),this.choices.push({name,name_localizations,value});return this}setChoices(...choices){if(choices.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return choicesPredicate.parse(choices),Reflect.set(this,"choices",[]),this.addChoices(...choices),this}setAutocomplete(autocomplete){if(booleanPredicate2.parse(autocomplete),autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return Reflect.set(this,"autocomplete",autocomplete),this}},"ApplicationCommandOptionWithChoicesAndAutocompleteMixin"),numberValidator=import_shapeshift8.s.number.int,SlashCommandIntegerOption=__name(class extends ApplicationCommandOptionBase{type=import_v1018.ApplicationCommandOptionType.Integer;setMaxValue(max){return numberValidator.parse(max),Reflect.set(this,"max_value",max),this}setMinValue(min){return numberValidator.parse(min),Reflect.set(this,"min_value",min),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}},"SlashCommandIntegerOption");__name2(SlashCommandIntegerOption,"SlashCommandIntegerOption"),SlashCommandIntegerOption=__decorateClass([(0,import_ts_mixer2.mix)(ApplicationCommandNumericOptionMinMaxValueMixin,ApplicationCommandOptionWithChoicesAndAutocompleteMixin)],SlashCommandIntegerOption);var import_v1019=__webpack_require__2(26538),SlashCommandMentionableOption=__name(class extends ApplicationCommandOptionBase{static#_=__name2(this,"SlashCommandMentionableOption");type=import_v1019.ApplicationCommandOptionType.Mentionable;toJSON(){return this.runRequiredValidations(),{...this}}},"SlashCommandMentionableOption"),import_shapeshift9=__webpack_require__2(2409),import_v1020=__webpack_require__2(26538),import_ts_mixer3=__webpack_require__2(92688),numberValidator2=import_shapeshift9.s.number,SlashCommandNumberOption=__name(class extends ApplicationCommandOptionBase{type=import_v1020.ApplicationCommandOptionType.Number;setMaxValue(max){return numberValidator2.parse(max),Reflect.set(this,"max_value",max),this}setMinValue(min){return numberValidator2.parse(min),Reflect.set(this,"min_value",min),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}},"SlashCommandNumberOption");__name2(SlashCommandNumberOption,"SlashCommandNumberOption"),SlashCommandNumberOption=__decorateClass([(0,import_ts_mixer3.mix)(ApplicationCommandNumericOptionMinMaxValueMixin,ApplicationCommandOptionWithChoicesAndAutocompleteMixin)],SlashCommandNumberOption);var import_v1021=__webpack_require__2(26538),SlashCommandRoleOption=__name(class extends ApplicationCommandOptionBase{static#_=__name2(this,"SlashCommandRoleOption");type=import_v1021.ApplicationCommandOptionType.Role;toJSON(){return this.runRequiredValidations(),{...this}}},"SlashCommandRoleOption"),import_shapeshift10=__webpack_require__2(2409),import_v1022=__webpack_require__2(26538),import_ts_mixer4=__webpack_require__2(92688),minLengthValidator2=import_shapeshift10.s.number.greaterThanOrEqual(0).lessThanOrEqual(6e3),maxLengthValidator2=import_shapeshift10.s.number.greaterThanOrEqual(1).lessThanOrEqual(6e3),SlashCommandStringOption=__name(class extends ApplicationCommandOptionBase{type=import_v1022.ApplicationCommandOptionType.String;max_length;min_length;setMaxLength(max){return maxLengthValidator2.parse(max),Reflect.set(this,"max_length",max),this}setMinLength(min){return minLengthValidator2.parse(min),Reflect.set(this,"min_length",min),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}},"SlashCommandStringOption");__name2(SlashCommandStringOption,"SlashCommandStringOption"),SlashCommandStringOption=__decorateClass([(0,import_ts_mixer4.mix)(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)],SlashCommandStringOption);var import_v1023=__webpack_require__2(26538),SlashCommandUserOption=__name(class extends ApplicationCommandOptionBase{static#_=__name2(this,"SlashCommandUserOption");type=import_v1023.ApplicationCommandOptionType.User;toJSON(){return this.runRequiredValidations(),{...this}}},"SlashCommandUserOption"),SharedSlashCommandOptions=__name(class{static#_=__name2(this,"SharedSlashCommandOptions");options;addBooleanOption(input){return this._sharedAddOptionMethod(input,SlashCommandBooleanOption)}addUserOption(input){return this._sharedAddOptionMethod(input,SlashCommandUserOption)}addChannelOption(input){return this._sharedAddOptionMethod(input,SlashCommandChannelOption)}addRoleOption(input){return this._sharedAddOptionMethod(input,SlashCommandRoleOption)}addAttachmentOption(input){return this._sharedAddOptionMethod(input,SlashCommandAttachmentOption)}addMentionableOption(input){return this._sharedAddOptionMethod(input,SlashCommandMentionableOption)}addStringOption(input){return this._sharedAddOptionMethod(input,SlashCommandStringOption)}addIntegerOption(input){return this._sharedAddOptionMethod(input,SlashCommandIntegerOption)}addNumberOption(input){return this._sharedAddOptionMethod(input,SlashCommandNumberOption)}_sharedAddOptionMethod(input,Instance){const{options}=this;validateMaxOptionsLength(options);const result="function"==typeof input?input(new Instance):input;return assertReturnOfBuilder(result,Instance),options.push(result),this}},"SharedSlashCommandOptions"),SlashCommandSubcommandGroupBuilder=__name(class{name=void 0;description=void 0;options=[];addSubcommand(input){const{options}=this;validateMaxOptionsLength(options);const result="function"==typeof input?input(new SlashCommandSubcommandBuilder):input;return assertReturnOfBuilder(result,SlashCommandSubcommandBuilder),options.push(result),this}toJSON(){return validateRequiredParameters3(this.name,this.description,this.options),{type:import_v1024.ApplicationCommandOptionType.SubcommandGroup,name:this.name,name_localizations:this.name_localizations,description:this.description,description_localizations:this.description_localizations,options:this.options.map(option=>option.toJSON())}}},"SlashCommandSubcommandGroupBuilder");__name2(SlashCommandSubcommandGroupBuilder,"SlashCommandSubcommandGroupBuilder"),SlashCommandSubcommandGroupBuilder=__decorateClass([(0,import_ts_mixer5.mix)(SharedNameAndDescription)],SlashCommandSubcommandGroupBuilder);var SlashCommandSubcommandBuilder=__name(class{name=void 0;description=void 0;options=[];toJSON(){return validateRequiredParameters3(this.name,this.description,this.options),{type:import_v1024.ApplicationCommandOptionType.Subcommand,name:this.name,name_localizations:this.name_localizations,description:this.description,description_localizations:this.description_localizations,options:this.options.map(option=>option.toJSON())}}},"SlashCommandSubcommandBuilder");__name2(SlashCommandSubcommandBuilder,"SlashCommandSubcommandBuilder"),SlashCommandSubcommandBuilder=__decorateClass([(0,import_ts_mixer5.mix)(SharedNameAndDescription,SharedSlashCommandOptions)],SlashCommandSubcommandBuilder);var SlashCommandBuilder=__name(class{name=void 0;name_localizations;description=void 0;description_localizations;options=[];default_permission=void 0;default_member_permissions=void 0;dm_permission=void 0;nsfw=void 0;setDefaultPermission(value){return validateDefaultPermission(value),Reflect.set(this,"default_permission",value),this}setDefaultMemberPermissions(permissions){const permissionValue=validateDefaultMemberPermissions(permissions);return Reflect.set(this,"default_member_permissions",permissionValue),this}setDMPermission(enabled){return validateDMPermission(enabled),Reflect.set(this,"dm_permission",enabled),this}setNSFW(nsfw=!0){return validateNSFW(nsfw),Reflect.set(this,"nsfw",nsfw),this}addSubcommandGroup(input){const{options}=this;validateMaxOptionsLength(options);const result="function"==typeof input?input(new SlashCommandSubcommandGroupBuilder):input;return assertReturnOfBuilder(result,SlashCommandSubcommandGroupBuilder),options.push(result),this}addSubcommand(input){const{options}=this;validateMaxOptionsLength(options);const result="function"==typeof input?input(new SlashCommandSubcommandBuilder):input;return assertReturnOfBuilder(result,SlashCommandSubcommandBuilder),options.push(result),this}toJSON(){return validateRequiredParameters3(this.name,this.description,this.options),validateLocalizationMap(this.name_localizations),validateLocalizationMap(this.description_localizations),{...this,options:this.options.map(option=>option.toJSON())}}},"SlashCommandBuilder");__name2(SlashCommandBuilder,"SlashCommandBuilder"),SlashCommandBuilder=__decorateClass([(0,import_ts_mixer6.mix)(SharedSlashCommandOptions,SharedNameAndDescription)],SlashCommandBuilder);var Assertions_exports6={};__export(Assertions_exports6,{validateDMPermission:()=>validateDMPermission2,validateDefaultMemberPermissions:()=>validateDefaultMemberPermissions2,validateDefaultPermission:()=>validateDefaultPermission2,validateName:()=>validateName2,validateRequiredParameters:()=>validateRequiredParameters4,validateType:()=>validateType});var import_shapeshift11=__webpack_require__2(2409),import_v1025=__webpack_require__2(26538),namePredicate2=import_shapeshift11.s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(32).regex(/^( *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}]+ *)+$/u).setValidationEnabled(isValidationEnabled),typePredicate=import_shapeshift11.s.union(import_shapeshift11.s.literal(import_v1025.ApplicationCommandType.User),import_shapeshift11.s.literal(import_v1025.ApplicationCommandType.Message)).setValidationEnabled(isValidationEnabled),booleanPredicate3=import_shapeshift11.s.boolean;function validateDefaultPermission2(value){booleanPredicate3.parse(value)}function validateName2(name){namePredicate2.parse(name)}function validateType(type){typePredicate.parse(type)}function validateRequiredParameters4(name,type){validateName2(name),validateType(type)}__name(validateDefaultPermission2,"validateDefaultPermission2"),__name2(validateDefaultPermission2,"validateDefaultPermission"),__name(validateName2,"validateName2"),__name2(validateName2,"validateName"),__name(validateType,"validateType"),__name2(validateType,"validateType"),__name(validateRequiredParameters4,"validateRequiredParameters4"),__name2(validateRequiredParameters4,"validateRequiredParameters");var dmPermissionPredicate2=import_shapeshift11.s.boolean.nullish;function validateDMPermission2(value){dmPermissionPredicate2.parse(value)}__name(validateDMPermission2,"validateDMPermission2"),__name2(validateDMPermission2,"validateDMPermission");var memberPermissionPredicate2=import_shapeshift11.s.union(import_shapeshift11.s.bigint.transform(value=>value.toString()),import_shapeshift11.s.number.safeInt.transform(value=>value.toString()),import_shapeshift11.s.string.regex(/^\d+$/)).nullish;function validateDefaultMemberPermissions2(permissions){return memberPermissionPredicate2.parse(permissions)}__name(validateDefaultMemberPermissions2,"validateDefaultMemberPermissions2"),__name2(validateDefaultMemberPermissions2,"validateDefaultMemberPermissions");var ContextMenuCommandBuilder=__name(class{static#_=__name2(this,"ContextMenuCommandBuilder");name=void 0;name_localizations;type=void 0;default_permission=void 0;default_member_permissions=void 0;dm_permission=void 0;setName(name){return validateName2(name),Reflect.set(this,"name",name),this}setType(type){return validateType(type),Reflect.set(this,"type",type),this}setDefaultPermission(value){return validateDefaultPermission2(value),Reflect.set(this,"default_permission",value),this}setDefaultMemberPermissions(permissions){const permissionValue=validateDefaultMemberPermissions2(permissions);return Reflect.set(this,"default_member_permissions",permissionValue),this}setDMPermission(enabled){return validateDMPermission2(enabled),Reflect.set(this,"dm_permission",enabled),this}setNameLocalization(locale,localizedName){this.name_localizations||Reflect.set(this,"name_localizations",{});const parsedLocale=validateLocale(locale);return null===localizedName?(this.name_localizations[parsedLocale]=null,this):(validateName2(localizedName),this.name_localizations[parsedLocale]=localizedName,this)}setNameLocalizations(localizedNames){if(null===localizedNames)return Reflect.set(this,"name_localizations",null),this;Reflect.set(this,"name_localizations",{});for(const args2 of Object.entries(localizedNames))this.setNameLocalization(...args2);return this}toJSON(){return validateRequiredParameters4(this.name,this.type),validateLocalizationMap(this.name_localizations),{...this}}},"ContextMenuCommandBuilder");function embedLength(data){return(data.title?.length??0)+(data.description?.length??0)+(data.fields?.reduce((prev,curr)=>prev+curr.name.length+curr.value.length,0)??0)+(data.footer?.text.length??0)+(data.author?.name.length??0)}__name(embedLength,"embedLength"),__name2(embedLength,"embedLength");var version="1.6.5"},9667:module2=>{"use strict";var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__defNormalProp=__name((obj,key,value)=>key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,"__defNormalProp"),__name2=__name((target,value)=>__defProp2(target,"name",{value,configurable:!0}),"__name"),__export=__name((target,all)=>{for(var name in all)__defProp2(target,name,{get:all[name],enumerable:!0})},"__export"),__copyProps=__name((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},"__copyProps"),__toCommonJS=__name(mod=>__copyProps(__defProp2({},"__esModule",{value:!0}),mod),"__toCommonJS"),__publicField=__name((obj,key,value)=>(__defNormalProp(obj,"symbol"!=typeof key?key+"":key,value),value),"__publicField"),src_exports={};__export(src_exports,{Collection:()=>Collection,default:()=>src_default}),module2.exports=__toCommonJS(src_exports);var _Collection=__name(class extends Map{ensure(key,defaultValueGenerator){if(this.has(key))return this.get(key);const defaultValue=defaultValueGenerator(key,this);return this.set(key,defaultValue),defaultValue}hasAll(...keys){return keys.every(k=>super.has(k))}hasAny(...keys){return keys.some(k=>super.has(k))}first(amount){if(typeof amount>"u")return this.values().next().value;if(amount<0)return this.last(-1*amount);amount=Math.min(this.size,amount);const iter=this.values();return Array.from({length:amount},()=>iter.next().value)}firstKey(amount){if(typeof amount>"u")return this.keys().next().value;if(amount<0)return this.lastKey(-1*amount);amount=Math.min(this.size,amount);const iter=this.keys();return Array.from({length:amount},()=>iter.next().value)}last(amount){const arr=[...this.values()];return typeof amount>"u"?arr[arr.length-1]:amount<0?this.first(-1*amount):amount?arr.slice(-amount):[]}lastKey(amount){const arr=[...this.keys()];return typeof amount>"u"?arr[arr.length-1]:amount<0?this.firstKey(-1*amount):amount?arr.slice(-amount):[]}at(index){return index=Math.floor(index),[...this.values()].at(index)}keyAt(index){return index=Math.floor(index),[...this.keys()].at(index)}random(amount){const arr=[...this.values()];return typeof amount>"u"?arr[Math.floor(Math.random()*arr.length)]:arr.length&&amount?Array.from({length:Math.min(amount,arr.length)},()=>arr.splice(Math.floor(Math.random()*arr.length),1)[0]):[]}randomKey(amount){const arr=[...this.keys()];return typeof amount>"u"?arr[Math.floor(Math.random()*arr.length)]:arr.length&&amount?Array.from({length:Math.min(amount,arr.length)},()=>arr.splice(Math.floor(Math.random()*arr.length),1)[0]):[]}reverse(){const entries=[...this.entries()].reverse();this.clear();for(const[key,value]of entries)this.set(key,value);return this}find(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));for(const[key,val]of this)if(fn2(val,key,this))return val}findKey(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));for(const[key,val]of this)if(fn2(val,key,this))return key}sweep(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));const previousSize=this.size;for(const[key,val]of this)fn2(val,key,this)&&this.delete(key);return previousSize-this.size}filter(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));const results=new this.constructor[Symbol.species];for(const[key,val]of this)fn2(val,key,this)&&results.set(key,val);return results}partition(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));const results=[new this.constructor[Symbol.species],new this.constructor[Symbol.species]];for(const[key,val]of this)fn2(val,key,this)?results[0].set(key,val):results[1].set(key,val);return results}flatMap(fn2,thisArg){const collections=this.map(fn2,thisArg);return(new this.constructor[Symbol.species]).concat(...collections)}map(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));const iter=this.entries();return Array.from({length:this.size},()=>{const[key,value]=iter.next().value;return fn2(value,key,this)})}mapValues(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));const coll=new this.constructor[Symbol.species];for(const[key,val]of this)coll.set(key,fn2(val,key,this));return coll}some(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));for(const[key,val]of this)if(fn2(val,key,this))return!0;return!1}every(fn2,thisArg){typeof thisArg<"u"&&(fn2=fn2.bind(thisArg));for(const[key,val]of this)if(!fn2(val,key,this))return!1;return!0}reduce(fn2,initialValue){let accumulator;if(typeof initialValue<"u"){accumulator=initialValue;for(const[key,val]of this)accumulator=fn2(accumulator,val,key,this);return accumulator}let first=!0;for(const[key,val]of this)first?(accumulator=val,first=!1):accumulator=fn2(accumulator,val,key,this);if(first)throw new TypeError("Reduce of empty collection with no initial value");return accumulator}each(fn2,thisArg){return this.forEach(fn2,thisArg),this}tap(fn2,thisArg){return typeof thisArg<"u"&&(fn2=fn2.bind(thisArg)),fn2(this),this}clone(){return new this.constructor[Symbol.species](this)}concat(...collections){const newColl=this.clone();for(const coll of collections)for(const[key,val]of coll)newColl.set(key,val);return newColl}equals(collection){if(!collection)return!1;if(this===collection)return!0;if(this.size!==collection.size)return!1;for(const[key,value]of this)if(!collection.has(key)||value!==collection.get(key))return!1;return!0}sort(compareFunction=_Collection.defaultSort){const entries=[...this.entries()];entries.sort((a,b2)=>compareFunction(a[1],b2[1],a[0],b2[0])),super.clear();for(const[k,v]of entries)super.set(k,v);return this}intersect(other){const coll=new this.constructor[Symbol.species];for(const[k,v]of other)this.has(k)&&Object.is(v,this.get(k))&&coll.set(k,v);return coll}difference(other){const coll=new this.constructor[Symbol.species];for(const[k,v]of other)this.has(k)||coll.set(k,v);for(const[k,v]of this)other.has(k)||coll.set(k,v);return coll}merge(other,whenInSelf,whenInOther,whenInBoth){const coll=new this.constructor[Symbol.species],keys=new Set([...this.keys(),...other.keys()]);for(const k of keys){const hasInSelf=this.has(k),hasInOther=other.has(k);if(hasInSelf&&hasInOther){const r=whenInBoth(this.get(k),other.get(k),k);r.keep&&coll.set(k,r.value)}else if(hasInSelf){const r=whenInSelf(this.get(k),k);r.keep&&coll.set(k,r.value)}else if(hasInOther){const r=whenInOther(other.get(k),k);r.keep&&coll.set(k,r.value)}}return coll}sorted(compareFunction=_Collection.defaultSort){return new this.constructor[Symbol.species](this).sort((av,bv,ak,bk)=>compareFunction(av,bv,ak,bk))}toJSON(){return[...this.values()]}static defaultSort(firstValue,secondValue){return Number(firstValue>secondValue)||Number(firstValue===secondValue)-1}static combineEntries(entries,combine){const coll=new _Collection;for(const[k,v]of entries)coll.has(k)?coll.set(k,combine(coll.get(k),v,k)):coll.set(k,v);return coll}},"_Collection"),Collection=_Collection;__name2(Collection,"Collection"),__publicField(Collection,"default",_Collection);var src_default=Collection},5806:module2=>{"use strict";var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name2=__name((target,value)=>__defProp2(target,"name",{value,configurable:!0}),"__name"),__export=__name((target,all)=>{for(var name in all)__defProp2(target,name,{get:all[name],enumerable:!0})},"__export"),__copyProps=__name((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},"__copyProps"),__toCommonJS=__name(mod=>__copyProps(__defProp2({},"__esModule",{value:!0}),mod),"__toCommonJS"),src_exports={};function escapeMarkdown(text,options={}){const{codeBlock:codeBlock2=!0,inlineCode:inlineCode2=!0,bold:bold2=!0,italic:italic2=!0,underline=!0,strikethrough:strikethrough2=!0,spoiler:spoiler2=!0,codeBlockContent=!0,inlineCodeContent=!0,escape:escape2=!0,heading=!1,bulletedList=!1,numberedList=!1,maskedLink=!1}=options;if(!codeBlockContent)return text.split("```").map((subString,index,array)=>index%2&&index!==array.length-1?subString:escapeMarkdown(subString,{inlineCode:inlineCode2,bold:bold2,italic:italic2,underline,strikethrough:strikethrough2,spoiler:spoiler2,inlineCodeContent,escape:escape2,heading,bulletedList,numberedList,maskedLink})).join(codeBlock2?"\\`\\`\\`":"```");if(!inlineCodeContent)return text.split(new RegExp("(?<=^|[^`])`(?=[^`]|$)","g")).map((subString,index,array)=>index%2&&index!==array.length-1?subString:escapeMarkdown(subString,{codeBlock:codeBlock2,bold:bold2,italic:italic2,underline,strikethrough:strikethrough2,spoiler:spoiler2,escape:escape2,heading,bulletedList,numberedList,maskedLink})).join(inlineCode2?"\\`":"`");let res=text;return escape2&&(res=escapeEscape(res)),inlineCode2&&(res=escapeInlineCode(res)),codeBlock2&&(res=escapeCodeBlock(res)),italic2&&(res=escapeItalic(res)),bold2&&(res=escapeBold(res)),underline&&(res=escapeUnderline(res)),strikethrough2&&(res=escapeStrikethrough(res)),spoiler2&&(res=escapeSpoiler(res)),heading&&(res=escapeHeading(res)),bulletedList&&(res=escapeBulletedList(res)),numberedList&&(res=escapeNumberedList(res)),maskedLink&&(res=escapeMaskedLink(res)),res}function escapeCodeBlock(text){return text.replaceAll("```","\\`\\`\\`")}function escapeInlineCode(text){return text.replaceAll(new RegExp("(?<=^|[^`])``?(?=[^`]|$)","g"),match=>2===match.length?"\\`\\`":"\\`")}function escapeItalic(text){let idx=0;const newText=text.replaceAll(new RegExp("(?<=^|[^*])\\*([^*]|\\*\\*|$)","g"),(_,match)=>"**"===match?++idx%2?`\\*${match}`:`${match}\\*`:`\\*${match}`);return idx=0,newText.replaceAll(new RegExp("(?<=^|[^_])(?)([^_]|__|$)","g"),(_,match)=>"__"===match?++idx%2?`\\_${match}`:`${match}\\_`:`\\_${match}`)}function escapeBold(text){let idx=0;return text.replaceAll(/\*\*(\*)?/g,(_,match)=>match?++idx%2?`${match}\\*\\*`:`\\*\\*${match}`:"\\*\\*")}function escapeUnderline(text){let idx=0;return text.replaceAll(new RegExp("(?)","g"),(_,match)=>match?++idx%2?`${match}\\_\\_`:`\\_\\_${match}`:"\\_\\_")}function escapeStrikethrough(text){return text.replaceAll("~~","\\~\\~")}function escapeSpoiler(text){return text.replaceAll("||","\\|\\|")}function escapeEscape(text){return text.replaceAll("\\","\\\\")}function escapeHeading(text){return text.replaceAll(/^( {0,2})([*-] )?( *)(#{1,3} )/gm,"$1$2$3\\$4")}function escapeBulletedList(text){return text.replaceAll(/^( *)([*-])( +)/gm,"$1\\$2$3")}function escapeNumberedList(text){return text.replaceAll(/^( *\d+)\./gm,"$1\\.")}function escapeMaskedLink(text){return text.replaceAll(/\[.+]\(.+\)/gm,"\\$&")}function codeBlock(language,content){return void 0===content?`\`\`\`\n${language}\n\`\`\``:`\`\`\`${language}\n${content}\n\`\`\``}function inlineCode(content){return`\`${content}\``}function italic(content){return`_${content}_`}function bold(content){return`**${content}**`}function underscore(content){return`__${content}__`}function strikethrough(content){return`~~${content}~~`}function quote(content){return`> ${content}`}function blockQuote(content){return`>>> ${content}`}function hideLinkEmbed(url){return`<${url}>`}function hyperlink(content,url,title){return title?`[${content}](${url} "${title}")`:`[${content}](${url})`}function spoiler(content){return`||${content}||`}function userMention(userId){return`<@${userId}>`}function channelMention(channelId){return`<#${channelId}>`}function roleMention(roleId){return`<@&${roleId}>`}function chatInputApplicationCommandMention(commandName,subcommandGroupName,subcommandName,commandId){return void 0!==commandId?``:void 0!==subcommandName?``:``}function formatEmoji(emojiId,animated=!1){return`<${animated?"a":""}:_:${emojiId}>`}function channelLink(channelId,guildId){return`https://discord.com/channels/${guildId??"@me"}/${channelId}`}function messageLink(channelId,messageId,guildId){return`${void 0===guildId?channelLink(channelId):channelLink(channelId,guildId)}/${messageId}`}function time(timeOrSeconds,style){return"number"!=typeof timeOrSeconds&&(timeOrSeconds=Math.floor((timeOrSeconds?.getTime()??Date.now())/1e3)),"string"==typeof style?``:``}__export(src_exports,{Faces:()=>Faces,TimestampStyles:()=>TimestampStyles,blockQuote:()=>blockQuote,bold:()=>bold,channelLink:()=>channelLink,channelMention:()=>channelMention,chatInputApplicationCommandMention:()=>chatInputApplicationCommandMention,codeBlock:()=>codeBlock,escapeBold:()=>escapeBold,escapeBulletedList:()=>escapeBulletedList,escapeCodeBlock:()=>escapeCodeBlock,escapeEscape:()=>escapeEscape,escapeHeading:()=>escapeHeading,escapeInlineCode:()=>escapeInlineCode,escapeItalic:()=>escapeItalic,escapeMarkdown:()=>escapeMarkdown,escapeMaskedLink:()=>escapeMaskedLink,escapeNumberedList:()=>escapeNumberedList,escapeSpoiler:()=>escapeSpoiler,escapeStrikethrough:()=>escapeStrikethrough,escapeUnderline:()=>escapeUnderline,formatEmoji:()=>formatEmoji,hideLinkEmbed:()=>hideLinkEmbed,hyperlink:()=>hyperlink,inlineCode:()=>inlineCode,italic:()=>italic,messageLink:()=>messageLink,quote:()=>quote,roleMention:()=>roleMention,spoiler:()=>spoiler,strikethrough:()=>strikethrough,time:()=>time,underscore:()=>underscore,userMention:()=>userMention}),module2.exports=__toCommonJS(src_exports),__name(escapeMarkdown,"escapeMarkdown"),__name2(escapeMarkdown,"escapeMarkdown"),__name(escapeCodeBlock,"escapeCodeBlock"),__name2(escapeCodeBlock,"escapeCodeBlock"),__name(escapeInlineCode,"escapeInlineCode"),__name2(escapeInlineCode,"escapeInlineCode"),__name(escapeItalic,"escapeItalic"),__name2(escapeItalic,"escapeItalic"),__name(escapeBold,"escapeBold"),__name2(escapeBold,"escapeBold"),__name(escapeUnderline,"escapeUnderline"),__name2(escapeUnderline,"escapeUnderline"),__name(escapeStrikethrough,"escapeStrikethrough"),__name2(escapeStrikethrough,"escapeStrikethrough"),__name(escapeSpoiler,"escapeSpoiler"),__name2(escapeSpoiler,"escapeSpoiler"),__name(escapeEscape,"escapeEscape"),__name2(escapeEscape,"escapeEscape"),__name(escapeHeading,"escapeHeading"),__name2(escapeHeading,"escapeHeading"),__name(escapeBulletedList,"escapeBulletedList"),__name2(escapeBulletedList,"escapeBulletedList"),__name(escapeNumberedList,"escapeNumberedList"),__name2(escapeNumberedList,"escapeNumberedList"),__name(escapeMaskedLink,"escapeMaskedLink"),__name2(escapeMaskedLink,"escapeMaskedLink"),__name(codeBlock,"codeBlock"),__name2(codeBlock,"codeBlock"),__name(inlineCode,"inlineCode"),__name2(inlineCode,"inlineCode"),__name(italic,"italic"),__name2(italic,"italic"),__name(bold,"bold"),__name2(bold,"bold"),__name(underscore,"underscore"),__name2(underscore,"underscore"),__name(strikethrough,"strikethrough"),__name2(strikethrough,"strikethrough"),__name(quote,"quote"),__name2(quote,"quote"),__name(blockQuote,"blockQuote"),__name2(blockQuote,"blockQuote"),__name(hideLinkEmbed,"hideLinkEmbed"),__name2(hideLinkEmbed,"hideLinkEmbed"),__name(hyperlink,"hyperlink"),__name2(hyperlink,"hyperlink"),__name(spoiler,"spoiler"),__name2(spoiler,"spoiler"),__name(userMention,"userMention"),__name2(userMention,"userMention"),__name(channelMention,"channelMention"),__name2(channelMention,"channelMention"),__name(roleMention,"roleMention"),__name2(roleMention,"roleMention"),__name(chatInputApplicationCommandMention,"chatInputApplicationCommandMention"),__name2(chatInputApplicationCommandMention,"chatInputApplicationCommandMention"),__name(formatEmoji,"formatEmoji"),__name2(formatEmoji,"formatEmoji"),__name(channelLink,"channelLink"),__name2(channelLink,"channelLink"),__name(messageLink,"messageLink"),__name2(messageLink,"messageLink"),__name(time,"time"),__name2(time,"time");var TimestampStyles={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Faces=(Faces2=>(Faces2.Shrug="\xaf_(\u30c4)_/\xaf",Faces2.Tableflip="(\u256f\xb0\u25a1\xb0)\u256f\ufe35 \u253b\u2501\u253b",Faces2.Unflip="\u252c\u2500\u252c\u30ce( \xba _ \xba\u30ce)",Faces2))(Faces||{})},62741:(module2,__unused_webpack_exports2,__webpack_require__2)=>{"use strict";var _asyncToGenerator=__webpack_require__2(17156).default,__create=Object.create,__defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__defNormalProp=__name((obj,key,value)=>key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,"__defNormalProp"),__name2=__name((target,value)=>__defProp2(target,"name",{value,configurable:!0}),"__name"),__commonJS=__name((cb,mod)=>__name(function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports},"__require"),"__commonJS"),__export=__name((target,all)=>{for(var name in all)__defProp2(target,name,{get:all[name],enumerable:!0})},"__export"),__copyProps=__name((to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp2(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},"__copyProps"),__toESM=__name((mod,isNodeMode,target)=>(target=null!=mod?__create(__getProtoOf(mod)):{},__copyProps(!isNodeMode&&mod&&mod.__esModule?target:__defProp2(target,"default",{value:mod,enumerable:!0}),mod)),"__toESM"),__toCommonJS=__name(mod=>__copyProps(__defProp2({},"__esModule",{value:!0}),mod),"__toCommonJS"),__publicField=__name((obj,key,value)=>(__defNormalProp(obj,"symbol"!=typeof key?key+"":key,value),value),"__publicField"),__accessCheck=__name((obj,member,msg)=>{if(!member.has(obj))throw TypeError("Cannot "+msg)},"__accessCheck"),__privateGet=__name((obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),"__privateGet"),__privateAdd=__name((obj,member,value)=>{if(member.has(obj))throw TypeError("Cannot add the same private member more than once");member instanceof WeakSet?member.add(obj):member.set(obj,value)},"__privateAdd"),__privateSet=__name((obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),"__privateSet"),require_package=__commonJS({"package.json"(exports2,module22){module22.exports={name:"@discordjs/rest",version:"0.4.0",description:"The REST API for discord.js",scripts:{build:"tsup && tsc --emitDeclarationOnly --incremental",test:"jest --pass-with-no-tests --collect-coverage",lint:"prettier --check . && eslint src __tests__ --ext mjs,js,ts",format:"prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",docs:"typedoc --json docs/typedoc-out.json src/index.ts && node scripts/docs.mjs",prepublishOnly:"yarn build && yarn lint && yarn test",changelog:"git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'"},main:"./dist/index.js",module:"./dist/index.mjs",typings:"./dist/index.d.ts",exports:{import:"./dist/index.mjs",require:"./dist/index.js",types:"./dist/index.d.ts"},directories:{lib:"src",test:"__tests__"},files:["dist"],contributors:["Crawl ","Amish Shah ","SpaceEEC ","Vlad Frangu ","Antonio Roman "],license:"Apache-2.0",keywords:["discord","api","rest","discordapp","discordjs"],repository:{type:"git",url:"git+https://github.com/discordjs/discord.js.git"},bugs:{url:"https://github.com/discordjs/discord.js/issues"},homepage:"https://discord.js.org",dependencies:{"@discordjs/collection":"workspace:^","@sapphire/async-queue":"^1.3.1","@sapphire/snowflake":"^3.2.1","@types/node-fetch":"^2.6.1","discord-api-types":"^0.29.0","form-data":"^4.0.0","node-fetch":"^2.6.7",tslib:"^2.3.1"},devDependencies:{"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@discordjs/ts-docgen":"^0.4.1","@types/jest":"^27.4.1","@typescript-eslint/eslint-plugin":"^5.19.0","@typescript-eslint/parser":"^5.19.0","babel-plugin-const-enum":"^1.2.0","babel-plugin-transform-typescript-metadata":"^0.3.2",eslint:"^8.13.0","eslint-config-marine":"^9.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.26.0",jest:"^27.5.1",nock:"^13.2.4",prettier:"^2.6.2",tsup:"^5.12.5",typedoc:"^0.22.15",typescript:"^4.6.3"},engines:{node:">=16.9.0"},publishConfig:{access:"public"}}}}),src_exports={};__export(src_exports,{ALLOWED_EXTENSIONS:()=>ALLOWED_EXTENSIONS,ALLOWED_SIZES:()=>ALLOWED_SIZES,ALLOWED_STICKER_EXTENSIONS:()=>ALLOWED_STICKER_EXTENSIONS,CDN:()=>CDN,DefaultRestOptions:()=>DefaultRestOptions,DefaultUserAgent:()=>DefaultUserAgent,DiscordAPIError:()=>DiscordAPIError,HTTPError:()=>HTTPError,REST:()=>REST,RESTEvents:()=>RESTEvents,RateLimitError:()=>RateLimitError,RequestManager:()=>RequestManager,RequestMethod:()=>RequestMethod,makeURLSearchParams:()=>makeURLSearchParams}),module2.exports=__toCommonJS(src_exports);var import_v10=__webpack_require__2(71622),Package=require_package(),DefaultUserAgent=`DiscordBot (${Package.homepage}, ${Package.version})`,DefaultRestOptions={agent:{},api:"https://discord.com/api",cdn:"https://cdn.discordapp.com",headers:{},invalidRequestWarningInterval:0,globalRequestsPerSecond:50,offset:50,rejectOnRateLimit:null,retries:3,timeout:15e3,userAgentAppendix:`Node.js ${process.version}`,version:import_v10.APIVersion,hashSweepInterval:144e5,hashLifetime:864e5,handlerSweepInterval:36e5},RESTEvents=(RESTEvents2=>(RESTEvents2.Debug="restDebug",RESTEvents2.InvalidRequestWarning="invalidRequestWarning",RESTEvents2.RateLimited="rateLimited",RESTEvents2.Request="request",RESTEvents2.Response="response",RESTEvents2.HashSweep="hashSweep",RESTEvents2.HandlerSweep="handlerSweep",RESTEvents2))(RESTEvents||{}),ALLOWED_EXTENSIONS=["webp","png","jpg","jpeg","gif"],ALLOWED_STICKER_EXTENSIONS=["png","json"],ALLOWED_SIZES=[16,32,64,128,256,512,1024,2048,4096],CDN=__name(class{constructor(base=DefaultRestOptions.cdn){this.base=base}appAsset(clientId,assetHash,options){return this.makeURL(`/app-assets/${clientId}/${assetHash}`,options)}appIcon(clientId,iconHash,options){return this.makeURL(`/app-icons/${clientId}/${iconHash}`,options)}avatar(id,avatarHash,options){return this.dynamicMakeURL(`/avatars/${id}/${avatarHash}`,avatarHash,options)}banner(id,bannerHash,options){return this.dynamicMakeURL(`/banners/${id}/${bannerHash}`,bannerHash,options)}channelIcon(channelId,iconHash,options){return this.makeURL(`/channel-icons/${channelId}/${iconHash}`,options)}defaultAvatar(discriminator){return this.makeURL(`/embed/avatars/${discriminator}`,{extension:"png"})}discoverySplash(guildId,splashHash,options){return this.makeURL(`/discovery-splashes/${guildId}/${splashHash}`,options)}emoji(emojiId,extension){return this.makeURL(`/emojis/${emojiId}`,{extension})}guildMemberAvatar(guildId,userId,avatarHash,options){return this.dynamicMakeURL(`/guilds/${guildId}/users/${userId}/avatars/${avatarHash}`,avatarHash,options)}icon(id,iconHash,options){return this.dynamicMakeURL(`/icons/${id}/${iconHash}`,iconHash,options)}roleIcon(roleId,roleIconHash,options){return this.makeURL(`/role-icons/${roleId}/${roleIconHash}`,options)}splash(guildId,splashHash,options){return this.makeURL(`/splashes/${guildId}/${splashHash}`,options)}sticker(stickerId,extension){return this.makeURL(`/stickers/${stickerId}`,{allowedExtensions:ALLOWED_STICKER_EXTENSIONS,extension:extension??"png"})}stickerPackBanner(bannerId,options){return this.makeURL(`/app-assets/710982414301790216/store/${bannerId}`,options)}teamIcon(teamId,iconHash,options){return this.makeURL(`/team-icons/${teamId}/${iconHash}`,options)}guildScheduledEventCover(scheduledEventId,coverHash,options){return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`,options)}dynamicMakeURL(route,hash,{forceStatic=!1,...options}={}){return this.makeURL(route,!forceStatic&&hash.startsWith("a_")?{...options,extension:"gif"}:options)}makeURL(route,{allowedExtensions=ALLOWED_EXTENSIONS,extension="webp",size}={}){if(extension=String(extension).toLowerCase(),!allowedExtensions.includes(extension))throw new RangeError(`Invalid extension provided: ${extension}\nMust be one of: ${allowedExtensions.join(", ")}`);if(size&&!ALLOWED_SIZES.includes(size))throw new RangeError(`Invalid size provided: ${size}\nMust be one of: ${ALLOWED_SIZES.join(", ")}`);const url=new URL(`${this.base}${route}.${extension}`);return size&&url.searchParams.set("size",String(size)),url.toString()}},"CDN");function isErrorGroupWrapper(error){return Reflect.has(error,"_errors")}function isErrorResponse(error){return"string"==typeof Reflect.get(error,"message")}__name2(CDN,"CDN"),__name(isErrorGroupWrapper,"isErrorGroupWrapper"),__name2(isErrorGroupWrapper,"isErrorGroupWrapper"),__name(isErrorResponse,"isErrorResponse"),__name2(isErrorResponse,"isErrorResponse");var DiscordAPIError=__name(class extends Error{constructor(rawError,code2,status,method,url,bodyData){super(DiscordAPIError.getMessage(rawError)),this.rawError=rawError,this.code=code2,this.status=status,this.method=method,this.url=url,__publicField(this,"requestBody"),this.requestBody={files:bodyData.files,json:bodyData.body}}get name(){return`${DiscordAPIError.name}[${this.code}]`}static getMessage(error){let flattened="";return"code"in error?(error.errors&&(flattened=[...this.flattenDiscordError(error.errors)].join("\n")),error.message&&flattened?`${error.message}\n${flattened}`:error.message||flattened||"Unknown Error"):error.error_description??"No Description"}static*flattenDiscordError(obj,key=""){if(isErrorResponse(obj))return yield`${key.length?`${key}[${obj.code}]`:`${obj.code}`}: ${obj.message}`.trim();for(const[k,v]of Object.entries(obj)){const nextKey=k.startsWith("_")?key:key?Number.isNaN(Number(k))?`${key}.${k}`:`${key}[${k}]`:k;if("string"==typeof v)yield v;else if(isErrorGroupWrapper(v))for(const error of v._errors)yield*this.flattenDiscordError(error,nextKey);else yield*this.flattenDiscordError(v,nextKey)}}},"DiscordAPIError");__name2(DiscordAPIError,"DiscordAPIError");var HTTPError=__name(class extends Error{constructor(message2,name,status,method,url,bodyData){super(message2),this.name=name,this.status=status,this.method=method,this.url=url,__publicField(this,"requestBody"),this.requestBody={files:bodyData.files,json:bodyData.body}}},"HTTPError");__name2(HTTPError,"HTTPError");var RateLimitError=__name(class extends Error{constructor({timeToReset,limit,method,hash,url,route,majorParameter,global:global2}){super(),__publicField(this,"timeToReset"),__publicField(this,"limit"),__publicField(this,"method"),__publicField(this,"hash"),__publicField(this,"url"),__publicField(this,"route"),__publicField(this,"majorParameter"),__publicField(this,"global"),this.timeToReset=timeToReset,this.limit=limit,this.method=method,this.hash=hash,this.url=url,this.route=route,this.majorParameter=majorParameter,this.global=global2}get name(){return`${RateLimitError.name}[${this.route}]`}},"RateLimitError");__name2(RateLimitError,"RateLimitError");var import_node_events=__webpack_require__2(82361),import_node_http=__webpack_require__2(13685),import_node_https=__webpack_require__2(95687),import_collection=__toESM(__webpack_require__2(9667)),import_snowflake=__webpack_require__2(33534),import_form_data=__toESM(__webpack_require__2(81556)),import_promises=__webpack_require__2(68670),import_async_queue=__webpack_require__2(44904),import_node_fetch=__toESM(__webpack_require__2(84259));function serializeSearchParam(value){switch(typeof value){case"string":return value;case"number":case"bigint":case"boolean":return value.toString();case"object":return null===value?null:value instanceof Date?Number.isNaN(value.getTime())?null:value.toISOString():"function"==typeof value.toString&&value.toString!==Object.prototype.toString?value.toString():null;default:return null}}function makeURLSearchParams(options){const params=new URLSearchParams;if(!options)return params;for(const[key,value]of Object.entries(options)){const serialized=serializeSearchParam(value);null!==serialized&¶ms.append(key,serialized)}return params}function parseResponse(res){return res.headers.get("Content-Type")?.startsWith("application/json")?res.json():res.arrayBuffer()}function hasSublimit(bucketRoute,body,method){if("/channels/:id"===bucketRoute){if("object"!=typeof body||null===body||"patch"!==method)return!1;const castedBody=body;return["name","topic"].some(key=>Reflect.has(castedBody,key))}return!0}__name(serializeSearchParam,"serializeSearchParam"),__name2(serializeSearchParam,"serializeSearchParam"),__name(makeURLSearchParams,"makeURLSearchParams"),__name2(makeURLSearchParams,"makeURLSearchParams"),__name(parseResponse,"parseResponse"),__name2(parseResponse,"parseResponse"),__name(hasSublimit,"hasSublimit"),__name2(hasSublimit,"hasSublimit");var _asyncQueue,_sublimitedQueue,_sublimitPromise,_shiftSublimit,invalidCount=0,invalidCountResetTime=null,SequentialHandler=__name(class{constructor(manager,hash,majorParameter){this.manager=manager,this.hash=hash,this.majorParameter=majorParameter,__publicField(this,"id"),__publicField(this,"reset",-1),__publicField(this,"remaining",1),__publicField(this,"limit",1/0),__privateAdd(this,_asyncQueue,new import_async_queue.AsyncQueue),__privateAdd(this,_sublimitedQueue,null),__privateAdd(this,_sublimitPromise,null),__privateAdd(this,_shiftSublimit,!1),this.id=`${hash}:${majorParameter}`}get inactive(){return 0===__privateGet(this,_asyncQueue).remaining&&(null===__privateGet(this,_sublimitedQueue)||0===__privateGet(this,_sublimitedQueue).remaining)&&!this.limited}get globalLimited(){return this.manager.globalRemaining<=0&&Date.now()rateLimitData.route.startsWith(route.toLowerCase()))))throw new RateLimitError(rateLimitData)})()}queueRequest(routeId,url,options,requestData){var _this3=this;return _asyncToGenerator(function*(){let queue=__privateGet(_this3,_asyncQueue),queueType=0;if(__privateGet(_this3,_sublimitedQueue)&&hasSublimit(routeId.bucketRoute,requestData.body,options.method)&&(queue=__privateGet(_this3,_sublimitedQueue),queueType=1),yield queue.wait(),0===queueType)if(__privateGet(_this3,_sublimitedQueue)&&hasSublimit(routeId.bucketRoute,requestData.body,options.method)){queue=__privateGet(_this3,_sublimitedQueue);const wait=queue.wait();__privateGet(_this3,_asyncQueue).shift(),yield wait}else __privateGet(_this3,_sublimitPromise)&&(yield __privateGet(_this3,_sublimitPromise).promise);try{return yield _this3.runRequest(routeId,url,options,requestData)}finally{queue.shift(),__privateGet(_this3,_shiftSublimit)&&(__privateSet(_this3,_shiftSublimit,!1),__privateGet(_this3,_sublimitedQueue)?.shift()),0===__privateGet(_this3,_sublimitedQueue)?.remaining&&(__privateGet(_this3,_sublimitPromise)?.resolve(),__privateSet(_this3,_sublimitedQueue,null))}})()}runRequest(routeId,url,options,requestData,retries=0){var _this4=this;return _asyncToGenerator(function*(){for(;_this4.limited;){const isGlobal=_this4.globalLimited;let limit2,timeout2,delay;isGlobal?(limit2=_this4.manager.options.globalRequestsPerSecond,timeout2=_this4.manager.globalReset+_this4.manager.options.offset-Date.now(),_this4.manager.globalDelay||(_this4.manager.globalDelay=_this4.globalDelayFor(timeout2)),delay=_this4.manager.globalDelay):(limit2=_this4.limit,timeout2=_this4.timeToReset,delay=(0,import_promises.setTimeout)(timeout2));const rateLimitData={timeToReset:timeout2,limit:limit2,method:options.method??"get",hash:_this4.hash,url,route:routeId.bucketRoute,majorParameter:_this4.majorParameter,global:isGlobal};_this4.manager.emit("rateLimited",rateLimitData),yield _this4.onRateLimit(rateLimitData),isGlobal?_this4.debug(`Global rate limit hit, blocking all requests for ${timeout2}ms`):_this4.debug(`Waiting ${timeout2}ms for rate limit to pass`),yield delay}(!_this4.manager.globalReset||_this4.manager.globalResetcontroller.abort(),_this4.manager.options.timeout).unref();let res;try{res=yield(0,import_node_fetch.default)(url,{...options,signal:controller.signal})}catch(error){if(error instanceof Error&&"AbortError"===error.name&&retries!==_this4.manager.options.retries)return yield _this4.runRequest(routeId,url,options,requestData,++retries);throw error}finally{clearTimeout(timeout)}_this4.manager.listenerCount("response")&&_this4.manager.emit("response",{method,path:routeId.original,route:routeId.bucketRoute,options,data:requestData,retries},res.clone());let retryAfter=0;const limit=res.headers.get("X-RateLimit-Limit"),remaining=res.headers.get("X-RateLimit-Remaining"),reset=res.headers.get("X-RateLimit-Reset-After"),hash=res.headers.get("X-RateLimit-Bucket"),retry=res.headers.get("Retry-After");if(_this4.limit=limit?Number(limit):1/0,_this4.remaining=remaining?Number(remaining):1,_this4.reset=reset?1e3*Number(reset)+Date.now()+_this4.manager.options.offset:Date.now(),retry&&(retryAfter=1e3*Number(retry)+_this4.manager.options.offset),hash&&hash!==_this4.hash)_this4.debug(["Received bucket hash update",` Old Hash : ${_this4.hash}`,` New Hash : ${hash}`].join("\n")),_this4.manager.hashes.set(`${method}:${routeId.bucketRoute}`,{value:hash,lastAccess:Date.now()});else if(hash){const hashData=_this4.manager.hashes.get(`${method}:${routeId.bucketRoute}`);hashData&&(hashData.lastAccess=Date.now())}let sublimitTimeout=null;if(retryAfter>0&&(res.headers.get("X-RateLimit-Global")?(_this4.manager.globalRemaining=0,_this4.manager.globalReset=Date.now()+retryAfter):_this4.localLimited||(sublimitTimeout=retryAfter)),(401===res.status||403===res.status||429===res.status)&&((!invalidCountResetTime||invalidCountResetTime0&&invalidCount%_this4.manager.options.invalidRequestWarningInterval==0&&_this4.manager.emit("invalidRequestWarning",{count:invalidCount,remainingTime:invalidCountResetTime-Date.now()})),res.ok)return parseResponse(res);if(429===res.status){const isGlobal=_this4.globalLimited;let limit2,timeout2;if(isGlobal?(limit2=_this4.manager.options.globalRequestsPerSecond,timeout2=_this4.manager.globalReset+_this4.manager.options.offset-Date.now()):(limit2=_this4.limit,timeout2=_this4.timeToReset),yield _this4.onRateLimit({timeToReset:timeout2,limit:limit2,method,hash:_this4.hash,url,route:routeId.bucketRoute,majorParameter:_this4.majorParameter,global:isGlobal}),_this4.debug(["Encountered unexpected 429 rate limit",` Global : ${isGlobal.toString()}`,` Method : ${method}`,` URL : ${url}`,` Bucket : ${routeId.bucketRoute}`,` Major parameter: ${routeId.majorParameter}`,` Hash : ${_this4.hash}`,` Limit : ${limit2}`,` Retry After : ${retryAfter}ms`," Sublimit : "+(sublimitTimeout?`${sublimitTimeout}ms`:"None")].join("\n")),sublimitTimeout){const firstSublimit=!__privateGet(_this4,_sublimitedQueue);let resolve;firstSublimit&&(__privateSet(_this4,_sublimitedQueue,new import_async_queue.AsyncQueue),__privateGet(_this4,_sublimitedQueue).wait(),__privateGet(_this4,_asyncQueue).shift()),__privateGet(_this4,_sublimitPromise)?.resolve(),__privateSet(_this4,_sublimitPromise,null),yield(0,import_promises.setTimeout)(sublimitTimeout,void 0,{ref:!1});const promise=new Promise(res2=>resolve=res2);__privateSet(_this4,_sublimitPromise,{promise,resolve}),firstSublimit&&(yield __privateGet(_this4,_asyncQueue).wait(),__privateSet(_this4,_shiftSublimit,!0))}return _this4.runRequest(routeId,url,options,requestData,retries)}if(res.status>=500&&res.status<600){if(retries!==_this4.manager.options.retries)return _this4.runRequest(routeId,url,options,requestData,++retries);throw new HTTPError(res.statusText,res.constructor.name,res.status,method,url,requestData)}if(res.status>=400&&res.status<500){401===res.status&&requestData.auth&&_this4.manager.setToken(null);const data=yield parseResponse(res);throw new DiscordAPIError(data,"code"in data?data.code:data.error,res.status,method,url,requestData)}return null})()}},"SequentialHandler");__name2(SequentialHandler,"SequentialHandler"),_asyncQueue=new WeakMap,_sublimitedQueue=new WeakMap,_sublimitPromise=new WeakMap,_shiftSublimit=new WeakMap;var _token,RequestMethod=(RequestMethod2=>(RequestMethod2.Delete="delete",RequestMethod2.Get="get",RequestMethod2.Patch="patch",RequestMethod2.Post="post",RequestMethod2.Put="put",RequestMethod2))(RequestMethod||{}),_RequestManager=__name(class extends import_node_events.EventEmitter{constructor(options){super(),__publicField(this,"globalRemaining"),__publicField(this,"globalDelay",null),__publicField(this,"globalReset",-1),__publicField(this,"hashes",new import_collection.default),__publicField(this,"handlers",new import_collection.default),__privateAdd(this,_token,null),__publicField(this,"hashTimer"),__publicField(this,"handlerTimer"),__publicField(this,"agent",null),__publicField(this,"options"),this.options={...DefaultRestOptions,...options},this.options.offset=Math.max(0,this.options.offset),this.globalRemaining=this.options.globalRequestsPerSecond,this.setupSweepers()}setupSweepers(){const validateMaxInterval=__name2(interval=>{if(interval>144e5)throw new Error("Cannot set an interval greater than 4 hours")},"validateMaxInterval");0!==this.options.hashSweepInterval&&this.options.hashSweepInterval!==1/0&&(validateMaxInterval(this.options.hashSweepInterval),this.hashTimer=setInterval(()=>{const sweptHashes=new import_collection.default,currentDate=Date.now();this.hashes.sweep((v,k)=>{if(-1===v.lastAccess)return!1;const shouldSweep=Math.floor(currentDate-v.lastAccess)>this.options.hashLifetime;return shouldSweep&&sweptHashes.set(k,v),this.emit("restDebug",`Hash ${v.value} for ${k} swept due to lifetime being exceeded`),shouldSweep}),this.emit("hashSweep",sweptHashes)},this.options.hashSweepInterval).unref()),0!==this.options.handlerSweepInterval&&this.options.handlerSweepInterval!==1/0&&(validateMaxInterval(this.options.handlerSweepInterval),this.handlerTimer=setInterval(()=>{const sweptHandlers=new import_collection.default;this.handlers.sweep((v,k)=>{const{inactive}=v;return inactive&&sweptHandlers.set(k,v),this.emit("restDebug",`Handler ${v.id} for ${k} swept due to being inactive`),inactive}),this.emit("handlerSweep",sweptHandlers)},this.options.handlerSweepInterval).unref())}setToken(token){return __privateSet(this,_token,token),this}queueRequest(request){var _this5=this;return _asyncToGenerator(function*(){const routeId=_RequestManager.generateRouteData(request.fullRoute,request.method),hash=_this5.hashes.get(`${request.method}:${routeId.bucketRoute}`)??{value:`Global(${request.method}:${routeId.bucketRoute})`,lastAccess:-1},handler=_this5.handlers.get(`${hash.value}:${routeId.majorParameter}`)??_this5.createHandler(hash.value,routeId.majorParameter),{url,fetchOptions}=_this5.resolveRequest(request);return handler.queueRequest(routeId,url,fetchOptions,{body:request.body,files:request.files,auth:!1!==request.auth})})()}createHandler(hash,majorParameter){const queue=new SequentialHandler(this,hash,majorParameter);return this.handlers.set(queue.id,queue),queue}resolveRequest(request){const{options}=this;this.agent??=options.api.startsWith("https")?new import_node_https.Agent({...options.agent,keepAlive:!0}):new import_node_http.Agent({...options.agent,keepAlive:!0});let query="";if(request.query){const resolvedQuery=request.query.toString();""!==resolvedQuery&&(query=`?${resolvedQuery}`)}const headers={...this.options.headers,"User-Agent":`${DefaultUserAgent} ${options.userAgentAppendix}`.trim()};if(!1!==request.auth){if(!__privateGet(this,_token))throw new Error("Expected token to be set for this request, but none was present");headers.Authorization=`${request.authPrefix??"Bot"} ${__privateGet(this,_token)}`}request.reason?.length&&(headers["X-Audit-Log-Reason"]=encodeURIComponent(request.reason));const url=`${options.api}${!1===request.versioned?"":`/v${options.version}`}${request.fullRoute}${query}`;let finalBody,additionalHeaders={};if(request.files?.length){const formData=new import_form_data.default;for(const[index,file2]of request.files.entries())formData.append(file2.key??`files[${index}]`,file2.data,file2.name);if(null!=request.body)if(request.appendToFormData)for(const[key,value]of Object.entries(request.body))formData.append(key,value);else formData.append("payload_json",JSON.stringify(request.body));finalBody=formData,additionalHeaders=formData.getHeaders()}else null!=request.body&&(request.passThroughBody?finalBody=request.body:(finalBody=JSON.stringify(request.body),additionalHeaders={"Content-Type":"application/json"}));return{url,fetchOptions:{agent:this.agent,body:finalBody,headers:{...request.headers??{},...additionalHeaders,...headers},method:request.method}}}clearHashSweeper(){clearInterval(this.hashTimer)}clearHandlerSweeper(){clearInterval(this.handlerTimer)}static generateRouteData(endpoint,method){const majorId=/^\/(?:channels|guilds|webhooks)\/(\d{16,19})/.exec(endpoint)?.[1]??"global",baseRoute=endpoint.replace(/\d{16,19}/g,":id").replace(/\/reactions\/(.*)/,"/reactions/:reaction");let exceptions="";if("delete"===method&&"/channels/:id/messages/:id"===baseRoute){const id=/\d{16,19}$/.exec(endpoint)[0],timestamp=import_snowflake.DiscordSnowflake.timestampFrom(id);Date.now()-timestamp>12096e5&&(exceptions+="/Delete Old Message")}return{majorParameter:majorId,bucketRoute:baseRoute+exceptions,original:endpoint}}},"_RequestManager"),RequestManager=_RequestManager;__name2(RequestManager,"RequestManager"),_token=new WeakMap;var import_node_events2=__webpack_require__2(82361),REST=__name(class extends import_node_events2.EventEmitter{constructor(options={}){super(),__publicField(this,"cdn"),__publicField(this,"requestManager"),this.cdn=new CDN(options.cdn??DefaultRestOptions.cdn),this.requestManager=new RequestManager(options).on("restDebug",this.emit.bind(this,"restDebug")).on("rateLimited",this.emit.bind(this,"rateLimited")).on("invalidRequestWarning",this.emit.bind(this,"invalidRequestWarning")).on("hashSweep",this.emit.bind(this,"hashSweep")),this.on("newListener",(name,listener)=>{("request"===name||"response"===name)&&this.requestManager.on(name,listener)}),this.on("removeListener",(name,listener)=>{("request"===name||"response"===name)&&this.requestManager.off(name,listener)})}setToken(token){return this.requestManager.setToken(token),this}get(fullRoute,options={}){return this.request({...options,fullRoute,method:"get"})}delete(fullRoute,options={}){return this.request({...options,fullRoute,method:"delete"})}post(fullRoute,options={}){return this.request({...options,fullRoute,method:"post"})}put(fullRoute,options={}){return this.request({...options,fullRoute,method:"put"})}patch(fullRoute,options={}){return this.request({...options,fullRoute,method:"patch"})}request(options){return this.requestManager.queueRequest(options)}},"REST");__name2(REST,"REST")},92006:(__unused_webpack_module,exports2)=>{"use strict";Object.defineProperty(exports2,"__esModule",{value:!0})},79658:function(__unused_webpack_module,exports2,__webpack_require__2){"use strict";var GatewayOpcodes2,GatewayCloseCodes2,GatewayIntentBits2,GatewayDispatchEvents2,__createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){void 0===k2&&(k2=k),o[k2]=m[k]}),__exportStar=this&&this.__exportStar||function(m,exports3){for(var p2 in m)"default"!==p2&&!Object.prototype.hasOwnProperty.call(exports3,p2)&&__createBinding(exports3,m,p2)};Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.GatewayDispatchEvents=exports2.GatewayIntentBits=exports2.GatewayCloseCodes=exports2.GatewayOpcodes=exports2.GatewayVersion=void 0,__exportStar(__webpack_require__2(92006),exports2),exports2.GatewayVersion="10",(GatewayOpcodes2=exports2.GatewayOpcodes||(exports2.GatewayOpcodes={}))[GatewayOpcodes2.Dispatch=0]="Dispatch",GatewayOpcodes2[GatewayOpcodes2.Heartbeat=1]="Heartbeat",GatewayOpcodes2[GatewayOpcodes2.Identify=2]="Identify",GatewayOpcodes2[GatewayOpcodes2.PresenceUpdate=3]="PresenceUpdate",GatewayOpcodes2[GatewayOpcodes2.VoiceStateUpdate=4]="VoiceStateUpdate",GatewayOpcodes2[GatewayOpcodes2.Resume=6]="Resume",GatewayOpcodes2[GatewayOpcodes2.Reconnect=7]="Reconnect",GatewayOpcodes2[GatewayOpcodes2.RequestGuildMembers=8]="RequestGuildMembers",GatewayOpcodes2[GatewayOpcodes2.InvalidSession=9]="InvalidSession",GatewayOpcodes2[GatewayOpcodes2.Hello=10]="Hello",GatewayOpcodes2[GatewayOpcodes2.HeartbeatAck=11]="HeartbeatAck",(GatewayCloseCodes2=exports2.GatewayCloseCodes||(exports2.GatewayCloseCodes={}))[GatewayCloseCodes2.UnknownError=4e3]="UnknownError",GatewayCloseCodes2[GatewayCloseCodes2.UnknownOpcode=4001]="UnknownOpcode",GatewayCloseCodes2[GatewayCloseCodes2.DecodeError=4002]="DecodeError",GatewayCloseCodes2[GatewayCloseCodes2.NotAuthenticated=4003]="NotAuthenticated",GatewayCloseCodes2[GatewayCloseCodes2.AuthenticationFailed=4004]="AuthenticationFailed",GatewayCloseCodes2[GatewayCloseCodes2.AlreadyAuthenticated=4005]="AlreadyAuthenticated",GatewayCloseCodes2[GatewayCloseCodes2.InvalidSeq=4007]="InvalidSeq",GatewayCloseCodes2[GatewayCloseCodes2.RateLimited=4008]="RateLimited",GatewayCloseCodes2[GatewayCloseCodes2.SessionTimedOut=4009]="SessionTimedOut",GatewayCloseCodes2[GatewayCloseCodes2.InvalidShard=4010]="InvalidShard",GatewayCloseCodes2[GatewayCloseCodes2.ShardingRequired=4011]="ShardingRequired",GatewayCloseCodes2[GatewayCloseCodes2.InvalidAPIVersion=4012]="InvalidAPIVersion",GatewayCloseCodes2[GatewayCloseCodes2.InvalidIntents=4013]="InvalidIntents",GatewayCloseCodes2[GatewayCloseCodes2.DisallowedIntents=4014]="DisallowedIntents",(GatewayIntentBits2=exports2.GatewayIntentBits||(exports2.GatewayIntentBits={}))[GatewayIntentBits2.Guilds=1]="Guilds",GatewayIntentBits2[GatewayIntentBits2.GuildMembers=2]="GuildMembers",GatewayIntentBits2[GatewayIntentBits2.GuildBans=4]="GuildBans",GatewayIntentBits2[GatewayIntentBits2.GuildEmojisAndStickers=8]="GuildEmojisAndStickers",GatewayIntentBits2[GatewayIntentBits2.GuildIntegrations=16]="GuildIntegrations",GatewayIntentBits2[GatewayIntentBits2.GuildWebhooks=32]="GuildWebhooks",GatewayIntentBits2[GatewayIntentBits2.GuildInvites=64]="GuildInvites",GatewayIntentBits2[GatewayIntentBits2.GuildVoiceStates=128]="GuildVoiceStates",GatewayIntentBits2[GatewayIntentBits2.GuildPresences=256]="GuildPresences",GatewayIntentBits2[GatewayIntentBits2.GuildMessages=512]="GuildMessages",GatewayIntentBits2[GatewayIntentBits2.GuildMessageReactions=1024]="GuildMessageReactions",GatewayIntentBits2[GatewayIntentBits2.GuildMessageTyping=2048]="GuildMessageTyping",GatewayIntentBits2[GatewayIntentBits2.DirectMessages=4096]="DirectMessages",GatewayIntentBits2[GatewayIntentBits2.DirectMessageReactions=8192]="DirectMessageReactions",GatewayIntentBits2[GatewayIntentBits2.DirectMessageTyping=16384]="DirectMessageTyping",GatewayIntentBits2[GatewayIntentBits2.MessageContent=32768]="MessageContent",GatewayIntentBits2[GatewayIntentBits2.GuildScheduledEvents=65536]="GuildScheduledEvents",(GatewayDispatchEvents2=exports2.GatewayDispatchEvents||(exports2.GatewayDispatchEvents={})).ChannelCreate="CHANNEL_CREATE",GatewayDispatchEvents2.ChannelDelete="CHANNEL_DELETE",GatewayDispatchEvents2.ChannelPinsUpdate="CHANNEL_PINS_UPDATE",GatewayDispatchEvents2.ChannelUpdate="CHANNEL_UPDATE",GatewayDispatchEvents2.GuildBanAdd="GUILD_BAN_ADD",GatewayDispatchEvents2.GuildBanRemove="GUILD_BAN_REMOVE",GatewayDispatchEvents2.GuildCreate="GUILD_CREATE",GatewayDispatchEvents2.GuildDelete="GUILD_DELETE",GatewayDispatchEvents2.GuildEmojisUpdate="GUILD_EMOJIS_UPDATE",GatewayDispatchEvents2.GuildIntegrationsUpdate="GUILD_INTEGRATIONS_UPDATE",GatewayDispatchEvents2.GuildMemberAdd="GUILD_MEMBER_ADD",GatewayDispatchEvents2.GuildMemberRemove="GUILD_MEMBER_REMOVE",GatewayDispatchEvents2.GuildMembersChunk="GUILD_MEMBERS_CHUNK",GatewayDispatchEvents2.GuildMemberUpdate="GUILD_MEMBER_UPDATE",GatewayDispatchEvents2.GuildRoleCreate="GUILD_ROLE_CREATE",GatewayDispatchEvents2.GuildRoleDelete="GUILD_ROLE_DELETE",GatewayDispatchEvents2.GuildRoleUpdate="GUILD_ROLE_UPDATE",GatewayDispatchEvents2.GuildStickersUpdate="GUILD_STICKERS_UPDATE",GatewayDispatchEvents2.GuildUpdate="GUILD_UPDATE",GatewayDispatchEvents2.IntegrationCreate="INTEGRATION_CREATE",GatewayDispatchEvents2.IntegrationDelete="INTEGRATION_DELETE",GatewayDispatchEvents2.IntegrationUpdate="INTEGRATION_UPDATE",GatewayDispatchEvents2.InteractionCreate="INTERACTION_CREATE",GatewayDispatchEvents2.InviteCreate="INVITE_CREATE",GatewayDispatchEvents2.InviteDelete="INVITE_DELETE",GatewayDispatchEvents2.MessageCreate="MESSAGE_CREATE",GatewayDispatchEvents2.MessageDelete="MESSAGE_DELETE",GatewayDispatchEvents2.MessageDeleteBulk="MESSAGE_DELETE_BULK",GatewayDispatchEvents2.MessageReactionAdd="MESSAGE_REACTION_ADD",GatewayDispatchEvents2.MessageReactionRemove="MESSAGE_REACTION_REMOVE",GatewayDispatchEvents2.MessageReactionRemoveAll="MESSAGE_REACTION_REMOVE_ALL",GatewayDispatchEvents2.MessageReactionRemoveEmoji="MESSAGE_REACTION_REMOVE_EMOJI",GatewayDispatchEvents2.MessageUpdate="MESSAGE_UPDATE",GatewayDispatchEvents2.PresenceUpdate="PRESENCE_UPDATE",GatewayDispatchEvents2.StageInstanceCreate="STAGE_INSTANCE_CREATE",GatewayDispatchEvents2.StageInstanceDelete="STAGE_INSTANCE_DELETE",GatewayDispatchEvents2.StageInstanceUpdate="STAGE_INSTANCE_UPDATE",GatewayDispatchEvents2.Ready="READY",GatewayDispatchEvents2.Resumed="RESUMED",GatewayDispatchEvents2.ThreadCreate="THREAD_CREATE",GatewayDispatchEvents2.ThreadDelete="THREAD_DELETE",GatewayDispatchEvents2.ThreadListSync="THREAD_LIST_SYNC",GatewayDispatchEvents2.ThreadMembersUpdate="THREAD_MEMBERS_UPDATE",GatewayDispatchEvents2.ThreadMemberUpdate="THREAD_MEMBER_UPDATE",GatewayDispatchEvents2.ThreadUpdate="THREAD_UPDATE",GatewayDispatchEvents2.TypingStart="TYPING_START",GatewayDispatchEvents2.UserUpdate="USER_UPDATE",GatewayDispatchEvents2.VoiceServerUpdate="VOICE_SERVER_UPDATE",GatewayDispatchEvents2.VoiceStateUpdate="VOICE_STATE_UPDATE",GatewayDispatchEvents2.WebhooksUpdate="WEBHOOKS_UPDATE",GatewayDispatchEvents2.GuildScheduledEventCreate="GUILD_SCHEDULED_EVENT_CREATE",GatewayDispatchEvents2.GuildScheduledEventUpdate="GUILD_SCHEDULED_EVENT_UPDATE",GatewayDispatchEvents2.GuildScheduledEventDelete="GUILD_SCHEDULED_EVENT_DELETE",GatewayDispatchEvents2.GuildScheduledEventUserAdd="GUILD_SCHEDULED_EVENT_USER_ADD",GatewayDispatchEvents2.GuildScheduledEventUserRemove="GUILD_SCHEDULED_EVENT_USER_REMOVE"},48583:(__unused_webpack_module,exports2)=>{"use strict";Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.FormattingPatterns=void 0,exports2.FormattingPatterns={User:/<@(?\d{17,20})>/,UserWithNickname:/<@!(?\d{17,20})>/,UserWithOptionalNickname:/<@!?(?\d{17,20})>/,Channel:/<#(?\d{17,20})>/,Role:/<@&(?\d{17,20})>/,Emoji:/<(?a)?:(?\w{2,32}):(?\d{17,20})>/,AnimatedEmoji:/<(?a):(?\w{2,32}):(?\d{17,20})>/,StaticEmoji:/<:(?\w{2,32}):(?\d{17,20})>/,Timestamp:/-?\d{1,13})(:(?