@social-mail/social-mail-client 1.2.655 → 1.2.656

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.
@@ -1499,7 +1499,7 @@ html, body {
1499
1499
  position: static;
1500
1500
  }
1501
1501
  }
1502
- `.installGlobal("[store-app]");StoreApp=class StoreApp extends MobileDesktopApp{init(){return __awaiter(this,void 0,void 0,(function*(){StoreCommands.install(this);this.element.setAttribute("store-app","store-app");if(!Command.invokeRoute()){StoreCommands.productList.dispatch()}}))}};StoreApp=__decorate([Pack],StoreApp);_export("default",StoreApp);Route.encodeUrl=url=>{if(url.startsWith("#")){return url}if(/\d+\./.test(location.hostname)){return"#!"+url}return url}}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/public/store/StoreApp");System.register([],(function(_export,_context){"use strict";var AtomOnce;_export("AtomOnce",void 0);return{setters:[],execute:function(){_export("AtomOnce",AtomOnce=class AtomOnce{run(f){if(this.isRunning){return}let isAsync=false;try{this.isRunning=true;const p=f();if(p&&p.then&&p.catch){isAsync=true;p.then((()=>{this.isRunning=false})).catch((()=>{this.isRunning=false}))}}finally{if(!isAsync){this.isRunning=false}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomOnce");System.register([],(function(_export,_context){"use strict";var StyleBuilder;function cssNumberToString(n,unit="px"){if(typeof n==="number"){if(n===0){return n+""}return n+unit}return n}_export({cssNumberToString,default:void 0});return{setters:[],execute:function(){_export("default",StyleBuilder=class StyleBuilder{static get newStyle(){return new StyleBuilder}constructor(style){this.style=style;this.style=this.style||{}}toStyle(){return this.style}size(width,height){width=cssNumberToString(width);height=cssNumberToString(height);return this.merge({width,height})}roundBorder(radius){radius=cssNumberToString(radius);return this.merge({borderRadius:radius,padding:radius})}border(borderWidth,borderColor,borderStyle="solid"){borderWidth=cssNumberToString(borderWidth);return this.merge({borderWidth,borderStyle,borderColor})}center(width,height){width=cssNumberToString(width);height=cssNumberToString(height);return this.merge({position:"absolute",left:0,right:0,top:0,bottom:0,width,height,margin:"auto"})}absolute(left,top,right,bottom){left=cssNumberToString(left);top=cssNumberToString(top);if(right!==undefined){right=cssNumberToString(right);bottom=cssNumberToString(bottom);return this.merge({position:"absolute",left,top,right,bottom})}return this.merge({position:"absolute",left,top})}merge(style){return new StyleBuilder(Object.assign(Object.assign({},this.style),style))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/StyleBuilder");System.register(["tslib","../../App","../../di/Inject","../../di/RegisterSingleton","../../services/BusyIndicatorService","../../services/NavigationService","../controls/AtomControl","../styles/StyleBuilder"],(function(_export,_context){"use strict";var __decorate,__metadata,App,Inject,RegisterSingleton,BusyIndicatorService,NavigationService,AtomControl,cssNumberToString,WebBusyIndicatorService;return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_App){App=_App.App},function(_diInject){Inject=_diInject.Inject},function(_diRegisterSingleton){RegisterSingleton=_diRegisterSingleton.RegisterSingleton},function(_servicesBusyIndicatorService){BusyIndicatorService=_servicesBusyIndicatorService.BusyIndicatorService},function(_servicesNavigationService){NavigationService=_servicesNavigationService.NavigationService},function(_controlsAtomControl){AtomControl=_controlsAtomControl.AtomControl},function(_stylesStyleBuilder){cssNumberToString=_stylesStyleBuilder.cssNumberToString}],execute:function(){_export("WebBusyIndicatorService",WebBusyIndicatorService=class WebBusyIndicatorService extends BusyIndicatorService{constructor(){super(...arguments);this.zIndex=5e4;this.indicators=0}createIndicator(){const host=document.createElement("div");const popup=new AtomControl(this.app,host);host.className="indicator-host";const span=document.createElement("i");const divStyle=host.style;divStyle.position="absolute";divStyle.overflow="hidden";divStyle.left=divStyle.right=divStyle.bottom=divStyle.top="0";divStyle.zIndex=this.zIndex+++"";const spanStyle=span.style;spanStyle.position="absolute";spanStyle.margin="auto";spanStyle.width="16px";spanStyle.height="16px";spanStyle.overflow="hidden";spanStyle.maxHeight="100%";spanStyle.maxWidth="100%";spanStyle.left=spanStyle.right=spanStyle.bottom=spanStyle.top="0";span.className="fas fa-spinner fa-spin";host.appendChild(span);const ws=this.navigationService;const e=ws.getHostForElement();if(e){e.appendChild(host)}else{document.body.appendChild(host);ws.refreshScreen();popup.bind(host,"styleLeft",[["this","scrollLeft"]],false,cssNumberToString,ws.screen);popup.bind(host,"styleTop",[["this","scrollTop"]],false,cssNumberToString,ws.screen);popup.bind(host,"styleWidth",[["this","width"]],false,cssNumberToString,ws.screen);popup.bind(host,"styleHeight",[["this","height"]],false,cssNumberToString,ws.screen)}popup.registerDisposable({dispose:()=>{host.remove()}});return popup}});__decorate([Inject,__metadata("design:type",NavigationService)],WebBusyIndicatorService.prototype,"navigationService",void 0);__decorate([Inject,__metadata("design:type",App)],WebBusyIndicatorService.prototype,"app",void 0);_export("WebBusyIndicatorService",WebBusyIndicatorService=__decorate([RegisterSingleton],WebBusyIndicatorService))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/services/WebBusyIndicatorService");System.register(["tslib"],(function(_export,_context){"use strict";var __awaiter,Atom;_export("Atom",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter}],execute:function(){_export("Atom",Atom=class Atom{static superProperty(tc,target,name){let c=tc;do{c=Object.getPrototypeOf(c);if(!c){throw new Error("No property descriptor found for "+name)}const pd=Object.getOwnPropertyDescriptor(c.prototype,name);if(!pd){continue}return pd.get.apply(target)}while(true)}static get(target,path){const segments=path.split(".");for(const iterator of segments){if(target===undefined||target===null){return target}target=target[iterator]}return target}static delay(n,ct){return new Promise(((resolve,reject)=>{const h={};h.id=setTimeout((()=>{resolve()}),n);if(ct){ct.registerForCancel((()=>{clearTimeout(h.id);reject(new Error("cancelled"))}))}}))}static encodeParameters(p){if(!p){return""}let s="";for(const key in p){if(p.hasOwnProperty(key)){const element=p[key];let v=element;if(v===undefined||v===null){continue}if(v instanceof Date){v=v.toISOString()}else if(typeof element==="object"){v=JSON.stringify(element)}if(s){s+="&"}s+=`${key}=${encodeURIComponent(v)}`}}return s}static url(url,query,hash){if(!url){return url}let p=this.encodeParameters(query);if(p){if(url.indexOf("?")===-1){url+="?"}else{url+="&"}url+=p}p=this.encodeParameters(hash);if(p){if(url.indexOf("#")===-1){url+="#"}else{url+="&"}url+=p}return url}static postAsync(app,f){return new Promise(((resolve,reject)=>{app.callLater((()=>__awaiter(this,void 0,void 0,(function*(){try{resolve(yield f())}catch(error){reject(error)}}))))}))}});Atom.designMode=false}}}));AmdLoader.instance.setup("@web-atoms/core/dist/Atom");System.register([],(function(_export,_context){"use strict";var FormattedError;_export("default",void 0);return{setters:[],execute:function(){_export("default",FormattedError=class FormattedError{constructor(msg){const e=new Error(msg.toString());e.formattedMessage=msg;e.__proto__=FormattedError.prototype;return e}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/FormattedError");System.register([],(function(_export,_context){"use strict";function registerInit(target,fx){const t=target;const inits=t._$_inits=t._$_inits||[];inits.push(fx)}_export("registerInit",registerInit);return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/view-model/baseTypes");System.register(["tslib","../App","../Atom","../core/AtomBinder","../core/AtomDisposableList","../core/AtomWatcher","../core/BindableProperty","../di/Inject","./baseTypes"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,__param,App,Atom,AtomBinder,AtomDisposableList,AtomWatcher,BindableProperty,Inject,registerInit,AtomViewModel;function runDecoratorInits(){const v=this.constructor.prototype;if(!v){return}const ris=v._$_inits;if(ris){for(const ri of ris){ri.call(this,this)}}}function privateInit(){return __awaiter(this,void 0,void 0,(function*(){try{yield Atom.postAsync(this.app,(()=>__awaiter(this,void 0,void 0,(function*(){runDecoratorInits.apply(this)}))));yield Atom.postAsync(this.app,(()=>__awaiter(this,void 0,void 0,(function*(){yield this.init();this.onReady()}))));if(this.postInit){for(const i of this.postInit){i()}this.postInit=null}}finally{const pi=this.pendingInits;this.pendingInits=null;for(const iterator of pi){iterator()}}}))}function waitForReady(vm){return __awaiter(this,void 0,void 0,(function*(){while(vm.pendingInits){yield Atom.delay(100)}}))}function Receive(...channel){return(target,key)=>{registerInit(target,(vm=>{const fx=vm[key];const a=(ch,d)=>{const p=fx.call(vm,ch,d);if(p&&p.then&&p.catch){p.catch((e=>{console.warn(e)}))}};const ivm=vm;for(const c of channel){ivm.registerDisposable(ivm.app.subscribe(c,a))}}))}}function BindableReceive(...channel){return(target,key)=>{const bp=BindableProperty(target,key);registerInit(target,(vm=>{const fx=(cx,m)=>{vm[key]=m};const ivm=vm;for(const c of channel){ivm.registerDisposable(ivm.app.subscribe(c,fx))}}));return bp}}function BindableBroadcast(...channel){return(target,key)=>{const bp=BindableProperty(target,key);registerInit(target,(vm=>{const fx=t=>{const v=vm[key];for(const c of channel){vm.app.broadcast(c,v)}};const d=new AtomWatcher(vm,[key.split(".")],fx);d.init();vm.registerDisposable(d)}));return bp}}function Watch(target,key,descriptor){registerInit(target,(vm=>{const ivm=vm;if(descriptor&&descriptor.get){ivm.setupWatch(descriptor.get,(()=>{vm.refresh(key.toString())}));return}ivm.setupWatch(vm[key])}))}function CachedWatch(target,key,descriptor){const getMethod=descriptor.get;descriptor.get=()=>null;registerInit(target,(vm=>{const ivm=vm;const fieldName=`_${key}`;Object.defineProperty(ivm,key,{enumerable:true,configurable:true,get(){const c=ivm[fieldName]||(ivm[fieldName]={value:getMethod.apply(ivm)});return c.value}});ivm.setupWatch(getMethod,(()=>{ivm[fieldName]=null;AtomBinder.refreshValue(ivm,key)}))}))}function Validate(target,key,descriptor){const getMethod=descriptor.get;descriptor.get=()=>null;registerInit(target,(vm=>{const initialized={i:false};const ivm=vm;Object.defineProperty(ivm,key,{enumerable:true,configurable:true,get(){if(vm.mShouldValidate&&initialized.i){return getMethod.apply(this)}return null}});ivm.setupWatch(getMethod,(()=>{initialized.i=true;vm.refresh(key.toString())}),true,key.toString());return}))}_export({waitForReady,Receive,BindableReceive,BindableBroadcast,Watch,CachedWatch,Validate});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata;__param=_tslib.__param},function(_App){App=_App.App},function(_Atom){Atom=_Atom.Atom},function(_coreAtomBinder){AtomBinder=_coreAtomBinder.AtomBinder},function(_coreAtomDisposableList){AtomDisposableList=_coreAtomDisposableList.AtomDisposableList},function(_coreAtomWatcher){AtomWatcher=_coreAtomWatcher.AtomWatcher},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_diInject){Inject=_diInject.Inject},function(_baseTypes){registerInit=_baseTypes.registerInit}],execute:function(){_export("AtomViewModel",AtomViewModel=class AtomViewModel{get isReady(){return this.pendingInits===null}get errors(){const e=[];if(!this.mShouldValidate){return e}for(const v of this.validations){if(!v.initialized){return e}const error=this[v.name];if(error){e.push({name:v.name,error})}}return e}get parent(){return this.mParent}set parent(v){if(this.mParent&&this.mParent.mChildren){this.mParent.mChildren.remove(this)}this.mParent=v;if(v){const c=v.mChildren||(v.mChildren=[]);c.add(this);this.registerDisposable({dispose:()=>{c.remove(this)}})}}get isValid(){let valid=true;const validateWasFalse=this.mShouldValidate===false;this.mShouldValidate=true;for(const v of this.validations){if(!v.initialized){v.watcher.init(true);v.initialized=true}if(this[v.name]){if(validateWasFalse){AtomBinder.refreshValue(this,v.name)}valid=false}}if(this.mChildren){for(const child of this.mChildren){if(!child.isValid){valid=false}}}AtomBinder.refreshValue(this,"errors");return valid}constructor(app){this.app=app;this.disposables=null;this.validations=[];this.pendingInits=[];this.mShouldValidate=false;this.app.runAsync((()=>privateInit.apply(this)))}resetValidations(resetChildren=true){this.mShouldValidate=false;for(const v of this.validations){this.refresh(v.name)}if(resetChildren&&this.mChildren){for(const iterator of this.mChildren){iterator.resetValidations(resetChildren)}}}runAfterInit(f){if(this.pendingInits){this.pendingInits.push(f);return}f()}refresh(name){AtomBinder.refreshValue(this,name)}init(){return __awaiter(this,void 0,void 0,(function*(){}))}dispose(){if(this.disposables){this.disposables.dispose()}}registerDisposable(d){this.disposables=this.disposables||new AtomDisposableList;return this.disposables.add(d)}onReady(){}setupWatch(ft,proxy,forValidation,name){const d=new AtomWatcher(this,ft,proxy,this);if(forValidation){this.validations=this.validations||[];this.validations.push({name,watcher:d,initialized:false})}else{d.init()}return this.registerDisposable(d)}onPropertyChanged(name){}});_export("AtomViewModel",AtomViewModel=__decorate([__param(0,Inject),__metadata("design:paramtypes",[App])],AtomViewModel))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/view-model/AtomViewModel");System.register(["tslib","../services/NavigationService","./AtomViewModel"],(function(_export,_context){"use strict";var __awaiter,NavigationService,AtomViewModel,AtomWindowViewModel;_export("AtomWindowViewModel",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_servicesNavigationService){NavigationService=_servicesNavigationService.NavigationService},function(_AtomViewModel){AtomViewModel=_AtomViewModel.AtomViewModel}],execute:function(){_export("AtomWindowViewModel",AtomWindowViewModel=class AtomWindowViewModel extends AtomViewModel{close(result){this.app.broadcast(`atom-window-close:${this.windowName}`,result)}cancel(){return __awaiter(this,void 0,void 0,(function*(){if(this.closeWarning){const navigationService=this.app.resolve(NavigationService);if(!(yield navigationService.confirm(this.closeWarning,"Are you sure?"))){return false}}this.app.broadcast(`atom-window-cancel:${this.windowName}`,"cancelled");return true}))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/view-model/AtomWindowViewModel");System.register(["@web-atoms/core/src/web/images/close-button-hover.svg","../styles/AtomStyle"],(function(_export,_context){"use strict";var closeButtonHover,AtomStyle,AtomWindowStyle;_export("AtomWindowStyle",void 0);return{setters:[function(_webAtomsCoreSrcWebImagesCloseButtonHoverSvg){closeButtonHover=_webAtomsCoreSrcWebImagesCloseButtonHoverSvg.default},function(_stylesAtomStyle){AtomStyle=_stylesAtomStyle.AtomStyle}],execute:function(){_export("AtomWindowStyle",AtomWindowStyle=class AtomWindowStyle extends AtomStyle{get root(){return Object.assign(Object.assign({},this.frameHost),{subclasses:{" .close-button":this.closeButton," .command-bar-presenter":this.commandBarPresenter," .command-bar":this.commandBar," .content-presenter":this.contentPresenter," .content":this.content," .frame":this.frame," .title":this.title," .title-host":this.titleHost," .title-presenter":this.titlePresenter}})}get frameHost(){return{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundColor:"#50505080"}}get frame(){return{position:"absolute",minHeight:"100px",minWidth:"300px",margin:"auto",border:"solid 1px #808080",borderRadius:"5px",backgroundColor:"white"}}get titlePresenter(){return{position:"relative",left:0,right:0,top:0,height:"37px"}}get titleHost(){return{position:"absolute",left:0,right:0,padding:"7px",minHeight:"32px",backgroundColor:"#404040",color:"white",top:0,borderTopRightRadius:"4px",borderTopLeftRadius:"4px"}}get title(){return{margin:"auto"}}get closeButton(){return{position:"absolute",right:"6px",top:"7px",width:"0",height:"0",padding:"9px",border:"none",backgroundColor:"transparent",backgroundImage:closeButtonHover}}get content(){return{}}get contentPresenter(){return{position:"relative",padding:"10px",background:"white"}}get commandBarPresenter(){return{left:0,right:0,bottom:0,padding:"5px",backgroundColor:"#d4d4d4",textAlign:"right",borderBottomRightRadius:"4px",borderBottomLeftRadius:"4px"}}get commandBar(){return{subclasses:{" button":{borderRadius:"3px",marginLeft:"5px",marginRight:"5px",padding:"4px 16px",backgroundColor:"whitesmoke",border:"1px solid gray"}}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomWindowStyle");System.register(["../../core/Colors","./AtomWindowStyle"],(function(_export,_context){"use strict";var Colors,AtomWindowStyle,AtomAlertWindowStyle;_export("default",void 0);return{setters:[function(_coreColors){Colors=_coreColors.default},function(_AtomWindowStyle){AtomWindowStyle=_AtomWindowStyle.AtomWindowStyle}],execute:function(){_export("default",AtomAlertWindowStyle=class AtomAlertWindowStyle extends AtomWindowStyle{get titleHost(){return Object.assign(Object.assign({},this.getBaseProperty(AtomAlertWindowStyle,"titleHost")),{color:Colors.black,backgroundColor:Colors.white})}get contentPresenter(){return Object.assign(Object.assign({},this.getBaseProperty(AtomAlertWindowStyle,"contentPresenter")),{padding:"0px 10px 30px 10px",textAlign:"center",color:Colors.rgba(51,51,51)})}get commandBar(){return Object.assign(Object.assign({},this.getBaseProperty(AtomAlertWindowStyle,"commandBar")),{textAlign:"center",subclasses:{" button":this.buttonStyle," .yes-button":{backgroundColor:Colors.rgba(0,128,0)}," .no-button":{backgroundColor:Colors.rgba(255,0,0)}}})}get buttonStyle(){return{border:"none",color:Colors.white,width:"50%",height:"40px"}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomAlertWindowStyle");System.register(["./AtomControl"],(function(_export,_context){"use strict";var AtomControl,AtomTemplate;_export("AtomTemplate",void 0);return{setters:[function(_AtomControl){AtomControl=_AtomControl.AtomControl}],execute:function(){_export("AtomTemplate",AtomTemplate=class AtomTemplate extends AtomControl{})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomTemplate");System.register(["../../App","../../core/Bind","../../core/XNode","../styles/AtomWindowStyle","./AtomControl","./AtomTemplate"],(function(_export,_context){"use strict";var App,Bind,XNode,AtomWindowStyle,AtomControl,AtomTemplate,AtomWindowFrameTemplate,AtomWindowTitleTemplate,AtomWindow;function getTemplateParent(e){const tp=e._templateParent;if(tp){return tp}const p=e._logicalParent||e.parentElement;if(p){return getTemplateParent(p)}}_export({getTemplateParent,AtomWindowFrameTemplate:void 0,AtomWindow:void 0});return{setters:[function(_App){App=_App.App},function(_coreBind){Bind=_coreBind.default},function(_coreXNode){XNode=_coreXNode.default},function(_stylesAtomWindowStyle){AtomWindowStyle=_stylesAtomWindowStyle.AtomWindowStyle},function(_AtomControl){AtomControl=_AtomControl.AtomControl},function(_AtomTemplate){AtomTemplate=_AtomTemplate.AtomTemplate}],execute:function(){_export("AtomWindowFrameTemplate",AtomWindowFrameTemplate=class AtomWindowFrameTemplate extends AtomTemplate{get templateParent(){return getTemplateParent(this.element)}preCreate(){this.titlePresenter=null;this.commandPresenter=null;this.contentPresenter=null;super.preCreate()}create(){this.render(XNode.create("div",{class:"frame",styleWidth:Bind.oneWay((()=>this.templateParent.width||undefined)),styleHeight:Bind.oneWay((()=>this.templateParent.height||undefined)),styleLeft:Bind.oneWay((()=>this.templateParent.x>=0?`${this.templateParent.x}px`:undefined)),styleTop:Bind.oneWay((()=>this.templateParent.y>=0?`${this.templateParent.y}px`:undefined)),styleMarginTop:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined)),styleMarginLeft:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined)),styleMarginRight:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined)),styleMarginBottom:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined))},XNode.create("div",{class:"title-presenter",presenter:Bind.presenter("titlePresenter")}),XNode.create("div",{class:"content-presenter",presenter:Bind.presenter("contentPresenter")}),XNode.create("div",{class:"command-bar-presenter",presenter:Bind.presenter("commandPresenter")})))}});AtomWindowTitleTemplate=class AtomWindowTitleTemplate extends AtomControl{get templateParent(){return getTemplateParent(this.element)}create(){this.render(XNode.create("div",{class:"title-host"},XNode.create("span",{class:"title",text:Bind.oneWay((()=>this.templateParent.title))}),XNode.create("button",{class:"close-button",eventClick:Bind.event((()=>this.templateParent.close()))})))}};_export("AtomWindow",AtomWindow=class AtomWindow extends AtomControl{constructor(){super(...arguments);this.title="";this.width="";this.height="";this.x=-1;this.y=-1;this.titleTemplate=AtomWindowTitleTemplate;this.frameTemplate=AtomWindowFrameTemplate;this.isReady=false}get templateParent(){return getTemplateParent(this.element)}onPropertyChanged(name){switch(name){case"windowTemplate":case"commandTemplate":case"frameTemplate":this.invalidate();break}}close(){const vm=this.viewModel;if(vm.cancel){this.app.runAsync((()=>vm.cancel()));return}const message=`atom-window-cancel:${this.id}`;const device=this.app.resolve(App);device.broadcast(message,"cancelled")}onUpdateUI(){if(!(this.windowTemplate&&this.frameTemplate)){return}if(this.isReady){return}this.bind(this.element,"title",[["viewModel","title"]]);const frame=new this.frameTemplate(this.app);const fe=frame.element;const titleContent=new this.titleTemplate(this.app);titleContent.element._templateParent=this;frame.titlePresenter.appendChild(titleContent.element);this.setupDragging(frame.titlePresenter);this.element.classList.add("frame-host");fe._logicalParent=this.element;fe._templateParent=this;if(!frame.contentPresenter){throw new Error("ContentPresenter must be set inside frameTemplate before creating window")}const content=new this.windowTemplate(this.app);content.element._templateParent=this;this.setElementClass(content.element,{content:1});frame.contentPresenter.appendChild(content.element);if(this.commandTemplate){if(!frame.commandPresenter){throw new Error("CommandPresenter must be set inside frameTemplate"+"before creating window if command template is present")}const command=new this.commandTemplate(this.app);command.element._templateParent=this;this.setElementClass(command.element,{"command-bar":1});frame.commandPresenter.appendChild(command.element)}this.append(frame);setTimeout((()=>{this.centerFrame(frame.element)}),100);this.isReady=true}preCreate(){this.defaultControlStyle=AtomWindowStyle;this.title=null;this.width="";this.height="";this.x=-1;this.y=-1;this.windowTemplate=null;this.commandTemplate=null;this.titleTemplate=AtomWindowTitleTemplate;this.frameTemplate=AtomWindowFrameTemplate;super.preCreate();this.render(XNode.create("div",{styleClass:Bind.oneTime((()=>this.controlStyle.name))}))}centerFrame(e){if(!this.element){return}const parent=this.element.parentElement;if(parent===window||parent===document.body){return}if(parent.offsetWidth<=0||parent.offsetHeight<=0){setTimeout((()=>{this.centerFrame(e)}),100);return}if(e.offsetWidth<=0||e.offsetHeight<=0){setTimeout((()=>{this.centerFrame(e)}),100);return}const x=(parent.offsetWidth-e.offsetWidth)/2;const y=(parent.offsetHeight-e.offsetHeight)/2;this.x=x;this.y=y;e.style.opacity="1";this.element.style.removeProperty("opacity")}setupDragging(tp){this.bindEvent(tp,"mousedown",(startEvent=>{startEvent.preventDefault();const disposables=[];const offset={x:tp.parentElement.offsetLeft,y:tp.parentElement.offsetTop};const rect={x:startEvent.clientX,y:startEvent.clientY};const cursor=tp.style.cursor;tp.style.cursor="move";disposables.push(this.bindEvent(document.body,"mousemove",(moveEvent=>{const{clientX,clientY}=moveEvent;const dx=clientX-rect.x;const dy=clientY-rect.y;offset.x+=dx;offset.y+=dy;this.x=offset.x;this.y=offset.y;rect.x=clientX;rect.y=clientY})));disposables.push(this.bindEvent(document.body,"mouseup",(endEvent=>{tp.style.cursor=cursor;for(const iterator of disposables){iterator.dispose()}})))}))}});AtomWindow.windowTemplate=XNode.prepare("windowTemplate",true,true);AtomWindow.commandTemplate=XNode.prepare("commandTemplate",true,true);AtomWindow.titleTemplate=XNode.prepare("titleTemplate",true,true);AtomWindow.frameTemplate=XNode.prepare("frameTemplate",true,true)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomWindow");System.register(["tslib","../../core/Bind","../../core/BindableProperty","../../core/XNode","../../view-model/AtomWindowViewModel","../styles/AtomAlertWindowStyle","./AtomWindow"],(function(_export,_context){"use strict";var __decorate,__metadata,Bind,BindableProperty,XNode,AtomWindowViewModel,AtomAlertWindowStyle,AtomWindow,AtomAlertWindow,AtomAlertViewModel;_export("default",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreBind){Bind=_coreBind.default},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_coreXNode){XNode=_coreXNode.default},function(_viewModelAtomWindowViewModel){AtomWindowViewModel=_viewModelAtomWindowViewModel.AtomWindowViewModel},function(_stylesAtomAlertWindowStyle){AtomAlertWindowStyle=_stylesAtomAlertWindowStyle.default},function(_AtomWindow){AtomWindow=_AtomWindow.AtomWindow}],execute:function(){_export("default",AtomAlertWindow=class AtomAlertWindow extends AtomWindow{create(){this.defaultControlStyle=AtomAlertWindowStyle;this.viewModel=this.resolve(AtomAlertViewModel);this.render(XNode.create(AtomWindow,{title:Bind.oneWay((()=>this.viewModel.title))},XNode.create(AtomWindow.windowTemplate,null,XNode.create("div",{formattedText:Bind.oneWay((()=>this.viewModel.message))})),XNode.create(AtomWindow.commandTemplate,null,XNode.create("div",null,XNode.create("button",{class:"yes-button",styleDisplay:Bind.oneWay((()=>this.viewModel.okTitle?"":"none")),text:Bind.oneWay((()=>this.viewModel.okTitle)),eventClick:()=>this.viewModel.onOkClicked()}),XNode.create("button",{class:"no-button",styleMarginBottom:Bind.oneWay((()=>this.viewModel.cancelTitle?"0":"10px")),styleDisplay:Bind.oneWay((()=>this.viewModel.cancelTitle?"":"none")),text:Bind.oneWay((()=>this.viewModel.cancelTitle)),eventClick:()=>this.viewModel.onCancelClicked()})))))}});AtomAlertViewModel=class AtomAlertViewModel extends AtomWindowViewModel{onOkClicked(){this.close(true)}onCancelClicked(){this.cancel()}};__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"title",void 0);__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"message",void 0);__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"okTitle",void 0);__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"cancelTitle",void 0)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomAlertWindow");System.register(["../../core/Colors","./AtomStyle"],(function(_export,_context){"use strict";var Colors,AtomStyle,AtomNotificationStyle;_export("default",void 0);return{setters:[function(_coreColors){Colors=_coreColors.default},function(_AtomStyle){AtomStyle=_AtomStyle.AtomStyle}],execute:function(){_export("default",AtomNotificationStyle=class AtomNotificationStyle extends AtomStyle{get root(){return{padding:"5px",borderRadius:"5px",border:"solid 1px lightgray",fontFamily:"Verdana, Geneva, sans-serif",fontSize:"16px",subclasses:{".error":{borderColor:Colors.red,color:Colors.red},".warning":{backgroundColor:Colors.lightYellow}}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomNotificationStyle");System.register(["tslib","../../core/Bind","../../core/BindableProperty","../../core/XNode","../styles/AtomNotificationStyle","./AtomControl"],(function(_export,_context){"use strict";var __decorate,__metadata,Bind,BindableProperty,XNode,AtomNotificationStyle,AtomControl,AtomNotification;_export("default",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreBind){Bind=_coreBind.default},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_coreXNode){XNode=_coreXNode.default},function(_stylesAtomNotificationStyle){AtomNotificationStyle=_stylesAtomNotificationStyle.default},function(_AtomControl){AtomControl=_AtomControl.AtomControl}],execute:function(){_export("default",AtomNotification=class AtomNotification extends AtomControl{constructor(){super(...arguments);this.timeout=5e3;this.timeoutKey=null}onPropertyChanged(name){switch(name){case"timeout":this.setupTimeout();break}}create(){this.defaultControlStyle=AtomNotificationStyle;this.render(XNode.create("div",{formattedText:Bind.oneWay((()=>this.viewModel.message)),timeout:Bind.oneWay((()=>this.viewModel.timeout||5e3)),styleClass:Bind.oneWay((()=>({[this.controlStyle.name]:1,error:this.viewModel.type&&/error/i.test(this.viewModel.type),warning:this.viewModel.type&&/warn/i.test(this.viewModel.type)})))}))}setupTimeout(){if(this.timeoutKey){clearTimeout(this.timeoutKey)}this.timeoutKey=setTimeout((()=>{if(this.element){this.app.broadcast(`atom-window-close:${this.id}`,"")}}),this.timeout)}});__decorate([BindableProperty,__metadata("design:type",Number)],AtomNotification.prototype,"timeout",void 0)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomNotification");System.register(["../styles/AtomStyle"],(function(_export,_context){"use strict";var AtomStyle,AtomPopupStyle;_export("AtomPopupStyle",void 0);return{setters:[function(_stylesAtomStyle){AtomStyle=_stylesAtomStyle.AtomStyle}],execute:function(){_export("AtomPopupStyle",AtomPopupStyle=class AtomPopupStyle extends AtomStyle{get root(){return{backgroundColor:"white",border:"solid 1px lightgray",padding:"5px",borderRadius:"5px"}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomPopupStyle");System.register(["../../core/XNode","../../style/styled","./PopupService"],(function(_export,_context){"use strict";var XNode,styled,PopupWindow,css;function NotificationPopup({message,type}){return class Notification extends PopupWindow{create(){if(message instanceof XNode){this.render(XNode.create("div",{styleClass:{[css]:1,error:/error/i.test(type),warning:/warn/i.test(type)}},message));return}this.render(XNode.create("div",{styleClass:{[css]:1,error:/error/i.test(type),warning:/warn/i.test(type)},formattedText:message}))}}}_export("default",NotificationPopup);return{setters:[function(_coreXNode){XNode=_coreXNode.default},function(_styleStyled){styled=_styleStyled.default},function(_PopupService){PopupWindow=_PopupService.PopupWindow}],execute:function(){css=styled.css`
1502
+ `.installGlobal("[store-app]");StoreApp=class StoreApp extends MobileDesktopApp{init(){return __awaiter(this,void 0,void 0,(function*(){StoreCommands.install(this);this.element.setAttribute("store-app","store-app");if(!Command.invokeRoute()){StoreCommands.productList.dispatch()}}))}};StoreApp=__decorate([Pack],StoreApp);_export("default",StoreApp);Route.encodeUrl=url=>{if(url.startsWith("#")){return url}if(/^\d+\.\d+\.\d+\.\d+/.test(location.hostname)){return"#!"+url}return url}}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/public/store/StoreApp");System.register([],(function(_export,_context){"use strict";var AtomOnce;_export("AtomOnce",void 0);return{setters:[],execute:function(){_export("AtomOnce",AtomOnce=class AtomOnce{run(f){if(this.isRunning){return}let isAsync=false;try{this.isRunning=true;const p=f();if(p&&p.then&&p.catch){isAsync=true;p.then((()=>{this.isRunning=false})).catch((()=>{this.isRunning=false}))}}finally{if(!isAsync){this.isRunning=false}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomOnce");System.register([],(function(_export,_context){"use strict";var StyleBuilder;function cssNumberToString(n,unit="px"){if(typeof n==="number"){if(n===0){return n+""}return n+unit}return n}_export({cssNumberToString,default:void 0});return{setters:[],execute:function(){_export("default",StyleBuilder=class StyleBuilder{static get newStyle(){return new StyleBuilder}constructor(style){this.style=style;this.style=this.style||{}}toStyle(){return this.style}size(width,height){width=cssNumberToString(width);height=cssNumberToString(height);return this.merge({width,height})}roundBorder(radius){radius=cssNumberToString(radius);return this.merge({borderRadius:radius,padding:radius})}border(borderWidth,borderColor,borderStyle="solid"){borderWidth=cssNumberToString(borderWidth);return this.merge({borderWidth,borderStyle,borderColor})}center(width,height){width=cssNumberToString(width);height=cssNumberToString(height);return this.merge({position:"absolute",left:0,right:0,top:0,bottom:0,width,height,margin:"auto"})}absolute(left,top,right,bottom){left=cssNumberToString(left);top=cssNumberToString(top);if(right!==undefined){right=cssNumberToString(right);bottom=cssNumberToString(bottom);return this.merge({position:"absolute",left,top,right,bottom})}return this.merge({position:"absolute",left,top})}merge(style){return new StyleBuilder(Object.assign(Object.assign({},this.style),style))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/StyleBuilder");System.register(["tslib","../../App","../../di/Inject","../../di/RegisterSingleton","../../services/BusyIndicatorService","../../services/NavigationService","../controls/AtomControl","../styles/StyleBuilder"],(function(_export,_context){"use strict";var __decorate,__metadata,App,Inject,RegisterSingleton,BusyIndicatorService,NavigationService,AtomControl,cssNumberToString,WebBusyIndicatorService;return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_App){App=_App.App},function(_diInject){Inject=_diInject.Inject},function(_diRegisterSingleton){RegisterSingleton=_diRegisterSingleton.RegisterSingleton},function(_servicesBusyIndicatorService){BusyIndicatorService=_servicesBusyIndicatorService.BusyIndicatorService},function(_servicesNavigationService){NavigationService=_servicesNavigationService.NavigationService},function(_controlsAtomControl){AtomControl=_controlsAtomControl.AtomControl},function(_stylesStyleBuilder){cssNumberToString=_stylesStyleBuilder.cssNumberToString}],execute:function(){_export("WebBusyIndicatorService",WebBusyIndicatorService=class WebBusyIndicatorService extends BusyIndicatorService{constructor(){super(...arguments);this.zIndex=5e4;this.indicators=0}createIndicator(){const host=document.createElement("div");const popup=new AtomControl(this.app,host);host.className="indicator-host";const span=document.createElement("i");const divStyle=host.style;divStyle.position="absolute";divStyle.overflow="hidden";divStyle.left=divStyle.right=divStyle.bottom=divStyle.top="0";divStyle.zIndex=this.zIndex+++"";const spanStyle=span.style;spanStyle.position="absolute";spanStyle.margin="auto";spanStyle.width="16px";spanStyle.height="16px";spanStyle.overflow="hidden";spanStyle.maxHeight="100%";spanStyle.maxWidth="100%";spanStyle.left=spanStyle.right=spanStyle.bottom=spanStyle.top="0";span.className="fas fa-spinner fa-spin";host.appendChild(span);const ws=this.navigationService;const e=ws.getHostForElement();if(e){e.appendChild(host)}else{document.body.appendChild(host);ws.refreshScreen();popup.bind(host,"styleLeft",[["this","scrollLeft"]],false,cssNumberToString,ws.screen);popup.bind(host,"styleTop",[["this","scrollTop"]],false,cssNumberToString,ws.screen);popup.bind(host,"styleWidth",[["this","width"]],false,cssNumberToString,ws.screen);popup.bind(host,"styleHeight",[["this","height"]],false,cssNumberToString,ws.screen)}popup.registerDisposable({dispose:()=>{host.remove()}});return popup}});__decorate([Inject,__metadata("design:type",NavigationService)],WebBusyIndicatorService.prototype,"navigationService",void 0);__decorate([Inject,__metadata("design:type",App)],WebBusyIndicatorService.prototype,"app",void 0);_export("WebBusyIndicatorService",WebBusyIndicatorService=__decorate([RegisterSingleton],WebBusyIndicatorService))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/services/WebBusyIndicatorService");System.register(["tslib"],(function(_export,_context){"use strict";var __awaiter,Atom;_export("Atom",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter}],execute:function(){_export("Atom",Atom=class Atom{static superProperty(tc,target,name){let c=tc;do{c=Object.getPrototypeOf(c);if(!c){throw new Error("No property descriptor found for "+name)}const pd=Object.getOwnPropertyDescriptor(c.prototype,name);if(!pd){continue}return pd.get.apply(target)}while(true)}static get(target,path){const segments=path.split(".");for(const iterator of segments){if(target===undefined||target===null){return target}target=target[iterator]}return target}static delay(n,ct){return new Promise(((resolve,reject)=>{const h={};h.id=setTimeout((()=>{resolve()}),n);if(ct){ct.registerForCancel((()=>{clearTimeout(h.id);reject(new Error("cancelled"))}))}}))}static encodeParameters(p){if(!p){return""}let s="";for(const key in p){if(p.hasOwnProperty(key)){const element=p[key];let v=element;if(v===undefined||v===null){continue}if(v instanceof Date){v=v.toISOString()}else if(typeof element==="object"){v=JSON.stringify(element)}if(s){s+="&"}s+=`${key}=${encodeURIComponent(v)}`}}return s}static url(url,query,hash){if(!url){return url}let p=this.encodeParameters(query);if(p){if(url.indexOf("?")===-1){url+="?"}else{url+="&"}url+=p}p=this.encodeParameters(hash);if(p){if(url.indexOf("#")===-1){url+="#"}else{url+="&"}url+=p}return url}static postAsync(app,f){return new Promise(((resolve,reject)=>{app.callLater((()=>__awaiter(this,void 0,void 0,(function*(){try{resolve(yield f())}catch(error){reject(error)}}))))}))}});Atom.designMode=false}}}));AmdLoader.instance.setup("@web-atoms/core/dist/Atom");System.register([],(function(_export,_context){"use strict";var FormattedError;_export("default",void 0);return{setters:[],execute:function(){_export("default",FormattedError=class FormattedError{constructor(msg){const e=new Error(msg.toString());e.formattedMessage=msg;e.__proto__=FormattedError.prototype;return e}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/FormattedError");System.register([],(function(_export,_context){"use strict";function registerInit(target,fx){const t=target;const inits=t._$_inits=t._$_inits||[];inits.push(fx)}_export("registerInit",registerInit);return{setters:[],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/view-model/baseTypes");System.register(["tslib","../App","../Atom","../core/AtomBinder","../core/AtomDisposableList","../core/AtomWatcher","../core/BindableProperty","../di/Inject","./baseTypes"],(function(_export,_context){"use strict";var __awaiter,__decorate,__metadata,__param,App,Atom,AtomBinder,AtomDisposableList,AtomWatcher,BindableProperty,Inject,registerInit,AtomViewModel;function runDecoratorInits(){const v=this.constructor.prototype;if(!v){return}const ris=v._$_inits;if(ris){for(const ri of ris){ri.call(this,this)}}}function privateInit(){return __awaiter(this,void 0,void 0,(function*(){try{yield Atom.postAsync(this.app,(()=>__awaiter(this,void 0,void 0,(function*(){runDecoratorInits.apply(this)}))));yield Atom.postAsync(this.app,(()=>__awaiter(this,void 0,void 0,(function*(){yield this.init();this.onReady()}))));if(this.postInit){for(const i of this.postInit){i()}this.postInit=null}}finally{const pi=this.pendingInits;this.pendingInits=null;for(const iterator of pi){iterator()}}}))}function waitForReady(vm){return __awaiter(this,void 0,void 0,(function*(){while(vm.pendingInits){yield Atom.delay(100)}}))}function Receive(...channel){return(target,key)=>{registerInit(target,(vm=>{const fx=vm[key];const a=(ch,d)=>{const p=fx.call(vm,ch,d);if(p&&p.then&&p.catch){p.catch((e=>{console.warn(e)}))}};const ivm=vm;for(const c of channel){ivm.registerDisposable(ivm.app.subscribe(c,a))}}))}}function BindableReceive(...channel){return(target,key)=>{const bp=BindableProperty(target,key);registerInit(target,(vm=>{const fx=(cx,m)=>{vm[key]=m};const ivm=vm;for(const c of channel){ivm.registerDisposable(ivm.app.subscribe(c,fx))}}));return bp}}function BindableBroadcast(...channel){return(target,key)=>{const bp=BindableProperty(target,key);registerInit(target,(vm=>{const fx=t=>{const v=vm[key];for(const c of channel){vm.app.broadcast(c,v)}};const d=new AtomWatcher(vm,[key.split(".")],fx);d.init();vm.registerDisposable(d)}));return bp}}function Watch(target,key,descriptor){registerInit(target,(vm=>{const ivm=vm;if(descriptor&&descriptor.get){ivm.setupWatch(descriptor.get,(()=>{vm.refresh(key.toString())}));return}ivm.setupWatch(vm[key])}))}function CachedWatch(target,key,descriptor){const getMethod=descriptor.get;descriptor.get=()=>null;registerInit(target,(vm=>{const ivm=vm;const fieldName=`_${key}`;Object.defineProperty(ivm,key,{enumerable:true,configurable:true,get(){const c=ivm[fieldName]||(ivm[fieldName]={value:getMethod.apply(ivm)});return c.value}});ivm.setupWatch(getMethod,(()=>{ivm[fieldName]=null;AtomBinder.refreshValue(ivm,key)}))}))}function Validate(target,key,descriptor){const getMethod=descriptor.get;descriptor.get=()=>null;registerInit(target,(vm=>{const initialized={i:false};const ivm=vm;Object.defineProperty(ivm,key,{enumerable:true,configurable:true,get(){if(vm.mShouldValidate&&initialized.i){return getMethod.apply(this)}return null}});ivm.setupWatch(getMethod,(()=>{initialized.i=true;vm.refresh(key.toString())}),true,key.toString());return}))}_export({waitForReady,Receive,BindableReceive,BindableBroadcast,Watch,CachedWatch,Validate});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter;__decorate=_tslib.__decorate;__metadata=_tslib.__metadata;__param=_tslib.__param},function(_App){App=_App.App},function(_Atom){Atom=_Atom.Atom},function(_coreAtomBinder){AtomBinder=_coreAtomBinder.AtomBinder},function(_coreAtomDisposableList){AtomDisposableList=_coreAtomDisposableList.AtomDisposableList},function(_coreAtomWatcher){AtomWatcher=_coreAtomWatcher.AtomWatcher},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_diInject){Inject=_diInject.Inject},function(_baseTypes){registerInit=_baseTypes.registerInit}],execute:function(){_export("AtomViewModel",AtomViewModel=class AtomViewModel{get isReady(){return this.pendingInits===null}get errors(){const e=[];if(!this.mShouldValidate){return e}for(const v of this.validations){if(!v.initialized){return e}const error=this[v.name];if(error){e.push({name:v.name,error})}}return e}get parent(){return this.mParent}set parent(v){if(this.mParent&&this.mParent.mChildren){this.mParent.mChildren.remove(this)}this.mParent=v;if(v){const c=v.mChildren||(v.mChildren=[]);c.add(this);this.registerDisposable({dispose:()=>{c.remove(this)}})}}get isValid(){let valid=true;const validateWasFalse=this.mShouldValidate===false;this.mShouldValidate=true;for(const v of this.validations){if(!v.initialized){v.watcher.init(true);v.initialized=true}if(this[v.name]){if(validateWasFalse){AtomBinder.refreshValue(this,v.name)}valid=false}}if(this.mChildren){for(const child of this.mChildren){if(!child.isValid){valid=false}}}AtomBinder.refreshValue(this,"errors");return valid}constructor(app){this.app=app;this.disposables=null;this.validations=[];this.pendingInits=[];this.mShouldValidate=false;this.app.runAsync((()=>privateInit.apply(this)))}resetValidations(resetChildren=true){this.mShouldValidate=false;for(const v of this.validations){this.refresh(v.name)}if(resetChildren&&this.mChildren){for(const iterator of this.mChildren){iterator.resetValidations(resetChildren)}}}runAfterInit(f){if(this.pendingInits){this.pendingInits.push(f);return}f()}refresh(name){AtomBinder.refreshValue(this,name)}init(){return __awaiter(this,void 0,void 0,(function*(){}))}dispose(){if(this.disposables){this.disposables.dispose()}}registerDisposable(d){this.disposables=this.disposables||new AtomDisposableList;return this.disposables.add(d)}onReady(){}setupWatch(ft,proxy,forValidation,name){const d=new AtomWatcher(this,ft,proxy,this);if(forValidation){this.validations=this.validations||[];this.validations.push({name,watcher:d,initialized:false})}else{d.init()}return this.registerDisposable(d)}onPropertyChanged(name){}});_export("AtomViewModel",AtomViewModel=__decorate([__param(0,Inject),__metadata("design:paramtypes",[App])],AtomViewModel))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/view-model/AtomViewModel");System.register(["tslib","../services/NavigationService","./AtomViewModel"],(function(_export,_context){"use strict";var __awaiter,NavigationService,AtomViewModel,AtomWindowViewModel;_export("AtomWindowViewModel",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_servicesNavigationService){NavigationService=_servicesNavigationService.NavigationService},function(_AtomViewModel){AtomViewModel=_AtomViewModel.AtomViewModel}],execute:function(){_export("AtomWindowViewModel",AtomWindowViewModel=class AtomWindowViewModel extends AtomViewModel{close(result){this.app.broadcast(`atom-window-close:${this.windowName}`,result)}cancel(){return __awaiter(this,void 0,void 0,(function*(){if(this.closeWarning){const navigationService=this.app.resolve(NavigationService);if(!(yield navigationService.confirm(this.closeWarning,"Are you sure?"))){return false}}this.app.broadcast(`atom-window-cancel:${this.windowName}`,"cancelled");return true}))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/view-model/AtomWindowViewModel");System.register(["@web-atoms/core/src/web/images/close-button-hover.svg","../styles/AtomStyle"],(function(_export,_context){"use strict";var closeButtonHover,AtomStyle,AtomWindowStyle;_export("AtomWindowStyle",void 0);return{setters:[function(_webAtomsCoreSrcWebImagesCloseButtonHoverSvg){closeButtonHover=_webAtomsCoreSrcWebImagesCloseButtonHoverSvg.default},function(_stylesAtomStyle){AtomStyle=_stylesAtomStyle.AtomStyle}],execute:function(){_export("AtomWindowStyle",AtomWindowStyle=class AtomWindowStyle extends AtomStyle{get root(){return Object.assign(Object.assign({},this.frameHost),{subclasses:{" .close-button":this.closeButton," .command-bar-presenter":this.commandBarPresenter," .command-bar":this.commandBar," .content-presenter":this.contentPresenter," .content":this.content," .frame":this.frame," .title":this.title," .title-host":this.titleHost," .title-presenter":this.titlePresenter}})}get frameHost(){return{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundColor:"#50505080"}}get frame(){return{position:"absolute",minHeight:"100px",minWidth:"300px",margin:"auto",border:"solid 1px #808080",borderRadius:"5px",backgroundColor:"white"}}get titlePresenter(){return{position:"relative",left:0,right:0,top:0,height:"37px"}}get titleHost(){return{position:"absolute",left:0,right:0,padding:"7px",minHeight:"32px",backgroundColor:"#404040",color:"white",top:0,borderTopRightRadius:"4px",borderTopLeftRadius:"4px"}}get title(){return{margin:"auto"}}get closeButton(){return{position:"absolute",right:"6px",top:"7px",width:"0",height:"0",padding:"9px",border:"none",backgroundColor:"transparent",backgroundImage:closeButtonHover}}get content(){return{}}get contentPresenter(){return{position:"relative",padding:"10px",background:"white"}}get commandBarPresenter(){return{left:0,right:0,bottom:0,padding:"5px",backgroundColor:"#d4d4d4",textAlign:"right",borderBottomRightRadius:"4px",borderBottomLeftRadius:"4px"}}get commandBar(){return{subclasses:{" button":{borderRadius:"3px",marginLeft:"5px",marginRight:"5px",padding:"4px 16px",backgroundColor:"whitesmoke",border:"1px solid gray"}}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomWindowStyle");System.register(["../../core/Colors","./AtomWindowStyle"],(function(_export,_context){"use strict";var Colors,AtomWindowStyle,AtomAlertWindowStyle;_export("default",void 0);return{setters:[function(_coreColors){Colors=_coreColors.default},function(_AtomWindowStyle){AtomWindowStyle=_AtomWindowStyle.AtomWindowStyle}],execute:function(){_export("default",AtomAlertWindowStyle=class AtomAlertWindowStyle extends AtomWindowStyle{get titleHost(){return Object.assign(Object.assign({},this.getBaseProperty(AtomAlertWindowStyle,"titleHost")),{color:Colors.black,backgroundColor:Colors.white})}get contentPresenter(){return Object.assign(Object.assign({},this.getBaseProperty(AtomAlertWindowStyle,"contentPresenter")),{padding:"0px 10px 30px 10px",textAlign:"center",color:Colors.rgba(51,51,51)})}get commandBar(){return Object.assign(Object.assign({},this.getBaseProperty(AtomAlertWindowStyle,"commandBar")),{textAlign:"center",subclasses:{" button":this.buttonStyle," .yes-button":{backgroundColor:Colors.rgba(0,128,0)}," .no-button":{backgroundColor:Colors.rgba(255,0,0)}}})}get buttonStyle(){return{border:"none",color:Colors.white,width:"50%",height:"40px"}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomAlertWindowStyle");System.register(["./AtomControl"],(function(_export,_context){"use strict";var AtomControl,AtomTemplate;_export("AtomTemplate",void 0);return{setters:[function(_AtomControl){AtomControl=_AtomControl.AtomControl}],execute:function(){_export("AtomTemplate",AtomTemplate=class AtomTemplate extends AtomControl{})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomTemplate");System.register(["../../App","../../core/Bind","../../core/XNode","../styles/AtomWindowStyle","./AtomControl","./AtomTemplate"],(function(_export,_context){"use strict";var App,Bind,XNode,AtomWindowStyle,AtomControl,AtomTemplate,AtomWindowFrameTemplate,AtomWindowTitleTemplate,AtomWindow;function getTemplateParent(e){const tp=e._templateParent;if(tp){return tp}const p=e._logicalParent||e.parentElement;if(p){return getTemplateParent(p)}}_export({getTemplateParent,AtomWindowFrameTemplate:void 0,AtomWindow:void 0});return{setters:[function(_App){App=_App.App},function(_coreBind){Bind=_coreBind.default},function(_coreXNode){XNode=_coreXNode.default},function(_stylesAtomWindowStyle){AtomWindowStyle=_stylesAtomWindowStyle.AtomWindowStyle},function(_AtomControl){AtomControl=_AtomControl.AtomControl},function(_AtomTemplate){AtomTemplate=_AtomTemplate.AtomTemplate}],execute:function(){_export("AtomWindowFrameTemplate",AtomWindowFrameTemplate=class AtomWindowFrameTemplate extends AtomTemplate{get templateParent(){return getTemplateParent(this.element)}preCreate(){this.titlePresenter=null;this.commandPresenter=null;this.contentPresenter=null;super.preCreate()}create(){this.render(XNode.create("div",{class:"frame",styleWidth:Bind.oneWay((()=>this.templateParent.width||undefined)),styleHeight:Bind.oneWay((()=>this.templateParent.height||undefined)),styleLeft:Bind.oneWay((()=>this.templateParent.x>=0?`${this.templateParent.x}px`:undefined)),styleTop:Bind.oneWay((()=>this.templateParent.y>=0?`${this.templateParent.y}px`:undefined)),styleMarginTop:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined)),styleMarginLeft:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined)),styleMarginRight:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined)),styleMarginBottom:Bind.oneWay((()=>this.templateParent.x>=0?"0":undefined))},XNode.create("div",{class:"title-presenter",presenter:Bind.presenter("titlePresenter")}),XNode.create("div",{class:"content-presenter",presenter:Bind.presenter("contentPresenter")}),XNode.create("div",{class:"command-bar-presenter",presenter:Bind.presenter("commandPresenter")})))}});AtomWindowTitleTemplate=class AtomWindowTitleTemplate extends AtomControl{get templateParent(){return getTemplateParent(this.element)}create(){this.render(XNode.create("div",{class:"title-host"},XNode.create("span",{class:"title",text:Bind.oneWay((()=>this.templateParent.title))}),XNode.create("button",{class:"close-button",eventClick:Bind.event((()=>this.templateParent.close()))})))}};_export("AtomWindow",AtomWindow=class AtomWindow extends AtomControl{constructor(){super(...arguments);this.title="";this.width="";this.height="";this.x=-1;this.y=-1;this.titleTemplate=AtomWindowTitleTemplate;this.frameTemplate=AtomWindowFrameTemplate;this.isReady=false}get templateParent(){return getTemplateParent(this.element)}onPropertyChanged(name){switch(name){case"windowTemplate":case"commandTemplate":case"frameTemplate":this.invalidate();break}}close(){const vm=this.viewModel;if(vm.cancel){this.app.runAsync((()=>vm.cancel()));return}const message=`atom-window-cancel:${this.id}`;const device=this.app.resolve(App);device.broadcast(message,"cancelled")}onUpdateUI(){if(!(this.windowTemplate&&this.frameTemplate)){return}if(this.isReady){return}this.bind(this.element,"title",[["viewModel","title"]]);const frame=new this.frameTemplate(this.app);const fe=frame.element;const titleContent=new this.titleTemplate(this.app);titleContent.element._templateParent=this;frame.titlePresenter.appendChild(titleContent.element);this.setupDragging(frame.titlePresenter);this.element.classList.add("frame-host");fe._logicalParent=this.element;fe._templateParent=this;if(!frame.contentPresenter){throw new Error("ContentPresenter must be set inside frameTemplate before creating window")}const content=new this.windowTemplate(this.app);content.element._templateParent=this;this.setElementClass(content.element,{content:1});frame.contentPresenter.appendChild(content.element);if(this.commandTemplate){if(!frame.commandPresenter){throw new Error("CommandPresenter must be set inside frameTemplate"+"before creating window if command template is present")}const command=new this.commandTemplate(this.app);command.element._templateParent=this;this.setElementClass(command.element,{"command-bar":1});frame.commandPresenter.appendChild(command.element)}this.append(frame);setTimeout((()=>{this.centerFrame(frame.element)}),100);this.isReady=true}preCreate(){this.defaultControlStyle=AtomWindowStyle;this.title=null;this.width="";this.height="";this.x=-1;this.y=-1;this.windowTemplate=null;this.commandTemplate=null;this.titleTemplate=AtomWindowTitleTemplate;this.frameTemplate=AtomWindowFrameTemplate;super.preCreate();this.render(XNode.create("div",{styleClass:Bind.oneTime((()=>this.controlStyle.name))}))}centerFrame(e){if(!this.element){return}const parent=this.element.parentElement;if(parent===window||parent===document.body){return}if(parent.offsetWidth<=0||parent.offsetHeight<=0){setTimeout((()=>{this.centerFrame(e)}),100);return}if(e.offsetWidth<=0||e.offsetHeight<=0){setTimeout((()=>{this.centerFrame(e)}),100);return}const x=(parent.offsetWidth-e.offsetWidth)/2;const y=(parent.offsetHeight-e.offsetHeight)/2;this.x=x;this.y=y;e.style.opacity="1";this.element.style.removeProperty("opacity")}setupDragging(tp){this.bindEvent(tp,"mousedown",(startEvent=>{startEvent.preventDefault();const disposables=[];const offset={x:tp.parentElement.offsetLeft,y:tp.parentElement.offsetTop};const rect={x:startEvent.clientX,y:startEvent.clientY};const cursor=tp.style.cursor;tp.style.cursor="move";disposables.push(this.bindEvent(document.body,"mousemove",(moveEvent=>{const{clientX,clientY}=moveEvent;const dx=clientX-rect.x;const dy=clientY-rect.y;offset.x+=dx;offset.y+=dy;this.x=offset.x;this.y=offset.y;rect.x=clientX;rect.y=clientY})));disposables.push(this.bindEvent(document.body,"mouseup",(endEvent=>{tp.style.cursor=cursor;for(const iterator of disposables){iterator.dispose()}})))}))}});AtomWindow.windowTemplate=XNode.prepare("windowTemplate",true,true);AtomWindow.commandTemplate=XNode.prepare("commandTemplate",true,true);AtomWindow.titleTemplate=XNode.prepare("titleTemplate",true,true);AtomWindow.frameTemplate=XNode.prepare("frameTemplate",true,true)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomWindow");System.register(["tslib","../../core/Bind","../../core/BindableProperty","../../core/XNode","../../view-model/AtomWindowViewModel","../styles/AtomAlertWindowStyle","./AtomWindow"],(function(_export,_context){"use strict";var __decorate,__metadata,Bind,BindableProperty,XNode,AtomWindowViewModel,AtomAlertWindowStyle,AtomWindow,AtomAlertWindow,AtomAlertViewModel;_export("default",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreBind){Bind=_coreBind.default},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_coreXNode){XNode=_coreXNode.default},function(_viewModelAtomWindowViewModel){AtomWindowViewModel=_viewModelAtomWindowViewModel.AtomWindowViewModel},function(_stylesAtomAlertWindowStyle){AtomAlertWindowStyle=_stylesAtomAlertWindowStyle.default},function(_AtomWindow){AtomWindow=_AtomWindow.AtomWindow}],execute:function(){_export("default",AtomAlertWindow=class AtomAlertWindow extends AtomWindow{create(){this.defaultControlStyle=AtomAlertWindowStyle;this.viewModel=this.resolve(AtomAlertViewModel);this.render(XNode.create(AtomWindow,{title:Bind.oneWay((()=>this.viewModel.title))},XNode.create(AtomWindow.windowTemplate,null,XNode.create("div",{formattedText:Bind.oneWay((()=>this.viewModel.message))})),XNode.create(AtomWindow.commandTemplate,null,XNode.create("div",null,XNode.create("button",{class:"yes-button",styleDisplay:Bind.oneWay((()=>this.viewModel.okTitle?"":"none")),text:Bind.oneWay((()=>this.viewModel.okTitle)),eventClick:()=>this.viewModel.onOkClicked()}),XNode.create("button",{class:"no-button",styleMarginBottom:Bind.oneWay((()=>this.viewModel.cancelTitle?"0":"10px")),styleDisplay:Bind.oneWay((()=>this.viewModel.cancelTitle?"":"none")),text:Bind.oneWay((()=>this.viewModel.cancelTitle)),eventClick:()=>this.viewModel.onCancelClicked()})))))}});AtomAlertViewModel=class AtomAlertViewModel extends AtomWindowViewModel{onOkClicked(){this.close(true)}onCancelClicked(){this.cancel()}};__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"title",void 0);__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"message",void 0);__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"okTitle",void 0);__decorate([BindableProperty,__metadata("design:type",String)],AtomAlertViewModel.prototype,"cancelTitle",void 0)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomAlertWindow");System.register(["../../core/Colors","./AtomStyle"],(function(_export,_context){"use strict";var Colors,AtomStyle,AtomNotificationStyle;_export("default",void 0);return{setters:[function(_coreColors){Colors=_coreColors.default},function(_AtomStyle){AtomStyle=_AtomStyle.AtomStyle}],execute:function(){_export("default",AtomNotificationStyle=class AtomNotificationStyle extends AtomStyle{get root(){return{padding:"5px",borderRadius:"5px",border:"solid 1px lightgray",fontFamily:"Verdana, Geneva, sans-serif",fontSize:"16px",subclasses:{".error":{borderColor:Colors.red,color:Colors.red},".warning":{backgroundColor:Colors.lightYellow}}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomNotificationStyle");System.register(["tslib","../../core/Bind","../../core/BindableProperty","../../core/XNode","../styles/AtomNotificationStyle","./AtomControl"],(function(_export,_context){"use strict";var __decorate,__metadata,Bind,BindableProperty,XNode,AtomNotificationStyle,AtomControl,AtomNotification;_export("default",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreBind){Bind=_coreBind.default},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_coreXNode){XNode=_coreXNode.default},function(_stylesAtomNotificationStyle){AtomNotificationStyle=_stylesAtomNotificationStyle.default},function(_AtomControl){AtomControl=_AtomControl.AtomControl}],execute:function(){_export("default",AtomNotification=class AtomNotification extends AtomControl{constructor(){super(...arguments);this.timeout=5e3;this.timeoutKey=null}onPropertyChanged(name){switch(name){case"timeout":this.setupTimeout();break}}create(){this.defaultControlStyle=AtomNotificationStyle;this.render(XNode.create("div",{formattedText:Bind.oneWay((()=>this.viewModel.message)),timeout:Bind.oneWay((()=>this.viewModel.timeout||5e3)),styleClass:Bind.oneWay((()=>({[this.controlStyle.name]:1,error:this.viewModel.type&&/error/i.test(this.viewModel.type),warning:this.viewModel.type&&/warn/i.test(this.viewModel.type)})))}))}setupTimeout(){if(this.timeoutKey){clearTimeout(this.timeoutKey)}this.timeoutKey=setTimeout((()=>{if(this.element){this.app.broadcast(`atom-window-close:${this.id}`,"")}}),this.timeout)}});__decorate([BindableProperty,__metadata("design:type",Number)],AtomNotification.prototype,"timeout",void 0)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomNotification");System.register(["../styles/AtomStyle"],(function(_export,_context){"use strict";var AtomStyle,AtomPopupStyle;_export("AtomPopupStyle",void 0);return{setters:[function(_stylesAtomStyle){AtomStyle=_stylesAtomStyle.AtomStyle}],execute:function(){_export("AtomPopupStyle",AtomPopupStyle=class AtomPopupStyle extends AtomStyle{get root(){return{backgroundColor:"white",border:"solid 1px lightgray",padding:"5px",borderRadius:"5px"}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomPopupStyle");System.register(["../../core/XNode","../../style/styled","./PopupService"],(function(_export,_context){"use strict";var XNode,styled,PopupWindow,css;function NotificationPopup({message,type}){return class Notification extends PopupWindow{create(){if(message instanceof XNode){this.render(XNode.create("div",{styleClass:{[css]:1,error:/error/i.test(type),warning:/warn/i.test(type)}},message));return}this.render(XNode.create("div",{styleClass:{[css]:1,error:/error/i.test(type),warning:/warn/i.test(type)},formattedText:message}))}}}_export("default",NotificationPopup);return{setters:[function(_coreXNode){XNode=_coreXNode.default},function(_styleStyled){styled=_styleStyled.default},function(_PopupService){PopupWindow=_PopupService.PopupWindow}],execute:function(){css=styled.css`
1503
1503
  padding: 5px;
1504
1504
  font-size: larger;
1505
1505
  & .error {