This repository has been archived by the owner on Aug 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
86.c0dd9c81f9e7c736e2b8.js
1 lines (1 loc) · 22.5 KB
/
86.c0dd9c81f9e7c736e2b8.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[86],{4785:(Z,O,n)=>{n.d(O,{TU:()=>C,Iq:()=>p});var t=n(8583),e=n(7716);class M{constructor(l,s){this._document=s;const i=this._textarea=this._document.createElement("textarea"),r=i.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",i.setAttribute("aria-hidden","true"),i.value=l,this._document.body.appendChild(i)}copy(){const l=this._textarea;let s=!1;try{if(l){const i=this._document.activeElement;l.select(),l.setSelectionRange(0,l.value.length),s=this._document.execCommand("copy"),i&&i.focus()}}catch(i){}return s}destroy(){const l=this._textarea;l&&(l.parentNode&&l.parentNode.removeChild(l),this._textarea=void 0)}}let C=(()=>{class o{constructor(s){this._document=s}copy(s){const i=this.beginCopy(s),r=i.copy();return i.destroy(),r}beginCopy(s){return new M(s,this._document)}}return o.\u0275fac=function(s){return new(s||o)(e.LFG(t.K0))},o.\u0275prov=e.Yz7({factory:function(){return new o(e.LFG(t.K0))},token:o,providedIn:"root"}),o})(),p=(()=>{class o{}return o.\u0275fac=function(s){return new(s||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})()},9123:(Z,O,n)=>{n.d(O,{i:()=>E});var t=n(7716),e=n(2238),M=n(1095),C=n(6627);let E=(()=>{class m{constructor(p,o){this.dialogRef=p,this.data=o,this.deleted=new t.vpe,this.message="Are you sure you want to delete?",this.yesIcon="delete",this.yes="Delete",this.no="No I dont!",o.message&&(this.message=o.message),o.yesIcon&&(this.yesIcon=o.yesIcon),o.yes&&(this.yes=o.yes),o.no&&(this.no=o.no)}}return m.\u0275fac=function(p){return new(p||m)(t.Y36(e.so),t.Y36(e.WI))},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-delete-confirm"]],outputs:{deleted:"deleted"},decls:8,vars:4,consts:[[2,"margin-top","0"],["mat-flat-button","","color","warn",2,"margin-right","10px",3,"click"],["mat-flat-button","",3,"click"]],template:function(p,o){1&p&&(t.TgZ(0,"p",0),t._uU(1),t.qZA(),t.TgZ(2,"button",1),t.NdJ("click",function(){return o.deleted.emit(),o.dialogRef.close()}),t.TgZ(3,"mat-icon"),t._uU(4),t.qZA(),t._uU(5),t.qZA(),t.TgZ(6,"button",2),t.NdJ("click",function(){return o.dialogRef.close()}),t._uU(7),t.qZA()),2&p&&(t.xp6(1),t.Oqu(o.message),t.xp6(3),t.Oqu(o.yesIcon),t.xp6(1),t.hij(" ",o.yes,"\n"),t.xp6(2),t.Oqu(o.no))},directives:[M.lW,C.Hw],styles:[""]}),m})()},2378:(Z,O,n)=>{n.d(O,{G:()=>w});var t=n(7716),e=n(3679),M=n(2238),C=n(9123),E=n(1584),m=n(8583),T=n(8295),p=n(9983),o=n(1908),l=n(1095),s=n(6627),i=n(3738),r=n(2178);function f(c,x){1&c&&(t.TgZ(0,"h2",12),t._uU(1,"Creating a new world"),t.qZA())}function P(c,x){if(1&c&&(t.TgZ(0,"h2",12),t._uU(1," Editing "),t.TgZ(2,"span",13),t._uU(3),t.qZA(),t.qZA()),2&c){const g=t.oxw();t.xp6(3),t.Oqu(g.domain.label)}}function d(c,x){if(1&c&&(t.TgZ(0,"mat-card",14),t.TgZ(1,"mat-icon",15),t._uU(2," error_outline "),t.qZA(),t._uU(3),t.qZA()),2&c){const g=t.oxw();t.xp6(3),t.hij(" ",g.error,"\n")}}function u(c,x){1&c&&(t.TgZ(0,"mat-error"),t._uU(1," Name is required "),t.qZA())}function _(c,x){1&c&&(t.TgZ(0,"mat-error"),t._uU(1," Name is too short "),t.qZA())}function a(c,x){1&c&&(t.TgZ(0,"mat-error"),t._uU(1," Name is too long "),t.qZA())}function b(c,x){1&c&&(t.TgZ(0,"mat-error"),t._uU(1," Description is too long "),t.qZA())}function U(c,x){if(1&c&&(t.TgZ(0,"button",16),t.TgZ(1,"mat-icon"),t._uU(2,"add"),t.qZA(),t._uU(3," Add world "),t.qZA()),2&c){const g=t.oxw();t.Q6J("disabled",g.form.invalid||g.form.pristine||g.isLoading)}}function I(c,x){if(1&c&&(t.TgZ(0,"button",16),t.TgZ(1,"mat-icon"),t._uU(2,"save"),t.qZA(),t._uU(3," Save world "),t.qZA()),2&c){const g=t.oxw();t.Q6J("disabled",g.form.invalid||g.form.pristine||g.isLoading)}}function A(c,x){if(1&c){const g=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){return t.CHM(g),t.oxw().onDelete()}),t.TgZ(1,"mat-icon"),t._uU(2,"delete"),t.qZA(),t._uU(3," Delete "),t.qZA()}if(2&c){const g=t.oxw();t.Q6J("disabled",g.isLoading)}}function y(c,x){1&c&&(t.TgZ(0,"div"),t._UZ(1,"br"),t._UZ(2,"mat-progress-bar",17),t.qZA())}let w=(()=>{class c{constructor(g,h,D,v){this.userService=g,this.dialogRef=h,this.domain=D,this.dialog=v,this.onUpdated=new t.vpe,this.isLoading=!1,this.editMode=!1,this.error="",this.form=null,this.dialogRef.disableClose=!0}ngOnInit(){this.domain?this.editMode=!0:this.domain={},this.form=new e.cw({label:new e.NI(this.domain.label||"",[e.kI.required,e.kI.minLength(4),e.kI.maxLength(64)]),description:new e.NI(this.domain.description||"",[e.kI.maxLength(8192)]),thumbnail:new e.NI(null)})}onSubmit(){if(this.form.invalid)return;this.isLoading=!0,this.form.disable();const g=this.form.value.thumbnail;delete this.form.value.thumbnail;const D=(this.editMode?this.userService.updateUserDomain(this.domain.id,this.form.value):this.userService.createUserDomain(this.form.value)).subscribe(v=>{if(null==g)this.onUpdated.emit(v),this.dialogRef.close();else{const k=this.userService.updateDomainImage(v.id,{image:g}).subscribe(()=>{this.onUpdated.emit(v),this.dialogRef.close()},W=>{this.error=W,this.isLoading=!1,this.form.enable()},()=>{k.unsubscribe()})}},v=>{this.error=v,this.isLoading=!1,this.form.enable()},()=>{D.unsubscribe()})}onDelete(){if(!this.editMode)return;const h=this.dialog.open(C.i,{data:{message:"Are you sure you want to delete "+this.domain.label+"?"}}).componentInstance.deleted.subscribe(()=>{this.isLoading=!0;const D=this.userService.deleteUserDomain(this.domain.id).subscribe(()=>{this.onUpdated.emit(),this.dialogRef.close(),this.isLoading=!1},v=>{this.error=v,this.isLoading=!1},()=>{D.unsubscribe()})},()=>{},()=>{h.unsubscribe()})}onDiscard(){if(this.form.pristine)return this.dialogRef.close();const h=this.dialog.open(C.i,{data:{message:"Are you sure you want to discard this domain?",yesIcon:"close",yes:"Discard"}}).componentInstance.deleted.subscribe(()=>{this.dialogRef.close()},()=>{},()=>{h.unsubscribe()})}}return c.\u0275fac=function(g){return new(g||c)(t.Y36(E.K),t.Y36(M.so),t.Y36(M.WI),t.Y36(M.uw))},c.\u0275cmp=t.Xpm({type:c,selectors:[["app-edit-domain"]],outputs:{onUpdated:"onUpdated"},decls:22,vars:13,consts:[["style","margin-top: 0;",4,"ngIf"],["class","bg-warn","style","\n\t\tmargin-bottom: 16px;\n\t\tcolor: #fff;\n\t\tdisplay: flex;\n\t\tvertical-align: middle;\n\t",4,"ngIf"],[3,"formGroup","ngSubmit"],[2,"width","100%"],["matInput","","placeholder","Name","required","","formControlName","label"],[4,"ngIf"],["matInput","","placeholder","Description","formControlName","description","rows","4"],["name","thumbnail","formControlName","thumbnail"],[2,"margin","8px 0"],["type","submit","mat-flat-button","","color","primary",3,"disabled",4,"ngIf"],["style","margin-left: 8px;","type","button","mat-flat-button","",3,"disabled","click",4,"ngIf"],["type","button","mat-flat-button","",2,"margin-left","8px",3,"disabled","click"],[2,"margin-top","0"],[2,"font-weight","500"],[1,"bg-warn",2,"margin-bottom","16px","color","#fff","display","flex","vertical-align","middle"],[2,"margin-top","-3px","margin-right","8px"],["type","submit","mat-flat-button","","color","primary",3,"disabled"],["mode","indeterminate"]],template:function(g,h){1&g&&(t.YNc(0,f,2,0,"h2",0),t.YNc(1,P,4,1,"h2",0),t.YNc(2,d,4,1,"mat-card",1),t.TgZ(3,"form",2),t.NdJ("ngSubmit",function(){return h.onSubmit()}),t.TgZ(4,"mat-form-field",3),t._UZ(5,"input",4),t.YNc(6,u,2,0,"mat-error",5),t.YNc(7,_,2,0,"mat-error",5),t.YNc(8,a,2,0,"mat-error",5),t.qZA(),t.TgZ(9,"mat-form-field",3),t._UZ(10,"textarea",6),t.YNc(11,b,2,0,"mat-error",5),t.qZA(),t._UZ(12,"app-image-picker",7),t._UZ(13,"div",8),t.YNc(14,U,4,1,"button",9),t.YNc(15,I,4,1,"button",9),t.YNc(16,A,4,1,"button",10),t.TgZ(17,"button",11),t.NdJ("click",function(){return h.onDiscard()}),t.TgZ(18,"mat-icon"),t._uU(19,"close"),t.qZA(),t._uU(20," Discard changes "),t.qZA(),t.qZA(),t.YNc(21,y,3,0,"div",5)),2&g&&(t.Q6J("ngIf",!h.editMode),t.xp6(1),t.Q6J("ngIf",h.editMode),t.xp6(1),t.Q6J("ngIf",h.error),t.xp6(1),t.Q6J("formGroup",h.form),t.xp6(3),t.Q6J("ngIf",h.form.hasError("required","label")),t.xp6(1),t.Q6J("ngIf",h.form.hasError("minLength","label")),t.xp6(1),t.Q6J("ngIf",h.form.hasError("maxLength","label")),t.xp6(3),t.Q6J("ngIf",h.form.hasError("maxLength","description")),t.xp6(3),t.Q6J("ngIf",!h.editMode),t.xp6(1),t.Q6J("ngIf",h.editMode),t.xp6(1),t.Q6J("ngIf",h.editMode),t.xp6(1),t.Q6J("disabled",h.isLoading),t.xp6(4),t.Q6J("ngIf",h.isLoading))},directives:[m.O5,e._Y,e.JL,e.sg,T.KE,p.Nt,e.Fj,e.Q7,e.JJ,e.u,o.Q,l.lW,s.Hw,i.a8,T.TO,r.pW],styles:[".thumbnail-preview[_ngcontent-%COMP%]{width:100px;height:75px;border-radius:4px;background-size:cover;background-position:center}.thumbnail-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;width:240px}"]}),c})()},1908:(Z,O,n)=>{n.d(O,{Q:()=>o});var t=n(7716),e=n(3679),M=n(1095),C=n(6627),E=n(8583);const m=["imageInput"];function T(l,s){if(1&l){const i=t.EpF();t.TgZ(0,"button",8),t.NdJ("click",function(){return t.CHM(i),t.oxw().onImageClear()}),t._uU(1),t.qZA()}if(2&l){const i=t.oxw();t.Q6J("disabled",i.disabled),t.xp6(1),t.hij(" Clear ",i.name," ")}}const p=function(l){return{backgroundImage:l}};let o=(()=>{class l{constructor(i){this.ref=i,this.name="image",this.accept="image/jpeg,image/png",this.circle=!1,this.disabled=!1,this.imagePreview="",this.onChange=()=>{}}onImageChanged(i){const r=i.srcElement;if(0==r.files.length)return this.onChange(null),void(this.imagePreview="");const f=r.files[0];if(this.onChange(f),!FileReader)return;const P=new FileReader;P.onload=d=>{this.imagePreview=d.target.result},P.readAsDataURL(f)}onImageClear(){this.onChange(""),this.imageInput.nativeElement.value="",this.imagePreview=""}writeValue(i){null!=this.imageInput&&(this.imageInput.nativeElement.value="",this.imagePreview="")}registerOnChange(i){this.onChange=i}registerOnTouched(i){}setDisabledState(i){this.disabled=i,this.ref.detectChanges()}}return l.\u0275fac=function(i){return new(i||l)(t.Y36(t.sBO))},l.\u0275cmp=t.Xpm({type:l,selectors:[["app-image-picker"]],viewQuery:function(i,r){if(1&i&&t.Gf(m,5),2&i){let f;t.iGM(f=t.CRH())&&(r.imageInput=f.first)}},inputs:{name:"name",accept:"accept",circle:"circle"},features:[t._Bn([{provide:e.JU,useExisting:(0,t.Gpc)(()=>l),multi:!0}])],decls:15,vars:10,consts:[[2,"vertical-align","top"],["hidden","","type","file",3,"accept","change"],["imageInput",""],["type","button","mat-flat-button","","color","primary",3,"disabled","click"],["type","button","mat-flat-button","",3,"disabled","click",4,"ngIf"],[2,"width","100%"],[1,"image-text",2,"margin-left","8px","margin-top","8px"],[1,"image-preview",3,"ngStyle"],["type","button","mat-flat-button","",3,"disabled","click"]],template:function(i,r){if(1&i){const f=t.EpF();t.TgZ(0,"table"),t.TgZ(1,"tr",0),t.TgZ(2,"td"),t.TgZ(3,"input",1,2),t.NdJ("change",function(d){return r.onImageChanged(d)}),t.qZA(),t.TgZ(5,"button",3),t.NdJ("click",function(){return t.CHM(f),t.MAs(4).click()}),t.TgZ(6,"mat-icon"),t._uU(7,"photo"),t.qZA(),t._uU(8),t.qZA(),t.YNc(9,T,2,2,"button",4),t.qZA(),t.TgZ(10,"td",5),t.TgZ(11,"p",6),t._uU(12),t.qZA(),t.qZA(),t.TgZ(13,"td"),t._UZ(14,"div",7),t.qZA(),t.qZA(),t.qZA()}if(2&i){const f=t.MAs(4);t.xp6(3),t.Q6J("accept",r.accept),t.xp6(2),t.Q6J("disabled",r.disabled),t.xp6(3),t.hij(" Choose ",r.name," "),t.xp6(1),t.Q6J("ngIf",f.value),t.xp6(3),t.hij(" ",f.value?f.files[0].name:"No "+r.name+" selected"," "),t.xp6(2),t.ekj("circle",r.circle),t.Q6J("ngStyle",t.VKq(8,p,"url("+r.imagePreview+")"))}},directives:[M.lW,C.Hw,E.O5,E.PC],styles:[".image-preview[_ngcontent-%COMP%]{width:100px;height:75px;border-radius:4px;background-size:cover;background-position:center}.image-preview.circle[_ngcontent-%COMP%]{width:75px;border-radius:50%}.image-text[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;width:240px}"]}),l})()},8086:(Z,O,n)=>{n.d(O,{W:()=>i});var t=n(8583),e=n(3679),M=n(3191),l=(n(7106),n(9626),n(2378),n(1908),n(9123),n(1928),n(7716));let i=(()=>{class r{}return r.\u0275fac=function(P){return new(P||r)},r.\u0275mod=l.oAB({type:r}),r.\u0275inj=l.cJS({imports:[[t.ez,M.q,e.UX]]}),r})()},1928:(Z,O,n)=>{n.d(O,{l:()=>E});var t=n(7716),e=n(8583);function M(m,T){1&m&&(t.O4$(),t._UZ(0,"circle",10))}function C(m,T){1&m&&(t.O4$(),t._UZ(0,"circle",11))}let E=(()=>{class m{constructor(){this.size=32,this.username="_",this.online=!1}}return m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-user-image"]],inputs:{size:"size",username:"username",online:"online"},decls:11,vars:5,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 32 32"],["id","user-image-mask","maskContentUnits","objectBoundingBox","viewBox","0 0 1 1"],["fill","white","cx","0.5","cy","0.5","r","0.5"],["fill","black","cx","0.84375","cy","0.84375","r","0.25"],["fill","black","cx","0.84375","cy","0.84375","r","0.1"],["id","user-image-offline-mask","maskContentUnits","objectBoundingBox","viewBox","0 0 1 1"],["fill","black","cx","0.5","cy","0.5","r","0.25"],["mask","url(#user-image-mask)","height","32","width","32","preserveAspectRatio","xMaxYMin slice"],["fill","rgb(67, 181, 129)","cx","27","cy","27","r","5",4,"ngIf"],["fill","rgb(116, 127, 141)","mask","url(#user-image-offline-mask)","cx","27","cy","27","r","5",4,"ngIf"],["fill","rgb(67, 181, 129)","cx","27","cy","27","r","5"],["fill","rgb(116, 127, 141)","mask","url(#user-image-offline-mask)","cx","27","cy","27","r","5"]],template:function(p,o){1&p&&(t.O4$(),t.TgZ(0,"svg",0),t.TgZ(1,"mask",1),t._UZ(2,"circle",2),t._UZ(3,"circle",3),t._UZ(4,"circle",4),t.qZA(),t.TgZ(5,"mask",5),t._UZ(6,"circle",2),t._UZ(7,"circle",6),t.qZA(),t._UZ(8,"image",7),t.YNc(9,M,1,0,"circle",8),t.YNc(10,C,1,0,"circle",9),t.qZA()),2&p&&(t.uIk("width",o.size)("height",o.size),t.xp6(8),t.uIk("href","/api/user/"+o.username+"/image"),t.xp6(1),t.Q6J("ngIf",o.online),t.xp6(1),t.Q6J("ngIf",!o.online))},directives:[e.O5],styles:[""]}),m})()},7106:(Z,O,n)=>{n.d(O,{F:()=>P});var t=n(7716),e=n(9626),M=n(2238),C=n(3738),E=n(8583),m=n(6627),T=n(1095);function p(d,u){1&d&&(t.TgZ(0,"mat-icon"),t._uU(1,"lock"),t.qZA())}function o(d,u){if(1&d){const _=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){return t.CHM(_),t.oxw().onEditWorld()}),t.TgZ(1,"mat-icon"),t._uU(2,"edit"),t.qZA(),t._uU(3," Edit details "),t.qZA()}}function l(d,u){if(1&d&&(t.TgZ(0,"a",12),t.TgZ(1,"mat-icon"),t._uU(2,"settings"),t.qZA(),t._uU(3," Open settings "),t.TgZ(4,"span",13),t._uU(5),t.qZA(),t.qZA()),2&d){const _=t.oxw();t.Q6J("href",_.worldSettingsUrl,t.LSH),t.xp6(5),t.hij(" ",_.world.networkAddress+":"+(_.world.networkPort-2)," ")}}function s(d,u){if(1&d){const _=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){return t.CHM(_),t.oxw().onGenerateToken()}),t.TgZ(1,"mat-icon"),t._uU(2,"vpn_key"),t.qZA(),t._uU(3," Generate new access token "),t.qZA()}}function i(d,u){if(1&d&&(t.TgZ(0,"a",12),t.TgZ(1,"mat-icon"),t._uU(2,"link"),t.qZA(),t._uU(3," World link "),t.qZA()),2&d){const _=t.oxw();t.Q6J("href",_.world.url,t.LSH)}}const r=function(d){return{offline:d,small:!0}},f=function(d){return{backgroundImage:d}};let P=(()=>{class d{constructor(_){this.dialog=_,this.onEdit=new t.vpe,this.thumbnailUrl="",this.worldSettingsUrl=""}displayPlural(_,a,b){return _+" "+(1===_?a:null!=b?b:a+"s")}ngOnInit(){let _;this.thumbnailUrl="/api/domain/"+this.world.id+"/image?"+ +new Date;try{_=Number(this.world.networkPort)-2}catch(a){_=4010}this.worldSettingsUrl="http://"+this.world.networkAddress+":"+_+"/settings"}get users(){return this.world.online?this.displayPlural(this.world.numUsers,"person","people"):"Offline"}onJoinWorld(){window.open(this.world.url,"_blank")}onEditWorld(){this.onEdit.emit(this.world)}onGenerateToken(){this.dialog.open(e.s,{width:"600px",data:this.world})}}return d.\u0275fac=function(_){return new(_||d)(t.Y36(M.uw))},d.\u0275cmp=t.Xpm({type:d,selectors:[["app-world-card"]],inputs:{world:"world",editMode:"editMode"},outputs:{onEdit:"onEdit"},decls:21,vars:15,consts:[[1,"world-card",3,"ngClass"],["mat-card-image",""],[1,"thumbnail",3,"ngStyle","click"],[1,"header"],[1,"title"],[4,"ngIf"],[1,"subtitle"],[2,"flex-grow","1"],[1,"ellipses"],["mat-button","",3,"click",4,"ngIf"],["mat-button","","target","_blank",3,"href",4,"ngIf"],["mat-button","",3,"click"],["mat-button","","target","_blank",3,"href"],[2,"opacity","0.5","font-size","0.8em","padding-left","8px"]],template:function(_,a){1&_&&(t.TgZ(0,"mat-card",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t.NdJ("click",function(){return a.onJoinWorld()}),t.TgZ(3,"p"),t._uU(4),t.qZA(),t.qZA(),t.qZA(),t.TgZ(5,"mat-card-header"),t.TgZ(6,"div",3),t.TgZ(7,"h3",4),t.YNc(8,p,2,0,"mat-icon",5),t._uU(9),t.qZA(),t.TgZ(10,"p",6),t._uU(11),t.qZA(),t._UZ(12,"span",7),t.qZA(),t.qZA(),t.TgZ(13,"mat-card-content"),t.TgZ(14,"div",8),t._uU(15),t.qZA(),t.qZA(),t.TgZ(16,"mat-card-actions"),t.YNc(17,o,4,0,"button",9),t.YNc(18,l,6,2,"a",10),t.YNc(19,s,4,0,"button",9),t.YNc(20,i,4,1,"a",10),t.qZA(),t.qZA()),2&_&&(t.Q6J("ngClass",t.VKq(11,r,!a.world.online)),t.xp6(2),t.Q6J("ngStyle",t.VKq(13,f,"url(/api/domain/"+a.world.id+"/image)")),t.xp6(2),t.Oqu(a.world.label),t.xp6(4),t.Q6J("ngIf","acl"==a.world.restriction),t.xp6(1),t.hij(" ",a.users," "),t.xp6(2),t.Oqu(a.world.username),t.xp6(4),t.Oqu(a.world.description),t.xp6(2),t.Q6J("ngIf",a.editMode),t.xp6(1),t.Q6J("ngIf",a.editMode&&!a.world.iceServerAddress),t.xp6(1),t.Q6J("ngIf",a.editMode),t.xp6(1),t.Q6J("ngIf",a.editMode))},directives:[C.a8,E.mk,C.G2,E.PC,C.dk,E.O5,C.dn,C.hq,m.Hw,T.lW,T.zs],styles:['.world-card[_ngcontent-%COMP%]{display:inline-block;width:100%}.world-card[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{height:160px;background-size:cover;background-position:center;background-repeat:no-repeat;position:relative;border-radius:inherit;cursor:pointer}.world-card[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{position:absolute;margin:auto;font-size:1.5em;bottom:16px;left:16px;color:#fff}.world-card[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:before{content:"";position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;background:linear-gradient(transparent,transparent,rgba(29,31,33,.2),rgba(29,31,33,.8))}.world-card[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%] .offline[_ngcontent-%COMP%]{opacity:.6}.world-card.offline[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{filter:grayscale(1)}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .mat-card-header-text{margin:0}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;font-weight:500;margin:0}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{margin-right:4px}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{display:inline-block;color:#0000008a;font-size:14px;margin:0 0 0 8px}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .like-button[_ngcontent-%COMP%]{min-width:0px;padding:0 4px;margin-right:-4px;opacity:.6;line-height:16px;font-size:1em}.world-card[_ngcontent-%COMP%] .mat-card-header[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .like-button.active[_ngcontent-%COMP%]{color:#f44336;opacity:1}.world-card[_ngcontent-%COMP%] .mat-card-actions[_ngcontent-%COMP%]{margin-top:-8px}.world-card[_ngcontent-%COMP%] .mat-card-actions[_ngcontent-%COMP%] .mat-button[_ngcontent-%COMP%]{display:block;max-width:100%;overflow:hidden;margin-left:-8px}.world-card[_ngcontent-%COMP%] .mat-card-actions[_ngcontent-%COMP%] a.mat-button[_ngcontent-%COMP%]{display:inline-block;margin-top:4px}.world-card[_ngcontent-%COMP%] .ellipses[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.world-card[_ngcontent-%COMP%] .mat-card-content[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin-top:8px;height:1.4em;overflow:hidden}']}),d})()},9626:(Z,O,n)=>{n.d(O,{s:()=>d});var t=n(2238),e=n(7716),M=n(1584),C=n(4785),E=n(8583),m=n(1095),T=n(6627),p=n(2178),o=n(8295),l=n(9983);function s(u,_){1&u&&(e.ynx(0),e._UZ(1,"br"),e._UZ(2,"mat-progress-bar",6),e.BQk())}function i(u,_){if(1&u){const a=e.EpF();e.ynx(0),e.TgZ(1,"h2",1),e._uU(2," Generate a new access token for "),e.TgZ(3,"b"),e._uU(4),e.qZA(),e._uU(5,"? "),e.qZA(),e.TgZ(6,"p"),e._uU(7," This will revoke your previously generated token and break your domain if you don't update the token. "),e.qZA(),e.TgZ(8,"div",2),e.TgZ(9,"button",3),e.NdJ("click",function(){return e.CHM(a),e.oxw().onClose()}),e._uU(10," Cancel "),e.qZA(),e._UZ(11,"span",4),e.TgZ(12,"button",5),e.NdJ("click",function(){return e.CHM(a),e.oxw().onGenerateToken()}),e.TgZ(13,"mat-icon"),e._uU(14,"vpn_key"),e.qZA(),e._uU(15," Generate new access token "),e.qZA(),e.qZA(),e.YNc(16,s,3,0,"ng-container",0),e.BQk()}if(2&u){const a=e.oxw();e.xp6(4),e.Oqu(a.domain.label),e.xp6(5),e.Q6J("disabled",a.loading),e.xp6(3),e.Q6J("disabled",a.loading),e.xp6(4),e.Q6J("ngIf",a.loading)}}function r(u,_){1&u&&(e.ynx(0),e._uU(1,"Copy to clipboard"),e.BQk())}function f(u,_){1&u&&(e.ynx(0),e._uU(1,"Copied!"),e.BQk())}function P(u,_){if(1&u){const a=e.EpF();e.ynx(0),e.TgZ(1,"h2",1),e._uU(2),e.qZA(),e.TgZ(3,"mat-form-field",7),e._UZ(4,"input",8),e.qZA(),e.TgZ(5,"div",2),e.TgZ(6,"button",9),e.NdJ("click",function(){return e.CHM(a),e.oxw().onClose()}),e._uU(7," Close "),e.qZA(),e._UZ(8,"span",4),e.TgZ(9,"button",10),e.NdJ("click",function(){return e.CHM(a),e.oxw().onCopyToClipboard()}),e.YNc(10,r,2,0,"ng-container",0),e.YNc(11,f,2,0,"ng-container",0),e.qZA(),e.qZA(),e.BQk()}if(2&u){const a=e.oxw();e.xp6(2),e.hij(" Your shiny new access token for ",a.domain.label,"! "),e.xp6(2),e.Q6J("value",a.token),e.xp6(6),e.Q6J("ngIf",!a.copied),e.xp6(1),e.Q6J("ngIf",a.copied)}}let d=(()=>{class u{constructor(a,b,U,I){this.userService=a,this.dialogRef=b,this.clipboard=U,this.domain=I,this.loading=!1,this.token="",this.copied=!1}onGenerateToken(){this.loading=!0;const a=this.userService.generateDomainAccessToken(this.domain.id).subscribe(b=>{this.token=b},b=>{},()=>{this.loading=!1,a.unsubscribe()})}onCopyToClipboard(){this.clipboard.copy(this.token),this.copied=!0}onClose(){this.dialogRef.close()}}return u.\u0275fac=function(a){return new(a||u)(e.Y36(M.K),e.Y36(t.so),e.Y36(C.TU),e.Y36(t.WI))},u.\u0275cmp=e.Xpm({type:u,selectors:[["app-world-token"]],decls:2,vars:2,consts:[[4,"ngIf"],[2,"margin-top","0"],[2,"text-align","right"],["mat-flat-button","",3,"disabled","click"],[2,"padding","0 4px"],["mat-flat-button","","color","warn",3,"disabled","click"],["mode","indeterminate"],[2,"width","100%"],["matInput","","placeholder","Access token","disabled","",3,"value"],["mat-button","",3,"click"],["mat-flat-button","","color","primary",3,"click"]],template:function(a,b){1&a&&(e.YNc(0,i,17,4,"ng-container",0),e.YNc(1,P,12,4,"ng-container",0)),2&a&&(e.Q6J("ngIf",!b.token),e.xp6(1),e.Q6J("ngIf",b.token))},directives:[E.O5,m.lW,T.Hw,p.pW,o.KE,l.Nt],styles:[""]}),u})()}}]);