manifest 4.12.3 → 4.12.4-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/{69.3a06102c8e39ae88.js → 69.9b3570b98630c452.js} +1 -1
- package/dist/admin/index.html +1 -1
- package/dist/admin/{main.76cbae026d532418.js → main.882a4d5946b0bdee.js} +1 -1
- package/dist/admin/runtime.0d8c8b10edb1c9e2.js +1 -0
- package/dist/manifest/src/auth/auth.service.js +7 -4
- package/package.json +1 -1
- package/dist/admin/runtime.b0ecb6141ff09499.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[69],{4493:(X,D,p)=>{p.d(D,{B:()=>G});var m=p(2943),E=p(9911),n=p(8428),e=p(8785),I=p(6631),i=p(183),R=p(8284);let G=(()=>{class g{static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275mod=R.$C({type:g})}static{this.\u0275inj=R.G2t({imports:[m.MD,i.iI,E.X1,I.L,n.S,e.x]})}}return g})()},1424:(X,D,p)=>{p.d(D,{O:()=>r});var m=p(7431),E=p(9911),n=p(5442),e=p(4782),I=p(7563),i=p(8284),R=p(6119),G=p(2283),g=p(183),P=p(9879),y=p(818),M=p(2943),Y=p(8428);const x=c=>({"is-loading":c});function b(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit ",o.entityManifest.nameSingular,"")}}function k(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit an existing ",o.entityManifest.nameSingular,"")}}function O(c,v){if(1&c&&(i.qex(0),i.DNE(1,b,2,1,"ng-container",0)(2,k,2,1,"ng-container",0),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.Y8G("ngIf",o.singleMode),i.R7$(),i.Y8G("ngIf",!o.singleMode)}}function $(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.SpI(" Create a new ",o.entityManifest.nameSingular," ")}}function B(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",15)(1,"div",16)(2,"app-input",17),i.bIt("valueChanged",function(h){const F=i.eBV(o).$implicit,d=i.XpG(3);return i.Njj(d.onChange({propName:F.name,newValue:h}))}),i.k0s()()()}if(2&c){const o=v.$implicit,f=i.XpG(3);i.R7$(2),i.Y8G("prop",o)("entityManifest",f.entityManifest)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function U(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",16)(1,"app-input",19),i.bIt("valueChanged",function(h){i.eBV(o);const F=i.XpG().$implicit,d=i.XpG(3);return i.Njj(d.onRelationChange({relationship:F,newValue:h}))}),i.k0s()()}if(2&c){const o=i.XpG().$implicit,f=i.XpG(3);i.R7$(),i.Y8G("relationship",o)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function L(c,v){if(1&c&&(i.j41(0,"div",15),i.DNE(1,U,2,3,"div",18),i.k0s()),2&c){const o=v.$implicit;i.R7$(),i.Y8G("ngIf","many-to-one"===o.type||"many-to-many"===o.type&&o.owningSide)}}function u(c,v){if(1&c&&(i.j41(0,"form",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13),i.DNE(5,B,3,4,"div",14)(6,L,2,1,"div",14),i.k0s()()()()()),2&c){const o=i.XpG(2);i.Y8G("formGroup",o.form),i.R7$(5),i.Y8G("ngForOf",o.entityManifest.properties),i.R7$(),i.Y8G("ngForOf",o.entityManifest.relationships)}}function C(c,v){if(1&c){const o=i.RV6();i.qex(0),i.j41(1,"section")(2,"div",1)(3,"div",2)(4,"h1",3),i.DNE(5,O,3,2,"ng-container",0)(6,$,2,1,"ng-container",0),i.k0s()(),i.j41(7,"div",4)(8,"button",5),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.EFF(9," Submit "),i.k0s(),i.j41(10,"button",6),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.nrm(11,"i",7),i.k0s()()(),i.DNE(12,u,7,3,"form",8),i.k0s(),i.bVm()}if(2&c){const o=i.XpG();i.R7$(5),i.Y8G("ngIf",o.edit),i.R7$(),i.Y8G("ngIf",!o.edit),i.R7$(2),i.Y8G("ngClass",i.eq3(5,x,o.loading)),i.R7$(2),i.Y8G("ngClass",i.eq3(7,x,o.loading)),i.R7$(2),i.Y8G("ngIf",o.item||!o.edit)}}let r=(()=>{class c{constructor(o,f,h,F,d,T,j){this.crudService=o,this.manifestService=f,this.activatedRoute=h,this.router=F,this.formBuilder=d,this.metaService=T,this.flashMessageService=j,this.errors={},this.form=this.formBuilder.group({}),this.PropType=n.Kk}ngOnInit(){var o=this;return(0,m.A)(function*(){(0,e.z)([o.activatedRoute.params,o.activatedRoute.data]).subscribe(function(){var f=(0,m.A)(function*([h,F]){if(o.edit=F.edit,o.entityManifest=yield o.manifestService.getEntityManifest({slug:h.entitySlug}),o.entityManifest||o.router.navigate(["/404"]),o.singleMode="single"===o.activatedRoute.snapshot.data.mode,o.edit){try{o.item=o.singleMode?yield o.crudService.showSingle(o.entityManifest.slug):yield o.crudService.show(o.entityManifest.slug,h.id,{relations:o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).map(d=>d.name)})}catch{o.router.navigate(["/404"])}o.metaService.setTitle(`Edit ${o.entityManifest.nameSingular}`)}else o.metaService.setTitle(`Create a new ${o.entityManifest.nameSingular}`);o.entityManifest.properties.forEach(d=>{let T=null;o.item?T=o.item[d.name]:d.type===n.Kk.Boolean&&(T=!1),o.form.addControl(d.name,new E.MJ(T))}),o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).forEach(d=>{let T=null;"many-to-one"===d.type?T=o.item?o.item[d.name]?.id:null:"many-to-many"===d.type&&(T=o.item?o.item[d.name].map(j=>j.id):[]),o.form.addControl((0,I.yk)(d),new E.MJ(T))})});return function(h){return f.apply(this,arguments)}}())})()}onChange(o){this.form.controls[o.propName].setValue(o.newValue)}onRelationChange(o){return this.onChange({newValue:o.newValue,propName:(0,I.yk)(o.relationship)})}submit(){this.loading=!0,this.edit?(this.singleMode?this.crudService.updateSingle(this.entityManifest.slug,this.form.value):this.crudService.update(this.entityManifest.slug,this.item.id,this.form.value)).then(()=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been updated`),this.router.navigate([this.singleMode?"/singles":"/collections",this.entityManifest.slug])}).catch(f=>{400===f.status&&(this.errors=this.getErrorMessages(f.error)),this.loading=!1,this.flashMessageService.error(`The ${this.entityManifest.nameSingular} could not be updated`)}):this.crudService.create(this.entityManifest.slug,this.form.value).then(o=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been created successfully`),this.router.navigate(["/collections",this.entityManifest.slug,o.id])}).catch(o=>{400===o.status&&(this.errors=this.getErrorMessages(o.error)),this.loading=!1,this.flashMessageService.error(`Error: the ${this.entityManifest.nameSingular} could not be created:\n ${Object.values(this.errors).join(", ")}\n `)})}getErrorMessages(o){const f={};return o.forEach(h=>{f[h.property]=Object.values(h.constraints)}),f}static{this.\u0275fac=function(f){return new(f||c)(i.rXU(R.m),i.rXU(G.x),i.rXU(g.nX),i.rXU(g.Ix),i.rXU(E.ok),i.rXU(P.R),i.rXU(y.L))}}static{this.\u0275cmp=i.VBU({type:c,selectors:[["app-create-edit"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part"],[1,"title","is-2","has-text-weight-light"],[1,"right-part"],["type","submit",1,"button","is-link","is-hidden-touch",3,"click","ngClass"],["type","submit",1,"button","is-link","is-hidden-desktop","is-circle",3,"click","ngClass"],[1,"icon","icon-save"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"card","is-shadowless","p-4"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],[1,"form-group"],["class","field mt-2 mb-4",4,"ngFor","ngForOf"],[1,"field","mt-2","mb-4"],[1,"control"],[3,"valueChanged","prop","entityManifest","value","errors"],["class","control",4,"ngIf"],[3,"valueChanged","relationship","value","errors"]],template:function(f,h){1&f&&i.DNE(0,C,13,9,"ng-container",0),2&f&&i.Y8G("ngIf",h.entityManifest)},dependencies:[M.YU,M.Sq,M.bT,E.qT,E.cb,E.j4,Y.S]})}}return c})()},992:(X,D,p)=>{p.d(D,{R:()=>L});var m=p(7431),E=p(9e3),n=p(8284),e=p(6119),I=p(2283),i=p(183),R=p(9879),G=p(2943),g=p(6631),P=p(8785);const y=u=>["/collections",u];function M(u,C){if(1&u&&(n.j41(0,"a",17),n.nrm(1,"i",18),n.k0s()),2&u){const r=n.XpG(2);n.Y8G("routerLink",n.eq3(1,y,r.entityManifest.namePlural))}}function Y(u,C){if(1&u&&(n.j41(0,"div",19)(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.nrm(4,"app-yield",22),n.k0s()()),2&u){const r=C.$implicit,c=n.XpG(2);n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("value",c.item[r.name])("prop",r)}}function x(u,C){if(1&u&&n.nrm(0,"app-relation-yield",25),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.Y8G("item",c.item[r.name])("relationship",r)}}function b(u,C){1&u&&(n.qex(0),n.EFF(1,", "),n.bVm())}function k(u,C){if(1&u&&(n.qex(0),n.nrm(1,"app-relation-yield",25),n.DNE(2,b,2,0,"ng-container",0),n.bVm()),2&u){const r=C.$implicit,c=C.last,v=n.XpG(3).$implicit;n.R7$(),n.Y8G("item",r)("relationship",v),n.R7$(),n.Y8G("ngIf",!c)}}function O(u,C){if(1&u&&(n.qex(0),n.DNE(1,k,3,3,"ng-container",26),n.bVm()),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.R7$(),n.Y8G("ngForOf",c.getManyToManyRelations(c.item,r))}}function $(u,C){if(1&u&&(n.qex(0),n.j41(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.DNE(4,x,1,2,"app-relation-yield",24)(5,O,2,1,"ng-container",0),n.k0s(),n.bVm()),2&u){const r=n.XpG().$implicit;n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("ngIf","many-to-one"===r.type),n.R7$(),n.Y8G("ngIf","many-to-many"===r.type)}}function B(u,C){if(1&u&&(n.j41(0,"div",23),n.DNE(1,$,6,3,"ng-container",0),n.k0s()),2&u){const r=C.$implicit;n.R7$(),n.Y8G("ngIf","many-to-one"===r.type||"many-to-many"===r.type&&r.owningSide)}}function U(u,C){if(1&u&&(n.j41(0,"section")(1,"div",1)(2,"div",2),n.DNE(3,M,2,3,"a",3),n.j41(4,"h1",4),n.EFF(5),n.k0s()(),n.j41(6,"div",5)(7,"a",6),n.nrm(8,"i",7),n.k0s(),n.j41(9,"a",8),n.EFF(10,"Edit "),n.k0s(),n.j41(11,"a",9),n.nrm(12,"i",10),n.k0s()()(),n.j41(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14),n.DNE(17,Y,5,3,"div",15)(18,B,2,1,"div",16),n.k0s()()()()()),2&u){const r=n.XpG();n.R7$(3),n.Y8G("ngIf",!r.entityManifest.single),n.R7$(2),n.SpI(" ",r.singleMode?r.entityManifest.nameSingular:r.item[r.entityManifest.mainProp]," "),n.R7$(12),n.Y8G("ngForOf",r.entityManifest.properties),n.R7$(),n.Y8G("ngForOf",r.entityManifest.relationships)}}let L=(()=>{class u{constructor(r,c,v,o,f){this.crudService=r,this.manifestService=c,this.activatedRoute=v,this.metaService=o,this.router=f}ngOnInit(){var r=this;this.activatedRoute.params.subscribe(function(){var c=(0,m.A)(function*(v){r.entityManifest=yield r.manifestService.getEntityManifest({slug:v.entitySlug}),r.entityManifest||r.router.navigate(["/404"]),r.singleMode="single"===r.activatedRoute.snapshot.data.mode;try{r.item=r.singleMode?yield r.crudService.showSingle(r.entityManifest.slug):yield r.crudService.show(r.entityManifest.slug,v.id,{relations:r.entityManifest.relationships?.filter(o=>"one-to-many"!==o.type).filter(o=>"many-to-many"!==o.type||o.owningSide).map(o=>o.name)})}catch{r.router.navigate(["/404"])}r.metaService.setTitle((new E.X).transform(r.entityManifest.nameSingular))});return function(v){return c.apply(this,arguments)}}())}getManyToManyRelations(r,c){return r[c.name]}static{this.\u0275fac=function(c){return new(c||u)(n.rXU(e.m),n.rXU(I.x),n.rXU(i.nX),n.rXU(R.R),n.rXU(i.Ix))}}static{this.\u0275cmp=n.VBU({type:u,selectors:[["app-detail"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part","is-flex","is-flex-wrap-wrap","is-align-items-center"],["class","button is-circle mr-2 button--back",3,"routerLink",4,"ngIf"],[1,"title","is-2","has-text-weight-light"],[1,"right-part","is-flex","is-flex-direction-row"],[1,"button","is-link","is-light","is-hidden-desktop","is-circle"],[1,"icon","icon-trash-2"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-touch"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-desktop","is-circle"],[1,"icon","icon-edit"],[1,"card","p-0","mb-6","is-shadowless"],[1,"card-content"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],["class","properties",4,"ngFor","ngForOf"],["class","relations",4,"ngFor","ngForOf"],[1,"button","is-circle","mr-2","button--back",3,"routerLink"],[1,"icon","icon-arrow-right"],[1,"properties"],[1,"is-property-label","mb-1","is-size-5","has-text-dark","has-text-weight-medium"],[1,"is-property-value"],[3,"value","prop"],[1,"relations"],[3,"item","relationship",4,"ngIf"],[3,"item","relationship"],[4,"ngFor","ngForOf"]],template:function(c,v){1&c&&n.DNE(0,U,19,4,"section",0),2&c&&n.Y8G("ngIf",v.item&&v.entityManifest)},dependencies:[G.Sq,G.bT,i.Wk,g.L,P.x],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.properties[_ngcontent-%COMP%] + div[_ngcontent-%COMP%], .relations[_ngcontent-%COMP%] + div[_ngcontent-%COMP%]{margin-top:16px}@media screen and (min-width: 1000px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:25%!important;padding-left:25%!important}}@media screen and (min-width: 1458px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:33%!important;padding-left:33%!important}}']})}}return u})()},8785:(X,D,p)=>{p.d(D,{x:()=>G});var m=p(2943),E=p(183),n=p(8284),e=p(2283);const I=(g,P)=>["/","collections",g,P];function i(g,P){if(1&g&&(n.j41(0,"a",2)(1,"span"),n.EFF(2),n.k0s()()),2&g){const y=n.XpG();n.Y8G("routerLink",n.l_i(2,I,y.entityManifest.slug,y.item.id)),n.R7$(2),n.JRh(y.item[y.entityManifest.mainProp])}}function R(g,P){1&g&&(n.j41(0,"span"),n.EFF(1,"-"),n.k0s())}let G=(()=>{class g{constructor(y){this.manifestService=y}ngOnInit(){this.manifestService.getEntityManifest({className:this.relationship.entity}).then(y=>{this.entityManifest=y})}static{this.\u0275fac=function(M){return new(M||g)(n.rXU(e.x))}}static{this.\u0275cmp=n.VBU({type:g,selectors:[["app-relation-yield"]],inputs:{item:"item",relationship:"relationship"},standalone:!0,features:[n.aNF],decls:2,vars:2,consts:[[3,"routerLink",4,"ngIf"],[4,"ngIf"],[3,"routerLink"]],template:function(M,Y){1&M&&n.DNE(0,i,3,5,"a",0)(1,R,2,0,"span",1),2&M&&(n.Y8G("ngIf",Y.item&&Y.entityManifest),n.R7$(),n.Y8G("ngIf",!Y.item||!Y.entityManifest))},dependencies:[E.iI,E.Wk,m.MD,m.bT]})}}return g})()},6631:(X,D,p)=>{p.d(D,{L:()=>ue});var m=p(2943),E=p(5442),n=function(t){return t[t.Text=0]="Text",t[t.Number=1]="Number",t[t.Link=2]="Link",t[t.Currency=3]="Currency",t[t.Date=4]="Date",t[t.Boolean=5]="Boolean",t[t.Email=6]="Email",t[t.ProgressBar=7]="ProgressBar",t[t.Label=8]="Label",t[t.Location=9]="Location",t}(n||{}),e=p(8284);function I(t,_){1&t&&(e.j41(0,"span"),e.nrm(1,"i",1),e.k0s())}function i(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let R=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-boolean-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:2,consts:[[4,"ngIf"],[1,"icon","icon-check-circle","has-text-success"]],template:function(l,s){1&l&&(e.j41(0,"div"),e.DNE(1,I,2,0,"span",0)(2,i,2,0,"span",0),e.k0s()),2&l&&(e.R7$(),e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT]})}}return t})();function G(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,a.value,a.currency),"")}}function g(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let P=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-currency-yield"]],inputs:{value:"value",currency:"currency"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,G,3,4,"span",0)(1,g,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.oe]})}}return t})();function y(t,_){1&t&&(e.j41(0,"span",0),e.EFF(1," - "),e.k0s())}let M=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-date-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:4,vars:5,consts:[[1,"is-nowrap"],["class","is-nowrap",4,"ngIf"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s(),e.DNE(3,y,2,0,"span",1)),2&l&&(e.R7$(),e.JRh(e.i5U(2,2,s.value,"MM/dd/yy")),e.R7$(2),e.Y8G("ngIf",!s.value))},dependencies:[m.vh,m.bT]})}}return t})(),Y=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-email-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:1,consts:[[1,"yield"],[1,"yield__value"]],template:function(l,s){1&l&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.k0s()()),2&l&&(e.R7$(2),e.JRh(s.value))}})}}return t})();function x(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.ZvI("tag is-rounded is-color-",a.index,""),e.R7$(),e.JRh(a.value)}}function b(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let k=(()=>{class t{ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-label-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[[3,"class",4,"ngIf"],[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,x,2,4,"span",0)(1,b,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT],styles:[".is-color-3[_ngcontent-%COMP%]{background-color:#f50057;color:#fff}.is-color-1[_ngcontent-%COMP%]{background-color:#ff6d00;color:#fff}.is-color-2[_ngcontent-%COMP%]{background-color:#ffd600;color:#000}.is-color-4[_ngcontent-%COMP%]{background-color:#d500f9;color:#fff}.is-color-5[_ngcontent-%COMP%]{background-color:#651fff;color:#fff}.is-color-6[_ngcontent-%COMP%]{background-color:#3d5afe;color:#fff}.is-color-7[_ngcontent-%COMP%]{background-color:#00b0ff;color:#fff}.is-color-8[_ngcontent-%COMP%]{background-color:#00c853;color:#fff}.is-color-9[_ngcontent-%COMP%]{background-color:#64dd17;color:#000}.is-color-10[_ngcontent-%COMP%]{background-color:#a1887f;color:#fff}.is-color-11[_ngcontent-%COMP%]{background-color:#607d8b;color:#fff}.is-color-12[_ngcontent-%COMP%]{background-color:#9e9e9e;color:#fff}"]})}}return t})(),O=(()=>{class t{transform(a,l){return a?.length>l?a.substring(0,l)+"...":a}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275pipe=e.EJ8({name:"truncate",type:t,pure:!0,standalone:!0})}}return t})();const $=(t,_)=>({"icon-external-link":t,"icon-download":_});function B(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function U(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(a.value)}}function L(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.DNE(2,B,3,4,"span",4)(3,U,2,1,"span",4),e.k0s()),2&t){const a=e.XpG();e.Y8G("href",a.value,e.B4B)("download",a.isDownload),e.R7$(),e.Y8G("ngClass",e.l_i(5,$,!a.isDownload,a.isDownload)),e.R7$(),e.Y8G("ngIf",a.compact),e.R7$(),e.Y8G("ngIf",!a.compact)}}function u(t,_){1&t&&(e.j41(0,"span",5),e.EFF(1," - "),e.k0s())}let C=(()=>{class t{constructor(){this.compact=!0,this.isDownload=!1}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-link-yield"]],inputs:{value:"value",compact:"compact",isDownload:"isDownload"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank","class","is-inline-flex is-align-items-center",3,"href","download",4,"ngIf"],["class","is-nowrap",4,"ngIf"],["target","_blank",1,"is-inline-flex","is-align-items-center",3,"href","download"],[1,"icon","icon-external-link","mr-1",3,"ngClass"],[4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,L,4,8,"a",0)(1,u,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.YU,O]})}}return t})();function r(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.j41(2,"span"),e.EFF(3,"View on map"),e.k0s()()),2&t){const a=e.XpG();e.FCK("href","https://www.openstreetmap.org/?mlat=",a.value.lat,"&mlon=",a.value.lng,"",e.B4B)}}function c(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let v=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-location-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank",3,"href",4,"ngIf"],[4,"ngIf"],["target","_blank",3,"href"],[1,"icon","icon-map-pin","mr-1"]],template:function(l,s){1&l&&e.DNE(0,r,4,3,"a",0)(1,c,2,0,"span",1),2&l&&(e.Y8G("ngIf",(null==s.value?null:s.value.lat)&&(null==s.value?null:s.value.lng)),e.R7$(),e.Y8G("ngIf",!(null!=s.value&&s.value.lat&&null!=s.value&&s.value.lng)))},dependencies:[m.bT]})}}return t})();function o(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",a.value," ")}}function f(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let h=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-number-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,o,2,1,"span",0)(1,f,2,0,"span",0),2&l&&(e.Y8G("ngIf",null!==s.value),e.R7$(),e.Y8G("ngIf",null===s.value))},dependencies:[m.bT]})}}return t})();function F(t,_){1&t&&e.nrm(0,"span",4)}function d(t,_){1&t&&e.nrm(0,"span",5)}function T(t,_){if(1&t&&(e.qex(0),e.DNE(1,F,1,0,"span",2)(2,d,1,0,"span",3),e.bVm()),2&t){const a=_.index,l=e.XpG();e.R7$(),e.Y8G("ngIf",l.index>=a),e.R7$(),e.Y8G("ngIf",l.index<a)}}let j=(()=>{class t{constructor(){this.enumAsArray=[]}ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-progress-bar-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:5,consts:[[1,"is-flex","is-align-items-center","is-white-space-nowrap","tooltip","has-tooltip-left"],[4,"ngFor","ngForOf"],["class","bullet",4,"ngIf"],["class","bullet is-grey",4,"ngIf"],[1,"bullet"],[1,"bullet","is-grey"]],template:function(l,s){1&l&&(e.j41(0,"div",0),e.DNE(1,T,3,2,"ng-container",1),e.k0s()),2&l&&(e.ZvI("is-color-",s.index,""),e.BMQ("data-tooltip",s.value||"Unknown"),e.R7$(),e.Y8G("ngForOf",s.values))},dependencies:[m.MD,m.Sq,m.bT]})}}return t})();function S(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function w(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(a.value)}}function N(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let A=(()=>{class t{constructor(){this.compact=!0}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-text-yield"]],inputs:{value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:3,vars:3,consts:[[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,S,3,4,"span",0)(1,w,2,1,"span",0)(2,N,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.compact),e.R7$(),e.Y8G("ngIf",!s.compact),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT,O]})}}return t})(),V=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-timestamp-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:4,consts:[[1,"is-nowrap"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&l&&(e.R7$(),e.JRh(e.i5U(2,1,s.value,"yyyy-MM-dd HH:mm:ss")))},dependencies:[m.vh],encapsulation:2})}}return t})();var K=p(7563);function W(t,_){if(1&t&&e.nrm(0,"img",2),2&t){const a=e.XpG();e.Y8G("src",a.image,e.B4B)}}function J(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let z=(()=>{class t{ngOnInit(){if(this.value){const a=(0,K.Gj)(this.sizes);this.image=this.value[a]}}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-image-yield"]],inputs:{value:"value",sizes:"sizes",label:"label"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["alt","image","width","36","height","36",3,"src",4,"ngIf"],[4,"ngIf"],["alt","image","width","36","height","36",3,"src"]],template:function(l,s){1&l&&e.DNE(0,W,1,1,"img",0)(1,J,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.image),e.R7$(),e.Y8G("ngIf",!s.image))},dependencies:[m.bT],encapsulation:2})}}return t})();function H(t,_){if(1&t&&(e.j41(0,"div",2)(1,"div",3),e.nrm(2,"div",4),e.k0s()()),2&t){const a=e.XpG();e.R7$(2),e.Y8G("innerHTML",a.value,e.npT)}}function Z(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let Q=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-rich-text-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","wrapper",4,"ngIf"],[4,"ngIf"],[1,"wrapper"],[1,"content","is-normal"],[3,"innerHTML"]],template:function(l,s){1&l&&e.DNE(0,H,3,1,"div",0)(1,Z,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.wrapper[_ngcontent-%COMP%]{border:1px solid #dddde2;background-color:#fff;padding:32px;border-radius:6px}.content[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{border-left:4px solid #39393c;background-color:#fff}']})}}return t})();function q(t,_){if(1&t&&e.nrm(0,"app-text-yield",6),2&t){const a=e.XpG();e.Y8G("value",a.value)("compact",a.compact)}}function ee(t,_){if(1&t&&e.nrm(0,"app-rich-text-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function te(t,_){if(1&t&&e.nrm(0,"app-number-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ne(t,_){if(1&t&&e.nrm(0,"app-link-yield",8),2&t){const a=e.XpG();e.Y8G("value",a.value)("isDownload",a.prop.type===a.PropType.File)("compact",a.compact)}}function ie(t,_){if(1&t&&e.nrm(0,"app-boolean-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ae(t,_){if(1&t&&e.nrm(0,"app-currency-yield",9),2&t){const a=e.XpG();e.Y8G("currency",null==a.prop.options?null:a.prop.options.currency)("value",a.value)}}function oe(t,_){if(1&t&&e.nrm(0,"app-date-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function se(t,_){if(1&t&&e.nrm(0,"app-timestamp-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function le(t,_){if(1&t&&e.nrm(0,"app-email-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function re(t,_){if(1&t&&e.nrm(0,"app-label-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function ce(t,_){if(1&t&&e.nrm(0,"app-progress-bar-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function pe(t,_){if(1&t&&e.nrm(0,"app-location-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function _e(t,_){if(1&t&&e.nrm(0,"app-image-yield",11),2&t){const a=e.XpG();e.Y8G("value",a.value)("sizes",null==a.prop.options?null:a.prop.options.sizes)}}let ue=(()=>{class t{constructor(){this.compact=!1,this.PropType=E.Kk,this.YieldType=n}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-yield"]],inputs:{prop:"prop",value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:13,vars:13,consts:[[3,"value","compact",4,"ngIf"],[3,"value",4,"ngIf"],[3,"value","isDownload","compact",4,"ngIf"],[3,"currency","value",4,"ngIf"],[3,"values","value",4,"ngIf"],[3,"value","sizes",4,"ngIf"],[3,"value","compact"],[3,"value"],[3,"value","isDownload","compact"],[3,"currency","value"],[3,"values","value"],[3,"value","sizes"]],template:function(l,s){1&l&&e.DNE(0,q,1,2,"app-text-yield",0)(1,ee,1,1,"app-rich-text-yield",1)(2,te,1,1,"app-number-yield",1)(3,ne,1,3,"app-link-yield",2)(4,ie,1,1,"app-boolean-yield",1)(5,ae,1,2,"app-currency-yield",3)(6,oe,1,1,"app-date-yield",1)(7,se,1,1,"app-timestamp-yield",1)(8,le,1,1,"app-email-yield",1)(9,re,1,2,"app-label-yield",4)(10,ce,1,2,"app-progress-bar-yield",4)(11,pe,1,1,"app-location-yield",1)(12,_e,1,2,"app-image-yield",5),2&l&&(e.Y8G("ngIf",s.prop.type===s.PropType.String||s.prop.type===s.PropType.Text),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.RichText),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Number),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Link||s.prop.type===s.PropType.File),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Boolean),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Money),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Date),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Timestamp),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Email),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0!==(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0===(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Location),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Image))},dependencies:[m.MD,m.bT,R,P,M,V,Y,h,C,A,k,j,v,z,Q],encapsulation:2})}}return t})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[69],{4493:(X,D,p)=>{p.d(D,{B:()=>G});var m=p(2943),E=p(9911),n=p(8428),e=p(8785),I=p(6631),i=p(183),R=p(8284);let G=(()=>{class g{static{this.\u0275fac=function(M){return new(M||g)}}static{this.\u0275mod=R.$C({type:g})}static{this.\u0275inj=R.G2t({imports:[m.MD,i.iI,E.X1,I.L,n.S,e.x]})}}return g})()},1424:(X,D,p)=>{p.d(D,{O:()=>r});var m=p(7431),E=p(9911),n=p(5442),e=p(4782),I=p(7563),i=p(8284),R=p(6119),G=p(2283),g=p(183),P=p(9879),y=p(818),M=p(2943),Y=p(8428);const x=c=>({"is-loading":c});function O(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit ",o.entityManifest.nameSingular,"")}}function k(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(3);i.R7$(),i.SpI("Edit an existing ",o.entityManifest.nameSingular,"")}}function b(c,v){if(1&c&&(i.qex(0),i.DNE(1,O,2,1,"ng-container",0)(2,k,2,1,"ng-container",0),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.Y8G("ngIf",o.singleMode),i.R7$(),i.Y8G("ngIf",!o.singleMode)}}function $(c,v){if(1&c&&(i.qex(0),i.EFF(1),i.bVm()),2&c){const o=i.XpG(2);i.R7$(),i.SpI(" Create a new ",o.entityManifest.nameSingular," ")}}function B(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",15)(1,"div",16)(2,"app-input",17),i.bIt("valueChanged",function(h){const F=i.eBV(o).$implicit,d=i.XpG(3);return i.Njj(d.onChange({propName:F.name,newValue:h}))}),i.k0s()()()}if(2&c){const o=v.$implicit,f=i.XpG(3);i.R7$(2),i.Y8G("prop",o)("entityManifest",f.entityManifest)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function U(c,v){if(1&c){const o=i.RV6();i.j41(0,"div",16)(1,"app-input",19),i.bIt("valueChanged",function(h){i.eBV(o);const F=i.XpG().$implicit,d=i.XpG(3);return i.Njj(d.onRelationChange({relationship:F,newValue:h}))}),i.k0s()()}if(2&c){const o=i.XpG().$implicit,f=i.XpG(3);i.R7$(),i.Y8G("relationship",o)("value",f.edit?f.item[o.name]:null)("errors",f.errors[o.name])}}function L(c,v){if(1&c&&(i.j41(0,"div",15),i.DNE(1,U,2,3,"div",18),i.k0s()),2&c){const o=v.$implicit;i.R7$(),i.Y8G("ngIf","many-to-one"===o.type||"many-to-many"===o.type&&o.owningSide)}}function u(c,v){if(1&c&&(i.j41(0,"form",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13),i.DNE(5,B,3,4,"div",14)(6,L,2,1,"div",14),i.k0s()()()()()),2&c){const o=i.XpG(2);i.Y8G("formGroup",o.form),i.R7$(5),i.Y8G("ngForOf",o.entityManifest.properties),i.R7$(),i.Y8G("ngForOf",o.entityManifest.relationships)}}function C(c,v){if(1&c){const o=i.RV6();i.qex(0),i.j41(1,"section")(2,"div",1)(3,"div",2)(4,"h1",3),i.DNE(5,b,3,2,"ng-container",0)(6,$,2,1,"ng-container",0),i.k0s()(),i.j41(7,"div",4)(8,"button",5),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.EFF(9," Submit "),i.k0s(),i.j41(10,"button",6),i.bIt("click",function(){i.eBV(o);const h=i.XpG();return i.Njj(h.submit())}),i.nrm(11,"i",7),i.k0s()()(),i.DNE(12,u,7,3,"form",8),i.k0s(),i.bVm()}if(2&c){const o=i.XpG();i.R7$(5),i.Y8G("ngIf",o.edit),i.R7$(),i.Y8G("ngIf",!o.edit),i.R7$(2),i.Y8G("ngClass",i.eq3(5,x,o.loading)),i.R7$(2),i.Y8G("ngClass",i.eq3(7,x,o.loading)),i.R7$(2),i.Y8G("ngIf",o.item||!o.edit)}}let r=(()=>{class c{constructor(o,f,h,F,d,T,j){this.crudService=o,this.manifestService=f,this.activatedRoute=h,this.router=F,this.formBuilder=d,this.metaService=T,this.flashMessageService=j,this.errors={},this.form=this.formBuilder.group({}),this.PropType=n.Kk}ngOnInit(){var o=this;return(0,m.A)(function*(){(0,e.z)([o.activatedRoute.params,o.activatedRoute.data]).subscribe(function(){var f=(0,m.A)(function*([h,F]){if(o.edit=F.edit,o.entityManifest=yield o.manifestService.getEntityManifest({slug:h.entitySlug}),o.entityManifest||o.router.navigate(["/404"]),o.singleMode="single"===o.activatedRoute.snapshot.data.mode,o.edit){try{o.item=o.singleMode?yield o.crudService.showSingle(o.entityManifest.slug):yield o.crudService.show(o.entityManifest.slug,h.id,{relations:o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).map(d=>d.name)})}catch{o.router.navigate(["/404"])}o.metaService.setTitle(`Edit ${o.entityManifest.nameSingular}`)}else o.metaService.setTitle(`Create a new ${o.entityManifest.nameSingular}`);o.entityManifest.properties.forEach(d=>{let T=null;o.item?T=o.item[d.name]:d.type===n.Kk.Boolean&&(T=!1),o.form.addControl(d.name,new E.MJ(T))}),o.entityManifest.relationships.filter(d=>"one-to-many"!==d.type).filter(d=>"many-to-many"!==d.type||d.owningSide).forEach(d=>{let T=null;"many-to-one"===d.type?T=o.item?o.item[d.name]?.id:null:"many-to-many"===d.type&&(T=o.item?o.item[d.name].map(j=>j.id):[]),o.form.addControl((0,I.yk)(d),new E.MJ(T))})});return function(h){return f.apply(this,arguments)}}())})()}onChange(o){this.form.controls[o.propName].setValue(o.newValue)}onRelationChange(o){return this.onChange({newValue:o.newValue,propName:(0,I.yk)(o.relationship)})}submit(){this.loading=!0,this.edit?(this.singleMode?this.crudService.updateSingle(this.entityManifest.slug,this.form.value):this.crudService.update(this.entityManifest.slug,this.item.id,this.form.value)).then(()=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been updated`),this.router.navigate([this.singleMode?"/singles":"/collections",this.entityManifest.slug])}).catch(f=>{400===f.status&&(this.errors=this.getErrorMessages(f.error)),this.loading=!1,this.flashMessageService.error(`The ${this.entityManifest.nameSingular} could not be updated`)}):this.crudService.create(this.entityManifest.slug,this.form.value).then(o=>{this.loading=!1,this.flashMessageService.success(`The ${this.entityManifest.nameSingular} has been created successfully`),this.router.navigate(["/collections",this.entityManifest.slug,o.id])}).catch(o=>{400===o.status&&(this.errors=this.getErrorMessages(o.error)),this.loading=!1,this.flashMessageService.error(`Error: the ${this.entityManifest.nameSingular} could not be created:\n ${Object.values(this.errors).join(", ")}\n `)})}getErrorMessages(o){const f={};return o.forEach(h=>{f[h.property]=Object.values(h.constraints)}),f}static{this.\u0275fac=function(f){return new(f||c)(i.rXU(R.m),i.rXU(G.x),i.rXU(g.nX),i.rXU(g.Ix),i.rXU(E.ok),i.rXU(P.R),i.rXU(y.L))}}static{this.\u0275cmp=i.VBU({type:c,selectors:[["app-create-edit"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part"],[1,"title","is-2","has-text-weight-light"],[1,"right-part"],["type","submit",1,"button","is-link","is-hidden-touch",3,"click","ngClass"],["type","submit",1,"button","is-link","is-hidden-desktop","is-circle",3,"click","ngClass"],[1,"icon","icon-save"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"card","is-shadowless","p-4"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],[1,"form-group"],["class","field mt-2 mb-4",4,"ngFor","ngForOf"],[1,"field","mt-2","mb-4"],[1,"control"],[3,"valueChanged","prop","entityManifest","value","errors"],["class","control",4,"ngIf"],[3,"valueChanged","relationship","value","errors"]],template:function(f,h){1&f&&i.DNE(0,C,13,9,"ng-container",0),2&f&&i.Y8G("ngIf",h.entityManifest)},dependencies:[M.YU,M.Sq,M.bT,E.qT,E.cb,E.j4,Y.S]})}}return c})()},992:(X,D,p)=>{p.d(D,{R:()=>L});var m=p(7431),E=p(9e3),n=p(8284),e=p(6119),I=p(2283),i=p(183),R=p(9879),G=p(2943),g=p(6631),P=p(8785);const y=u=>["/collections",u];function M(u,C){if(1&u&&(n.j41(0,"a",17),n.nrm(1,"i",18),n.k0s()),2&u){const r=n.XpG(2);n.Y8G("routerLink",n.eq3(1,y,r.entityManifest.namePlural))}}function Y(u,C){if(1&u&&(n.j41(0,"div",19)(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.nrm(4,"app-yield",22),n.k0s()()),2&u){const r=C.$implicit,c=n.XpG(2);n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("value",c.item[r.name])("prop",r)}}function x(u,C){if(1&u&&n.nrm(0,"app-relation-yield",25),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.Y8G("item",c.item[r.name])("relationship",r)}}function O(u,C){1&u&&(n.qex(0),n.EFF(1,", "),n.bVm())}function k(u,C){if(1&u&&(n.qex(0),n.nrm(1,"app-relation-yield",25),n.DNE(2,O,2,0,"ng-container",0),n.bVm()),2&u){const r=C.$implicit,c=C.last,v=n.XpG(3).$implicit;n.R7$(),n.Y8G("item",r)("relationship",v),n.R7$(),n.Y8G("ngIf",!c)}}function b(u,C){if(1&u&&(n.qex(0),n.DNE(1,k,3,3,"ng-container",26),n.bVm()),2&u){const r=n.XpG(2).$implicit,c=n.XpG(2);n.R7$(),n.Y8G("ngForOf",c.getManyToManyRelations(c.item,r))}}function $(u,C){if(1&u&&(n.qex(0),n.j41(1,"p",20),n.EFF(2),n.k0s(),n.j41(3,"p",21),n.DNE(4,x,1,2,"app-relation-yield",24)(5,b,2,1,"ng-container",0),n.k0s(),n.bVm()),2&u){const r=n.XpG().$implicit;n.R7$(2),n.SpI(" ",r.name," "),n.R7$(2),n.Y8G("ngIf","many-to-one"===r.type),n.R7$(),n.Y8G("ngIf","many-to-many"===r.type)}}function B(u,C){if(1&u&&(n.j41(0,"div",23),n.DNE(1,$,6,3,"ng-container",0),n.k0s()),2&u){const r=C.$implicit;n.R7$(),n.Y8G("ngIf","many-to-one"===r.type||"many-to-many"===r.type&&r.owningSide)}}function U(u,C){if(1&u&&(n.j41(0,"section")(1,"div",1)(2,"div",2),n.DNE(3,M,2,3,"a",3),n.j41(4,"h1",4),n.EFF(5),n.k0s()(),n.j41(6,"div",5)(7,"a",6),n.nrm(8,"i",7),n.k0s(),n.j41(9,"a",8),n.EFF(10,"Edit "),n.k0s(),n.j41(11,"a",9),n.nrm(12,"i",10),n.k0s()()(),n.j41(13,"div",11)(14,"div",12)(15,"div",13)(16,"div",14),n.DNE(17,Y,5,3,"div",15)(18,B,2,1,"div",16),n.k0s()()()()()),2&u){const r=n.XpG();n.R7$(3),n.Y8G("ngIf",!r.entityManifest.single),n.R7$(2),n.SpI(" ",r.singleMode?r.entityManifest.nameSingular:r.item[r.entityManifest.mainProp]," "),n.R7$(12),n.Y8G("ngForOf",r.entityManifest.properties),n.R7$(),n.Y8G("ngForOf",r.entityManifest.relationships)}}let L=(()=>{class u{constructor(r,c,v,o,f){this.crudService=r,this.manifestService=c,this.activatedRoute=v,this.metaService=o,this.router=f}ngOnInit(){var r=this;this.activatedRoute.params.subscribe(function(){var c=(0,m.A)(function*(v){r.entityManifest=yield r.manifestService.getEntityManifest({slug:v.entitySlug}),r.entityManifest||r.router.navigate(["/404"]),r.singleMode="single"===r.activatedRoute.snapshot.data.mode;try{r.item=r.singleMode?yield r.crudService.showSingle(r.entityManifest.slug):yield r.crudService.show(r.entityManifest.slug,v.id,{relations:r.entityManifest.relationships?.filter(o=>"one-to-many"!==o.type).filter(o=>"many-to-many"!==o.type||o.owningSide).map(o=>o.name)})}catch{r.router.navigate(["/404"])}r.metaService.setTitle((new E.X).transform(r.entityManifest.nameSingular))});return function(v){return c.apply(this,arguments)}}())}getManyToManyRelations(r,c){return r[c.name]}static{this.\u0275fac=function(c){return new(c||u)(n.rXU(e.m),n.rXU(I.x),n.rXU(i.nX),n.rXU(R.R),n.rXU(i.Ix))}}static{this.\u0275cmp=n.VBU({type:u,selectors:[["app-detail"]],decls:1,vars:1,consts:[[4,"ngIf"],[1,"is-flex","is-justify-content-space-between","is-align-items-center","mb-5"],[1,"left-part","is-flex","is-flex-wrap-wrap","is-align-items-center"],["class","button is-circle mr-2 button--back",3,"routerLink",4,"ngIf"],[1,"title","is-2","has-text-weight-light"],[1,"right-part","is-flex","is-flex-direction-row"],[1,"button","is-link","is-light","is-hidden-desktop","is-circle"],[1,"icon","icon-trash-2"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-touch"],["routerLink","edit",1,"button","is-link","ml-2","is-hidden-desktop","is-circle"],[1,"icon","icon-edit"],[1,"card","p-0","mb-6","is-shadowless"],[1,"card-content"],[1,"columns"],[1,"column","is-12-touch","is-8-desktop","is-offset-2-desktop","is-6-widescreen","is-offset-3-widescreen","is-6-fullhd","is-offset-3-fullhd"],["class","properties",4,"ngFor","ngForOf"],["class","relations",4,"ngFor","ngForOf"],[1,"button","is-circle","mr-2","button--back",3,"routerLink"],[1,"icon","icon-arrow-right"],[1,"properties"],[1,"is-property-label","mb-1","is-size-5","has-text-dark","has-text-weight-medium"],[1,"is-property-value"],[3,"value","prop"],[1,"relations"],[3,"item","relationship",4,"ngIf"],[3,"item","relationship"],[4,"ngFor","ngForOf"]],template:function(c,v){1&c&&n.DNE(0,U,19,4,"section",0),2&c&&n.Y8G("ngIf",v.item&&v.entityManifest)},dependencies:[G.Sq,G.bT,i.Wk,g.L,P.x],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.properties[_ngcontent-%COMP%] + div[_ngcontent-%COMP%], .relations[_ngcontent-%COMP%] + div[_ngcontent-%COMP%]{margin-top:16px}@media screen and (min-width: 1000px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:25%!important;padding-left:25%!important}}@media screen and (min-width: 1458px){.card.is-single-card[_ngcontent-%COMP%]{padding-right:33%!important;padding-left:33%!important}}']})}}return u})()},8785:(X,D,p)=>{p.d(D,{x:()=>G});var m=p(2943),E=p(183),n=p(8284),e=p(2283);const I=(g,P)=>["/","collections",g,P];function i(g,P){if(1&g&&(n.j41(0,"a",2)(1,"span"),n.EFF(2),n.k0s()()),2&g){const y=n.XpG();n.Y8G("routerLink",n.l_i(2,I,y.entityManifest.slug,y.item.id)),n.R7$(2),n.JRh(y.item[y.entityManifest.mainProp])}}function R(g,P){1&g&&(n.j41(0,"span"),n.EFF(1,"-"),n.k0s())}let G=(()=>{class g{constructor(y){this.manifestService=y}ngOnInit(){this.manifestService.getEntityManifest({className:this.relationship.entity}).then(y=>{this.entityManifest=y})}static{this.\u0275fac=function(M){return new(M||g)(n.rXU(e.x))}}static{this.\u0275cmp=n.VBU({type:g,selectors:[["app-relation-yield"]],inputs:{item:"item",relationship:"relationship"},standalone:!0,features:[n.aNF],decls:2,vars:2,consts:[[3,"routerLink",4,"ngIf"],[4,"ngIf"],[3,"routerLink"]],template:function(M,Y){1&M&&n.DNE(0,i,3,5,"a",0)(1,R,2,0,"span",1),2&M&&(n.Y8G("ngIf",Y.item&&Y.entityManifest),n.R7$(),n.Y8G("ngIf",!Y.item||!Y.entityManifest))},dependencies:[E.iI,E.Wk,m.MD,m.bT]})}}return g})()},6631:(X,D,p)=>{p.d(D,{L:()=>ue});var m=p(2943),E=p(5442),n=function(t){return t[t.Text=0]="Text",t[t.Number=1]="Number",t[t.Link=2]="Link",t[t.Currency=3]="Currency",t[t.Date=4]="Date",t[t.Boolean=5]="Boolean",t[t.Email=6]="Email",t[t.ProgressBar=7]="ProgressBar",t[t.Label=8]="Label",t[t.Location=9]="Location",t}(n||{}),e=p(8284);function I(t,_){1&t&&(e.j41(0,"span"),e.nrm(1,"i",1),e.k0s())}function i(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let R=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-boolean-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:2,consts:[[4,"ngIf"],[1,"icon","icon-check-circle","has-text-success"]],template:function(l,s){1&l&&(e.j41(0,"div"),e.DNE(1,I,2,0,"span",0)(2,i,2,0,"span",0),e.k0s()),2&l&&(e.R7$(),e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT]})}}return t})();function G(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.nI1(2,"currency"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,a.value,a.currency),"")}}function g(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let P=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-currency-yield"]],inputs:{value:"value",currency:"currency"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,G,3,4,"span",0)(1,g,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.oe]})}}return t})();function y(t,_){1&t&&(e.j41(0,"span",0),e.EFF(1," - "),e.k0s())}let M=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-date-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:4,vars:5,consts:[[1,"is-nowrap"],["class","is-nowrap",4,"ngIf"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s(),e.DNE(3,y,2,0,"span",1)),2&l&&(e.R7$(),e.JRh(e.i5U(2,2,s.value,"MM/dd/yy")),e.R7$(2),e.Y8G("ngIf",!s.value))},dependencies:[m.vh,m.bT]})}}return t})(),Y=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-email-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:1,consts:[[1,"yield"],[1,"yield__value"]],template:function(l,s){1&l&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.k0s()()),2&l&&(e.R7$(2),e.JRh(s.value))}})}}return t})();function x(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.ZvI("tag is-rounded is-color-",a.index,""),e.R7$(),e.JRh(a.value)}}function O(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let k=(()=>{class t{ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-label-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[[3,"class",4,"ngIf"],[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,x,2,4,"span",0)(1,O,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT],styles:[".is-color-3[_ngcontent-%COMP%]{background-color:#f50057;color:#fff}.is-color-1[_ngcontent-%COMP%]{background-color:#ff6d00;color:#fff}.is-color-2[_ngcontent-%COMP%]{background-color:#ffd600;color:#000}.is-color-4[_ngcontent-%COMP%]{background-color:#d500f9;color:#fff}.is-color-5[_ngcontent-%COMP%]{background-color:#651fff;color:#fff}.is-color-6[_ngcontent-%COMP%]{background-color:#3d5afe;color:#fff}.is-color-7[_ngcontent-%COMP%]{background-color:#00b0ff;color:#fff}.is-color-8[_ngcontent-%COMP%]{background-color:#00c853;color:#fff}.is-color-9[_ngcontent-%COMP%]{background-color:#64dd17;color:#000}.is-color-10[_ngcontent-%COMP%]{background-color:#a1887f;color:#fff}.is-color-11[_ngcontent-%COMP%]{background-color:#607d8b;color:#fff}.is-color-12[_ngcontent-%COMP%]{background-color:#9e9e9e;color:#fff}"]})}}return t})(),b=(()=>{class t{transform(a,l){return a?.length>l?a.substring(0,l)+"...":a}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275pipe=e.EJ8({name:"truncate",type:t,pure:!0,standalone:!0})}}return t})();const $=(t,_)=>({"icon-external-link":t,"icon-download":_});function B(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function U(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG(2);e.R7$(),e.JRh(a.value)}}function L(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.DNE(2,B,3,4,"span",4)(3,U,2,1,"span",4),e.k0s()),2&t){const a=e.XpG();e.Y8G("href",a.value,e.B4B)("download",a.isDownload),e.R7$(),e.Y8G("ngClass",e.l_i(5,$,!a.isDownload,a.isDownload)),e.R7$(),e.Y8G("ngIf",a.compact),e.R7$(),e.Y8G("ngIf",!a.compact)}}function u(t,_){1&t&&(e.j41(0,"span",5),e.EFF(1," - "),e.k0s())}let C=(()=>{class t{constructor(){this.compact=!0,this.isDownload=!1}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-link-yield"]],inputs:{value:"value",compact:"compact",isDownload:"isDownload"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank","class","is-inline-flex is-align-items-center",3,"href","download",4,"ngIf"],["class","is-nowrap",4,"ngIf"],["target","_blank",1,"is-inline-flex","is-align-items-center",3,"href","download"],[1,"icon","icon-external-link","mr-1",3,"ngClass"],[4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,L,4,8,"a",0)(1,u,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT,m.YU,b]})}}return t})();function r(t,_){if(1&t&&(e.j41(0,"a",2),e.nrm(1,"i",3),e.j41(2,"span"),e.EFF(3,"View on map"),e.k0s()()),2&t){const a=e.XpG();e.FCK("href","https://www.openstreetmap.org/?mlat=",a.value.lat,"&mlon=",a.value.lng,"",e.B4B)}}function c(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let v=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-location-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["target","_blank",3,"href",4,"ngIf"],[4,"ngIf"],["target","_blank",3,"href"],[1,"icon","icon-map-pin","mr-1"]],template:function(l,s){1&l&&e.DNE(0,r,4,3,"a",0)(1,c,2,0,"span",1),2&l&&(e.Y8G("ngIf",(null==s.value?null:s.value.lat)&&(null==s.value?null:s.value.lng)),e.R7$(),e.Y8G("ngIf",!(null!=s.value&&s.value.lat&&null!=s.value&&s.value.lng)))},dependencies:[m.bT]})}}return t})();function o(t,_){if(1&t&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.SpI(" ",a.value," ")}}function f(t,_){1&t&&(e.j41(0,"span",1),e.EFF(1," - "),e.k0s())}let h=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-number-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","is-nowrap",4,"ngIf"],[1,"is-nowrap"]],template:function(l,s){1&l&&e.DNE(0,o,2,1,"span",0)(1,f,2,0,"span",0),2&l&&(e.Y8G("ngIf",null!==s.value),e.R7$(),e.Y8G("ngIf",null===s.value))},dependencies:[m.bT]})}}return t})();function F(t,_){1&t&&e.nrm(0,"span",4)}function d(t,_){1&t&&e.nrm(0,"span",5)}function T(t,_){if(1&t&&(e.qex(0),e.DNE(1,F,1,0,"span",2)(2,d,1,0,"span",3),e.bVm()),2&t){const a=_.index,l=e.XpG();e.R7$(),e.Y8G("ngIf",l.index>=a),e.R7$(),e.Y8G("ngIf",l.index<a)}}let j=(()=>{class t{constructor(){this.enumAsArray=[]}ngOnInit(){this.index=this.values.indexOf(this.value)}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-progress-bar-yield"]],inputs:{value:"value",values:"values"},standalone:!0,features:[e.aNF],decls:2,vars:5,consts:[[1,"is-flex","is-align-items-center","is-white-space-nowrap","tooltip","has-tooltip-left"],[4,"ngFor","ngForOf"],["class","bullet",4,"ngIf"],["class","bullet is-grey",4,"ngIf"],[1,"bullet"],[1,"bullet","is-grey"]],template:function(l,s){1&l&&(e.j41(0,"div",0),e.DNE(1,T,3,2,"ng-container",1),e.k0s()),2&l&&(e.ZvI("is-color-",s.index,""),e.BMQ("data-tooltip",s.value||"Unknown"),e.R7$(),e.Y8G("ngForOf",s.values))},dependencies:[m.MD,m.Sq,m.bT]})}}return t})();function S(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"truncate"),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(e.i5U(2,1,a.value,44))}}function w(t,_){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const a=e.XpG();e.R7$(),e.JRh(a.value)}}function N(t,_){1&t&&(e.j41(0,"span"),e.EFF(1," - "),e.k0s())}let A=(()=>{class t{constructor(){this.compact=!0}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-text-yield"]],inputs:{value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:3,vars:3,consts:[[4,"ngIf"]],template:function(l,s){1&l&&e.DNE(0,S,3,4,"span",0)(1,w,2,1,"span",0)(2,N,2,0,"span",0),2&l&&(e.Y8G("ngIf",s.compact),e.R7$(),e.Y8G("ngIf",!s.compact),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.MD,m.bT,b]})}}return t})(),V=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-timestamp-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:3,vars:4,consts:[[1,"is-nowrap"]],template:function(l,s){1&l&&(e.j41(0,"span",0),e.EFF(1),e.nI1(2,"date"),e.k0s()),2&l&&(e.R7$(),e.JRh(e.i5U(2,1,s.value,"yyyy-MM-dd HH:mm:ss")))},dependencies:[m.vh],encapsulation:2})}}return t})();var K=p(7563);function W(t,_){if(1&t&&e.nrm(0,"img",2),2&t){const a=e.XpG();e.Y8G("src",a.image,e.B4B)}}function J(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let z=(()=>{class t{ngOnInit(){if(this.value){const a=(0,K.Gj)(this.sizes);this.image=this.value[a]}}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-image-yield"]],inputs:{value:"value",sizes:"sizes",label:"label"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["alt","image","width","36","height","36",3,"src",4,"ngIf"],[4,"ngIf"],["alt","image","width","36","height","36",3,"src"]],template:function(l,s){1&l&&e.DNE(0,W,1,1,"img",0)(1,J,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.image),e.R7$(),e.Y8G("ngIf",!s.image))},dependencies:[m.bT],encapsulation:2})}}return t})();function H(t,_){if(1&t&&(e.j41(0,"div",2)(1,"div",3),e.nrm(2,"div",4),e.k0s()()),2&t){const a=e.XpG();e.R7$(2),e.Y8G("innerHTML",a.value,e.npT)}}function Z(t,_){1&t&&(e.j41(0,"span"),e.EFF(1,"-"),e.k0s())}let Q=(()=>{class t{static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-rich-text-yield"]],inputs:{value:"value"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["class","wrapper",4,"ngIf"],[4,"ngIf"],[1,"wrapper"],[1,"content","is-normal"],[3,"innerHTML"]],template:function(l,s){1&l&&e.DNE(0,H,3,1,"div",0)(1,Z,2,0,"span",1),2&l&&(e.Y8G("ngIf",s.value),e.R7$(),e.Y8G("ngIf",!s.value))},dependencies:[m.bT],styles:['@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";.wrapper[_ngcontent-%COMP%]{border:1px solid #dddde2;background-color:#fff;padding:32px;border-radius:6px}.content[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{border-left:4px solid #39393c;background-color:#fff}']})}}return t})();function q(t,_){if(1&t&&e.nrm(0,"app-text-yield",6),2&t){const a=e.XpG();e.Y8G("value",a.value)("compact",a.compact)}}function ee(t,_){if(1&t&&e.nrm(0,"app-rich-text-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function te(t,_){if(1&t&&e.nrm(0,"app-number-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ne(t,_){if(1&t&&e.nrm(0,"app-link-yield",8),2&t){const a=e.XpG();e.Y8G("value",a.value)("isDownload",a.prop.type===a.PropType.File)("compact",a.compact)}}function ie(t,_){if(1&t&&e.nrm(0,"app-boolean-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function ae(t,_){if(1&t&&e.nrm(0,"app-currency-yield",9),2&t){const a=e.XpG();e.Y8G("currency",null==a.prop.options?null:a.prop.options.currency)("value",a.value)}}function oe(t,_){if(1&t&&e.nrm(0,"app-date-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function se(t,_){if(1&t&&e.nrm(0,"app-timestamp-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function le(t,_){if(1&t&&e.nrm(0,"app-email-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function re(t,_){if(1&t&&e.nrm(0,"app-label-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function ce(t,_){if(1&t&&e.nrm(0,"app-progress-bar-yield",10),2&t){const a=e.XpG();e.Y8G("values",null==a.prop.options?null:a.prop.options.values)("value",a.value)}}function pe(t,_){if(1&t&&e.nrm(0,"app-location-yield",7),2&t){const a=e.XpG();e.Y8G("value",a.value)}}function _e(t,_){if(1&t&&e.nrm(0,"app-image-yield",11),2&t){const a=e.XpG();e.Y8G("value",a.value)("sizes",null==a.prop.options?null:a.prop.options.sizes)}}let ue=(()=>{class t{constructor(){this.compact=!1,this.PropType=E.Kk,this.YieldType=n}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["app-yield"]],inputs:{prop:"prop",value:"value",compact:"compact"},standalone:!0,features:[e.aNF],decls:13,vars:13,consts:[[3,"value","compact",4,"ngIf"],[3,"value",4,"ngIf"],[3,"value","isDownload","compact",4,"ngIf"],[3,"currency","value",4,"ngIf"],[3,"values","value",4,"ngIf"],[3,"value","sizes",4,"ngIf"],[3,"value","compact"],[3,"value"],[3,"value","isDownload","compact"],[3,"currency","value"],[3,"values","value"],[3,"value","sizes"]],template:function(l,s){1&l&&e.DNE(0,q,1,2,"app-text-yield",0)(1,ee,1,1,"app-rich-text-yield",1)(2,te,1,1,"app-number-yield",1)(3,ne,1,3,"app-link-yield",2)(4,ie,1,1,"app-boolean-yield",1)(5,ae,1,2,"app-currency-yield",3)(6,oe,1,1,"app-date-yield",1)(7,se,1,1,"app-timestamp-yield",1)(8,le,1,1,"app-email-yield",1)(9,re,1,2,"app-label-yield",4)(10,ce,1,2,"app-progress-bar-yield",4)(11,pe,1,1,"app-location-yield",1)(12,_e,1,2,"app-image-yield",5),2&l&&(e.Y8G("ngIf",s.prop.type===s.PropType.String||s.prop.type===s.PropType.Text),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.RichText),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Number),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Link||s.prop.type===s.PropType.File),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Boolean),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Money),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Date),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Timestamp),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Email),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0!==(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Choice&&!0===(null==s.prop.options?null:s.prop.options.sequential)),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Location),e.R7$(),e.Y8G("ngIf",s.prop.type===s.PropType.Image))},dependencies:[m.MD,m.bT,R,P,M,V,Y,h,C,A,k,j,v,z,Q],encapsulation:2})}}return t})()}}]);
|
package/dist/admin/index.html
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
<style>@import"https://fonts.googleapis.com/css?family=Rubik:300,400,400i,500";@charset "UTF-8";html,body{margin:0;padding:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}html{background-color:#fff;font-size:10px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{font-family:Rubik,sans-serif}body{color:#535356;font-size:1em;font-weight:400;line-height:1.5}*:focus{outline:none}html{overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}@media screen and (max-width: 999px){html{font-size:10.22px}}body{text-rendering:optimizeLegibility;overflow:hidden;background:#f5f7f9;color:#303032;font-size:1.2rem}*[href]{cursor:pointer}</style><link rel="stylesheet" href="styles.8ccfc17311992374.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.8ccfc17311992374.css"></noscript></head>
|
|
10
10
|
<body>
|
|
11
11
|
<app-root></app-root>
|
|
12
|
-
<script src="runtime.
|
|
12
|
+
<script src="runtime.0d8c8b10edb1c9e2.js" type="module"></script><script src="polyfills.2aefc0784c3d32a6.js" type="module"></script><script src="main.882a4d5946b0bdee.js" type="module"></script></body>
|
|
13
13
|
</html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"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);
|
|
1
|
+
"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," Signup "),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);
|
|
2
2
|
/**
|
|
3
3
|
* @license Angular v17.3.12
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e,v={},m={};function r(e){var o=m[e];if(void 0!==o)return o.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e](t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(o,t,i,d)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,d]=e[n],s=!0,f=0;f<t.length;f++)(!1&d||a>=d)&&Object.keys(r.O).every(b=>r.O[b](t[f]))?t.splice(f--,1):(s=!1,d<a&&(a=d));if(s){e.splice(n--,1);var l=i();void 0!==l&&(o=l)}}return o}d=d||0;for(var n=e.length;n>0&&e[n-1][2]>d;n--)e[n]=e[n-1];e[n]=[t,i,d]},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((o,t)=>(r.f[t](e,o),o),[])),r.u=e=>e+"."+{45:"a8f252c4d479ea1c",69:"9b3570b98630c452",256:"cf479e10e4de8f41",693:"78d2d5a546c5c39a"}[e]+".js",r.miniCssF=e=>{},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={},o="admin:";r.l=(t,i,d,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==d)for(var f=document.getElementsByTagName("script"),l=0;l<f.length;l++){var u=f[l];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==o+d){a=u;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",o+d),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.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:o=>o},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,d)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)d.push(n[2]);else if(121!=i){var a=new Promise((u,c)=>n=e[i]=[u,c]);d.push(n[2]=a);var s=r.p+r.u(i),f=new Error;r.l(s,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;f.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",f.name="ChunkLoadError",f.type=c,f.request=p,n[1](f)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var o=(i,d)=>{var f,l,[n,a,s]=d,u=0;if(n.some(p=>0!==e[p])){for(f in a)r.o(a,f)&&(r.m[f]=a[f]);if(s)var c=s(r)}for(i&&i(d);u<n.length;u++)r.o(e,l=n[u])&&e[l]&&e[l][0](),e[l]=0;return r.O(c)},t=self.webpackChunkadmin=self.webpackChunkadmin||[];t.forEach(o.bind(null,0)),t.push=o.bind(null,t.push.bind(t))})()})();
|
|
@@ -51,9 +51,11 @@ const config_1 = require("@nestjs/config");
|
|
|
51
51
|
const bcryptjs_1 = __importDefault(require("bcryptjs"));
|
|
52
52
|
const jwt = __importStar(require("jsonwebtoken"));
|
|
53
53
|
const entity_service_1 = require("../entity/services/entity.service");
|
|
54
|
+
const signup_authenticable_entity_dto_1 = require("./dtos/signup-authenticable-entity.dto");
|
|
54
55
|
const constants_1 = require("../constants");
|
|
55
56
|
const class_validator_1 = require("class-validator");
|
|
56
57
|
const entity_manifest_service_1 = require("../manifest/services/entity-manifest.service");
|
|
58
|
+
const class_transformer_1 = require("class-transformer");
|
|
57
59
|
let AuthService = class AuthService {
|
|
58
60
|
constructor(configService, entityService, entityManifestService) {
|
|
59
61
|
this.configService = configService;
|
|
@@ -85,6 +87,11 @@ let AuthService = class AuthService {
|
|
|
85
87
|
if (!entityManifest.authenticable) {
|
|
86
88
|
throw new common_1.HttpException('Entity is not authenticable', common_1.HttpStatus.BAD_REQUEST);
|
|
87
89
|
}
|
|
90
|
+
const newUserClass = (0, class_transformer_1.plainToClass)(signup_authenticable_entity_dto_1.SignupAuthenticableEntityDto, signupUserDto);
|
|
91
|
+
const errors = await (0, class_validator_1.validate)(newUserClass);
|
|
92
|
+
if (errors.length) {
|
|
93
|
+
throw new common_1.HttpException(errors, common_1.HttpStatus.BAD_REQUEST);
|
|
94
|
+
}
|
|
88
95
|
const entityRepository = this.entityService.getEntityRepository({
|
|
89
96
|
entitySlug
|
|
90
97
|
});
|
|
@@ -92,10 +99,6 @@ let AuthService = class AuthService {
|
|
|
92
99
|
email: signupUserDto.email
|
|
93
100
|
});
|
|
94
101
|
newUser.password = bcryptjs_1.default.hashSync(signupUserDto.password, constants_1.SALT_ROUNDS);
|
|
95
|
-
const errors = await (0, class_validator_1.validate)(newUser);
|
|
96
|
-
if (errors.length) {
|
|
97
|
-
throw new common_1.HttpException(errors, common_1.HttpStatus.BAD_REQUEST);
|
|
98
|
-
}
|
|
99
102
|
const savedUser = await entityRepository.save(newUser);
|
|
100
103
|
return this.createToken(entitySlug, {
|
|
101
104
|
email: savedUser.email,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e,v={},m={};function r(e){var d=m[e];if(void 0!==d)return d.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e](t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(d,t,i,f)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,f]=e[n],s=!0,o=0;o<t.length;o++)(!1&f||a>=f)&&Object.keys(r.O).every(b=>r.O[b](t[o]))?t.splice(o--,1):(s=!1,f<a&&(a=f));if(s){e.splice(n--,1);var l=i();void 0!==l&&(d=l)}}return d}f=f||0;for(var n=e.length;n>0&&e[n-1][2]>f;n--)e[n]=e[n-1];e[n]=[t,i,f]},r.d=(e,d)=>{for(var t in d)r.o(d,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:d[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((d,t)=>(r.f[t](e,d),d),[])),r.u=e=>e+"."+{45:"a8f252c4d479ea1c",69:"3a06102c8e39ae88",256:"cf479e10e4de8f41",693:"78d2d5a546c5c39a"}[e]+".js",r.miniCssF=e=>{},r.o=(e,d)=>Object.prototype.hasOwnProperty.call(e,d),(()=>{var e={},d="admin:";r.l=(t,i,f,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==f)for(var o=document.getElementsByTagName("script"),l=0;l<o.length;l++){var u=o[l];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==d+f){a=u;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",d+f),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.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:d=>d},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(i,f)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)f.push(n[2]);else if(121!=i){var a=new Promise((u,c)=>n=e[i]=[u,c]);f.push(n[2]=a);var s=r.p+r.u(i),o=new Error;r.l(s,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;o.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",o.name="ChunkLoadError",o.type=c,o.request=p,n[1](o)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var d=(i,f)=>{var o,l,[n,a,s]=f,u=0;if(n.some(p=>0!==e[p])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var c=s(r)}for(i&&i(f);u<n.length;u++)r.o(e,l=n[u])&&e[l]&&e[l][0](),e[l]=0;return r.O(c)},t=self.webpackChunkadmin=self.webpackChunkadmin||[];t.forEach(d.bind(null,0)),t.push=d.bind(null,t.push.bind(t))})()})();
|