text: (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{VVAt:function(t,e,i){"use strict";i.r(e),i.d(e,"DictionaryModule",(function(){return A}));var n=i("ofXK"),o=i("tyNb"),c=i("yTNM"),r=i("fXoL");const a=function(t){return["/novel/dictionary",t,"add"]};function s(t,e){if(1&t&&(r.Ob(0,"div",5),r.Ob(1,"div",6),r.Ob(2,"a",7),r.oc(3,"Add Dictionary"),r.Nb(),r.Nb(),r.Nb()),2&t){const t=r.Xb();r.yb(2),r.ac("routerLink",r.dc(1,a,t.idNovel))}}function l(t,e){1&t&&r.Kb(0)}const b=function(t,e){return["/novel/dictionary/",t,e]},d=function(t,e){return["/novel/dictionary/",t,e,"diff"]},h=function(t,e){return["/novel/dictionary/",t,e,"edit"]},u=function(t,e){return["/novel/dictionary/",t,e,"del"]};function g(t,e){if(1&t&&(r.Mb(0),r.Ob(1,"tr",8),r.Ob(2,"td"),r.oc(3),r.Nb(),r.Ob(4,"td"),r.oc(5),r.Nb(),r.Ob(6,"td"),r.Ob(7,"a",8),r.oc(8," Diff "),r.Nb(),r.oc(9," / "),r.Ob(10,"a",9),r.Jb(11,"i",10),r.Nb(),r.oc(12," / "),r.Ob(13,"a",11),r.Jb(14,"i",12),r.Nb(),r.Nb(),r.Nb(),r.Lb()),2&t){const t=e.$implicit;r.yb(1),r.ac("routerLink",r.ec(6,b,t.idNovel,t.id)),r.yb(2),r.pc(t.language),r.yb(2),r.pc(t.count_categories[0].count),r.yb(2),r.ac("routerLink",r.ec(9,d,t.idNovel,t.id)),r.yb(3),r.ac("routerLink",r.ec(12,h,t.idNovel,t.id)),r.yb(3),r.ac("routerLink",r.ec(15,u,t.idNovel,t.id))}}let y=(()=>{class t{constructor(t,e,i){this.router=t,this.route=e,this.api=i,this.dictionaries=[]}ngOnInit(){this.idNovel=this.route.snapshot.params.idNovel,this.novel=this.api.Novel(this.idNovel),this.novel?this.dictionaryList():this.api.getNovel(this.idNovel).subscribe(t=>{this.novel=this.api.Novel(this.idNovel),this.dictionaryList()},t=>{console.log(t)})}dictionaryList(){this.api.getDictionaries(this.idNovel).subscribe(t=>{let e=this.api.Dictionaries(this.idNovel);e&&(this.dictionaries=Object.values(e)),console.log(this.dictionaries)},t=>{console.log(t)})}}return t.\u0275fac=function(e){return new(e||t)(r.Ib(o.c),r.Ib(o.a),r.Ib(c.a))},t.\u0275cmp=r.Cb({type:t,selectors:[["app-dictionary-list"]],decls:15,vars:2,consts:[["actionButtons",""],[4,"ngTemplateOutlet"],[1,"table","is-striped","is-hoverable","is-fullwidth"],[2,"width","200px"],[4,"ngFor","ngForOf"],[1,"columns","actionButtons"],[1,"column"],[1,"button","is-info",3,"routerLink"],[3,"routerLink"],[1,"icon","has-text-success",3,"routerLink"],[1,"fas","fa-info-circle"],[1,"icon","has-text-danger",3,"routerLink"],[1,"fas","fa-ban"]],template:function(t,e){if(1&t&&(r.mc(0,s,4,3,"ng-template",null,0,r.nc),r.mc(2,l,1,0,"ng-container",1),r.Ob(3,"div"),r.Ob(4,"table",2),r.Ob(5,"thead"),r.Ob(6,"tr"),r.Ob(7,"th"),r.oc(8,"Language"),r.Nb(),r.Ob(9,"th",3),r.oc(10,"# of Categories"),r.Nb(),r.Ob(11,"th",3),r.oc(12,"Actions"),r.Nb(),r.Nb(),r.Nb(),r.Ob(13,"tbody"),r.mc(14,g,15,18,"ng-container",4),r.Nb(),r.Nb(),r.Nb()),2&t){const t=r.hc(1);r.yb(2),r.ac("ngTemplateOutlet",t),r.yb(12),r.ac("ngForOf",e.dictionaries)}},directives:[n.n,n.i,o.f,o.d],styles:[".actionButtons[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{text-align:center;width:100%}"]}),t})();var p=i("WIjz"),f=i("3Pt+");function m(t,e){if(1&t&&(r.Mb(0,null,12),r.Jb(2,"input",13),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(2),r.bc("formControlName",t.name)}}function O(t,e){if(1&t&&(r.Mb(0,null,14),r.Ob(2,"label",15),r.Jb(3,"input",16),r.oc(4),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(3),r.bc("formControlName",t.name),r.yb(1),r.qc(" ",t.label," ")}}function N(t,e){if(1&t&&(r.Ob(0,"option",19),r.oc(1),r.Nb()),2&t){const t=e.$implicit;r.bc("value",t.value),r.yb(1),r.pc(t.label)}}function v(t,e){if(1&t&&(r.Mb(0,null,14),r.Ob(2,"label"),r.oc(3),r.Nb(),r.Ob(4,"div",5),r.Ob(5,"select",17),r.mc(6,N,2,2,"option",18),r.Nb(),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(3),r.pc(t.label),r.yb(2),r.bc("formControlName",t.name),r.yb(1),r.ac("ngForOf",t.options)}}function S(t,e){if(1&t&&(r.Mb(0,null,20),r.Ob(2,"label",21),r.oc(3),r.Nb(),r.Ob(4,"div",5),r.Jb(5,"input",22),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(2),r.bc("for",t.name),r.yb(1),r.pc(t.label),r.yb(2),r.bc("type",t.type),r.bc("id",t.name),r.bc("formControlName",t.name)}}function C(t,e){if(1&t&&(r.Ob(0,"div",8),r.Mb(1,9),r.mc(2,m,3,1,"ng-container",10),r.mc(3,O,5,2,"ng-container",10),r.mc(4,v,7,3,"ng-container",10),r.mc(5,S,6,5,"ng-container",11),r.Lb(),r.Nb()),2&t){const t=e.$implicit;r.yb(1),r.ac("ngSwitch",t.type),r.yb(1),r.ac("ngSwitchCase","hidden"),r.yb(1),r.ac("ngSwitchCase","checkbox"),r.yb(1),r.ac("ngSwitchCase","select")}}let D=(()=>{class t{constructor(t,e,i,n){this.router=t,this.route=e,this.api=i,this.formBuilder=n,new p.b("english"),this.form=[new p.a("idNovel","idNovel","hidden"),new p.a("language","Language","text")]}ngOnInit(){this.idNovel=this.route.snapshot.params.idNovel,this.formTitle="Add new Dictionary",this.formGroup=this.formBuilder.group({idNovel:[null],language:[null]})}submitForm(t){console.log(t),this.api.addDictionary(this.idNovel,t).subscribe(t=>{console.log(t),this.router.navigate(["/novel/dictionary",this.idNovel])},t=>{console.log(t)})}goBack(){this.router.navigate(["/novel/dictionary",this.idNovel])}}return t.\u0275fac=function(e){return new(e||t)(r.Ib(o.c),r.Ib(o.a),r.Ib(c.a),r.Ib(f.e))},t.\u0275cmp=r.Cb({type:t,selectors:[["app-dictionary-add"]],decls:10,vars:3,consts:[[1,"form-content"],[1,"title"],[3,"formGroup","ngSubmit"],["class","field",4,"ngFor","ngForOf"],[1,"field","is-grouped"],[1,"control"],["type","submit","value","Submit",1,"button","is-link"],["value","Cancel",1,"button","is-danger",3,"click"],[1,"field"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["tempHidden",""],["type","hidden",3,"formControlName"],["tempCheck",""],[1,"checkbox"],["type","checkbox",3,"formControlName"],[3,"formControlName"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["tempText",""],[1,"label",3,"for"],[1,"input",3,"type","id","formControlName"]],template:function(t,e){1&t&&(r.Ob(0,"div",0),r.Ob(1,"h1",1),r.oc(2),r.Nb(),r.Ob(3,"form",2),r.Vb("ngSubmit",(function(){return e.submitForm(e.formGroup.value)})),r.mc(4,C,6,4,"div",3),r.Ob(5,"div",4),r.Ob(6,"div",5),r.Jb(7,"input",6),r.Nb(),r.Ob(8,"div",5),r.Ob(9,"input",7),r.Vb("click",(function(){return e.goBack()})),r.Nb(),r.Nb(),r.Nb(),r.Nb(),r.Nb()),2&t&&(r.yb(2),r.pc(e.formTitle),r.yb(1),r.ac("formGroup",e.formGroup),r.yb(1),r.ac("ngForOf",e.form))},directives:[f.q,f.k,f.g,n.i,n.k,n.l,n.m,f.b,f.j,f.f,f.a,f.o,f.m,f.p],styles:[".form-content[_ngcontent-%COMP%]{background-color:#fff;padding:30px;border-radius:10px}"]}),t})();function M(t,e){if(1&t&&(r.Mb(0,null,12),r.Jb(2,"input",13),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(2),r.bc("formControlName",t.name)}}function H(t,e){if(1&t&&(r.Mb(0,null,14),r.Ob(2,"label",15),r.Jb(3,"input",16),r.oc(4),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(3),r.bc("formControlName",t.name),r.yb(1),r.qc(" ",t.label," ")}}function w(t,e){if(1&t&&(r.Ob(0,"option",19),r.oc(1),r.Nb()),2&t){const t=e.$implicit;r.bc("value",t.value),r.yb(1),r.pc(t.label)}}function k(t,e){if(1&t&&(r.Mb(0,null,14),r.Ob(2,"label"),r.oc(3),r.Nb(),r.Ob(4,"div",5),r.Ob(5,"select",17),r.mc(6,w,2,2,"option",18),r.Nb(),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(3),r.pc(t.label),r.yb(2),r.bc("formControlName",t.name),r.yb(1),r.ac("ngForOf",t.options)}}function X(t,e){if(1&t&&(r.Mb(0,null,20),r.Ob(2,"label",21),r.oc(3),r.Nb(),r.Ob(4,"div",5),r.Jb(5,"input",22),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit;r.yb(2),r.bc("for",t.name),r.yb(1),r.pc(t.label),r.yb(2),r.bc("type",t.type),r.bc("id",t.name),r.bc("formControlName",t.name)}}function L(t,e){if(1&t&&(r.Ob(0,"div",8),r.Mb(1,9),r.mc(2,M,3,1,"ng-container",10),r.mc(3,H,5,2,"ng-container",10),r.mc(4,k,7,3,"ng-container",10),r.mc(5,X,6,5,"ng-container",11),r.Lb(),r.Nb()),2&t){const t=e.$implicit;r.yb(1),r.ac("ngSwitch",t.type),r.yb(1),r.ac("ngSwitchCase","hidden"),r.yb(1),r.ac("ngSwitchCase","checkbox"),r.yb(1),r.ac("ngSwitchCase","select")}}let F=(()=>{class t{constructor(t,e,i,n){this.router=t,this.route=e,this.api=i,this.formBuilder=n;let o=[new p.b("english")];console.log(o),this.form=[new p.a("id","id","hidden"),new p.a("idNovel","idNovel","hidden"),new p.a("language","Language","text")]}ngOnInit(){this.idNovel=this.route.snapshot.params.idNovel,this.idDictionary=this.route.snapshot.params.idDictionary,this.formTitle="Edit Dictionary",this.formGroup=this.formBuilder.group({id:[null],idNovel:[null],language:[null]}),this.getDictionary()}getDictionary(){this.dictionary=this.api.Dictionary(this.idNovel,this.idDictionary),this.dictionary?this.setFormValues():this.api.getDictionary(this.idNovel,this.idDictionary).subscribe(t=>{this.dictionary=this.api.Dictionary(this.idNovel,this.idDictionary),this.setFormValues()})}setFormValues(){this.formGroup.setValue({id:this.dictionary.id,idNovel:this.dictionary.idNovel,language:this.dictionary.language})}submitForm(t){console.log(t),this.api.updateDictionary(this.idNovel,this.idDictionary,t).subscribe(t=>{console.log(t),this.router.navigate(["/novel/dictionary",this.idNovel])},t=>{console.log(t)})}goBack(){this.router.navigate(["/novel/dictionary",this.idNovel])}}return t.\u0275fac=function(e){return new(e||t)(r.Ib(o.c),r.Ib(o.a),r.Ib(c.a),r.Ib(f.e))},t.\u0275cmp=r.Cb({type:t,selectors:[["app-dictionary-edit"]],decls:10,vars:3,consts:[[1,"form-content"],[1,"title"],[3,"formGroup","ngSubmit"],["class","field",4,"ngFor","ngForOf"],[1,"field","is-grouped"],[1,"control"],["type","submit","value","Submit",1,"button","is-link"],["value","Cancel",1,"button","is-danger",3,"click"],[1,"field"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["tempHidden",""],["type","hidden",3,"formControlName"],["tempCheck",""],[1,"checkbox"],["type","checkbox",3,"formControlName"],[3,"formControlName"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["tempText",""],[1,"label",3,"for"],[1,"input",3,"type","id","formControlName"]],template:function(t,e){1&t&&(r.Ob(0,"div",0),r.Ob(1,"h1",1),r.oc(2),r.Nb(),r.Ob(3,"form",2),r.Vb("ngSubmit",(function(){return e.submitForm(e.formGroup.value)})),r.mc(4,L,6,4,"div",3),r.Ob(5,"div",4),r.Ob(6,"div",5),r.Jb(7,"input",6),r.Nb(),r.Ob(8,"div",5),r.Ob(9,"input",7),r.Vb("click",(function(){return e.goBack()})),r.Nb(),r.Nb(),r.Nb(),r.Nb(),r.Nb()),2&t&&(r.yb(2),r.pc(e.formTitle),r.yb(1),r.ac("formGroup",e.formGroup),r.yb(1),r.ac("ngForOf",e.form))},directives:[f.q,f.k,f.g,n.i,n.k,n.l,n.m,f.b,f.j,f.f,f.a,f.o,f.m,f.p],styles:[".form-content[_ngcontent-%COMP%]{background-color:#fff;padding:30px;border-radius:10px}"]}),t})();class ${}function I(t,e){if(1&t){const t=r.Pb();r.Ob(0,"div",9),r.Ob(1,"div",10),r.Ob(2,"a",11),r.Vb("click",(function(){return r.ic(t),r.Xb().saveList()})),r.oc(3,"Save List"),r.Nb(),r.Nb(),r.Nb()}}function V(t,e){1&t&&r.Kb(0)}function T(t,e){if(1&t&&(r.Ob(0,"option",12),r.oc(1),r.Nb()),2&t){const t=e.$implicit;r.bc("value",t.id),r.yb(1),r.pc(t.language)}}function x(t,e){if(1&t&&(r.Mb(0),r.Ob(1,"td"),r.oc(2),r.Nb(),r.Ob(3,"td"),r.oc(4),r.Nb(),r.Ob(5,"td"),r.oc(6),r.Nb(),r.Ob(7,"td"),r.oc(8),r.Nb(),r.Lb()),2&t){const t=r.Xb().$implicit,e=r.Xb();r.yb(2),r.qc(" ",e.categoriesSelectedHash[e.entriesSelected[e.entry2SelectHash[t].selected].idCategory].name," "),r.yb(2),r.qc(" ",e.entriesSelected[e.entry2SelectHash[t].selected].entryTranslation," "),r.yb(2),r.qc(" ",e.entriesSelected[e.entry2SelectHash[t].selected].entryOriginal," "),r.yb(2),r.qc(" ",e.entriesSelected[e.entry2SelectHash[t].selected].description," ")}}function E(t,e){1&t&&(r.Ob(0,"td"),r.oc(1," - "),r.Nb(),r.Ob(2,"td"),r.oc(3," - "),r.Nb(),r.Ob(4,"td"),r.oc(5," - "),r.Nb(),r.Ob(6,"td"),r.oc(7," - "),r.Nb())}function P(t,e){if(1&t&&(r.Ob(0,"option",12),r.oc(1),r.Nb()),2&t){const t=e.$implicit;r.bc("value",t.id),r.yb(1),r.pc(t.name)}}function _(t,e){if(1&t){const t=r.Pb();r.Mb(0),r.Ob(1,"td"),r.Ob(2,"select",17),r.Vb("ngModelChange",(function(e){r.ic(t);const i=r.Xb().$implicit,n=r.Xb();return n.entries[n.entry2SelectHash[i].entry].idCategory=e}))("ngModelChange",(function(){r.ic(t);const e=r.Xb().$implicit,i=r.Xb();return i.changeEntry(i.entries[i.entry2SelectHash[e].entry])})),r.mc(3,P,2,2,"option",6),r.Nb(),r.Nb(),r.Ob(4,"td"),r.Ob(5,"input",18),r.Vb("ngModelChange",(function(e){r.ic(t);const i=r.Xb().$implicit,n=r.Xb();return n.entries[n.entry2SelectHash[i].entry].entryTranslation=e}))("ngModelChange",(function(){r.ic(t);const e=r.Xb().$implicit,i=r.Xb();return i.changeEntry(i.entries[i.entry2SelectHash[e].entry])})),r.Nb(),r.Nb(),r.Ob(6,"td"),r.Ob(7,"input",18),r.Vb("ngModelChange",(function(e){r.ic(t);const i=r.Xb().$implicit,n=r.Xb();return n.entries[n.entry2SelectHash[i].entry].entryOriginal=e}))("ngModelChange",(function(){r.ic(t);const e=r.Xb().$implicit,i=r.Xb();return i.changeEntry(i.entries[i.entry2SelectHash[e].entry])})),r.Nb(),r.Nb(),r.Ob(8,"td"),r.Ob(9,"input",18),r.Vb("ngModelChange",(function(e){r.ic(t);const i=r.Xb().$implicit,n=r.Xb();return n.entries[n.entry2SelectHash[i].entry].description=e}))("ngModelChange",(function(){r.ic(t);const e=r.Xb().$implicit,i=r.Xb();return i.changeEntry(i.entries[i.entry2SelectHash[e].entry])})),r.Nb(),r.Nb(),r.Lb()}if(2&t){const t=r.Xb().$implicit,e=r.Xb();r.yb(2),r.ac("ngModel",e.entries[e.entry2SelectHash[t].entry].idCategory),r.yb(1),r.ac("ngForOf",e.categories),r.yb(2),r.ac("ngModel",e.entries[e.entry2SelectHash[t].entry].entryTranslation),r.yb(2),r.ac("ngModel",e.entries[e.entry2SelectHash[t].entry].entryOriginal),r.yb(2),r.ac("ngModel",e.entries[e.entry2SelectHash[t].entry].description)}}function j(t,e){if(1&t&&(r.Ob(0,"option",12),r.oc(1),r.Nb()),2&t){const t=e.$implicit;r.bc("value",t.id),r.yb(1),r.pc(t.name)}}function B(t,e){if(1&t){const t=r.Pb();r.Ob(0,"td"),r.Ob(1,"select",19),r.Vb("change",(function(e){r.ic(t);const i=r.Xb().index;return r.Xb().addEntry(e,i)})),r.Ob(2,"option",20),r.oc(3,"Select a category to copy"),r.Nb(),r.mc(4,j,2,2,"option",6),r.Nb(),r.Nb(),r.Ob(5,"td"),r.oc(6," - "),r.Nb(),r.Ob(7,"td"),r.oc(8," - "),r.Nb(),r.Ob(9,"td"),r.oc(10," - "),r.Nb()}if(2&t){const t=r.Xb(2);r.yb(4),r.ac("ngForOf",t.categories)}}const G=function(t,e,i){return{new:t,deleted:e,changed:i}};function J(t,e){if(1&t&&(r.Mb(0),r.Ob(1,"tr",13),r.mc(2,x,9,4,"ng-container",14),r.mc(3,E,8,0,"ng-template",null,15,r.nc),r.Ob(5,"td"),r.oc(6,"|"),r.Nb(),r.mc(7,_,10,5,"ng-container",14),r.mc(8,B,11,1,"ng-template",null,16,r.nc),r.Nb(),r.Lb()),2&t){const t=e.$implicit,i=r.hc(4),n=r.hc(9),o=r.Xb();r.yb(1),r.ac("ngClass",r.fc(5,G,o.entry2SelectHash[t].entry&&0==o.entries[o.entry2SelectHash[t].entry].id,o.entry2SelectHash[t].entry&&1==o.entries[o.entry2SelectHash[t].entry].delete,o.entry2SelectHash[t].entry&&1==o.entries[o.entry2SelectHash[t].entry].update)),r.yb(1),r.ac("ngIf",o.entry2SelectHash[t]&&o.entry2SelectHash[t].selected)("ngIfElse",i),r.yb(5),r.ac("ngIf",o.entry2SelectHash[t]&&null!=o.entry2SelectHash[t].entry)("ngIfElse",n)}}const K=[{path:"list",component:y,data:{title:"List Dictionaries"}},{path:"add",component:D,data:{title:"Add Dictionaries"}},{path:":idDictionary/edit",component:F,data:{title:"Edit Dictionary"}},{path:":idDictionary/diff",component:(()=>{class t{constructor(t,e,i){this.api=t,this.route=e,this.router=i,this.dictionaries=[],this.categories=[],this.categoriesHash={},this.entries=[],this.entriesOriginalValues={},this.entry2SelectHash={},this.entry2SelectHashKeys=[],this.categoriesSelected=[],this.categoriesSelectedHash={},this.entriesSelected=[]}ngOnInit(){this.idNovel=this.route.snapshot.params.idNovel,this.idDictionary=this.route.snapshot.params.idDictionary,this.dictionaries=Object.values(this.api.Dictionaries(this.idNovel)),0==this.dictionaries.length?this.api.getDictionaries(this.idNovel).subscribe(t=>{let e=this.api.Dictionaries(this.idNovel);e&&(this.dictionaries=Object.values(e)),this.getCache()},t=>{console.log(t)}):this.getCache()}ngOnDestroy(){delete this.dictionaries,delete this.categories,delete this.categoriesHash,delete this.entries,delete this.idDictionary,delete this.entry2SelectHash,delete this.entry2SelectHashKeys,delete this.categoriesSelected,delete this.categoriesSelectedHash,delete this.entriesSelected,delete this.idDictionarySelected}loadSelectedDictionary(){this.getSelectedCache()}changeEntry(t){t.id>0&&(console.log(t.id),console.log(t.idCategory),t.update=t.entryOriginal!=this.entriesOriginalValues[t.id].entryOriginal||t.entryTranslation!=this.entriesOriginalValues[t.id].entryTranslation||!!t.description&&t.description!=this.entriesOriginalValues[t.id].description||t.idCategory!=this.entriesOriginalValues[t.id].idCategory,console.log(t))}addEntry(t,e){let i=t.target.value,n=this.entry2SelectHash[this.entry2SelectHashKeys[e]],o=this.entriesSelected[n.selected],c=new $;c.id=0,c.idCategory=i,c.entryOriginal=o.entryOriginal,c.entryTranslation=o.entryTranslation,c.description=o.description,n.entry=this.entries.length,this.entries.push(c)}saveList(){let t={},e=[];this.categories.forEach(i=>{e.push(i),t[i.id]=[]}),this.entries.forEach(e=>{t[e.idCategory].push(e)}),e.forEach(e=>{e.entries=t[e.id]}),this.api.saveFullDictionary(this.idNovel,this.idDictionary,e).subscribe(t=>{t.changes&&(this.dictionaries=Object.values(this.api.Dictionaries(this.idNovel)),this.categories=[],this.router.navigate(["/novel/dictionary/",this.idNovel])),console.log(t)},t=>{console.log(t)})}getCache(){0==this.categories.length&&this.api.dictionaryCache(this.idNovel,this.idDictionary).subscribe(t=>{this.categories=[],this.entries=[],this.categories=Object.values(this.api.Categories(this.idDictionary)),this.categories.forEach(t=>{this.categoriesHash[t.id]={name:t.name};let e=this.api.Entries(t.id);for(let i in e)this.entry2SelectHash[e[i].entryOriginal]={entry:this.entries.length,selected:null},this.entries.push(e[i]),this.entriesOriginalValues[e[i].id]={entryOriginal:""+e[i].entryOriginal,entryTranslation:""+e[i].entryTranslation,description:""+e[i].description,idCategory:""+e[i].idCategory}}),this.entry2SelectHashKeys=Object.keys(this.entry2SelectHash)},t=>{console.log(t)})}getSelectedCache(){this.api.dictionaryCache(this.idNovel,this.idDictionarySelected).subscribe(t=>{this.categoriesSelected=[],this.entriesSelected=[],this.categoriesSelected=Object.values(this.api.Categories(this.idDictionarySelected)),this.categoriesSelected.forEach(t=>{this.categoriesSelectedHash[t.id]={name:t.name};let e=this.api.Entries(t.id);for(let i in e)this.entry2SelectHash[e[i].entryOriginal]?this.entry2SelectHash[e[i].entryOriginal].selected=this.entriesSelected.length:this.entry2SelectHash[e[i].entryOriginal]={entry:null,selected:this.entriesSelected.length},this.entriesSelected.push(e[i])}),this.entry2SelectHashKeys=Object.keys(this.entry2SelectHash)},t=>{console.log(t)})}}return t.\u0275fac=function(e){return new(e||t)(r.Ib(c.a),r.Ib(o.a),r.Ib(o.c))},t.\u0275cmp=r.Cb({type:t,selectors:[["app-diff"]],decls:33,vars:4,consts:[["actionButtons",""],[4,"ngTemplateOutlet"],[1,"table","is-stripede","is-fullwidth","tableContent"],["colspan","4"],[3,"ngModel","ngModelChange","change"],["value","","selected","selected"],[3,"value",4,"ngFor","ngForOf"],[1,"tableContent"],[4,"ngFor","ngForOf"],[1,"columns","actionButtons"],[1,"column"],[1,"button","is-info",3,"click"],[3,"value"],[3,"ngClass"],[4,"ngIf","ngIfElse"],["selectedEmpty",""],["nonAnEntry",""],[3,"ngModel","ngModelChange"],["type","text",3,"ngModel","ngModelChange"],[3,"change"],["value",""]],template:function(t,e){if(1&t&&(r.mc(0,I,4,0,"ng-template",null,0,r.nc),r.mc(2,V,1,0,"ng-container",1),r.Ob(3,"div"),r.Ob(4,"table",2),r.Ob(5,"thead"),r.Ob(6,"tr"),r.Ob(7,"th",3),r.Ob(8,"select",4),r.Vb("ngModelChange",(function(t){return e.idDictionarySelected=t}))("change",(function(){return e.loadSelectedDictionary()})),r.Ob(9,"option",5),r.oc(10,"Select a Dictionary"),r.Nb(),r.mc(11,T,2,2,"option",6),r.Nb(),r.Nb(),r.Nb(),r.Ob(12,"tr"),r.Ob(13,"th"),r.oc(14,"Original"),r.Nb(),r.Ob(15,"th"),r.oc(16,"Translated"),r.Nb(),r.Ob(17,"th"),r.oc(18,"Description"),r.Nb(),r.Ob(19,"th"),r.oc(20,"Category"),r.Nb(),r.Ob(21,"th"),r.oc(22,"|"),r.Nb(),r.Ob(23,"th"),r.oc(24,"Category"),r.Nb(),r.Ob(25,"th"),r.oc(26,"Original"),r.Nb(),r.Ob(27,"th"),r.oc(28,"Translated"),r.Nb(),r.Ob(29,"th"),r.oc(30,"Description"),r.Nb(),r.Nb(),r.Nb(),r.Ob(31,"tbody",7),r.mc(32,J,10,9,"ng-container",8),r.Nb(),r.Nb(),r.Nb()),2&t){const t=r.hc(1);r.yb(2),r.ac("ngTemplateOutlet",t),r.yb(6),r.ac("ngModel",e.idDictionarySelected),r.yb(3),r.ac("ngForOf",e.dictionaries),r.yb(21),r.ac("ngForOf",e.entry2SelectHashKeys)}},directives:[n.n,f.o,f.j,f.l,f.m,f.p,n.i,n.h,n.j,f.b],styles:[".actionButtons[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{text-align:center;width:100%}.tableContent[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#eee}.tableContent[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.changed[_ngcontent-%COMP%]{background-color:#afa}.tableContent[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr.new[_ngcontent-%COMP%]{background-color:#aaf}"]}),t})(),data:{title:"Diff Dictionary"}},{path:":idDictionary",loadChildren:"../category#CategoryModule",data:{title:"View chapters"}},{path:"**",redirectTo:"list"}];let q=(()=>{class t{}return t.\u0275mod=r.Gb({type:t}),t.\u0275inj=r.Fb({factory:function(e){return new(e||t)},imports:[[n.b,o.g.forChild(K)],o.g]}),t})(),A=(()=>{class t{}return t.\u0275mod=r.Gb({type:t}),t.\u0275inj=r.Fb({factory:function(e){return new(e||t)},imports:[[n.b,q,f.i,f.n]]}),t})()}}]);