{"version":3,"sources":["https://lively-kernel.org/lively4/swt21-debugging/src/components/widgets/lively-notification-list.js"],"names":["Morph","lively","NotificationList","addNotification","title","message","timeout","moreCallBack","color","notification","document","createElement","more","components","openIn","then","hidden","undefined","setTimeout","onClose","clear","Array","from","childNodes","forEach","ea","removeChild","hideIfEmpty","length"],"mappings":"AAAA;;;;;;;;;;;AAEOA,W;;AACAC,Y;;;;;;;;;;;AADAD,gD;;;;;;;;;;;;;AACAC,iD;;;;;;;AAEQ,YAAMC,gBAAN,SAA+BF,KAA/B,CAAqC;;AAElDG,wBAAgBC,KAAhB,EAAuBC,OAAvB,EAAgCC,OAAhC,EAAyCC,YAAzC,EAAuDC,KAAvD,EAA8D;AAC5D,cAAIC,kCAAeC,SAASC,aAAT,CAAuB,qBAAvB,CAAf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAJ;AACAF,uBAAaL,KAAb,GAAqBA,KAArB;AACAK,uBAAaJ,OAAb,GAAuBA,OAAvB;AACAI,uBAAaG,IAAb,GAAoBL,YAApB;AACAE,uBAAaD,KAAb,GAAqBA,KAArB;;AAEAP,iBAAOY,UAAP,CAAkBC,MAAlB,CAAyB,IAAzB,EAA+BL,YAA/B,EAA6CM,IAA7C,CAAmD,MAAM;AACvD,iBAAKC,MAAL,GAAc,KAAd;AACA,gBAAIV,YAAYW,SAAhB,EAA2BX,UAAU,CAAV;AAC3BY,uBAAW,MAAMT,aAAaU,OAAb,EAAjB,EAAyCb,UAAU,IAAnD;AACD,WAJD;AAMD;;AAEDc,gBAAQ;AACNC,gBAAMC,IAAN,CAAW,KAAKC,UAAhB,EAA4BC,OAA5B,CAAoCC,MAAM,KAAKC,WAAL,CAAiBD,EAAjB,CAA1C;AACD;;AAEDE,sBAAe;AACb,cAAI,KAAKJ,UAAL,CAAgBK,MAAhB,KAA2B,CAA/B,EAAkC;AAChC,iBAAKZ,MAAL,GAAc,IAAd;AACD,WAFD,MAEO;AACL,iBAAKA,MAAL,GAAc,KAAd;AACD;AACF;AA3BiD;;yBAA/Bd,gB;;;;;;;;6BAAAA,iD","file":"lively-notification-list.js","sourcesContent":["'use strict';\n\nimport Morph from 'src/components/widgets/lively-morph.js';\nimport lively from 'src/client/lively.js'\n\nexport default class NotificationList extends Morph {\n  \n  addNotification(title, message, timeout, moreCallBack, color) {\n    var notification = document.createElement(\"lively-notification\")\n    notification.title = title\n    notification.message = message\n    notification.more = moreCallBack\n    notification.color = color\n    \n    lively.components.openIn(this, notification).then( () => {\n      this.hidden = false;\n      if (timeout === undefined) timeout = 7;\n      setTimeout(() => notification.onClose(), timeout * 1000); \n    })\n\n  }\n\n  clear() {\n    Array.from(this.childNodes).forEach(ea => this.removeChild(ea))\n  }\n  \n  hideIfEmpty( ) {\n    if (this.childNodes.length === 0) {\n      this.hidden = true\n    } else {\n      this.hidden = false\n    }\n  }\n}"]}