manifest
Version:
The backend for AI code editors
6 lines • 437 kB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[792],{4783:(Je,he,I)=>{I.r(he),I.d(he,{AuthModule:()=>tn});var h=I(2943),o=I(8023),W=I(183),X=I(4385),T=I(8284);let pe=(()=>{class ke{constructor(Ie){this.router=Ie}canActivate(){return!localStorage.getItem(X.il)||(this.router.navigate(["/"]),!1)}static{this.\u0275fac=function(Xe){return new(Xe||ke)(T.KVO(W.Ix))}}static{this.\u0275prov=T.jDH({token:ke,factory:ke.\u0275fac,providedIn:"root"})}}return ke})();var J=I(7431),fe=I(9911),le=I(5442),de=I(7906),oe=I(2283),_e=I(8428);const xe=ke=>({name:"email",type:ke}),Q=ke=>({name:"password",type:ke});function ve(ke,vn){if(1&ke){const Ie=T.RV6();T.j41(0,"div",10)(1,"div",11)(2,"div",12)(3,"app-input",13),T.bIt("valueChanged",function(vt){T.eBV(Ie);const Tt=T.XpG(2);return T.Njj(Tt.patchValue("email",vt))}),T.k0s()()(),T.j41(4,"div",11)(5,"div",12)(6,"app-input",13),T.bIt("valueChanged",function(vt){T.eBV(Ie);const Tt=T.XpG(2);return T.Njj(Tt.patchValue("password",vt))}),T.k0s()()(),T.j41(7,"button",14),T.bIt("click",function(){T.eBV(Ie);const vt=T.XpG(2);return T.Njj(vt.submit())}),T.EFF(8," Login "),T.k0s(),T.j41(9,"div",15)(10,"span",16),T.EFF(11,"Built with"),T.k0s(),T.nrm(12,"img",17),T.k0s()()}if(2&ke){const Ie=T.XpG(2);T.R7$(3),T.Y8G("prop",T.eq3(5,xe,Ie.PropType.Email))("value",Ie.suggestedEmail),T.R7$(3),T.Y8G("prop",T.eq3(7,Q,Ie.PropType.Password))("value",Ie.suggestedPassword),T.R7$(),T.Y8G("disabled",!Ie.form.valid)}}function He(ke,vn){if(1&ke&&(T.j41(0,"section",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div")(6,"h1",6),T.EFF(7),T.k0s(),T.j41(8,"h2",7),T.EFF(9,"Sign in to your admin panel"),T.k0s(),T.DNE(10,ve,13,9,"div",8),T.k0s()()(),T.nrm(11,"div",9),T.k0s()()()),2&ke){const Ie=T.XpG();T.R7$(7),T.SpI(" ",Ie.appName," "),T.R7$(3),T.Y8G("ngIf",Ie.form)}}let Pe=(()=>{class ke{constructor(Ie,Xe,vt,Tt){this.authService=Ie,this.router=Xe,this.activatedRoute=vt,this.manifestService=Tt,this.PropType=le.Kk}ngOnInit(){var Ie=this;return(0,J.A)(function*(){(yield Ie.authService.isDbEmpty())&&Ie.router.navigate(["/auth/welcome"]),Ie.manifestService.getAppName().then(vt=>{Ie.appName=vt}),Ie.activatedRoute.queryParams.subscribe(function(){var vt=(0,J.A)(function*(Tt){Tt.email&&Tt.password?(Ie.suggestedEmail=Tt.email,Ie.suggestedPassword=Tt.password):(yield Ie.authService.isDefaultAdminExists())&&(Ie.suggestedEmail=X.Fr.email,Ie.suggestedPassword=X.Fr.password),Ie.form=new fe.gE({email:new fe.MJ(Ie.suggestedEmail||"",[fe.k0.required,fe.k0.email]),password:new fe.MJ(Ie.suggestedPassword||"",[fe.k0.required])})});return function(Tt){return vt.apply(this,arguments)}}())})()}patchValue(Ie,Xe){this.form.get(Ie)?.patchValue(Xe)}submit(){this.authService.login(this.form.value).then(()=>{this.router.navigate(["/"])},Ie=>{alert(401===Ie.status?"Error: Incorrect username or password.":Ie.error.message)})}static{this.\u0275fac=function(Xe){return new(Xe||ke)(T.rXU(de.u),T.rXU(W.Ix),T.rXU(W.nX),T.rXU(oe.x))}}static{this.\u0275cmp=T.VBU({type:ke,selectors:[["app-login"]],decls:1,vars:1,consts:[["class","hero is-fullheight",4,"ngIf"],[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],[1,"column","col-login"],[1,"is-size-3","has-text-weight-bold"],[1,"title","is-5","mt-2"],["class","has-text-left",4,"ngIf"],[1,"column","col-decoration"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop","value"],[1,"button","is-block","is-dark","is-fullwidth","mb-3",3,"click","disabled"],[1,"is-flex","is-align-items-center","is-justify-content-flex-end","my-3"],[2,"margin-top","9px"],["src","/assets/images/logo.svg","alt","manifest logo","width","94",1,"ml-3"]],template:function(Xe,vt){1&Xe&&T.DNE(0,He,12,2,"section",0),2&Xe&&T.Y8G("ngIf",vt.appName)},dependencies:[h.bT,_e.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.col-login[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.col-login[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}@media screen and (max-width: 999px){.col-login[_ngcontent-%COMP%]{width:66.66667%}}@media screen and (max-width: 767px){.col-login[_ngcontent-%COMP%]{width:100%}}@media screen and (min-width: 1000px){.col-login[_ngcontent-%COMP%]{width:40%}}@media screen and (min-width: 1188px){.col-login[_ngcontent-%COMP%]{width:33.33333%}}.col-decoration[_ngcontent-%COMP%]{width:60%}@media screen and (max-width: 999px){.col-decoration[_ngcontent-%COMP%]{width:33.33333%}}@media screen and (min-width: 1188px){.col-decoration[_ngcontent-%COMP%]{width:66.66666%}}']})}}return ke})(),Ze=(()=>{class ke{constructor(Ie,Xe){this.authService=Ie,this.router=Xe}ngOnInit(){this.authService.logout(),this.router.navigate(["/","auth","login"])}static{this.\u0275fac=function(Xe){return new(Xe||ke)(T.rXU(de.u),T.rXU(W.Ix))}}static{this.\u0275cmp=T.VBU({type:ke,selectors:[["ng-component"]],decls:1,vars:0,template:function(Xe,vt){1&Xe&&T.EFF(0,"NO UI TO BE FOUND HERE!")},encapsulation:2})}}return ke})();function lt(ke){return vn=>{const Ie=vn.parent;if(!Ie)return null;const Xe=Ie.get(ke);if(!Xe)return null;const Tt=vn.value;return Tt&&Xe.value===Tt?null:{confirmPasswordMismatch:!0}}}var Dt=I(818);const Oe=ke=>({name:"email",type:ke}),we=ke=>({name:"password",type:ke}),Ge=ke=>({name:"confirm password",type:ke});function Ke(ke,vn){if(1&ke){const Ie=T.RV6();T.j41(0,"div",17)(1,"div",18)(2,"div",19)(3,"app-input",20),T.bIt("valueChanged",function(vt){T.eBV(Ie);const Tt=T.XpG(2);return T.Njj(Tt.patchValue("email",vt))}),T.k0s()()(),T.j41(4,"div",18)(5,"div",19)(6,"app-input",20),T.bIt("valueChanged",function(vt){T.eBV(Ie);const Tt=T.XpG(2);return T.Njj(Tt.patchValue("password",vt))}),T.k0s()()(),T.j41(7,"div",18)(8,"div",19)(9,"app-input",20),T.bIt("valueChanged",function(vt){T.eBV(Ie);const Tt=T.XpG(2);return T.Njj(Tt.patchValue("confirmPassword",vt))}),T.k0s()()()()}if(2&ke){const Ie=T.XpG(2);T.R7$(3),T.Y8G("prop",T.eq3(3,Oe,Ie.PropType.Email)),T.R7$(3),T.Y8G("prop",T.eq3(5,we,Ie.PropType.Password)),T.R7$(3),T.Y8G("prop",T.eq3(7,Ge,Ie.PropType.Password))}}function Ve(ke,vn){if(1&ke){const Ie=T.RV6();T.j41(0,"div",5)(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"h1",10),T.EFF(6),T.k0s(),T.j41(7,"p",11),T.EFF(8," Welcome to your admin panel, please create your first admin account to continue. You can always change those values later. "),T.k0s(),T.DNE(9,Ke,10,9,"div",12),T.j41(10,"button",13),T.bIt("click",function(){T.eBV(Ie);const vt=T.XpG();return T.Njj(vt.submit())}),T.EFF(11," Login "),T.k0s()()()(),T.j41(12,"div",14)(13,"span",15),T.EFF(14,"Built with"),T.k0s(),T.nrm(15,"img",16),T.k0s()()()}if(2&ke){const Ie=T.XpG();T.R7$(6),T.SpI(" ",Ie.appName," "),T.R7$(3),T.Y8G("ngIf",Ie.form),T.R7$(),T.Y8G("disabled",!Ie.form.valid)}}const it=[{path:"login",component:Pe,canActivate:[pe]},{path:"logout",component:Ze},{path:"welcome",component:(()=>{class ke{constructor(Ie,Xe,vt,Tt){this.authService=Ie,this.router=Xe,this.flashMessageService=vt,this.manifestService=Tt,this.PropType=le.Kk}ngOnInit(){this.manifestService.getAppName().then(Ie=>{this.appName=Ie}),this.form=new fe.gE({email:new fe.MJ("",[fe.k0.required,fe.k0.email]),password:new fe.MJ("",[fe.k0.required]),confirmPassword:new fe.MJ("",[fe.k0.required,lt("password")])})}patchValue(Ie,Xe){this.form.get(Ie)?.patchValue(Xe)}submit(){var Ie=this;return(0,J.A)(function*(){if(!(yield Ie.authService.signup(Ie.form.value)))return Ie.flashMessageService.error("Error: Failed to register");Ie.flashMessageService.success("Welcome! You have successfully registered as an admin."),Ie.router.navigate(["/"])})()}static{this.\u0275fac=function(Xe){return new(Xe||ke)(T.rXU(de.u),T.rXU(W.Ix),T.rXU(Dt.L),T.rXU(oe.x))}}static{this.\u0275cmp=T.VBU({type:ke,selectors:[["app-register-first-admin"]],decls:5,vars:1,consts:[[1,"hero","is-fullheight"],[1,"hero-body"],[1,"container","has-text-centered"],[1,"columns"],["class","column col-welcome",4,"ngIf"],[1,"column","col-welcome"],[1,"register-wrap"],[1,"card","is-bordered"],[1,"card-content"],[1,"content"],[1,"is-size-3","has-text-weight-bold","my-3"],[1,"is-size-5"],["class","has-text-left",4,"ngIf"],[1,"button","is-block","is-dark","is-fullwidth","mb-0",3,"click","disabled"],[1,"is-flex","is-align-items-center","is-justify-content-flex-end","my-3"],[2,"margin-top","9px"],["src","/assets/images/logo.svg","alt","manifest logo","width","94",1,"ml-3"],[1,"has-text-left"],[1,"field","mb-5"],[1,"control"],[3,"valueChanged","prop"]],template:function(Xe,vt){1&Xe&&(T.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3),T.DNE(4,Ve,16,3,"div",4),T.k0s()()()()),2&Xe&&(T.R7$(4),T.Y8G("ngIf",vt.appName))},dependencies:[h.bT,_e.S],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.container[_ngcontent-%COMP%]{max-width:100%;width:100%}.hero.is-fullheight[_ngcontent-%COMP%]{min-height:calc(100vh - 64px)}.notification[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:auto;border-radius:0;bottom:unset}.col-welcome[_ngcontent-%COMP%]{position:fixed;display:flex;align-items:center;justify-content:center;background-color:#fff;left:0;top:0;height:100vh}.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{margin:auto}@media screen and (min-width: 1188px){.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:482px;min-width:382px}}@media screen and (min-width: 1000px){.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:360px}}@media screen and (min-width: 768px),print{.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{max-width:424px;min-width:320px}}@media screen and (max-width: 767px){.col-welcome[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:50%;max-width:380px}}.col-welcome[_ngcontent-%COMP%]{width:100vw}']})}}return ke})(),canActivate:[(()=>{class ke{constructor(Ie,Xe){this.authService=Ie,this.router=Xe}canActivate(){var Ie=this;return(0,J.A)(function*(){return!!(yield Ie.authService.isDbEmpty())||(Ie.router.navigate(["/auth/login"]),!1)})()}static{this.\u0275fac=function(Xe){return new(Xe||ke)(T.KVO(de.u),T.KVO(W.Ix))}}static{this.\u0275prov=T.jDH({token:ke,factory:ke.\u0275fac,providedIn:"root"})}}return ke})()]}];let et=(()=>{class ke{static{this.\u0275fac=function(Xe){return new(Xe||ke)}}static{this.\u0275mod=T.$C({type:ke})}static{this.\u0275inj=T.G2t({imports:[W.iI.forChild(it),W.iI]})}}return ke})(),tn=(()=>{class ke{static{this.\u0275fac=function(Xe){return new(Xe||ke)}}static{this.\u0275mod=T.$C({type:ke})}static{this.\u0275inj=T.G2t({imports:[h.MD,et,o.G]})}}return ke})()},7906:(Je,he,I)=>{I.d(he,{u:()=>Q});var h=I(7431),o=I(2410),W=I(8033),X=I(1467),T=I(6243),pe=I(8919),J=I(1968),fe=I(4385),le=I(9606),de=I(8284),oe=I(5640),_e=I(183),xe=I(818);let Q=(()=>{class ve{constructor(Pe,Ze,lt){this.http=Pe,this.router=Ze,this.flashMessageService=lt,this.currentUserSubject=new o.t(null),this.currentUser$=this.currentUserSubject.asObservable(),this.isUserLoaded=!1}login(Pe){var Ze=this;return(0,h.A)(function*(){return(0,W._)(Ze.http.post(`${le.c.apiBaseUrl}/auth/admins/login`,Pe)).then(lt=>{const Dt=lt?.token;return Dt&&localStorage.setItem(fe.il,Dt),Dt})})()}signup(Pe){var Ze=this;return(0,h.A)(function*(){return(0,W._)(Ze.http.post(`${le.c.apiBaseUrl}/auth/admins/signup`,Pe)).then(lt=>{const Dt=lt?.token;return Dt&&localStorage.setItem(fe.il,Dt),Dt})})()}logout(){this.currentUserSubject.next(null),localStorage.removeItem(fe.il),this.isUserLoaded=!1}isLoggedIn(){return!!this.currentUserSubject.value}loadCurrentUser(){return this.isUserLoaded?(0,X.of)(this.currentUserSubject.value):this.http.get(`${le.c.apiBaseUrl}/auth/admins/me`).pipe((0,T.M)(Pe=>{this.isUserLoaded=!0,this.currentUserSubject.next(Pe)}),(0,pe.W)(Pe=>(this.logout(),this.router.navigate(["/auth/login"]),this.flashMessageService.error("You must be logged in to view that page."),(0,J.$)(()=>Pe))))}getCurrentUserValue(){return this.currentUserSubject.value}isDefaultAdminExists(){var Pe=this;return(0,h.A)(function*(){return(0,W._)(Pe.http.get(`${le.c.apiBaseUrl}/auth/admins/default-exists`)).then(Ze=>Ze.exists)})()}isDbEmpty(){var Pe=this;return(0,h.A)(function*(){return(0,W._)(Pe.http.get(`${le.c.apiBaseUrl}/db/is-db-empty`)).then(Ze=>Ze.empty)})()}static{this.\u0275fac=function(Ze){return new(Ze||ve)(de.KVO(oe.Qq),de.KVO(_e.Ix),de.KVO(xe.L))}}static{this.\u0275prov=de.jDH({token:ve,factory:ve.\u0275fac,providedIn:"root"})}}return ve})()},6119:(Je,he,I)=>{I.d(he,{m:()=>T});var h=I(8033),o=I(9606),W=I(8284),X=I(5640);let T=(()=>{class pe{constructor(fe){this.http=fe,this.collectionBaseUrl=o.c.apiBaseUrl+"/collections",this.singleBaseUrl=o.c.apiBaseUrl+"/singles"}list(fe,le){const de={page:le.filters?.page||1,perPage:20};return Object.keys(le.filters||{}).forEach(oe=>{"page"!==oe&&(de[`${oe}_eq`]=le.filters[oe])}),le.relations&&(de.relations=le.relations.join(",")),(0,h._)(this.http.get(`${this.collectionBaseUrl}/${fe}`,{params:de}))}listSelectOptions(fe){return(0,h._)(this.http.get(`${this.collectionBaseUrl}/${fe}/select-options`))}show(fe,le,de){return(0,h._)(this.http.get(`${this.collectionBaseUrl}/${fe}/${le}`,{params:{relations:de?.relations?.join(",")}}))}showSingle(fe){return(0,h._)(this.http.get(`${this.singleBaseUrl}/${fe}`))}create(fe,le){return(0,h._)(this.http.post(`${this.collectionBaseUrl}/${fe}`,le))}update(fe,le,de){return(0,h._)(this.http.put(`${this.collectionBaseUrl}/${fe}/${le}`,de))}updateSingle(fe,le){return(0,h._)(this.http.put(`${this.singleBaseUrl}/${fe}`,le))}delete(fe,le){return(0,h._)(this.http.delete(`${this.collectionBaseUrl}/${fe}/${le}`))}static{this.\u0275fac=function(le){return new(le||pe)(W.KVO(X.Qq))}}static{this.\u0275prov=W.jDH({token:pe,factory:pe.\u0275fac,providedIn:"root"})}}return pe})()},8428:(Je,he,I)=>{I.d(he,{S:()=>wr});var h=I(2943),o=I(8284),W=I(5442);const X=R=>({"is-danger":R}),T=R=>({"is-checked":R});function pe(R,te){if(1&R&&(o.j41(0,"p",5),o.EFF(1),o.k0s()),2&R){const C=o.XpG();o.R7$(),o.JRh(C.helpText)}}let J=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnChanges(C){this.checked=!!this.value}toggleCheck(){this.checked=!this.checked,this.valueChanged.emit(this.checked)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-boolean-input"]],inputs:{prop:"prop",value:"value",helpText:"helpText",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.OA$,o.aNF],decls:6,vars:8,consts:[["input",""],[1,"control","mt-7","mb-4"],["for","",1,"checkbox",3,"click","ngClass"],[1,"checkmark"],["class","help",4,"ngIf"],[1,"help"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"div",1)(1,"label",2,0),o.bIt("click",function(){return o.eBV(z),o.Njj(O.toggleCheck())}),o.EFF(3),o.nrm(4,"span",3),o.k0s(),o.DNE(5,pe,2,1,"p",4),o.k0s()}2&S&&(o.R7$(),o.Y8G("ngClass",o.eq3(4,X,O.isError))("ngClass",o.eq3(6,T,O.checked)),o.R7$(2),o.SpI("",O.prop.name," "),o.R7$(2),o.Y8G("ngIf",O.helpText))},dependencies:[h.YU,h.bT]})}}return R})();const fe=["input"],le=R=>({"is-danger":R});let de=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.symbol=(0,h.Qn)(this.currency||"USD","wide"),void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(Number(C.target.value))}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-currency-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(fe,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",currency:"currency",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:8,vars:6,consts:[["input",""],[3,"for"],[1,"control","has-icons-left"],[1,"icon","is-small","is-left"],[1,"is-family-sans-serif"],["type","number","step","0.01",1,"input",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"p",2)(3,"span",3)(4,"span",4),o.EFF(5),o.k0s()(),o.j41(6,"input",5,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(4),o.SpI(" ",O.symbol," "),o.R7$(),o.Y8G("ngClass",o.eq3(4,le,O.isError)))},dependencies:[h.YU]})}}return R})();const oe=["input"],_e=R=>({"is-danger":R});let xe=(()=>{class R{constructor(){this.valueChanged=new o.bkB,this.today=Date.now()}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-date-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(oe,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:6,consts:[["input",""],[3,"for"],["type","date",1,"input",3,"change","ngClass","value"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,_e,O.isError))("value",O.value?O.value:O.today))},dependencies:[h.YU]})}}return R})();const Q=["input"],ve=R=>({"is-danger":R});let He=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-email-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(Q,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","email","placeholder","Email...","autocomplete","email",1,"input",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,ve,O.isError)))},dependencies:[h.YU]})}}return R})();const Pe=["latInput"],Ze=["lngInput"],lt=R=>({"is-danger":R});let Dt=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.latInput.nativeElement.value=this.value?.lat,this.lngInput.nativeElement.value=this.value?.lng)}onChange(){this.valueChanged.emit({lat:this.latInput.nativeElement.value,lng:this.lngInput.nativeElement.value})}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-location-input"]],viewQuery:function(S,O){if(1&S&&(o.GBs(Pe,7),o.GBs(Ze,7)),2&S){let z;o.mGM(z=o.lsd())&&(O.latInput=z.first),o.mGM(z=o.lsd())&&(O.lngInput=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:21,vars:7,consts:[["latInput",""],["lngInput",""],["for",""],[1,"columns","is-mobile"],[1,"column"],[1,"field"],["for","lat-input"],[1,"control","has-icons-left"],[1,"icon","is-small","is-left"],[1,"icon","icon-map-pin"],["type","number","step","0.0001","min","-90","max","90",1,"input","form-control",3,"change","ngClass"],["for","lng-input"],["type","number","step","0.0001","min","-180","max","180",1,"input","form-control",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",2),o.EFF(1),o.k0s(),o.j41(2,"div",3)(3,"div",4)(4,"div",5)(5,"label",6),o.EFF(6,"Latitude"),o.k0s(),o.j41(7,"p",7)(8,"span",8),o.nrm(9,"i",9),o.k0s(),o.j41(10,"input",10,0),o.bIt("change",function(){return o.eBV(z),o.Njj(O.onChange())}),o.k0s()()()(),o.j41(12,"div",4)(13,"div",5)(14,"label",11),o.EFF(15,"Longitude"),o.k0s(),o.j41(16,"p",7)(17,"span",8),o.nrm(18,"i",9),o.k0s(),o.j41(19,"input",12,1),o.bIt("change",function(){return o.eBV(z),o.Njj(O.onChange())}),o.k0s()()()()()}2&S&&(o.R7$(),o.JRh(O.prop.name),o.R7$(9),o.Y8G("ngClass",o.eq3(3,lt,O.isError)),o.R7$(9),o.Y8G("ngClass",o.eq3(5,lt,O.isError)))},dependencies:[h.YU],styles:["label[for=lat-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label), label[for=lng-input][_ngcontent-%COMP%]:not(.file-label):not(.checkbox):not(.image-label){text-transform:unset}"]})}}return R})();var Oe=I(7431),we=I(2283),Ge=I(6119);const Ke=R=>({"is-danger":R}),Ve=R=>({"is-checked":R});function je(R,te){if(1&R&&o.EFF(0),2&R){const C=o.XpG(2);o.SpI("No ",C.entityManifest.nameSingular," selected")}}function Ye(R,te){if(1&R&&o.EFF(0),2&R){const C=o.XpG(2);o.SpI("1 ",C.entityManifest.nameSingular," selected")}}function it(R,te){if(1&R&&o.EFF(0),2&R){const C=o.XpG(2);o.Lme("",C.selectedOptions.length," ",C.entityManifest.namePlural," selected ")}}function et(R,te){if(1&R&&(o.qex(0,6),o.DNE(1,je,1,1,"ng-template",7)(2,Ye,1,1,"ng-template",8)(3,it,1,2,"ng-template",9),o.bVm()),2&R){const C=o.XpG();o.Y8G("ngPlural",C.selectedOptions.length)}}function tn(R,te){if(1&R){const C=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(C);const O=o.XpG(2);return o.Njj(O.selectAll())}),o.EFF(1,"Select all"),o.k0s()}}function ke(R,te){if(1&R){const C=o.RV6();o.j41(0,"a",14),o.bIt("click",function(){o.eBV(C);const O=o.XpG(2);return o.Njj(O.selectNone())}),o.EFF(1,"Select none"),o.k0s()}}function vn(R,te){if(1&R){const C=o.RV6();o.j41(0,"div",15)(1,"label",16),o.bIt("click",function(){const O=o.eBV(C).$implicit,z=o.XpG(2);return o.Njj(z.toggleSelected(O))}),o.EFF(2),o.nrm(3,"span",17),o.k0s()()}if(2&R){const C=te.$implicit;o.R7$(),o.Y8G("ngClass",o.eq3(2,Ve,C.selected)),o.R7$(),o.SpI(" ",C.label," ")}}function Ie(R,te){if(1&R&&(o.j41(0,"div",10)(1,"p",11),o.DNE(2,tn,2,0,"a",12)(3,ke,2,0,"a",12),o.k0s(),o.DNE(4,vn,4,4,"div",13),o.k0s()),2&R){const C=o.XpG();o.Y8G("ngClass",o.eq3(4,Ke,C.isError)),o.R7$(2),o.Y8G("ngIf",C.selectedOptions.length<C.options.length),o.R7$(),o.Y8G("ngIf",C.selectedOptions.length===C.options.length),o.R7$(),o.Y8G("ngForOf",C.options)}}let Xe=(()=>{class R{constructor(C,S,O){this.manifestService=C,this.crudService=S,this.elementRef=O,this.valueChanged=new o.bkB,this.selectedOptions=[]}ngOnInit(){var C=this;return(0,Oe.A)(function*(){C.label=C.prop?.name||C.relationship.name,C.relationship&&(C.entityManifest=yield C.manifestService.getEntityManifest({className:C.relationship.entity}),C.options=yield C.crudService.listSelectOptions(C.entityManifest.slug)),C.value&&(C.selectedOptions=[],C.options.filter(S=>C.value.map(O=>O.id).find(O=>O===S.id)).forEach(S=>{S.selected=!0,C.selectedOptions.push(S)}))})()}selectAll(){this.options.forEach(C=>C.selected=!0),this.selectedOptions=this.options,this.valueChanged.emit(this.selectedOptions.map(C=>C.id))}selectNone(){this.options.forEach(C=>C.selected=!1),this.selectedOptions=[],this.valueChanged.emit([])}toggleSelected(C){const S=this.selectedOptions.findIndex(O=>O.id===C.id);S>-1?this.selectedOptions.splice(S,1):this.selectedOptions.push(C),C.selected=!C.selected,this.valueChanged.emit(this.selectedOptions.map(O=>O.id))}clickOut(C){this.showList&&!this.elementRef.nativeElement.contains(C)&&!C.className.includes("mass-selection-button")&&(this.showList=!1)}static{this.\u0275fac=function(S){return new(S||R)(o.rXU(we.x),o.rXU(Ge.m),o.rXU(o.aKT))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-multi-select-input"]],hostBindings:function(S,O){1&S&&o.bIt("click",function(Se){return O.clickOut(Se.target)},!1,o.EBC)},inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:7,vars:3,consts:[[1,"multiselect-box"],[1,"control"],[3,"click"],[1,"select","select--simulate",3,"click"],[3,"ngPlural",4,"ngIf"],["class","box",3,"ngClass",4,"ngIf"],[3,"ngPlural"],["ngPluralCase","=0"],["ngPluralCase","=1"],["ngPluralCase","other"],[1,"box",3,"ngClass"],[1,"pb-2","px-4"],["class","small-meta mass-selection-button has-text-grey-dark is-underlined is-inline-block is-fullwidth",3,"click",4,"ngIf"],["class","control px-4 py-1 is-fullwidth",4,"ngFor","ngForOf"],[1,"small-meta","mass-selection-button","has-text-grey-dark","is-underlined","is-inline-block","is-fullwidth",3,"click"],[1,"control","px-4","py-1","is-fullwidth"],[1,"checkbox",3,"click","ngClass"],[1,"checkmark"]],template:function(S,O){1&S&&(o.j41(0,"div",0)(1,"div",1)(2,"label",2),o.bIt("click",function(){return O.showList=!0}),o.EFF(3),o.k0s(),o.j41(4,"div",3),o.bIt("click",function(){return O.showList=!O.showList}),o.DNE(5,et,4,1,"ng-container",4),o.k0s(),o.DNE(6,Ie,5,6,"div",5),o.k0s()()),2&S&&(o.R7$(3),o.SpI("",O.label," "),o.R7$(2),o.Y8G("ngIf",O.entityManifest),o.R7$(),o.Y8G("ngIf",O.showList&&(null==O.options?null:O.options.length)))},dependencies:[h.MD,h.YU,h.Sq,h.bT,h.IJ,h.WO],styles:[".is-disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]})}}return R})();const vt=["input"],Tt=R=>({"is-danger":R});let Fn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(Number(C.target.value))}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-number-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(vt,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","number","step","1",1,"input","form-control",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Tt,O.isError)))},dependencies:[h.YU]})}}return R})();const ne=["input"],re=R=>({"is-danger":R});let ue=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-password-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(ne,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["placeholder","Password...","type","password","autocomplete","current-password",1,"input","form-control",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,re,O.isError)))},dependencies:[h.YU]})}}return R})();var ee=I(9911);const Me=R=>({"is-danger":R});function Te(R,te){if(1&R&&(o.j41(0,"option",7),o.EFF(1),o.k0s()),2&R){const C=te.$implicit;o.Y8G("value",C.id),o.R7$(),o.SpI(" ",C.label," ")}}let nt=(()=>{class R{constructor(C,S,O){this.manifestService=C,this.crudService=S,this.formBuilder=O,this.valueChanged=new o.bkB,this.form=this.formBuilder.group({select:null})}ngOnInit(){var C=this;return(0,Oe.A)(function*(){C.label=C.prop?.name||C.relationship.name,C.relationship?(C.entityManifest=yield C.manifestService.getEntityManifest({className:C.relationship.entity}),C.options=yield C.crudService.listSelectOptions(C.entityManifest.slug)):C.prop.type===W.Kk.Choice&&(C.options=(C.prop.options?.values||[]).map(S=>({id:S,label:S}))),C.value&&C.form.patchValue({select:C.relationship?C.value.id:C.value})})()}onChange(C){if(""===C.target.value)return this.form.patchValue({select:null}),void this.valueChanged.emit(null);this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)(o.rXU(we.x),o.rXU(Ge.m),o.rXU(ee.ok))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-select-input"]],inputs:{prop:"prop",relationship:"relationship",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:9,vars:8,consts:[[3,"formGroup"],[3,"for"],[1,"control"],[1,"select",3,"ngClass"],["formControlName","select",1,"is-fullwidth",3,"change"],["value",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(S,O){1&S&&(o.j41(0,"div",0)(1,"label",1),o.EFF(2),o.k0s(),o.j41(3,"div",2)(4,"div",3)(5,"select",4),o.bIt("change",function(Se){return O.onChange(Se)}),o.j41(6,"option",5),o.EFF(7),o.k0s(),o.DNE(8,Te,2,2,"option",6),o.k0s()()()()),2&S&&(o.Y8G("formGroup",O.form),o.R7$(),o.Y8G("for",O.label),o.R7$(),o.JRh(O.label),o.R7$(2),o.Y8G("ngClass",o.eq3(6,Me,O.isError)),o.R7$(3),o.SpI("Select ",O.label,"..."),o.R7$(),o.Y8G("ngForOf",O.options))},dependencies:[ee.X1,ee.xH,ee.y7,ee.wz,ee.BC,ee.cb,ee.j4,ee.JD,h.YU,h.pM]})}}return R})();const xt=["input"],Zt=R=>({"is-danger":R});let dt=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-text-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(xt,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","text",1,"input","form-control",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Zt,O.isError)))},dependencies:[h.YU]})}}return R})();const Ut=["input"],qe=R=>({"is-danger":R});let cn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-textarea-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(Ut,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:6,consts:[["input",""],[3,"for"],[1,"textarea",3,"change","ngClass","name"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"textarea",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.EFF(4," "),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(4,qe,O.isError))("name",O.prop.name))},dependencies:[h.YU]})}}return R})();const Bt=["input"],Pt=R=>({"is-danger":R});let on=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){void 0!==this.value&&(this.input.nativeElement.value=this.value)}onChange(C){this.valueChanged.emit(C.target.value)}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-url-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(Bt,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","url","placeholder","https://example.com",1,"input","form-control",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Pt,O.isError)))},dependencies:[h.YU]})}}return R})();const Ne=["input"],Et=R=>({"is-danger":R});let yn=(()=>{class R{constructor(){this.valueChanged=new o.bkB}ngOnInit(){this.input.nativeElement.value=null!==this.value?new Date(this.value).toISOString().replace("T"," ").substring(0,19):""}onChange(C){this.valueChanged.emit(new Date(C.target.value))}static{this.\u0275fac=function(S){return new(S||R)}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-timestamp-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(Ne,7),2&S){let z;o.mGM(z=o.lsd())&&(O.input=z.first)}},inputs:{prop:"prop",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:4,vars:5,consts:[["input",""],[3,"for"],["type","datetime-local",1,"input",3,"change","ngClass"]],template:function(S,O){if(1&S){const z=o.RV6();o.j41(0,"label",1),o.EFF(1),o.k0s(),o.j41(2,"input",2,0),o.bIt("change",function(rt){return o.eBV(z),o.Njj(O.onChange(rt))}),o.k0s()}2&S&&(o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngClass",o.eq3(3,Et,O.isError)))},dependencies:[h.YU],encapsulation:2})}}return R})();var ar=I(8033),Fr=I(9606),vr=I(5640);let kn=(()=>{class R{constructor(C){this.http=C}uploadImage({entity:C,property:S,fileContent:O}){return this.upload({type:"image",entity:C,property:S,fileContent:O})}uploadFile(C){var S=this;return(0,Oe.A)(function*({entity:O,property:z,fileContent:Se}){return S.upload({type:"file",entity:O,property:z,fileContent:Se})}).apply(this,arguments)}upload(C){var S=this;return(0,Oe.A)(function*({type:O,entity:z,property:Se,fileContent:rt}){const Ot=new FormData;return Ot.append(O,rt),Ot.append("entity",z),Ot.append("property",Se),(0,ar._)(S.http.post(`${Fr.c.apiBaseUrl}/upload/${O}`,Ot)).catch(an=>{throw new Error(an.error.message)})}).apply(this,arguments)}static{this.\u0275fac=function(S){return new(S||R)(o.KVO(vr.Qq))}}static{this.\u0275prov=o.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})();var ft=I(818);const wt=["fileInput"],Xn=R=>({"show-errors":R});function q(R,te){1&R&&(o.j41(0,"span",10)(1,"span",11),o.nrm(2,"i",12),o.k0s(),o.j41(3,"span",6),o.EFF(4," Upload file... "),o.k0s()())}function pt(R,te){1&R&&(o.j41(0,"button",13),o.EFF(1," Loading "),o.k0s())}function K(R,te){if(1&R){const C=o.RV6();o.j41(0,"div")(1,"div",5)(2,"label",6)(3,"input",7,0),o.bIt("change",function(){o.eBV(C);const O=o.XpG();return o.Njj(O.onFileInputEvent())}),o.k0s(),o.DNE(5,q,5,0,"span",8)(6,pt,2,0,"button",9),o.k0s()()()}if(2&R){const C=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,Xn,C.isError)),o.R7$(4),o.Y8G("ngIf",!C.loading),o.R7$(),o.Y8G("ngIf",C.loading)}}function ge(R,te){if(1&R){const C=o.RV6();o.j41(0,"div",14)(1,"a",15),o.EFF(2),o.k0s(),o.j41(3,"span",16)(4,"a",17),o.bIt("click",function(){o.eBV(C);const O=o.XpG();return o.Njj(O.removeFile())}),o.nrm(5,"i",18),o.k0s()()()}if(2&R){const C=o.XpG();o.R7$(),o.Y8G("href",C.value,o.B4B),o.R7$(),o.SpI(" ",C.value," ")}}let We=(()=>{class R{constructor(C,S){this.uploadService=C,this.flashMessageService=S,this.valueChanged=new o.bkB}onFileInputEvent(){var C=this;return(0,Oe.A)(function*(){return C.loading=!0,C.uploadService.uploadFile({entity:C.entitySlug,property:C.prop.name,fileContent:C.fileInputEl.nativeElement.files.item(0)}).then(S=>{C.loading=!1,C.value=S.path,C.valueChanged.emit(C.value)},S=>{C.loading=!1,C.flashMessageService.error("There was an error uploading your file.")})})()}removeFile(){delete this.value,this.valueChanged.emit(null)}static{this.\u0275fac=function(S){return new(S||R)(o.rXU(kn),o.rXU(ft.L))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-file-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(wt,5),2&S){let z;o.mGM(z=o.lsd())&&(O.fileInputEl=z.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["fileInput",""],[1,"control"],[3,"for"],[4,"ngIf"],["class","has-current-file is-flex is-justify-content-space-between is-align-items-center mt-1 has-background-white-ter pl-1",4,"ngIf"],[1,"file",3,"ngClass"],[1,"file-label"],["type","file",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"button","is-link","is-loading"],[1,"has-current-file","is-flex","is-justify-content-space-between","is-align-items-center","mt-1","has-background-white-ter","pl-1"],["target","_blank",3,"href"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(S,O){1&S&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,K,7,5,"div",3)(4,ge,6,2,"div",4),o.k0s()),2&S&&(o.R7$(),o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngIf",!O.value),o.R7$(),o.Y8G("ngIf",O.value))},dependencies:[h.bT,h.YU],encapsulation:2})}}return R})();var Be=I(7563);const Ct=["imageInput"],gt=R=>({"show-errors":R});function Gt(R,te){1&R&&(o.j41(0,"span",11)(1,"span",12),o.nrm(2,"i",13),o.k0s(),o.j41(3,"span",14),o.EFF(4," Upload image..."),o.k0s()())}function Qn(R,te){1&R&&(o.j41(0,"button",15),o.EFF(1," Loading "),o.k0s())}function gn(R,te){if(1&R){const C=o.RV6();o.j41(0,"div",5)(1,"div",6)(2,"label",7)(3,"input",8,0),o.bIt("change",function(){o.eBV(C);const O=o.XpG();return o.Njj(O.imageInputEvent())}),o.k0s(),o.DNE(5,Gt,5,0,"span",9)(6,Qn,2,0,"button",10),o.k0s()()()}if(2&R){const C=o.XpG();o.R7$(),o.Y8G("ngClass",o.eq3(3,gt,C.isError)),o.R7$(4),o.Y8G("ngIf",!C.loading),o.R7$(),o.Y8G("ngIf",C.loading)}}function Ln(R,te){if(1&R){const C=o.RV6();o.j41(0,"div",16),o.nrm(1,"img",17),o.j41(2,"span",18)(3,"a",19),o.bIt("click",function(){o.eBV(C);const O=o.XpG();return o.Njj(O.removeFile())}),o.nrm(4,"i",20),o.k0s()()()}if(2&R){const C=o.XpG();o.R7$(),o.Y8G("src",C.displayedImage,o.B4B)}}let oi=(()=>{class R{constructor(C,S){this.uploadService=C,this.flashMessageService=S,this.valueChanged=new o.bkB}ngOnInit(){if(this.value){const C=(0,Be.Gj)(this.prop.options?.sizes);this.displayedImage=this.value[C]}}imageInputEvent(){this.loading=!0,this.uploadService.uploadImage({entity:this.entitySlug,property:this.prop.name,fileContent:this.imageInputEl.nativeElement.files.item(0)}).then(C=>{this.loading=!1,this.value=C,setTimeout(()=>{this.displayedImage=C[Object.keys(C)[0]],this.valueChanged.emit(this.value)},100)},C=>{this.loading=!1,this.flashMessageService.error("There was an error uploading your image.")})}removeFile(){delete this.value,delete this.displayedImage,this.valueChanged.emit(null)}static{this.\u0275fac=function(S){return new(S||R)(o.rXU(kn),o.rXU(ft.L))}}static{this.\u0275cmp=o.VBU({type:R,selectors:[["app-image-input"]],viewQuery:function(S,O){if(1&S&&o.GBs(Ct,5),2&S){let z;o.mGM(z=o.lsd())&&(O.imageInputEl=z.first)}},inputs:{prop:"prop",entitySlug:"entitySlug",value:"value",isError:"isError"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[o.aNF],decls:5,vars:4,consts:[["imageInput",""],[1,"control"],[3,"for"],["class","image",4,"ngIf"],["class","has-current-file is-flex is-align-items-center is-justify-content-space-between mt-1 has-background-white-ter pl-1 py-1",4,"ngIf"],[1,"image"],[1,"file",3,"ngClass"],[1,"image-label"],["type","file","accept","image/*",1,"file-input",3,"change"],["class","file-cta",4,"ngIf"],["class","button is-link is-loading full-width",4,"ngIf"],[1,"file-cta"],[1,"file-icon"],[1,"icon","icon-upload-cloud","is-size-5"],[1,"file-label"],[1,"button","is-link","is-loading","full-width"],[1,"has-current-file","is-flex","is-align-items-center","is-justify-content-space-between","mt-1","has-background-white-ter","pl-1","py-1"],[3,"src"],[1,"file-cta","file-remove"],[3,"click"],[1,"icon","icon-x","is-size-5"]],template:function(S,O){1&S&&(o.j41(0,"div",1)(1,"label",2),o.EFF(2),o.k0s(),o.DNE(3,gn,7,5,"div",3)(4,Ln,5,1,"div",4),o.k0s()),2&S&&(o.R7$(),o.Y8G("for",O.prop.name),o.R7$(),o.JRh(O.prop.name),o.R7$(),o.Y8G("ngIf",!O.value),o.R7$(),o.Y8G("ngIf",O.displayedImage))},dependencies:[h.bT,h.YU],encapsulation:2})}}return R})();const Qr={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"],["table"]]},Yn=new o.nKC("config",{providedIn:"root",factory:()=>({modules:Qr})});var F=I(7711),$=I(7787),Ee=I(5719);
/**
* @license Angular v17.3.12
* (c) 2010-2024 Google LLC. https://angular.io/
* License: MIT
*/function $e(R){R||((0,o.Af3)($e),R=(0,o.WQX)(o.abz));const te=new $.c(C=>R.onDestroy(C.next.bind(C)));return C=>C.pipe((0,Ee.Q)(te))}var Mn=I(6852),yr=I(7624),Mi=I(7233),Vi=I(7412),Tn=I(3575),at=I(5271),Ar=I(2097),Cr=I(7236);const kr=["addListener","removeListener"],Lr=["addEventListener","removeEventListener"],br=["on","off"];function Mt(R,te,C,S){if((0,Ar.T)(C)&&(S=C,C=void 0),S)return Mt(R,te,C).pipe((0,Cr.I)(S));const[O,z]=function ur(R){return(0,Ar.T)(R.addEventListener)&&(0,Ar.T)(R.removeEventListener)}(R)?Lr.map(Se=>rt=>R[Se](te,rt,C)):function Vr(R){return(0,Ar.T)(R.addListener)&&(0,Ar.T)(R.removeListener)}(R)?kr.map(Yr(R,te)):function _r(R){return(0,Ar.T)(R.on)&&(0,Ar.T)(R.off)}(R)?br.map(Yr(R,te)):[];if(!O&&(0,at.X)(R))return(0,Tn.Z)(Se=>Mt(Se,te,C))((0,Vi.Tg)(R));if(!O)throw new TypeError("Invalid event target");return new $.c(Se=>{const rt=(...Ot)=>Se.next(1<Ot.length?Ot:Ot[0]);return O(rt),()=>z(rt)})}function Yr(R,te){return C=>S=>R[C](te,S)}var cr=I(1087);const jr={now:()=>(jr.delegate||Date).now(),delegate:void 0};class Ur extends cr.B{constructor(te=1/0,C=1/0,S=jr){super(),this._bufferSize=te,this._windowTime=C,this._timestampProvider=S,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=C===1/0,this._bufferSize=Math.max(1,te),this._windowTime=Math.max(1,C)}next(te){const{isStopped:C,_buffer:S,_infiniteTimeWindow:O,_timestampProvider:z,_windowTime:Se}=this;C||(S.push(te),!O&&S.push(z.now()+Se)),this._trimBuffer(),super.next(te)}_subscribe(te){this._throwIfClosed(),this._trimBuffer();const C=this._innerSubscribe(te),{_infiniteTimeWindow:S,_buffer:O}=this,z=O.slice();for(let Se=0;Se<z.length&&!te.closed;Se+=S?1:2)te.next(z[Se]);return this._checkFinalizedStatuses(te),C}_trimBuffer(){const{_bufferSize:te,_timestampProvider:C,_buffer:S,_infiniteTimeWindow:O}=this,z=(O?1:2)*te;if(te<1/0&&z<S.length&&S.splice(0,S.length-z),!O){const Se=C.now();let rt=0;for(let Ot=1;Ot<S.length&&S[Ot]<=Se;Ot+=2)rt=Ot;rt&&S.splice(0,rt+1)}}}var P=I(3173),V=I(1524);function me(R,te,...C){if(!0===te)return void R();if(!1===te)return;const S=new P.Ms({next:()=>{S.unsubscribe(),R()}});return(0,Vi.Tg)(te(...C)).subscribe(S)}class Fe extends Mi.yU{constructor(te,C){super()}schedule(te,C=0){return this}}const Le={setInterval(R,te,...C){const{delegate:S}=Le;return S?.setInterval?S.setInterval(R,te,...C):setInterval(R,te,...C)},clearInterval(R){const{delegate:te}=Le;return(te?.clearInterval||clearInterval)(R)},delegate:void 0};var yt=I(2070);class zt{constructor(te,C=zt.now){this.schedulerActionCtor=te,this.now=C}schedule(te,C=0,S){return new this.schedulerActionCtor(this,te).schedule(S,C)}}zt.now=jr.now;const Wt=new class En extends zt{constructor(te,C=zt.now){super(te,C),this.actions=[],this._active=!1}flush(te){const{actions:C}=this;if(this._active)return void C.push(te);let S;this._active=!0;do{if(S=te.execute(te.state,te.delay))break}while(te=C.shift());if(this._active=!1,S){for(;te=C.shift();)te.unsubscribe();throw S}}}(class ot extends Fe{constructor(te,C){super(te,C),this.scheduler=te,this.work=C,this.pending=!1}schedule(te,C=0){var S;if(this.closed)return this;this.state=te;const O=this.id,z=this.scheduler;return null!=O&&(this.id=this.recycleAsyncId(z,O,C)),this.pending=!0,this.delay=C,this.id=null!==(S=this.id)&&void 0!==S?S:this.requestAsyncId(z,this.id,C),this}requestAsyncId(te,C,S=0){return Le.setInterval(te.flush.bind(te,this),S)}recycleAsyncId(te,C,S=0){if(null!=S&&this.delay===S&&!1===this.pending)return C;null!=C&&Le.clearInterval(C)}execute(te,C){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const S=this._execute(te,C);if(S)return S;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(te,C){let O,S=!1;try{this.work(te)}catch(z){S=!0,O=z||new Error("Scheduled action threw falsy error")}if(S)return this.unsubscribe(),O}unsubscribe(){if(!this.closed){const{id:te,scheduler:C}=this,{actions:S}=C;this.work=this.state=this.scheduler=null,this.pending=!1,(0,yt.o)(S,this),null!=te&&(this.id=this.recycleAsyncId(C,te,null)),this.delay=null,super.unsubscribe()}}});var Vn=I(5510);function ct(R,te=Wt){return(0,V.N)((C,S)=>{let O=null,z=null,Se=null;const rt=()=>{if(O){O.unsubscribe(),O=null;const an=z;z=null,S.next(an)}};function Ot(){const an=Se+R,Wn=te.now();if(Wn<an)return O=this.schedule(void 0,an-Wn),void S.add(O);rt()}C.subscribe((0,Vn._)(S,an=>{z=an,Se=te.now(),O||(O=te.schedule(Ot,R),S.add(O))},()=>{rt(),S.complete()},void 0,()=>{z=O=null}))})}const mt=[[["","above-quill-editor-toolbar",""]],[["","quill-editor-toolbar",""]],[["","below-quill-editor-toolbar",""]]],Ft=["[above-quill-editor-toolbar]","[quill-editor-toolbar]","[below-quill-editor-toolbar]"];function en(R,te){1&R&&o.nrm(0,"div",0)}function dn(R,te){1&R&&o.nrm(0,"div",0)}const Kt=(R,te)=>R||te||"html";let jn=(()=>{class R{constructor(C,S){var O=this;this.config=S,this.quill$=(0,Mn.v)((0,Oe.A)(function*(){if(!O.Quill){const z=O.document.addEventListener;O.document.addEventListener=O.document.__zone_symbol__addEventListener||O.document.addEventListener;const Se=yield I.e(256).then(I.bind(I,256));O.document.addEventListener=z,O.Quill=Se.default?.default??Se.default??Se}return O.config.customOptions?.forEach(z=>{const Se=O.Quill.import(z.import);Se.whitelist=z.whitelist,O.Quill.register(Se,!0,O.config.suppressGlobalRegisterWarning)}),yield O.registerCustomModules(O.Quill,O.config.customModules,O.config.suppressGlobalRegisterWarning)})).pipe(function ce(R,te,C){let S,O=!1;return R&&"object"==typeof R?({bufferSize:S=1/0,windowTime:te=1/0,refCount:O=!1,scheduler:C}=R):S=R??1/0,function j(R={}){const{connector:te=(()=>new cr.B),resetOnError:C=!0,resetOnComplete:S=!0,resetOnRefCountZero:O=!0}=R;return z=>{let Se,rt,Ot,an=0,Wn=!1,Rn=!1;const Bn=()=>{rt?.unsubscribe(),rt=void 0},Zn=()=>{Bn(),Se=Ot=void 0,Wn=Rn=!1},$r=()=>{const Jn=Se;Zn(),Jn?.unsubscribe()};return(0,V.N)((Jn,Ai)=>{an++,!Rn&&!Wn&&Bn();const bn=Ot=Ot??te();Ai.add(()=>{an--,0===an&&!Rn&&!Wn&&(rt=me($r,O))}),bn.subscribe(Ai),!Se&&an>0&&(Se=new P.Ms({next:$n=>bn.next($n),error:$n=>{Rn=!0,Bn(),rt=me(Zn,C,$n),bn.error($n)},complete:()=>{Wn=!0,Bn(),rt=me(Zn,S),bn.complete()}}),(0,Vi.Tg)(Jn).subscribe(Se))})(z)}}({connector:()=>new Ur(S,te,C),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:O})}({bufferSize:1,refCount:!0})),this.document=C.get(h.qQ),this.config||(this.config={modules:Qr})}getQuill(){return this.quill$}registerCustomModules(C,S,O){return(0,Oe.A)(function*(){if(Array.isArray(S))for(let{implementation:z,path:Se}of S)(0,yr.A)(z)&&(z=yield(0,ar._)(z)),C.register(Se,z,O);return C})()}static{this.\u0275fac=function(S){return new(S||R)(o.KVO(o.zZn),o.KVO(Yn,8))}}static{this.\u0275prov=o.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})}}return R})(),Gn=(()=>{class R{constructor(){this.format=(0,o.hFB)(void 0),this.theme=(0,o.hFB)(void 0),this.modules=(0,o.hFB)(void 0),this.debug=(0,o.hFB)(!1),this.readOnly=(0,o.hFB)(!1),this.placeholder=(0,o.hFB)(void 0),this.maxLength=(0,o.hFB)(void 0),this.minLength=(0,o.hFB)(void 0),this.required=(0,o.hFB)(!1),this.formats=(0,o.hFB)(void 0),this.customToolbarPosition=(0,o.hFB)("top"),this.sanitize=(0,o.hFB)(!1),this.beforeRender=(0,o.hFB)(void 0),this.styles=(0,o.hFB)(null),this.registry=(0,o.hFB)(void 0),this.bounds=(0,o.hFB)(void 0),this.customOptions=(0,o.hFB)([]),this.customModules=(0,o.hFB)([]),this.trackChanges=(0,o.hFB)(void 0),this.classes=(0,o.hFB)(void 0),this.trimOnValidation=(0,o.hFB)(!1),this.linkPlaceholder=(0,o.hFB)(void 0),this.compareValues=(0,o.hFB)(!1),this.filterNull=(0,o.hFB)(!1),this.debounceTime=(0,o.hFB)(void 0),this.defaultEmptyValue=(0,o.hFB)(null),this.onEditorCreated=new o.bkB,this.onEditorChanged=new o.bkB,this.onContentChanged=new o.bkB,this.onSelectionChanged=new o.bkB,this.onFocus=new o.bkB,this.onBlur=new o.bkB,this.onNativeFocus=new o.bkB,this.onNativeBlur=new o.bkB,this.disabled=!1,this.toolbarPosition=(0,o.vPA)("top"),this.subscription=null,this.quillSubscription=null,this.elementRef=(0,o.WQX)(o.aKT),this.document=(0,o.WQX)(h.qQ),this.cd=(0,o.WQX)(o.gRc),this.domSanitizer=(0,o.WQX)(F.up),this.platformId=(0,o.WQX)(o.Agw),this.renderer=(0,o.WQX)(o.sFG),this.zone=(0,o.WQX)(o.SKi),this.service=(0,o.WQX)(jn),this.destroyRef=(0,o.WQX)(o.abz),this.valueGetter=(0,o.hFB)(C=>{let S=C.getSemant