-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-T6RMIULX.js
1 lines (1 loc) · 24.2 KB
/
chunk-T6RMIULX.js
1
import{a as _e}from"./chunk-VOT4QOQ7.js";import{a as ue,c as pe,d as me,e as L,f as K}from"./chunk-STP3VB3D.js";import"./chunk-3MICEEYE.js";import{b as W,j as E,x as N,y as z}from"./chunk-TL3SOKZG.js";import{a as le,c as ce,h as se,o as G,p as de}from"./chunk-2UOGX6KS.js";import{g as re,i as oe,j as ae}from"./chunk-FB7CDEED.js";import{Ab as ie,Ia as I,L as Y,Na as V,Oa as Z,Pa as x,Pb as ne,Qa as T,Ra as w,Ua as F,V as A,Va as f,Xa as g,Ya as C,Za as l,_a as s,ba as _,ca as h,cb as y,da as U,db as v,ea as J,eb as c,hc as D,ka as Q,mb as m,na as $,nb as S,ob as j,pb as ee,rb as H,sb as O,tb as R,xb as te,ya as d,yb as B,za as M}from"./chunk-XIWENJHJ.js";import{i as P}from"./chunk-BL3FZZIZ.js";function xe(r,o){if(r&1){let n=y();l(0,"button",7),v("click",function(e){_(n);let t=c();return h(t.raise(e,"nav"))}),m(1),s(),l(2,"button",8),v("click",function(e){_(n);let t=c();return h(t.raise(e,"nav"))}),l(3,"span",9),m(4,"link"),s()(),l(5,"button",8),v("click",function(e){_(n);let t=c();return h(t.raise(e,"clone"))}),l(6,"span",9),m(7,"cyclone"),s()(),l(8,"button",8),v("click",function(e){_(n);let t=c();return h(t.raise(e,"delete"))}),l(9,"span",9),m(10,"delete"),s()()}if(r&2){let n=c();d(),S(n.data.key),d(),x("title","navigate to project detail"),d(3),x("title","clone project "),d(3),x("title","delete project ")}}var he=(()=>{let o=class o{constructor(){this.data=new E,this.itemChanged=new $}raise(i,e){i.stopPropagation(),i.preventDefault();let t={e:i,data:this.data,type:e};this.itemChanged.emit(t)}};o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=A({type:o,selectors:[["project-card"]],inputs:{data:"data",current:"current"},outputs:{itemChanged:"itemChanged"},standalone:!0,features:[B],decls:13,vars:8,consts:[[1,"card","el5",3,"click","id"],[1,"card-header"],[1,"card-content"],[1,"title"],[1,"subtitle"],[1,"type"],[1,"card-footer"],[1,"small-button",3,"click"],[1,"small-button",3,"click","title"],[1,"small-icon"]],template:function(e,t){e&1&&(l(0,"div",0),v("click",function(u){return t.raise(u,"edit")}),l(1,"div",1),m(2),s(),l(3,"div",2)(4,"div")(5,"div",3),m(6),s(),l(7,"div",4),m(8),s(),l(9,"div",5),m(10),s()()(),l(11,"div",6),V(12,xe,11,4),s()()),e&2&&(w("active",t.current===t.data),x("id",t.data.id),d(2),j("Project ",t.data.appType,""),d(4),S(t.data.key),d(2),S(t.data.description),d(2),S(t.data.appType),d(2),F(t.data===t.current?12:-1))},dependencies:[D],encapsulation:2});let r=o;return r})();var q=(()=>{let o=class o{constructor(){this.elementW=122,this.elementH=27,this.createdElements=[],this.project=new E}getHashTemplate(){let i="",e=new Array;for(let t of e)i+=`#${t.key}# `;return i}createElements(i){let e=i?.id||"",t=i?.key||"",p=i?.description||"",u=i?.appType||"",a=i?.code||"";return[new L({key:"Key",value:t,label:"Key",description:"A unique name for the Project",type:"UniqueKey",required:!0,order:1}),new L({key:"Description",value:p,type:"StringType",label:"Description",description:"A brief description of the Project",required:!0,order:2}),new L({key:"AppType",value:u,label:"AppType",description:"Pick a Category to which this Project Belongs",type:"StringEnum",required:!0,order:3,options:[{key:"All",value:"All"},{key:"EMR",value:"EMR"},{key:"ClinicalNotes",value:"ClinicalNotes"},{key:"Telemedicine",value:"Telemedicine"},{key:"Wellness",value:"Wellness"},{key:"MentalHealth",value:"MentalHealth"},{key:"WomenHealth",value:"WomenHealth"},{key:"Pediatrics",value:"Pediatrics"},{key:"Geriatrics",value:"Geriatrics"},{key:"Fitness",value:"Fitness"},{key:"Nutrition",value:"Nutrition"},{key:"MedicalReference",value:"MedicalReference"},{key:"Emergency",value:"Emergency"},{key:"RemoteMonitoring",value:"RemoteMonitoring"},{key:"Deals",value:"Deals"},{key:"Coupons",value:"Coupons"},{key:"Fashion",value:"Fashion"},{key:"Beauty",value:"Beauty"},{key:"Electronics",value:"Electronics"},{key:"HomeGoods",value:"HomeGoods"},{key:"Grocery",value:"Grocery"},{key:"Accommodations",value:"Accommodations"},{key:"Travel",value:"Travel"},{key:"Tourism",value:"Tourism"},{key:"Manufacturing",value:"Manufacturing"},{key:"Retail",value:"Retail"},{key:"Utilities",value:"Utilities"},{key:"Logistics",value:"Logistics"},{key:"Sales",value:"Sales"},{key:"Marketing",value:"Marketing"},{key:"HumanResources",value:"HumanResources"},{key:"CustomerRelations",value:"CustomerRelations"},{key:"ProjectManagement",value:"ProjectManagement"},{key:"SupplyChain",value:"SupplyChain"},{key:"Music",value:"Music"},{key:"Gaming",value:"Gaming"},{key:"Sports",value:"Sports"},{key:"Photography",value:"Photography"},{key:"Books",value:"Books"},{key:"TVShows",value:"TVShows"},{key:"Movies",value:"Movies"},{key:"Podcasts",value:"Podcasts"},{key:"SocialMedia",value:"SocialMedia"},{key:"LanguageLearning",value:"LanguageLearning"},{key:"TestPreparation",value:"TestPreparation"},{key:"SkillDevelopment",value:"SkillDevelopment"},{key:"OnlineCourses",value:"OnlineCourses"},{key:"Food",value:"Food"},{key:"Cooking",value:"Cooking"},{key:"Recipes",value:"Recipes"},{key:"Dining",value:"Dining"},{key:"TravelPlanning",value:"TravelPlanning"},{key:"Transportation",value:"Transportation"},{key:"PersonalFinance",value:"PersonalFinance"},{key:"HomeDesign",value:"HomeDesign"},{key:"HomeAutomation",value:"HomeAutomation"},{key:"Gardening",value:"Gardening"},{key:"PetCare",value:"PetCare"},{key:"PublicServices",value:"PublicServices"},{key:"LicensesAndPermits",value:"LicensesAndPermits"},{key:"Taxes",value:"Taxes"},{key:"Banking",value:"Banking"},{key:"Investments",value:"Investments"},{key:"Insurance",value:"Insurance"},{key:"CreditScores",value:"CreditScores"},{key:"TaxPlanning",value:"TaxPlanning"},{key:"Rentals",value:"Rentals"},{key:"HomeSearch",value:"HomeSearch"},{key:"PropertyManagement",value:"PropertyManagement"},{key:"Construction",value:"Construction"},{key:"Architecture",value:"Architecture"},{key:"Engineering",value:"Engineering"},{key:"Contracting",value:"Contracting"},{key:"Trade",value:"Trade"},{key:"Farming",value:"Farming"},{key:"Livestock",value:"Livestock"},{key:"Fisheries",value:"Fisheries"},{key:"Forestry",value:"Forestry"},{key:"OilAndGas",value:"OilAndGas"},{key:"Energy",value:"Energy"},{key:"NaturalResources",value:"NaturalResources"},{key:"News",value:"News"},{key:"Weather",value:"Weather"},{key:"MapsAndNavigation",value:"MapsAndNavigation"},{key:"Reference",value:"Reference"},{key:"Science",value:"Science"},{key:"Legal",value:"Legal"},{key:"Accounting",value:"Accounting"},{key:"Consulting",value:"Consulting"},{key:"Advertising",value:"Advertising"},{key:"PublicRelations",value:"PublicRelations"},{key:"Personalization",value:"Personalization"},{key:"Productivity",value:"Productivity"},{key:"Tools",value:"Tools"},{key:"Customizable",value:"Customizable"}]}),new L({key:"Code",value:a,type:"SourceCode",label:"Code",description:"Project Detail",required:!0,order:4})]}create(){return{key:this.createdElements[0].value,description:this.createdElements[1].value,appType:this.createdElements[2].value,code:this.createdElements[3].value}}update(){return this.project.key=this.createdElements[0].value,this.project.description=this.createdElements[1].value,this.project.appType=this.createdElements[2].value,this.project.code=this.createdElements[3].value,this.project}initialize(i){}toElements(i){this.project=i;let e=this.createElements(i);return this.createdElements=e,e}getElements(){return this.createElements()}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=Y({token:o,factory:o.\u0275fac});let r=o;return r})();function ge(r,o){if(r&1){let n=y();l(0,"div",9),v("click",function(){let e=_(n).$implicit,t=c();return h(t.setElement(e))}),m(1),s(),l(2,"div",10),v("click",function(){let e=_(n).$implicit,t=c();return h(t.setElement(e))}),m(3),s()}if(r&2){let n=o.$implicit,i=c();w("active",n===i.current),d(),j("enter: ",n.label,""),d(),w("active",n===i.current),d(),S(n.value?n.value:"...")}}function Ce(r,o){if(r&1){let n=y();l(0,"input",11),R("ngModelChange",function(e){_(n);let t=c();return O(t.current.value,e)||(t.current.value=e),h(e)}),s()}if(r&2){let n=c();x("id",n.current.value)("spellcheck",!1)("type","text"),H("ngModel",n.current.value),x("placeholder",n.current.label)}}function ke(r,o){if(r&1){let n=y();l(0,"div",13),v("click",function(){let e=_(n).$implicit,t=c(2);return h(t.updateValue(t.data,t.current,e))}),m(1),s()}if(r&2){let n=o.$implicit,i=c(2);w("active",i.current.value===n.value),d(),j(" ",n.key," ")}}function we(r,o){if(r&1&&(l(0,"div",7),g(1,ke,2,3,"div",12,f),s()),r&2){let n=c();d(),C(n.current.options)}}function Te(r,o){if(r&1){let n=y();l(0,"input",11),R("ngModelChange",function(e){_(n);let t=c();return O(t.current.value,e)||(t.current.value=e),h(e)}),s()}if(r&2){let n=c();x("id",n.current.value)("spellcheck",!1)("type","text"),H("ngModel",n.current.value),x("placeholder",n.current.label)}}function je(r,o){if(r&1){let n=y();l(0,"input",11),R("ngModelChange",function(e){_(n);let t=c();return O(t.current.value,e)||(t.current.value=e),h(e)}),s()}if(r&2){let n=c();x("id",n.current.value)("spellcheck",!1)("type","checkbox"),H("ngModel",n.current.value),x("placeholder",n.current.label)}}function Pe(r,o){if(r&1){let n=y();l(0,"input",11),R("ngModelChange",function(e){_(n);let t=c();return O(t.current.value,e)||(t.current.value=e),h(e)}),s()}if(r&2){let n=c();x("id",n.current.value)("spellcheck",!1)("type","number"),H("ngModel",n.current.value),x("placeholder",n.current.label)}}function Se(r,o){if(r&1){let n=y();l(0,"div",13),v("click",function(){let e=_(n).$implicit,t=c(2);return h(t.updateValue(t.data,t.current,e))}),m(1),s()}if(r&2){let n=o.$implicit,i=c(2);w("active",i.hasValue(i.data,i.current,n)),d(),j(" ",n.key," ")}}function Ee(r,o){if(r&1&&(l(0,"div",7),g(1,Se,2,3,"div",12,f),s()),r&2){let n=c();d(),C(n.current.options)}}function be(r,o){if(r&1){let n=y();l(0,"div",13),v("click",function(){let e=_(n).$implicit,t=c(2);return h(t.updateValue(t.data,t.current,e))}),m(1),s()}if(r&2){let n=o.$implicit,i=c(2);w("active",i.hasValue(i.data,i.current,n)),d(),j(" ",n.key," ")}}function Me(r,o){if(r&1&&(l(0,"div",7),g(1,be,2,3,"div",12,f),s()),r&2){let n=c();d(),C(n.current.options)}}function Ve(r,o){if(r&1){let n=y();l(0,"div",13),v("click",function(){let e=_(n).$implicit,t=c(2);return h(t.updateValue(t.data,t.current,e))}),m(1),s()}if(r&2){let n=o.$implicit,i=c(2);w("active",i.hasValue(i.data,i.current,n)),d(),j(" ",n.key," ")}}function Fe(r,o){if(r&1&&(l(0,"div",7),g(1,Ve,2,3,"div",12,f),s()),r&2){let n=c();d(),C(n.current.options)}}function Ie(r,o){if(r&1){let n=y();l(0,"textarea",14),R("ngModelChange",function(e){_(n);let t=c();return O(t.current.value,e)||(t.current.value=e),h(e)}),s()}if(r&2){let n=c();x("id",n.current.value)("spellcheck",!1),H("ngModel",n.current.value),x("placeholder",n.current.label)}}function We(r,o){if(r&1){let n=y();l(0,"div",13),v("click",function(){let e=_(n).$implicit,t=c(2);return h(t.updateValue(t.data,t.current,e))}),m(1),s()}if(r&2){let n=o.$implicit,i=c(2);w("active",i.current.value===n.value),d(),j(" ",n.key," ")}}function Le(r,o){if(r&1&&(l(0,"div",7),g(1,We,2,3,"div",12,f),s()),r&2){let n=c();d(),C(n.current.options)}}var ve=(()=>{let o=class o{get data(){return this._data}set data(i){this._data=i,this._data&&this.initialize()}get root(){return this._root}set root(i){this._root=i,this.initialize()}constructor(i,e,t){this.store=i,this.service=e,this.qcs=t,this.w=Q.required(),this.h=Q.required(),this._data=new E,this.role="add",this.dataEdited=new $,this.current=new L({key:"test",value:"",label:"test",description:"test",required:!1,order:0,type:"StringType"}),this.elements=I([]),this.initialize()}hasValue(i,e,t){if(i!=null){let p=e.key,u=t.value;switch(e.type){case"StringEnum":return u===u;case"ParentKey":return u===u;case"Keys":let a=u?.split(",");if(a){for(let k of a)if(k===u)return!0}return!1;default:alert(p+" A "+e.type)}}return!1}updateValue(i,e,t){if(i!=null){let p=e.key,u=t.value;if(!u)return;switch(e.type){case"StringEnum":e.value=u;break;case"ParentKey":e.value=u;break;case"Keys":if(e.value===void 0||e.value===null||e.value.trim()===""){e.value=u,alert(`was empty ${e.value}`);return}let a=e.value.split(",").map(b=>b.trim()).filter(b=>b!==""),k=!1;for(let b of a)if(b===u){k=!0;break}if(k){let b=a.indexOf(u);a.splice(b,1)}else a.push(u);e.value=a.join(",");break;default:alert(p+" A "+e.type)}}}initialize(){return P(this,null,function*(){this.root!=null&&this.service.initialize(this.root),this.elements.set(this.service.toElements(this._data));for(let i of this.elements())if(i.value==="")break;this.elements().length>0&&(this.current=this.elements()[0])})}moveNext(){let i=this.elements().indexOf(this.current);i<this.elements().length-1&&(this.current=this.elements()[i+1])}onSubmit(){return P(this,null,function*(){if(this.role==="add"){let i=this.service.create();i.id=this.store.newid(),yield this.store.createProject(i),this.dataEdited.emit(i)}else{let i=this.service.update();yield this.store.updateProject(i),this.dataEdited.emit(i)}})}setElement(i){this.current=i}};o.\u0275fac=function(e){return new(e||o)(M(z),M(q),M(K))},o.\u0275cmp=A({type:o,selectors:[["project-chat"]],inputs:{w:[1,"w"],h:[1,"h"],data:"data",root:"root",parent:"parent",role:"role"},outputs:{dataEdited:"dataEdited"},standalone:!0,features:[te([q,K]),B],decls:21,vars:7,consts:[[1,"builder","form"],[1,"builder-top"],[1,"bubbles"],[1,"builder-label"],[1,"update",3,"click"],[1,"builder-bottom"],[3,"id","spellcheck","type","ngModel","placeholder"],[1,"chips"],[3,"id","spellcheck","ngModel","placeholder"],[1,"bubble","bubble-start",3,"click"],[1,"bubble","bubble-end",3,"click"],[3,"ngModelChange","id","spellcheck","type","ngModel","placeholder"],[1,"chip",3,"active"],[1,"chip",3,"click"],[3,"ngModelChange","id","spellcheck","ngModel","placeholder"]],template:function(e,t){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),g(3,ge,4,6,null,null,f),s()(),l(5,"div",3)(6,"label"),m(7),s(),l(8,"button",4),v("click",function(){return t.onSubmit()}),m(9,"Update"),s()(),l(10,"div",5),V(11,Ce,1,5,"input",6)(12,we,3,0,"div",7)(13,Te,1,5,"input",6)(14,je,1,5,"input",6)(15,Pe,1,5,"input",6)(16,Ee,3,0,"div",7)(17,Me,3,0,"div",7)(18,Fe,3,0,"div",7)(19,Ie,1,4,"textarea",8)(20,Le,3,0,"div",7),s()()),e&2&&(T("max-height",t.h(),"px")("max-width",t.w(),"px"),d(3),C(t.elements()),d(4),ee("",t.current.label," : ",t.current.description,""),d(4),F(t.current.type==="StringType"?11:t.current.type==="StringEnum"?12:t.current.type==="UniqueKey"||t.current.type==="GuidKeyType"||t.current.type==="NumericKeyType"?13:t.current.type==="BooleanType"?14:t.current.type==="IntegerType"||t.current.type==="DoubleType"?15:t.current.type==="ParentKey"?16:t.current.type==="Keys"?17:t.current.type==="NextKey"?18:t.current.type==="SourceCode"?19:t.current.type==="ObjectTypes"||t.current.type==="ObjectType"?20:-1))},dependencies:[D,de,le,ce,G,se],encapsulation:2});let r=o;return r})();var Ae=r=>[r];function He(r,o){if(r&1){let n=y();l(0,"mnu",19),v("dataChanged",function(e){_(n);let t=c(4);return h(t.saveAndClose(e))}),s()}if(r&2){let n=o.$implicit;x("data",n)}}function Oe(r,o){if(r&1&&(l(0,"div")(1,"div",18),g(2,He,1,1,":xhtml:mnu",7,f),s()()),r&2){let n=c(2).$implicit,i=c();T("max-height",n.h-20,"px")("overflow-y","scroll"),d(2),C(i.menus())}}function Re(r,o){if(r&1){let n=y();l(0,"div",24),v("click",function(){let e=_(n).$implicit,t=c(4);return h(t.setEnumAppType(e))}),l(1,"span"),m(2),s(),l(3,"span",25),m(4),s()()}if(r&2){let n=o.$implicit,i=c(4);w("active",i.service.currentAppType()===n),d(2),S(n.key),d(2),S(n.value.length)}}function Be(r,o){if(r&1){let n=y();l(0,"fieldset")(1,"legend"),m(2," AppType "),l(3,"div")(4,"button",20),v("click",function(){_(n);let e=c(3);return h(e.service.resetAppType())}),m(5," Reset "),l(6,"span",21),m(7,"clear"),s()()()(),l(8,"div",22),g(9,Re,5,4,":xhtml:div",23,f),s()()}if(r&2){let n=c(2).$implicit,i=c();d(8),T("max-height",n.h-50,"px"),d(),C(i.service.AppTypeGroups())}}function De(r,o){if(r&1){let n=y();l(0,"project-card",28),v("itemChanged",function(e){_(n);let t=c(4);return h(t.onItemChanged(e))}),s()}if(r&2){let n=o.$implicit,i=c(4);x("data",n)("current",i.current())}}function Ne(r,o){if(r&1&&(l(0,"div",26),g(1,De,1,2,":xhtml:project-card",27,f),s()),r&2){let n=c(2).$implicit,i=c();T("max-height",n.h-80,"px")("overflow-y","scroll"),d(),C(i.service.filtered())}}function $e(r,o){if(r&1){let n=y();l(0,"div",29)(1,"project-chat",30),v("dataEdited",function(e){_(n);let t=c(3);return h(t.dataUpdated(e))}),s()()}if(r&2){let n=c(2).$implicit,i=c();T("max-height",n.h-60,"px")("overflow-y","hidden"),d(),x("data",i.current())("role","edit")("w",n.w)("h",n.h-50)}}function Ge(r,o){if(r&1){let n=y();l(0,"div",29)(1,"project-chat",30),v("dataEdited",function(e){_(n);let t=c(3);return h(t.dataCreated(e))}),s()()}if(r&2){let n=c(2).$implicit,i=c();T("max-height",n.h-60,"px")("overflow-y","hidden"),d(),x("data",i.newProject())("role","add")("w",n.w)("h",n.h-50)}}function ze(r,o){if(r&1){let n=y();U(),l(0,"g",13),v("reIndexed",function(e){_(n);let t=c(2);return h(t.reindexItem(e))}),J(),l(1,"div",14),V(2,Oe,4,4,":xhtml:div",15)(3,Be,11,2,":xhtml:fieldset")(4,Ne,3,4,":xhtml:div",16)(5,$e,2,8,":xhtml:div",17)(6,Ge,2,8,":xhtml:div",17),s()()}if(r&2){let n=c().$implicit,i=c();x("data",n)("current",i.menu()),Z("data-id",n.id),d(),T("width",n.w,"px")("height",n.h,"px"),d(),F(n.role==="Root"?2:n.role==="Filter"?3:n.role==="Master"?4:n.role==="Edit"?5:n.role==="Add"?6:-1)}}function Ke(r,o){if(r&1&&V(0,ze,7,8,":svg:g",12),r&2){let n=o.$implicit;F(n.isOpen?0:-1)}}function qe(r,o){if(r&1){let n=y();l(0,"menu-toggle",31),v("menuToggled",function(e){_(n);let t=c();return h(t.menuToggled(e))}),s()}if(r&2){let n=o.$implicit;x("data",n)}}function Ue(r,o){if(r&1&&(l(0,"button",10)(1,"span",6),m(2,"arrow_forward"),s(),m(3),s()),r&2){let n=c();x("routerLink",ie(2,Ae,"/projects/"+n.current().id)),d(3),j(" ",n.current().key," ")}}function Je(r,o){r&1&&(l(0,"button",11)(1,"span",6),m(2,"mouse"),s(),m(3," select a Project "),s())}function Qe(r,o){if(r&1){let n=y();l(0,"mnu",19),v("dataChanged",function(e){_(n);let t=c();return h(t.saveAndClose(e))}),s()}if(r&2){let n=c();x("data",n.menu())}}var Nt=(()=>{let o=class o{constructor(i,e,t,p){this.store=i,this.service=e,this.route=t,this.router=p,this.current=I(new E),this.newProject=I(new E),this.menus=I([]),this.customOn=I(!1),this.menu=I(new W),this.maxW=window.innerWidth-20,this.w=window.innerWidth-20,this.h=window.innerHeight-20,this.rootMenu=ne(()=>this.menus().find(u=>u.role==="Root")),window.addEventListener("resize",()=>{this.placeShapes()})}ngOnInit(){return P(this,null,function*(){yield this.loadMenus("Projects"),this.service.data.length===0&&(yield this.service.refresh())})}onItemChanged(i){let e={data:i.data,type:i.type,e:i.e};if(e.type==="edit"){for(let t of this.menus())t.role==="Edit"&&(t.isOpen=!0,t.text=e.data.key);this.current.set(e.data)}else e.type==="nav"?this.router.navigate(["/projects",e.data.id]):e.type==="delete"?this.service.deleteProject(e.data):e.type==="clone"&&(alert("clone"),this.addProject())}setEnumAppType(i){this.newProject().appType=i.key,this.service.setAppType(i)}setAppType(i){this.newProject().appType=i.data.key,this.service.setAppType(i.data)}addProject(){this.newProject.set(new E),this.service.currentAppType()&&(this.newProject().appType=this.service.currentAppType().key),this.current.set(this.newProject())}dataCreated(i){i&&(this.service.refresh(),this.current.set(i))}dataUpdated(i){}saveAndClose(i){return P(this,null,function*(){let e=i;this.customOn.set(!1),e.id&&(yield this.store.updateMenu(e),this.placeShapes())})}reindexItem(i){return P(this,null,function*(){let e=i.data,t=i.event;if(!e&&!e.id){this.placeShapes();return}switch(t){case"on-resize":e.config.maxWidth=e.w,e.config.maxHeight=e.h,yield this.store.updateMenu(e);break;case"on-index":e.zIndex=1;for(let p of this.menus())p!==p&&(p.zIndex=0);break;case"on-move":break;case"on-open":e.isOpen=!e.isOpen,yield this.store.updateMenu(e);break;case"on-tack":e.isTack=!e.isTack,yield this.store.updateMenu(e);break}this.placeShapes(),this.menu.set(e),this.rootMenu().placement==="auto"&&setTimeout(()=>{this.scrollToCurrent(e)},200)})}menuToggled(i){return P(this,null,function*(){if(!i.id)return;let e=i,t=this.menus().filter(u=>u.isOpen),p=t.findIndex(u=>u.id===e.id);e.isOpen=!e.isOpen,yield this.store.updateMenu(e),this.placeShapes(),e.isOpen||(p===t.length-1?(e=t[p-1],this.menu.set(e)):(e=t[p+1],this.menu.set(e))),setTimeout(()=>{this.scrollToCurrent(e)},500)})}loadMenus(i){return P(this,null,function*(){let e=yield this.store.getMenus();e.length===0&&(yield this.createNeededMenus(i),e=yield this.store.getMenus());let t=e.filter(p=>p.parentId===i).sort((p,u)=>p.order-u.order);t.length===0?(yield this.createNeededMenus(i),e=yield this.store.getMenus(),t=e.filter(p=>p.parentId===i).sort((p,u)=>p.order-u.order),this.menus.set(t)):this.menus.set(t),this.placeShapes()})}placeShapes(){this.maxW=window.innerWidth-20,this.w=window.innerWidth-20,this.h=window.innerHeight-20;let i=this.menus().filter(a=>a.isOpen),e=20;this.h=window.innerHeight-35;let t=12,p=28;this.maxW=0;let u=this.rootMenu();u||(this.createNeededMenus("Projects"),i=this.menus().filter(a=>a.isOpen),u=this.rootMenu()),u?.placement==="fixed"?i.forEach(a=>{(a.x===0||a.x===void 0||a.x<0)&&(a.x=t),(a.y===0||a.y===void 0||a.y<0)&&(a.y=p),(a.config.maxWidth===0||a.config.maxWidth===void 0||a.config.maxWidth<0)&&(a.config.maxWidth=350),(a.config.maxHeight===0||a.config.maxHeight===void 0||a.config.maxHeight<0)&&(a.config.maxHeight=350),a.w=a.config.maxWidth,a.h=a.config.maxHeight,this.maxW+=a.w+e,t+=a.w+e}):i.forEach(a=>{(a.config.maxWidth===0||a.config.maxWidth===void 0||a.config.maxWidth<0)&&(a.config.maxWidth=350),(a.config.maxHeight===0||a.config.maxHeight===void 0||a.config.maxHeight<0)&&(a.config.maxHeight=350),a.w=a.config.maxWidth,a.x=t,a.h=this.h-e*3,a.y=p,t+=a.w+e,this.maxW+=a.w+e}),this.maxW<this.w&&(this.maxW=this.w),this.maxW+=100}createNeededMenus(i){return P(this,null,function*(){let e=new W;e.id=N.newid(),e.role="Root",e.text="Root",e.parentId=i,e.order=0,e.isOpen=!1,e.config.maxWidth=0,e.config.maxHeight=0,e.placement="Auto";let t=new W;t.id=N.newid(),t.role="Filter",t.parentId=i,t.text="Filter",t.order=0,t.isOpen=!0,t.config.maxWidth=300;let p=new W;p.id=N.newid(),p.role="Master",p.parentId=i,p.text="Projects",p.order=1,p.isOpen=!0,p.config.maxWidth=0;let u=new W;u.id=N.newid(),u.role="Edit",u.text="Edit",u.parentId=i,u.order=2,u.isOpen=!0,u.config.maxWidth=400;let a=new W;a.id=N.newid(),a.role="Add",a.text="Add",a.parentId=i,a.order=3,a.isOpen=!0,a.config.maxWidth=400;let k=[];k.push(e),k.push(t),k.push(p),k.push(u),k.push(a);for(let b of k)yield this.store.createMenu(b)})}scrollToCurrent(i){if(this.rootMenu().placement==="auto"){let e=i.id,t=document.querySelector(".project-container");t&&t.scrollTo({left:i.x,behavior:"smooth"})}}};o.\u0275fac=function(e){return new(e||o)(M(z),M(_e),M(re),M(oe))},o.\u0275cmp=A({type:o,selectors:[["projects"]],standalone:!0,features:[B],decls:17,vars:10,consts:[[1,"list"],[1,"project-container"],[1,"non-pannable-svg"],[1,"rightbar"],[1,"fab"],[1,"fab-btn",3,"click"],[1,"icon"],[3,"data"],[1,"detail"],[1,"header-btns"],[1,"image-btn",3,"routerLink"],[1,"image-btn"],["menu-holder","",3,"data","current"],["menu-holder","",3,"reIndexed","data","current"],[1,"non-pannable-svg","form"],[3,"maxHeight","overflow-y"],[1,"gridcards","padded",3,"max-height","overflow-y"],[1,"padded",3,"max-height","overflow-y"],[1,"flexcards","padded"],[3,"dataChanged","data"],[1,"image-btn",3,"click"],[1,"small-icon"],[1,"chips","padded"],[1,"chip",3,"active"],[1,"chip",3,"click"],[1,"badge"],[1,"gridcards","padded"],[3,"data","current"],[3,"itemChanged","data","current"],[1,"padded"],[3,"dataEdited","data","role","w","h"],[3,"menuToggled","data"]],template:function(e,t){e&1&&(l(0,"div",0)(1,"div",1),U(),l(2,"svg",2),g(3,Ke,1,1,null,null,f),s()(),J(),l(5,"div",3)(6,"div",4)(7,"button",5),v("click",function(){return t.customOn.set(!t.customOn())}),l(8,"span",6),m(9,"settings"),s()()(),g(10,qe,1,1,"menu-toggle",7,f),s(),l(12,"div",8)(13,"div",9),V(14,Ue,4,4,"button",10)(15,Je,4,0,"button",11),s()(),V(16,Qe,1,1,"mnu",7),s()),e&2&&(d(),T("max-width",t.w,"px")("max-height",t.h,"px"),d(),T("width",t.maxW,"px")("height",t.h,"px"),d(),C(t.menus()),d(7),C(t.menus()),d(4),F(t.current()?14:15),d(2),F(t.customOn()?16:-1))},dependencies:[D,G,ae,ue,pe,me,he,ve],styles:[".list[_ngcontent-%COMP%]{height:100vh;overflow:hidden}.permanent[_ngcontent-%COMP%]{position:fixed;top:30px;right:71px;z-index:100;margin:0rem;padding:0rem;height:300px;width:255px;background-color:var(--primary-color);border-radius:5px;color:var(--text-color);overflow-y:auto;overflow-x:hidden}"]});let r=o;return r})();export{Nt as projectsList};