function _defineProperties(n,l){for(var t=0;t<l.length;t++){var e=l[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function _createClass(n,l,t){return l&&_defineProperties(n.prototype,l),t&&_defineProperties(n,t),n}function _classCallCheck(n,l){if(!(n instanceof l))throw new TypeError("Cannot call a class as a function")}(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{wGt0:function(n,l,t){"use strict";t.r(l);var e=t("8Y7J"),o=function n(){_classCallCheck(this,n)},i=t("pMnS"),u=t("MKJQ"),a=t("sZkV"),c=t("SVse"),s=t("TSSN"),r=t("mrSG"),b=t("tAnt"),h=t("kbZ1"),g=t("QA36"),f=t("EGUZ"),p=t("olg3"),d=t("AjPc"),C=t("sUqe"),m=t("CDm8"),k=t("0+M4"),M=function(){function n(l,t,e,o,i,u,a,c,s,r,h){var g=this;_classCallCheck(this,n),this.navCtrl=l,this.itemsManager=t,this.storageManager=e,this.userManager=o,this.alertCtrl=i,this.collectionsManager=u,this.viewCtrl=a,this.router=c,this.events=s,this.modalCtrl=r,this.translateService=h,this.toknow=this.translateService.currentLang,this.text="",this.collection=new b.a(""),this.events.subscribe(C.c.tutorialAddCollection,(function(){"dictionary"==g.collection.type&&g.add()}))}return _createClass(n,[{key:"ngAfterViewInit",value:function(){this.collection=this.collection=new b.a(this.collectionObject),console.log("collectionObjectin collection Component",this.collectionObject),this.initClass()}},{key:"initClass",value:function(){(this.isFree()||this.hasEnoughCredit())&&(this.collection.class="free")}},{key:"getCollectionClass",value:function(){return"fa"===this.collection.lang?"persianText":"aaaa"}},{key:"getIconName",value:function(){return this.hasSubItem()?"ios-arrow-forward":this.isFree()||this.hasEnoughCredit()?"add":"lock"}},{key:"getIconNameIcon",value:function(){var n;switch(this.collection.type){case"dictionary":n="bookmarks";break;case"news":n="paper-plane";break;case"partner":n="people";break;case"puzzle":n="apps";break;case"idiom":n="ios-quote";break;case"quiz":case"artikelQuiz":case"imageQuiz":case"translationQuiz":n="ribbon";break;case"leitner":n="cube"}return n}},{key:"run",value:function(){event.preventDefault(),event.stopPropagation(),this.hasSubItem()?this.router.navigate(["collections/subitem"],{state:this.collection}):this.isFree()||this.hasEnoughCredit()?this.add():this.buy()}},{key:"open",value:function(){this.showDescription()}},{key:"showDescription",value:function(){}},{key:"isFree",value:function(){return 0==this.collection.cost}},{key:"hasEnoughCredit",value:function(){return this.userManager.user.credit>=this.collection.cost}},{key:"hasSubItem",value:function(){return this.collection.subItems.length>0}},{key:"buy",value:function(){console.log("lets buy it")}},{key:"handleMessage",value:function(n){var l=JSON.parse(n);if(console.log("collection component handlemessage JSON.parse(res) ",l),d.a.isJson(l.msg)){var t=this.itemsManager.createItem(this.collection),e=JSON.parse(l.msg);1==e.added&&(t.setStorageID(e.itemID),t.itemID=e.itemID,t.title=e.itemName,t.name=e.itemName,t.setUserID(this.userManager.user.userID),this.itemsManager.add(t))}else console.log("We can not add collection for you",l)}},{key:"addTestItem",value:function(){var n=this.itemsManager.createItem(this.collection);n.setStorageID("testitem"+this.collection.type+Math.random()),n.itemID="testitem"+this.collection.type+Math.random(),n.type=this.collection.type,this.itemsManager.add(n),this.router.navigate(["Items"])}},{key:"add",value:function(){return r.a(this,void 0,void 0,regeneratorRuntime.mark((function n(){var l,t=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.modalCtrl.create({component:m.a,swipeToClose:!0,componentProps:{collection:this.collection},cssClass:"collection-modal"});case 2:(l=n.sent).present(),l.onDidDismiss().then((function(n){if(n){var l=n.data.item;l.type=t.collection.type,t.itemsManager.addItem(l,t)}}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"selectTab",value:function(n){}}]),n}(),O=t("iInd"),x=e.qb({encapsulation:0,styles:[["[_nghost-%COMP%]{margin-bottom:10px;display:block;border-radius:20px;background-color:#fff;min-height:200px}[_nghost-%COMP%] ion-row[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ion-row[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{width:10%;float:left;margin-right:16px;font-size:10vw;margin-top:-15px;margin-left:20px}[_nghost-%COMP%] ion-row[_ngcontent-%COMP%] ion-col.photo[_ngcontent-%COMP%]{width:30%}[_nghost-%COMP%] ion-row[_ngcontent-%COMP%] ion-col.descriptionfa[_ngcontent-%COMP%]{width:70%;font-weight:100;padding:10px;direction:rtl;text-align:justify;text-justify:inter-word}[_nghost-%COMP%] ion-row[_ngcontent-%COMP%] ion-col.descriptionen[_ngcontent-%COMP%]{width:70%;font-weight:100;padding:10px;direction:ltr;text-align:justify;text-justify:inter-word}[_nghost-%COMP%] .forfa[_ngcontent-%COMP%]{color:#585858;font-weight:700;font-size:22px;margin:15px;direction:rtl}[_nghost-%COMP%] .foren[_ngcontent-%COMP%]{color:#585858;font-weight:700;font-size:22px;margin:15px;direction:ltr}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin:18px 8px 18px 0}[_nghost-%COMP%] .persianText[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] div.item-inner[_ngcontent-%COMP%]{border-bottom:0}[_nghost-%COMP%] ion-button.button[_ngcontent-%COMP%]{float:right}[_nghost-%COMP%] ion-button.button[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{margin-right:5px}[_nghost-%COMP%] ion-button.button[_ngcontent-%COMP%] .buttonText[_ngcontent-%COMP%]{padding-left:0;margin-left:0;padding-top:4px;color:#fff}[_nghost-%COMP%] img[_ngcontent-%COMP%]{width:100px;height:100px}[_nghost-%COMP%] ion-item[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{float:right}.itemMainIcon[_ngcontent-%COMP%]{padding:15px;border:1px solid #3880ff;border-radius:100px;margin-left:10px;color:#3880ff;margin-top:15px;direction:ltr;float:left}.add-item[_ngcontent-%COMP%]{width:100%;margin:15px;border-radius:100px}"]],data:{}});function w(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,3,"ion-row",[["class","forfa"]],null,null,null,u.qb,u.B)),e.rb(1,49152,null,0,a.gb,[e.h,e.k,e.x],null,null),(n()(),e.sb(2,0,null,0,1,"h4",[["class","cTitle"]],null,null,null,null,null)),(n()(),e.Lb(3,null,[""," "]))],null,(function(n,l){n(l,3,0,l.component.collection.getTitle())}))}function v(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,3,"ion-row",[["class","foren"]],null,null,null,u.qb,u.B)),e.rb(1,49152,null,0,a.gb,[e.h,e.k,e.x],null,null),(n()(),e.sb(2,0,null,0,1,"h4",[["class","cTitle"]],null,null,null,null,null)),(n()(),e.Lb(3,null,[""," "]))],null,(function(n,l){n(l,3,0,l.component.collection.getTitle())}))}function _(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,6,"ion-col",[["class","descriptio0nfa ion-text-wrap"]],null,null,null,u.X,u.i)),e.Ib(512,null,c.u,c.v,[e.q,e.r,e.k,e.D]),e.rb(2,278528,null,0,c.i,[c.u],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),e.rb(3,49152,null,0,a.t,[e.h,e.k,e.x],null,null),(n()(),e.sb(4,0,null,0,1,"ion-icon",[["class","itemMainIcon"]],null,null,null,u.fb,u.q)),e.rb(5,49152,null,0,a.C,[e.h,e.k,e.x],{name:[0,"name"]},null),(n()(),e.Lb(6,0,[" "," "]))],(function(n,l){var t=l.component;n(l,2,0,"descriptio0nfa ion-text-wrap",t.getCollectionClass()),n(l,5,0,e.wb(1,"",t.getIconNameIcon(),""))}),(function(n,l){n(l,6,0,l.component.collection.getDescription())}))}function P(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,6,"ion-col",[["class","descriptionen ion-text-wrap"]],null,null,null,u.X,u.i)),e.Ib(512,null,c.u,c.v,[e.q,e.r,e.k,e.D]),e.rb(2,278528,null,0,c.i,[c.u],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),e.rb(3,49152,null,0,a.t,[e.h,e.k,e.x],null,null),(n()(),e.sb(4,0,null,0,1,"ion-icon",[["class","itemMainIcon"]],null,null,null,u.fb,u.q)),e.rb(5,49152,null,0,a.C,[e.h,e.k,e.x],{name:[0,"name"]},null),(n()(),e.Lb(6,0,[" "," "]))],(function(n,l){var t=l.component;n(l,2,0,"descriptionen ion-text-wrap",t.getCollectionClass()),n(l,5,0,e.wb(1,"",t.getIconNameIcon(),""))}),(function(n,l){n(l,6,0,l.component.collection.getDescription())}))}function y(n){return e.Nb(0,[(n()(),e.hb(16777216,null,null,1,null,w)),e.rb(1,16384,null,0,c.k,[e.O,e.L],{ngIf:[0,"ngIf"],ngIfElse:[1,"ngIfElse"]},null),(n()(),e.hb(0,[["cond1",2]],null,0,null,v)),(n()(),e.sb(3,0,null,null,4,"ion-row",[],null,null,null,u.qb,u.B)),e.rb(4,49152,null,0,a.gb,[e.h,e.k,e.x],null,null),(n()(),e.hb(16777216,null,0,1,null,_)),e.rb(6,16384,null,0,c.k,[e.O,e.L],{ngIf:[0,"ngIf"],ngIfElse:[1,"ngIfElse"]},null),(n()(),e.hb(0,[["descond",2]],0,0,null,P)),(n()(),e.sb(8,0,null,null,8,"ion-row",[["padding",""]],null,null,null,u.qb,u.B)),e.rb(9,49152,null,0,a.gb,[e.h,e.k,e.x],null,null),(n()(),e.sb(10,0,null,0,6,"ion-button",[["class","add-item"],["expand","block"],["shape","round"]],null,[[null,"click"]],(function(n,l,t){var e=!0;return"click"===l&&(e=!1!==n.component.run()&&e),e}),u.S,u.d)),e.rb(11,49152,null,0,a.k,[e.h,e.k,e.x],{expand:[0,"expand"],shape:[1,"shape"]},null),(n()(),e.sb(12,0,null,0,1,"ion-icon",[],null,null,null,u.fb,u.q)),e.rb(13,49152,null,0,a.C,[e.h,e.k,e.x],{name:[0,"name"]},null),(n()(),e.sb(14,0,null,0,2,"div",[["class","buttonText"]],null,null,null,null,null)),(n()(),e.Lb(15,null,[" "," "])),e.Fb(131072,s.i,[s.j,e.h])],(function(n,l){var t=l.component;n(l,1,0,"fa"==t.toknow,e.Eb(l,2)),n(l,6,0,"fa"==t.toknow,e.Eb(l,7)),n(l,11,0,"block","round"),n(l,13,0,e.wb(1,"",t.getIconName(),""))}),(function(n,l){n(l,15,0,e.Mb(l,15,0,e.Eb(l,16).transform("BUTTONS.addItem")))}))}var I=t("ri/Y"),j=t("HcDZ"),N=t("J20c"),F=t("2IJ5"),D=t("h4wn"),T=t("sk1z"),B=t("/qZA"),E=t("ja1e"),q=t("Ff54"),L=t("LKtr"),S=t("Hceu"),z=e.qb({encapsulation:0,styles:[["[_nghost-%COMP%] .scroll-content[_ngcontent-%COMP%]{margin-bottom:72px}[_nghost-%COMP%] ion-content.content[_ngcontent-%COMP%]{background-color:\\$bodyColor;background-color:#ff4500}[_nghost-%COMP%] .swipLayer[_ngcontent-%COMP%]{width:100%;height:100%}"]],data:{}});function G(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,1,"collection",[["class",""]],null,null,null,y,x)),e.rb(1,4243456,null,0,M,[a.Gb,h.a,f.a,p.a,a.b,g.a,a.Fb,O.m,k.a,a.Fb,s.j],{collectionObject:[0,"collectionObject"]},null)],(function(n,l){n(l,1,0,l.context.$implicit)}),null)}function J(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,4,"ion-header",[],null,null,null,u.eb,u.p)),e.rb(1,49152,null,0,a.B,[e.h,e.k,e.x],null,null),(n()(),e.sb(2,0,null,0,2,"comp-header",[["showMenuBtn","true"]],null,null,null,I.c,I.b)),e.rb(3,4308992,null,0,j.a,[a.Gb,c.g,h.a,N.a,F.a,p.a,a.Fb,s.j,D.a,T.a,a.Eb,k.a,B.a,O.m],{textToUse:[0,"textToUse"],showMenuBtn:[1,"showMenuBtn"]},null),e.Fb(131072,s.i,[s.j,e.h]),(n()(),e.sb(5,0,null,null,4,"ion-content",[["class","ion-padding"]],null,null,null,u.Y,u.j)),e.rb(6,49152,null,0,a.u,[e.h,e.k,e.x],null,null),(n()(),e.sb(7,0,null,0,2,"div",[],null,null,null,null,null)),(n()(),e.hb(16777216,null,null,1,null,G)),e.rb(9,278528,null,0,c.j,[e.O,e.L,e.q],{ngForOf:[0,"ngForOf"]},null),(n()(),e.sb(10,0,null,null,1,"comp-footer",[],null,null,null,E.c,E.b)),e.rb(11,49152,null,0,q.a,[a.Gb,L.a,D.a,h.a,F.a],null,null)],(function(n,l){var t=l.component;n(l,3,0,e.wb(1,"",e.Mb(l,3,0,e.Eb(l,4).transform("TITLE.collections")),""),"true"),n(l,9,0,t.collectionsManager.collections)}),null)}var U=e.ob("page-collections",S.a,(function(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,1,"page-collections",[],null,null,null,J,z)),e.rb(1,15843328,null,0,S.a,[a.Gb,O.m,g.a,a.Eb,L.a,e.h],null,null)],(function(n,l){n(l,1,0)}),null)}),{},{},[]),A=function(){function n(l,t){_classCallCheck(this,n),this.navCtrl=l,this.router=t,this.collection=this.router.getCurrentNavigation().extras.state}return _createClass(n,[{key:"ionViewDidLoad",value:function(){console.log("ionViewDidLoad SubItemsPage",this.collection)}}]),n}(),Q=e.qb({encapsulation:2,styles:[],data:{}});function V(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,1,"collection",[],null,null,null,y,x)),e.rb(1,4243456,null,0,M,[a.Gb,h.a,f.a,p.a,a.b,g.a,a.Fb,O.m,k.a,a.Fb,s.j],{collectionObject:[0,"collectionObject"]},null)],(function(n,l){n(l,1,0,l.context.$implicit)}),null)}function K(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,3,"ion-header",[],null,null,null,u.eb,u.p)),e.rb(1,49152,null,0,a.B,[e.h,e.k,e.x],null,null),(n()(),e.sb(2,0,null,0,1,"comp-header",[],null,null,null,I.c,I.b)),e.rb(3,4308992,null,0,j.a,[a.Gb,c.g,h.a,N.a,F.a,p.a,a.Fb,s.j,D.a,T.a,a.Eb,k.a,B.a,O.m],{textToUse:[0,"textToUse"],showBackBtn:[1,"showBackBtn"]},null),(n()(),e.sb(4,0,null,null,4,"ion-content",[["class","ion-padding"]],null,null,null,u.Y,u.j)),e.rb(5,49152,null,0,a.u,[e.h,e.k,e.x],null,null),(n()(),e.sb(6,0,null,0,2,"div",[["class","foreground"]],null,null,null,null,null)),(n()(),e.hb(16777216,null,null,1,null,V)),e.rb(8,278528,null,0,c.j,[e.O,e.L,e.q],{ngForOf:[0,"ngForOf"]},null),(n()(),e.sb(9,0,null,null,1,"comp-footer",[],null,null,null,E.c,E.b)),e.rb(10,49152,null,0,q.a,[a.Gb,L.a,D.a,h.a,F.a],null,null)],(function(n,l){var t=l.component;n(l,3,0,e.wb(1,"",t.collection.title,""),!0),n(l,8,0,t.collection.subItems)}),null)}var Z=e.ob("page-sub-items",A,(function(n){return e.Nb(0,[(n()(),e.sb(0,0,null,null,1,"page-sub-items",[],null,null,null,K,Q)),e.rb(1,49152,null,0,A,[a.Gb,O.m],null,null)],null,null)}),{},{},[]),H=t("t68o"),X=t("m/40"),Y=t("B/Pu"),R=t("s7LF"),$=t("QQfA"),W=t("IP0z"),nn=t("s6ns"),ln=t("W2O4"),tn=function n(){_classCallCheck(this,n)},en=t("Xd0L"),on=t("cUpR"),un=t("BzsH"),an=t("zMNK"),cn=t("/HVE"),sn=t("hOhj"),rn=t("Gi4r"),bn=t("L8C7"),hn=t("FpXt");t.d(l,"CollectionsModuleNgFactory",(function(){return gn}));var gn=e.pb(o,[],(function(n){return e.Bb([e.Cb(512,e.j,e.ab,[[8,[i.a,U,Z,H.a,X.a,Y.a,I.a,E.a]],[3,e.j],e.v]),e.Cb(4608,c.m,c.l,[e.s,[2,c.z]]),e.Cb(4608,R.k,R.k,[]),e.Cb(4608,a.c,a.c,[e.x,e.g]),e.Cb(4608,a.Fb,a.Fb,[a.c,e.j,e.p]),e.Cb(4608,a.Kb,a.Kb,[a.c,e.j,e.p]),e.Cb(4608,$.a,$.a,[$.g,$.c,e.j,$.f,$.d,e.p,e.x,c.d,W.c,[2,c.g]]),e.Cb(5120,$.h,$.i,[$.a]),e.Cb(5120,nn.b,nn.c,[$.a]),e.Cb(135680,nn.d,nn.d,[$.a,e.p,[2,c.g],[2,nn.a],nn.b,[3,nn.d],$.c]),e.Cb(4608,ln.c,ln.c,[]),e.Cb(4608,ln.i,ln.b,[]),e.Cb(5120,ln.k,ln.l,[]),e.Cb(4608,ln.j,ln.j,[ln.c,ln.i,ln.k]),e.Cb(4608,ln.h,ln.a,[]),e.Cb(5120,ln.e,ln.m,[ln.j,ln.h]),e.Cb(1073742336,c.c,c.c,[]),e.Cb(1073742336,O.n,O.n,[[2,O.s],[2,O.m]]),e.Cb(1073742336,tn,tn,[]),e.Cb(1073742336,R.j,R.j,[]),e.Cb(1073742336,R.c,R.c,[]),e.Cb(1073742336,a.Bb,a.Bb,[]),e.Cb(1073742336,W.a,W.a,[]),e.Cb(1073742336,en.b,en.b,[[2,en.a],[2,on.f]]),e.Cb(1073742336,un.b,un.b,[]),e.Cb(1073742336,an.f,an.f,[]),e.Cb(1073742336,cn.b,cn.b,[]),e.Cb(1073742336,sn.b,sn.b,[]),e.Cb(1073742336,$.e,$.e,[]),e.Cb(1073742336,nn.g,nn.g,[]),e.Cb(1073742336,rn.a,rn.a,[]),e.Cb(1073742336,bn.a,bn.a,[]),e.Cb(1073742336,ln.f,ln.f,[]),e.Cb(1073742336,s.g,s.g,[]),e.Cb(1073742336,hn.a,hn.a,[]),e.Cb(1073742336,o,o,[]),e.Cb(1024,O.k,(function(){return[[{path:"",component:S.a},{path:"subitem",component:A}]]}),[])])}))}}]);