New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@evs-chris/raui

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evs-chris/raui - npm Package Compare versions

Comparing version

to
0.5.33

9

es/Window.js

@@ -214,4 +214,6 @@ import Ractive from 'ractive';

if (!bs) { return; }
bs.forEach(function (b) { return host.add(("windows." + (escape(b)) + ".index"), top++); });
bs.forEach(function (b) { return blocks(b); });
bs.forEach(function (b) {
host.add(("windows." + (escape(b)) + ".index"), top++);
blocks(b);
});
}

@@ -221,3 +223,4 @@

if (opts.parent !== false && wnd.get('control.blocking')) {
top = this.get(("windows." + (wnd.get('control.blocking')) + ".index")) || 0;
var blocking = wnd.get("control.blocking");
top = this.get(("windows." + blocking + ".index")) || 0 + (this.get(("windows." + blocking + ".blockers.length")) || 0);
wnds.forEach(function (w) {

@@ -224,0 +227,0 @@ if (w.index > top) { w.index++; }

@@ -1,1 +0,1 @@

import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";var escape=Ractive.escapeKey;var windowTrans;export var Base=function(Ractive){function Base(opts){Ractive.call(this,opts)}if(Ractive)Base.__proto__=Ractive;Base.prototype=Object.create(Ractive&&Ractive.prototype);Base.prototype.constructor=Base;return Base}(Ractive);Ractive.extendWith(Base,{css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.window.primary"));primary.action=Object.assign({},data("raui.window.action"),data("raui.window.primary.action"));primary.host=Object.assign({},data("raui.window.host"),data("raui.window.primary.host"));primary.title=Object.assign({inactive:{}},data("raui.window.title"),data("raui.window.primary.title"));return"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(primary.host.bg||primary.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(primary.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(primary.minWidth||"6em")+";\n min-height: "+(primary.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(primary.title.inactive.bg||primary.fg||"#222")+";\n color: "+(primary.title.inactive.fg||primary.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(primary.title.bg||primary.fga||"#07e")+";\n color: "+(primary.title.fg||primary.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(primary.action.bc||primary.bc||"#ccc")+";\n background-color: "+(primary.action.bg||primary.bg||"#fff")+";\n color: "+(primary.action.fg||primary.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+(typeof data("raui.window.extra")==="function"?data("raui.window.extra").call(this,data):"")+"\n "}.call(this,data)].join(" ")},cssId:"rwindow",noCssTransform:true,delegate:false,decorators:{tracked:function tracked(node,id){this[id]=node;return{teardown:function teardown(){if(this[id]===node){this[id]=null}}}}},transitions:{window:function window(t,params){if(windowTrans){return t.complete()}windowTrans=t;var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0});setTimeout(function(){t.animateStyle({transform:"none",opacity:1},p).then(function(){t.setStyle("opacity",1);windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})})}else{t.setStyle({transform:"none",opacity:1});t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},p).then(function(){windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})}}}});var id=0;export var Host=function(Base){function Host(opts){Base.call(this,opts);this.defaults={}}if(Base)Host.__proto__=Base;Host.prototype=Object.create(Base&&Base.prototype);Host.prototype.constructor=Host;var prototypeAccessors={current:{configurable:true},currentId:{configurable:true},placement:{configurable:true},topmost:{configurable:true},windows:{configurable:true}};prototypeAccessors.current.get=function(){var top=this.get("topLevel");return this.getWindow(this.get("windows")[top].id)};prototypeAccessors.currentId.get=function(){var top=this.get("topLevel");return this.get("windows."+escape(top)+".id")};prototypeAccessors.placement.get=function(){return this.get("placement")};prototypeAccessors.placement.set=function(v){return this.set("placement",v)};prototypeAccessors.topmost.get=function(){var this$1=this;var windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this$1.getWindow(windows[k].id)}}};prototypeAccessors.windows.get=function(){return Object.keys(this.get("windows"))};Host.prototype.addWindow=function addWindow(window,opts){var this$1=this;var options=Object.assign({},this.defaults,window.constructor.prototype.options,window.options,window.get("options"),opts);if(!(window instanceof Window)){throw new Error("Windows must be instances of Window")}if(!window.id){window.set("@.id",options.id||"window"+id++)}if(!this.get("windows."+escape(window.id))){this.set("windows."+escape(window.id),Object.assign({show:options.show!==false,autosize:true,id:window.id,blockers:[],close:true,minimize:true,maximize:true},options,{id:window.id}))}window.host=this;var promise=this.attachChild(window,{target:"window"});var parent;if(options.block){parent=options.block.id||options.block;if(typeof parent==="string"&&parent in this.get("windows")){this.push("windows."+escape(parent)+".blockers",window.id);window.set("control.blocking",parent)}else{parent=false}}if(options.size==="fill"&&(parent||options.block)){var wnd;if(options.block===true){wnd=this.find(".rwhost-pane")}else if(wnd=this.getWindow(parent)){wnd=wnd.find(".rwindow")}if(wnd){window.size(wnd.clientWidth-(options.fillPad||20),wnd.clientHeight-(options.fillPad||20));if(options.block&&!(options.top||options.left)){options.top=options.left=Math.floor((options.fillPad||20)/2)}}}else if(options.width&&options.height){window.size(options.width,options.height)}else{window.size("auto")}if(options.top&&options.left){window.move(options.top,options.left)}else{this.place(window)}this.raise(window,{show:options.show!==false,parent:options.stickToParent});window.on("close",function(){var blocking=window.get("control.blocking");if(blocking){var blockers=this$1.windowGet(blocking,"blockers");this$1.splice("windows."+escape(blocking)+".blockers",blockers.indexOf(window.id),1)}this$1.detachChild(window).then(function(){return window.teardown()});this$1.set("windows."+escape(window.id)+".block",false);this$1.set("windows."+escape(window.id)+".index",-1);this$1.raise();this$1.set("windows."+escape(window.id),undefined);delete this$1.get("windows")[window.id]});this.update("windows."+escape(window.id)+".id",{force:true});return promise.then(function(){return window})};Host.prototype.getWindow=function getWindow(id){return this.children.byName.window&&this.children.byName.window.filter(function(w){return w.instance.id===id}).map(function(w){return w.instance})[0]};Host.prototype.windowGet=function windowGet(id,path){return this.get("windows."+escape(id)+"."+path)};Host.prototype.windowSet=function windowSet(id,path,val){return this.set("windows."+escape(id)+"."+path,val)};Host.prototype.raise=function raise(window,opts){var this$1=this;if(opts===void 0)opts={};var wnd=window instanceof Window?window:this.children.byName.window.filter(function(a){return a.instance.id===window}).map(function(a){return a.instance})[0];var object=this.get("windows");var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=wnds.length+1;var last=this.get("topLevel");var wasBlocked=this.get("blocked");function blocks(id){var bs=host.get("windows."+escape(id)+".blockers");if(!bs){return}bs.forEach(function(b){return host.add("windows."+escape(b)+".index",top++)});bs.forEach(function(b){return blocks(b)})}if(wnd){if(opts.parent!==false&&wnd.get("control.blocking")){top=this.get("windows."+wnd.get("control.blocking")+".index")||0;wnds.forEach(function(w){if(w.index>top){w.index++}});top++}wnd.set("control.index",opts.show===false?-1:top++);if(opts.show!==false&&!wnd.visible){wnd.show()}blocks(wnd.id)}wnds.filter(function(w){return w.show!==false&&w.block===true}).forEach(function(w){this$1.set("windows."+escape(w.id)+".index",(w.index||0)+top);blocks(w.id)});var ordered=wnds.sort(function(l,r){return!l.show?-1:!r.show?1:l.index<r.index?-1:1});var visible=ordered.filter(function(w){return w.show});top=ordered.indexOf(visible[visible.length-1]);var sets={};var modalIdx=null;ordered.forEach(function(w,i){var key=escape(w.id);if(w.block===true&&modalIdx===null){modalIdx=i}sets["windows."+key+".index"]=modalIdx!==null?i+2:i;sets["windows."+key+".topmost"]=i===top;sets["windows."+key+".stack"]=ordered.length-i});if(modalIdx!==null){sets.blocked=modalIdx+1}else{sets.blocked=0}if(~top&&ordered.length){sets.topLevel=ordered[top].id}else{sets.topLevel=null}this.set(sets);top=sets.topLevel;if(top&&top!==last&&this.get("currentMax")&&this.rendered){var leaving=this.get("windows."+escape(last));wnd=this.getWindow(top);var transition=this.get("transition");if(transition!==false&&(!leaving||!leaving.dialog||leaving.blocking&&leaving.blocking!==top)){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}};Host.prototype.place=function place(wnd){var this$1=this;if(!wnd.get("control.show")){return Promise.resolve()}return new Promise(function(ok){requestAnimationFrame(function(){var local=wnd.get("control");if(local.width===undefined){wnd.size("auto")}var left=0;var top=0;if(!(this$1.fragment&&this$1.fragment.rendered)){return}var host=this$1.find(".rwhost");var maxw=host.clientWidth;var maxh=host.clientHeight;var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:this$1.sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:this$1.sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-this$1.sizeInPx(local.width+"em")/2;top=(max?maxh:bh/2)+(max?0:bt)-this$1.sizeInPx(local.height+"em")/2}else{var place=this$1.get("placement");var pos;if(typeof place==="function"){try{pos=place(this$1,host,local)}catch(e){pos=placeGrid(this$1,host,local)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local);break;default:pos=placeGrid(this$1,host,local);break}}else{pos=placeGrid(this$1,host,local)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});ok()})})};Host.prototype.sizeInPx=function sizeInPx(size){if(!this.sizer){return parseFloat(size)*16}this.sizer.style.width=typeof size==="number"?size+"px":size;return this.sizer.clientWidth};Host.prototype.sizeInEm=function sizeInEm(size){var px=this.sizeInPx(size);return px/this.sizeInPx("1em")};Object.defineProperties(Host.prototype,prototypeAccessors);return Host}(Base);function placeGrid(host,target,node){var maxw=target.clientWidth;var maxh=target.clientHeight;var top=0,left=0;var grid1=host._grid1===undefined?host._grid1=0:host._grid1>7?host._grid1=0:++host._grid1;var width=Math.floor(maxw/3);var height=Math.floor(maxh/3);var localWidth=host.sizeInPx(node.width+"em");var localHeight=host.sizeInPx(node.height+"em");switch(grid1){case 5:case 7:case 8:top=maxh-localHeight-10;break;case 2:case 4:case 6:top=height+Math.floor((height-localHeight)/2);break;case 0:case 1:case 3:top=10;break}switch(grid1){case 3:case 6:case 8:left=maxw-localWidth-10;break;case 1:case 4:case 7:left=width+Math.floor((width-localWidth)/2);break;case 0:case 2:case 5:left=10;break}if(left+localWidth>maxw){left=maxw-localWidth-10}if(top+localHeight>maxh){top=maxh-localHeight-10}return{top:top,left:left}}function placeSmart(host,target,node){var maxw=target.clientWidth-10;var maxh=target.clientHeight-10;var i,j;var cell=16;var mh=Math.floor(maxh/cell),mw=Math.floor(maxw/cell);var grid=new Array(mh*mw);var dest=new Array(mh*mw);for(i=0;i<grid.length;i++){grid[i]=0}var win,t,l,w,h,wins=0;var windows=host.get("windows");for(var k in windows){wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(host.sizeInPx(win.height+"em")/cell);w=Math.ceil(host.sizeInPx(win.width+"em")/cell);for(i=t;i<t+h&&i<mh;i++){for(j=l;j<l+w&&j<mw;j++){grid[i*mw+j]++}}}var c,ii,jj;w=Math.ceil(host.sizeInPx(node.width+"em")/cell);h=Math.ceil(host.sizeInPx(node.height+"em")/cell);for(i=0;i<mh;i++){for(j=0;j<mw;j++){if(i+h>mh||j+w>mw){c=wins*w*h}else{c=0;for(ii=0;ii<h;ii++){for(jj=0;jj<w;jj++){c+=grid[(i+ii)*mw+j+jj]}}}if(c===0){return{top:i*cell+5,left:j*cell+5}}dest[i*mw+j]=c}}c=wins*w*h;ii=0;for(i=0;i<dest.length;i++){if(dest[i]<c){c=dest[i];ii=i}}return{top:Math.floor(ii/mw)*cell+5,left:ii%mw*cell+5}}Base.extendWith(Host,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(_0){return{t:_0}},"_0&&_1":function(_0,_1){return _0&&_1},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(_0,_1){return[_0.getWindow(_1).hide()]},"[_0.getWindow(_1).maximize()]":function(_0,_1){return[_0.getWindow(_1).maximize()]},"!_0&&_1&&_2":function(_0,_1,_2){return!_0&&_1&&_2},"[_0.getWindow(_1).close()]":function(_0,_1){return[_0.getWindow(_1).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(_0){return[_0.hide()]},"!_0&&_1":function(_0,_1){return!_0&&_1},"[_0.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"(_0||_1||_2)&&_3&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&_3&&!_4},'["content"]':function(){return["content"]},"!_0":function(_0){return!_0},"[_0.call(_1)]":function(_0,_1){return[_0.call(_1)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(_0){return _0!==false},"_0||_1":function(_0,_1){return _0||_1},"(_0||_1||_2)&&!_3":function(_0,_1,_2,_3){return(_0||_1||_2)&&!_3},"[_0._startResize(_1)]":function(_0,_1){return[_0._startResize(_1)]},"[_0._sizeHandle(_1)]":function(_0,_1){return[_0._sizeHandle(_1)]},"[_0._startMove(_1)]":function(_0,_1){return[_0._startMove(_1)]},"!(_0===false||_1||_2||_3)&&!_4":function(_0,_1,_2,_3,_4){return!(_0===false||_1||_2||_3)&&!_4},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,observe:{"@style.raui.window.maxFrom":function _style_raui_window_maxFrom(){initMediaListener(this)},topLevel:function topLevel(v){if(v){this.link("windows."+escape(v),"current")}else{this.unlink("current")}},currentMax:{handler:function handler(v){(this.children.byName.window||[]).forEach(function(w){return w.instance.fire("resize")})},defer:true}},computed:{currentMax:function currentMax(){var top=this.get("topLevel");var max=this.get("windows."+escape(top)+".max");var user=this.get("userMax");return user||this.get("max")||max}},on:{config:function config(){var this$1=this;var content=this.partials.content;if(content&&Array.isArray(content)){content=this.partials.content=content.slice();var i=content.length;while(i--){var e=content[i];if(e.e==="max-top"){content.splice(i,1);this$1.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this$1.set({_maxAttrsP:{t:e.m}})}}}}if(typeof window!=="undefined"){var tm;this._resizeListener=function(){if(tm){return}tm=setTimeout(function(){tm=null;this$1.fire("resize")},300)};window.addEventListener("resize",this._resizeListener)}},teardown:function teardown(){if(this._resizeListener){window.removeEventListener("resize",this._resizeListener)}}}});function initMediaListener(r){if(r._media){r._media.fn()}else{r._media={};r._media.fn=function(){if(!r.host){return}var max=r.sizeInPx(r.get("@style.raui.window.maxFrom"));var trans=r.transitionsEnabled;r.transitionsEnabled=false;r.set("max",r.host.clientWidth<=max);r.set("dimensions",{clientWidth:r.host.clientWidth,clientHeight:r.host.clientHeight});r.transitionsEnabled=trans};r._media.handle=r.root.on("*.resize",r._media.fn);setTimeout(r._media.fn)}}function findEvent(instance){var i=instance;while(i){if(i.event&&i.event){return i.event.event}i=i.parent}}function getEventCoords(event){var node=event.target;if(!node){return{x:0,y:0}}var rect=node.getBoundingClientRect();return{x:Math.round(rect.left+(rect.right-rect.left)/2),y:Math.round(rect.top+(rect.bottom-rect.top)/2)}}Ractive.transitions.modal=function(t,parms){var params=t.processParams(parms,{duration:400,easing:"easeOut",x:0,y:-50,event:true});var event=null;var current={x:t.node.offsetLeft,y:t.node.offsetTop};var styles;var overflow=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(!event&&!t.node._modalSrc){if(t.isIntro){styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0}}}else{var click=t.node._modalSrc||(event?getEventCoords(event):{x:current.x+params.x,y:current.y+params.y});var target={x:click.x-Math.round(t.node.clientWidth/2)-current.x,y:click.y-Math.round(t.node.clientHeight/2)-current.y};if(t.node.parentNode.style){t.node.parentNode.style.overflow="hidden"}if(t.isIntro){t.node._modalSrc=click;styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0}}}t.animateStyle(styles,params).then(function(){if(t.node.parentNode.style){t.node.parentNode.style.overflow=overflow}t.complete()})};var moveEvents=["mousemove","mouseup","touchmove","touchend"];var handleSize=7;export var Window=function(Base){function Window(opts){Base.call(this,opts)}if(Base)Window.__proto__=Base;Window.prototype=Object.create(Base&&Base.prototype);Window.prototype.constructor=Window;var prototypeAccessors$1={resizable:{configurable:true},title:{configurable:true},visible:{configurable:true},pad:{configurable:true},buttons:{configurable:true},blocked:{configurable:true},result:{configurable:true}};prototypeAccessors$1.resizable.get=function(){return this.get("control.resizable")};prototypeAccessors$1.resizable.set=function(v){return this.set("control.resizable",v)};prototypeAccessors$1.title.get=function(){return this.get("control.title")};prototypeAccessors$1.title.set=function(v){return this.set("control.title",v)};prototypeAccessors$1.visible.get=function(){return this.get("control.show")};prototypeAccessors$1.visible.set=function(v){if(v){this.show()}else{this.set("control.show",v,{keep:true})}this.host.raise(this,{show:v})};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){this.set("pad",v)};prototypeAccessors$1.buttons.get=function(){return this.get("buttons")};prototypeAccessors$1.buttons.set=function(v){return this.set("buttons",v)};prototypeAccessors$1.blocked.get=function(){return this.get("control.blocked")};prototypeAccessors$1.blocked.set=function(v){return this.set("control.blocked",v)};prototypeAccessors$1.result.get=function(){var this$1=this;if(!this._result){this._result={};this._result.promise=new Promise(function(ok){this$1._result.ok=ok})}return this._result.promise};Window.prototype.setResult=function setResult(v){this.result;this._result.value=v};Window.prototype.close=function close(force,result){if(force!==true){if(!this.parent){return false}if(this.get("control.blockers.length")){return false}if(typeof this.beforeClose==="function"&&this.beforeClose()===false){return false}if(this.fire("beforeClose")===false){return false}}this.fire("close");if(this._result){this._result.ok(this._result.value||result)}return true};Window.prototype.maximize=function maximize(){this.toggle("root.userMax")};Window.prototype.hide=function hide(){this.visible=false};Window.prototype.raise=function raise(show){this.host.raise(this,{show:show})};Window.prototype.show=function show(){this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}};Window.prototype.size=function size(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}return}var el=this$1.wrapper;if(!el){return}if(w==="auto"){this$1.set("control.autosize",true);var nw=this$1.host.sizeInEm(el.clientWidth+16);var nh=this$1.host.sizeInEm(el.clientHeight);this$1.set({"control.width":nw,"control.height":nh,"control.naturalWidth":nw,"control.naturalHeight":nh,"control.autosize":false})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.width":this$1.host.sizeInEm(nw$1),"control.height":this$1.host.sizeInEm(nh$1),"control.naturalWidth":this$1.host.sizeInEm(nw$1),"control.naturalHeight":this$1.host.sizeInEm(nh$1),"control.autosize":false})}this$1.fire("resize");ok()})})};Window.prototype.move=function move(top,left){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(top==="center"){top=this$1.host.modalPane.clientHeight/2-this$1.wrapper.clientHeight/2}else if(typeof top==="string"){top=this$1.host.sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=this$1.host.sizeInEm(left)}var set={};if(typeof top==="number"){set["control.top"]=top}if(typeof left==="number"){set["control.left"]=left}this$1.set(set);ok()})})};Window.prototype._startMove=function _startMove(event){var this$1=this;if(event.type==="mousedown"&&event.button!==0){return}if(!this.get("control.topmost")){this.raise()}if(~event.type.indexOf("mouse")){if(!event.ctrlKey&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}else{if(event.targetTouches&&event.targetTouches.length===1&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}var wnd=this.pane;var cursor=wnd.style.cursor;wnd.style.cursor="move";wnd.style.userSelect="none";var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=wnd.clientWidth;var oh=wnd.clientHeight;var _move=function(ev){var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var nx=ox+(x-sx);var ny=oy+(y-sy);if(nx<(ow<30?0:30-ow)){nx=ow<30?0:30-ow}if(ny<(oh<30?0:30-oh)){ny=oh<30?0:30-oh}if(nx<0){nx=0}if(ny<0){ny=0}this$1.set({"control.top":ny,"control.left":nx});if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_move,{passive:false})});wnd.style.cursor=cursor;wnd.style.userSelect=""}else{ev.preventDefault()}};moveEvents.forEach(function(e){return document.addEventListener(e,_move,{passive:false})});if(event.type.indexOf("mouse")===0){return false}};Window.prototype._startResize=function _startResize(event){var this$1=this;if(event.target!==this.wrapper){return}if(event.type==="mousedown"&&event.button!==0){return}if(this.get("control.autosize")){this.size("auto")}if(!this.get("control.topmost")){this.raise()}this.set("control.resizing",true);var el=this.wrapper;var ix=event.offsetX||event.targetTouches&&event.targetTouches[0].pageX-el.getBoundingClientRect().left;var iy=event.offsetY||event.targetTouches&&event.targetTouches[0].pageY-el.getBoundingClientRect().top;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size*2,bottom=el.clientHeight-size*2;var min=2*size;var l=ix<=min||ix>=right;var t=iy<=min||iy>=bottom;var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=this.host.sizeInPx(this.get("control.width")+"em");var oh=this.host.sizeInPx(this.get("control.height")+"em");var nh=this.host.sizeInPx(this.get("control.naturalHeight")+"em");var nw=this.host.sizeInPx(this.get("control.naturalWidth")+"em");var tm;var _resize=function(ev){ev.preventDefault();var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var dx=l?x-sx:0;var dy=t?y-sy:0;var set={};if(iy<=size){set["control.top"]=oy+dy;set["control.height"]=oh-dy}else{set["control.height"]=oh+dy}if(ix<=size){set["control.left"]=ox+dx;set["control.width"]=ow-dx}else{set["control.width"]=ow+dx}if(set["control.width"]<nw){delete set["control.width"];delete set["control.left"]}if(set["control.height"]<nh){delete set["control.height"];delete set["control.top"]}if(set["control.left"]<0){set["control.left"]=0}if(set["control.top"]<0){set["control.top"]=0}if(set["control.width"]){set["control.width"]=this$1.host.sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=this$1.host.sizeInEm(set["control.height"])}this$1.set(set);if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_resize,{passive:false})});this$1.set("control.resizing",false);if(ow!==this$1.get("control.width")||oh!==this$1.get("control.height")){if(tm){clearTimeout(tm)}tm=null;this$1.fire("resize")}}else{if(!tm){tm=setTimeout(function(){this$1.fire("resize");tm=null},200)}}};moveEvents.forEach(function(e){return document.addEventListener(e,_resize,{passive:false})});return false};Window.prototype._sizeHandle=function _sizeHandle(event){if(event.target!==this.wrapper){return}var el=this.wrapper;if(event.type==="mouseout"){return el.style.cursor="auto"}var x=event.offsetX,y=event.offsetY;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size,bottom=el.clientHeight-size;var style=el.style;if(x<=size+size&&y<=size+size||x>=right-size&&y>=bottom-size){style.cursor="nwse-resize"}else if(x>=right-size&&y<=size+size||x<=size+size&&y>=bottom-size){style.cursor="nesw-resize"}else if((x<=size||x>=right)&&(y<bottom||y>size)){style.cursor="ew-resize"}else if((y<=size||y>=bottom)&&(x<right||x>size)){style.cursor="ns-resize"}else{style.cursor="auto"}};Object.defineProperties(Window.prototype,prototypeAccessors$1);return Window}(Base);var buttonAttrs=["left","right","center","condition"];Base.extendWith(Window,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}]}.t,title:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}]}.t,contents:{v:4,t:""}.t,status:{v:4,t:""}.t},data:function data(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function leftButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="left"})},centerButtons:function centerButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="center"})},rightButtons:function rightButtons(){return(this.get("buttons")||[]).filter(function(b){return!b.where||b.where==="right"})}},decorators:{button:function button(node){var ctx=this.getContext(node);ctx.add("visibleButtons");return{update:function update(){},teardown:function teardown(){ctx.subtract("visibleButtons")}}}},on:{config:function config(){var parent=Window.prototype.template;var child=this.template;if(typeof parent!=="string"&&!Array.isArray(parent)&&parent.t){parent=parent.t}if(typeof child!=="string"&&!Array.isArray(child)&&child.t){child=child.t}if(parent!==child){if(!this.partials.hasOwnProperty("contents")){this.partials.contents=child}this.template=parent}},construct:function construct(){var wnd=this.constructor;if(!wnd._constructed){wnd._constructed=1;var tpl=wnd.prototype.template.t.slice();var btns=tpl.find(function(e){return e.e==="buttons"});wnd.prototype.template.t=tpl.filter(function(e){return e.e!=="buttons"});function mapButton(b){var attrs=b.m||[];var res={partial:{t:[{t:b.t,e:b.e,f:b.f,m:attrs.filter(function(a){return!~buttonAttrs.indexOf(a.n)})}]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};res.partial.t[0].m.push({t:71,n:"button"});return res}if(btns){wnd._btns=btns.f.filter(function(e){return e.e==="button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"}).map(function(bb){var b=mapButton(bb);var f={t:n.t,n:n.n,f:[b.partial.t[0]]};if(n.r){f.r=n.r}if(n.rx){f.rx=n.rx}if(n.x){f.x=n.x}b.partial={t:[f]};return b})}else{var b=mapButton(n);return[b]}}).reduce(function(a,c){return a.concat(c)},[])}}},init:function init(){var wnd=this.constructor;if(wnd._btns&&!this.get("buttons.length")){this.set("buttons",wnd._btns)}}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function handler(v,o,k){if(!this.get("control.id")){return}var max=this.get("control.max")||this.get("root.userMax")||this.get("root.max");var actual=this.get("control.actual")||{};if(max){if(!actual.max){var root=this.wrapper;if(this.wrapper){this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",this.host.sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",this.host.sizeInEm(v))}}}else{if(typeof v==="number"){if(~k.indexOf("width")){this.set("control.actual.width",v)}else if(~k.indexOf("height")){this.set("control.actual.height",v)}}if(actual.max){this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:max})}this.set("control.actual.max",false)}},init:false,defer:true}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"host"]=Host}}globalRegister("RMWindowHost","components",Host);globalRegister("RMWindow","components",Window);Host.prototype.Window=Window;export default plugin;
import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";var escape=Ractive.escapeKey;var windowTrans;export var Base=function(Ractive){function Base(opts){Ractive.call(this,opts)}if(Ractive)Base.__proto__=Ractive;Base.prototype=Object.create(Ractive&&Ractive.prototype);Base.prototype.constructor=Base;return Base}(Ractive);Ractive.extendWith(Base,{css:function(data){return[function(data){var primary=Object.assign({},data("raui.primary"),data("raui.window.primary"));primary.action=Object.assign({},data("raui.window.action"),data("raui.window.primary.action"));primary.host=Object.assign({},data("raui.window.host"),data("raui.window.primary.host"));primary.title=Object.assign({inactive:{}},data("raui.window.title"),data("raui.window.primary.title"));return"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(primary.host.bg||primary.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(primary.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(primary.bg||"#fff")+";\n color: "+(primary.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(primary.minWidth||"6em")+";\n min-height: "+(primary.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(primary.title.inactive.bg||primary.fg||"#222")+";\n color: "+(primary.title.inactive.fg||primary.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(primary.title.bg||primary.fga||"#07e")+";\n color: "+(primary.title.fg||primary.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(primary.action.bc||primary.bc||"#ccc")+";\n background-color: "+(primary.action.bg||primary.bg||"#fff")+";\n color: "+(primary.action.fg||primary.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+(typeof data("raui.window.extra")==="function"?data("raui.window.extra").call(this,data):"")+"\n "}.call(this,data)].join(" ")},cssId:"rwindow",noCssTransform:true,delegate:false,decorators:{tracked:function tracked(node,id){this[id]=node;return{teardown:function teardown(){if(this[id]===node){this[id]=null}}}}},transitions:{window:function window(t,params){if(windowTrans){return t.complete()}windowTrans=t;var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0});setTimeout(function(){t.animateStyle({transform:"none",opacity:1},p).then(function(){t.setStyle("opacity",1);windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})})}else{t.setStyle({transform:"none",opacity:1});t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},p).then(function(){windowTrans=false;t.complete();if(parent.style){parent.style.overflow=overflow}})}}}});var id=0;export var Host=function(Base){function Host(opts){Base.call(this,opts);this.defaults={}}if(Base)Host.__proto__=Base;Host.prototype=Object.create(Base&&Base.prototype);Host.prototype.constructor=Host;var prototypeAccessors={current:{configurable:true},currentId:{configurable:true},placement:{configurable:true},topmost:{configurable:true},windows:{configurable:true}};prototypeAccessors.current.get=function(){var top=this.get("topLevel");return this.getWindow(this.get("windows")[top].id)};prototypeAccessors.currentId.get=function(){var top=this.get("topLevel");return this.get("windows."+escape(top)+".id")};prototypeAccessors.placement.get=function(){return this.get("placement")};prototypeAccessors.placement.set=function(v){return this.set("placement",v)};prototypeAccessors.topmost.get=function(){var this$1=this;var windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this$1.getWindow(windows[k].id)}}};prototypeAccessors.windows.get=function(){return Object.keys(this.get("windows"))};Host.prototype.addWindow=function addWindow(window,opts){var this$1=this;var options=Object.assign({},this.defaults,window.constructor.prototype.options,window.options,window.get("options"),opts);if(!(window instanceof Window)){throw new Error("Windows must be instances of Window")}if(!window.id){window.set("@.id",options.id||"window"+id++)}if(!this.get("windows."+escape(window.id))){this.set("windows."+escape(window.id),Object.assign({show:options.show!==false,autosize:true,id:window.id,blockers:[],close:true,minimize:true,maximize:true},options,{id:window.id}))}window.host=this;var promise=this.attachChild(window,{target:"window"});var parent;if(options.block){parent=options.block.id||options.block;if(typeof parent==="string"&&parent in this.get("windows")){this.push("windows."+escape(parent)+".blockers",window.id);window.set("control.blocking",parent)}else{parent=false}}if(options.size==="fill"&&(parent||options.block)){var wnd;if(options.block===true){wnd=this.find(".rwhost-pane")}else if(wnd=this.getWindow(parent)){wnd=wnd.find(".rwindow")}if(wnd){window.size(wnd.clientWidth-(options.fillPad||20),wnd.clientHeight-(options.fillPad||20));if(options.block&&!(options.top||options.left)){options.top=options.left=Math.floor((options.fillPad||20)/2)}}}else if(options.width&&options.height){window.size(options.width,options.height)}else{window.size("auto")}if(options.top&&options.left){window.move(options.top,options.left)}else{this.place(window)}this.raise(window,{show:options.show!==false,parent:options.stickToParent});window.on("close",function(){var blocking=window.get("control.blocking");if(blocking){var blockers=this$1.windowGet(blocking,"blockers");this$1.splice("windows."+escape(blocking)+".blockers",blockers.indexOf(window.id),1)}this$1.detachChild(window).then(function(){return window.teardown()});this$1.set("windows."+escape(window.id)+".block",false);this$1.set("windows."+escape(window.id)+".index",-1);this$1.raise();this$1.set("windows."+escape(window.id),undefined);delete this$1.get("windows")[window.id]});this.update("windows."+escape(window.id)+".id",{force:true});return promise.then(function(){return window})};Host.prototype.getWindow=function getWindow(id){return this.children.byName.window&&this.children.byName.window.filter(function(w){return w.instance.id===id}).map(function(w){return w.instance})[0]};Host.prototype.windowGet=function windowGet(id,path){return this.get("windows."+escape(id)+"."+path)};Host.prototype.windowSet=function windowSet(id,path,val){return this.set("windows."+escape(id)+"."+path,val)};Host.prototype.raise=function raise(window,opts){var this$1=this;if(opts===void 0)opts={};var wnd=window instanceof Window?window:this.children.byName.window.filter(function(a){return a.instance.id===window}).map(function(a){return a.instance})[0];var object=this.get("windows");var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=wnds.length+1;var last=this.get("topLevel");var wasBlocked=this.get("blocked");function blocks(id){var bs=host.get("windows."+escape(id)+".blockers");if(!bs){return}bs.forEach(function(b){host.add("windows."+escape(b)+".index",top++);blocks(b)})}if(wnd){if(opts.parent!==false&&wnd.get("control.blocking")){var blocking=wnd.get("control.blocking");top=this.get("windows."+blocking+".index")||0+(this.get("windows."+blocking+".blockers.length")||0);wnds.forEach(function(w){if(w.index>top){w.index++}});top++}wnd.set("control.index",opts.show===false?-1:top++);if(opts.show!==false&&!wnd.visible){wnd.show()}blocks(wnd.id)}wnds.filter(function(w){return w.show!==false&&w.block===true}).forEach(function(w){this$1.set("windows."+escape(w.id)+".index",(w.index||0)+top);blocks(w.id)});var ordered=wnds.sort(function(l,r){return!l.show?-1:!r.show?1:l.index<r.index?-1:1});var visible=ordered.filter(function(w){return w.show});top=ordered.indexOf(visible[visible.length-1]);var sets={};var modalIdx=null;ordered.forEach(function(w,i){var key=escape(w.id);if(w.block===true&&modalIdx===null){modalIdx=i}sets["windows."+key+".index"]=modalIdx!==null?i+2:i;sets["windows."+key+".topmost"]=i===top;sets["windows."+key+".stack"]=ordered.length-i});if(modalIdx!==null){sets.blocked=modalIdx+1}else{sets.blocked=0}if(~top&&ordered.length){sets.topLevel=ordered[top].id}else{sets.topLevel=null}this.set(sets);top=sets.topLevel;if(top&&top!==last&&this.get("currentMax")&&this.rendered){var leaving=this.get("windows."+escape(last));wnd=this.getWindow(top);var transition=this.get("transition");if(transition!==false&&(!leaving||!leaving.dialog||leaving.blocking&&leaving.blocking!==top)){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}};Host.prototype.place=function place(wnd){var this$1=this;if(!wnd.get("control.show")){return Promise.resolve()}return new Promise(function(ok){requestAnimationFrame(function(){var local=wnd.get("control");if(local.width===undefined){wnd.size("auto")}var left=0;var top=0;if(!(this$1.fragment&&this$1.fragment.rendered)){return}var host=this$1.find(".rwhost");var maxw=host.clientWidth;var maxh=host.clientHeight;var blocking=local.blocking;if(blocking){var key="windows."+escape(blocking);var blocked=this$1.get(key);var max=local.max||!local.dialog&&(this$1.get("max")||this$1.get("userMax"));var bmax=blocked.max||this$1.get("userMax")||this$1.get("max");var bw=bmax?this$1.host.clientWidth:this$1.sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:this$1.sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-this$1.sizeInPx(local.width+"em")/2;top=(max?maxh:bh/2)+(max?0:bt)-this$1.sizeInPx(local.height+"em")/2}else{var place=this$1.get("placement");var pos;if(typeof place==="function"){try{pos=place(this$1,host,local)}catch(e){pos=placeGrid(this$1,host,local)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local);break;default:pos=placeGrid(this$1,host,local);break}}else{pos=placeGrid(this$1,host,local)}top=pos.top;left=pos.left}if(isNaN(left)||left<0){left=10}if(isNaN(top)||top<0){top=10}wnd.set({"control.top":top,"control.left":left});ok()})})};Host.prototype.sizeInPx=function sizeInPx(size){if(!this.sizer){return parseFloat(size)*16}this.sizer.style.width=typeof size==="number"?size+"px":size;return this.sizer.clientWidth};Host.prototype.sizeInEm=function sizeInEm(size){var px=this.sizeInPx(size);return px/this.sizeInPx("1em")};Object.defineProperties(Host.prototype,prototypeAccessors);return Host}(Base);function placeGrid(host,target,node){var maxw=target.clientWidth;var maxh=target.clientHeight;var top=0,left=0;var grid1=host._grid1===undefined?host._grid1=0:host._grid1>7?host._grid1=0:++host._grid1;var width=Math.floor(maxw/3);var height=Math.floor(maxh/3);var localWidth=host.sizeInPx(node.width+"em");var localHeight=host.sizeInPx(node.height+"em");switch(grid1){case 5:case 7:case 8:top=maxh-localHeight-10;break;case 2:case 4:case 6:top=height+Math.floor((height-localHeight)/2);break;case 0:case 1:case 3:top=10;break}switch(grid1){case 3:case 6:case 8:left=maxw-localWidth-10;break;case 1:case 4:case 7:left=width+Math.floor((width-localWidth)/2);break;case 0:case 2:case 5:left=10;break}if(left+localWidth>maxw){left=maxw-localWidth-10}if(top+localHeight>maxh){top=maxh-localHeight-10}return{top:top,left:left}}function placeSmart(host,target,node){var maxw=target.clientWidth-10;var maxh=target.clientHeight-10;var i,j;var cell=16;var mh=Math.floor(maxh/cell),mw=Math.floor(maxw/cell);var grid=new Array(mh*mw);var dest=new Array(mh*mw);for(i=0;i<grid.length;i++){grid[i]=0}var win,t,l,w,h,wins=0;var windows=host.get("windows");for(var k in windows){wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(host.sizeInPx(win.height+"em")/cell);w=Math.ceil(host.sizeInPx(win.width+"em")/cell);for(i=t;i<t+h&&i<mh;i++){for(j=l;j<l+w&&j<mw;j++){grid[i*mw+j]++}}}var c,ii,jj;w=Math.ceil(host.sizeInPx(node.width+"em")/cell);h=Math.ceil(host.sizeInPx(node.height+"em")/cell);for(i=0;i<mh;i++){for(j=0;j<mw;j++){if(i+h>mh||j+w>mw){c=wins*w*h}else{c=0;for(ii=0;ii<h;ii++){for(jj=0;jj<w;jj++){c+=grid[(i+ii)*mw+j+jj]}}}if(c===0){return{top:i*cell+5,left:j*cell+5}}dest[i*mw+j]=c}}c=wins*w*h;ii=0;for(i=0;i<dest.length;i++){if(dest[i]<c){c=dest[i];ii=i}}return{top:Math.floor(ii/mw)*cell+5,left:ii%mw*cell+5}}Base.extendWith(Host,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(_0){return{t:_0}},"_0&&_1":function(_0,_1){return _0&&_1},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(_0,_1){return[_0.getWindow(_1).hide()]},"[_0.getWindow(_1).maximize()]":function(_0,_1){return[_0.getWindow(_1).maximize()]},"!_0&&_1&&_2":function(_0,_1,_2){return!_0&&_1&&_2},"[_0.getWindow(_1).close()]":function(_0,_1){return[_0.getWindow(_1).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(_0){return[_0.hide()]},"!_0&&_1":function(_0,_1){return!_0&&_1},"[_0.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"(_0||_1||_2)&&_3&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&_3&&!_4},'["content"]':function(){return["content"]},"!_0":function(_0){return!_0},"[_0.call(_1)]":function(_0,_1){return[_0.call(_1)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(_0){return _0!==false},"_0||_1":function(_0,_1){return _0||_1},"(_0||_1||_2)&&!_3":function(_0,_1,_2,_3){return(_0||_1||_2)&&!_3},"[_0._startResize(_1)]":function(_0,_1){return[_0._startResize(_1)]},"[_0._sizeHandle(_1)]":function(_0,_1){return[_0._sizeHandle(_1)]},"[_0._startMove(_1)]":function(_0,_1){return[_0._startMove(_1)]},"!(_0===false||_1||_2||_3)&&!_4":function(_0,_1,_2,_3,_4){return!(_0===false||_1||_2||_3)&&!_4},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,observe:{"@style.raui.window.maxFrom":function _style_raui_window_maxFrom(){initMediaListener(this)},topLevel:function topLevel(v){if(v){this.link("windows."+escape(v),"current")}else{this.unlink("current")}},currentMax:{handler:function handler(v){(this.children.byName.window||[]).forEach(function(w){return w.instance.fire("resize")})},defer:true}},computed:{currentMax:function currentMax(){var top=this.get("topLevel");var max=this.get("windows."+escape(top)+".max");var user=this.get("userMax");return user||this.get("max")||max}},on:{config:function config(){var this$1=this;var content=this.partials.content;if(content&&Array.isArray(content)){content=this.partials.content=content.slice();var i=content.length;while(i--){var e=content[i];if(e.e==="max-top"){content.splice(i,1);this$1.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this$1.set({_maxAttrsP:{t:e.m}})}}}}if(typeof window!=="undefined"){var tm;this._resizeListener=function(){if(tm){return}tm=setTimeout(function(){tm=null;this$1.fire("resize")},300)};window.addEventListener("resize",this._resizeListener)}},teardown:function teardown(){if(this._resizeListener){window.removeEventListener("resize",this._resizeListener)}}}});function initMediaListener(r){if(r._media){r._media.fn()}else{r._media={};r._media.fn=function(){if(!r.host){return}var max=r.sizeInPx(r.get("@style.raui.window.maxFrom"));var trans=r.transitionsEnabled;r.transitionsEnabled=false;r.set("max",r.host.clientWidth<=max);r.set("dimensions",{clientWidth:r.host.clientWidth,clientHeight:r.host.clientHeight});r.transitionsEnabled=trans};r._media.handle=r.root.on("*.resize",r._media.fn);setTimeout(r._media.fn)}}function findEvent(instance){var i=instance;while(i){if(i.event&&i.event){return i.event.event}i=i.parent}}function getEventCoords(event){var node=event.target;if(!node){return{x:0,y:0}}var rect=node.getBoundingClientRect();return{x:Math.round(rect.left+(rect.right-rect.left)/2),y:Math.round(rect.top+(rect.bottom-rect.top)/2)}}Ractive.transitions.modal=function(t,parms){var params=t.processParams(parms,{duration:400,easing:"easeOut",x:0,y:-50,event:true});var event=null;var current={x:t.node.offsetLeft,y:t.node.offsetTop};var styles;var overflow=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(!event&&!t.node._modalSrc){if(t.isIntro){styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+params.x+"px, "+params.y+"px) scale(0.5, 0.5)",opacity:0}}}else{var click=t.node._modalSrc||(event?getEventCoords(event):{x:current.x+params.x,y:current.y+params.y});var target={x:click.x-Math.round(t.node.clientWidth/2)-current.x,y:click.y-Math.round(t.node.clientHeight/2)-current.y};if(t.node.parentNode.style){t.node.parentNode.style.overflow="hidden"}if(t.isIntro){t.node._modalSrc=click;styles={transform:"translate(0, 0) scale(1, 1)",opacity:1};t.setStyle({transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0})}else{styles={transform:"translate("+target.x+"px, "+target.y+"px) scale(0.5, 0.5)",opacity:0}}}t.animateStyle(styles,params).then(function(){if(t.node.parentNode.style){t.node.parentNode.style.overflow=overflow}t.complete()})};var moveEvents=["mousemove","mouseup","touchmove","touchend"];var handleSize=7;export var Window=function(Base){function Window(opts){Base.call(this,opts)}if(Base)Window.__proto__=Base;Window.prototype=Object.create(Base&&Base.prototype);Window.prototype.constructor=Window;var prototypeAccessors$1={resizable:{configurable:true},title:{configurable:true},visible:{configurable:true},pad:{configurable:true},buttons:{configurable:true},blocked:{configurable:true},result:{configurable:true}};prototypeAccessors$1.resizable.get=function(){return this.get("control.resizable")};prototypeAccessors$1.resizable.set=function(v){return this.set("control.resizable",v)};prototypeAccessors$1.title.get=function(){return this.get("control.title")};prototypeAccessors$1.title.set=function(v){return this.set("control.title",v)};prototypeAccessors$1.visible.get=function(){return this.get("control.show")};prototypeAccessors$1.visible.set=function(v){if(v){this.show()}else{this.set("control.show",v,{keep:true})}this.host.raise(this,{show:v})};prototypeAccessors$1.pad.get=function(){return this.get("pad")};prototypeAccessors$1.pad.set=function(v){this.set("pad",v)};prototypeAccessors$1.buttons.get=function(){return this.get("buttons")};prototypeAccessors$1.buttons.set=function(v){return this.set("buttons",v)};prototypeAccessors$1.blocked.get=function(){return this.get("control.blocked")};prototypeAccessors$1.blocked.set=function(v){return this.set("control.blocked",v)};prototypeAccessors$1.result.get=function(){var this$1=this;if(!this._result){this._result={};this._result.promise=new Promise(function(ok){this$1._result.ok=ok})}return this._result.promise};Window.prototype.setResult=function setResult(v){this.result;this._result.value=v};Window.prototype.close=function close(force,result){if(force!==true){if(!this.parent){return false}if(this.get("control.blockers.length")){return false}if(typeof this.beforeClose==="function"&&this.beforeClose()===false){return false}if(this.fire("beforeClose")===false){return false}}this.fire("close");if(this._result){this._result.ok(this._result.value||result)}return true};Window.prototype.maximize=function maximize(){this.toggle("root.userMax")};Window.prototype.hide=function hide(){this.visible=false};Window.prototype.raise=function raise(show){this.host.raise(this,{show:show})};Window.prototype.show=function show(){this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}};Window.prototype.size=function size(w,h){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(!this$1.visible){if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}return}var el=this$1.wrapper;if(!el){return}if(w==="auto"){this$1.set("control.autosize",true);var nw=this$1.host.sizeInEm(el.clientWidth+16);var nh=this$1.host.sizeInEm(el.clientHeight);this$1.set({"control.width":nw,"control.height":nh,"control.naturalWidth":nw,"control.naturalHeight":nh,"control.autosize":false})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.width":this$1.host.sizeInEm(w),"control.height":this$1.host.sizeInEm(h),"control.naturalWidth":this$1.host.sizeInEm(w),"control.naturalHeight":this$1.host.sizeInEm(h),"control.autosize":false})}else if(typeof w==="string"&&typeof h==="string"){var ow=el.style.width;var oh=el.style.height;el.style.width=w;el.style.height=h;var nw$1=el.clientWidth;var nh$1=el.clientHeight;el.style.width=ow;el.style.height=oh;this$1.set({"control.width":this$1.host.sizeInEm(nw$1),"control.height":this$1.host.sizeInEm(nh$1),"control.naturalWidth":this$1.host.sizeInEm(nw$1),"control.naturalHeight":this$1.host.sizeInEm(nh$1),"control.autosize":false})}this$1.fire("resize");ok()})})};Window.prototype.move=function move(top,left){var this$1=this;return new Promise(function(ok){requestAnimationFrame(function(){if(top==="center"){top=this$1.host.modalPane.clientHeight/2-this$1.wrapper.clientHeight/2}else if(typeof top==="string"){top=this$1.host.sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=this$1.host.sizeInEm(left)}var set={};if(typeof top==="number"){set["control.top"]=top}if(typeof left==="number"){set["control.left"]=left}this$1.set(set);ok()})})};Window.prototype._startMove=function _startMove(event){var this$1=this;if(event.type==="mousedown"&&event.button!==0){return}if(!this.get("control.topmost")){this.raise()}if(~event.type.indexOf("mouse")){if(!event.ctrlKey&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}else{if(event.targetTouches&&event.targetTouches.length===1&&event.target!==this.content&&event.target!==this.top&&!this.top.contains(event.target)){return}}var wnd=this.pane;var cursor=wnd.style.cursor;wnd.style.cursor="move";wnd.style.userSelect="none";var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=wnd.clientWidth;var oh=wnd.clientHeight;var _move=function(ev){var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var nx=ox+(x-sx);var ny=oy+(y-sy);if(nx<(ow<30?0:30-ow)){nx=ow<30?0:30-ow}if(ny<(oh<30?0:30-oh)){ny=oh<30?0:30-oh}if(nx<0){nx=0}if(ny<0){ny=0}this$1.set({"control.top":ny,"control.left":nx});if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_move,{passive:false})});wnd.style.cursor=cursor;wnd.style.userSelect=""}else{ev.preventDefault()}};moveEvents.forEach(function(e){return document.addEventListener(e,_move,{passive:false})});if(event.type.indexOf("mouse")===0){return false}};Window.prototype._startResize=function _startResize(event){var this$1=this;if(event.target!==this.wrapper){return}if(event.type==="mousedown"&&event.button!==0){return}if(this.get("control.autosize")){this.size("auto")}if(!this.get("control.topmost")){this.raise()}this.set("control.resizing",true);var el=this.wrapper;var ix=event.offsetX||event.targetTouches&&event.targetTouches[0].pageX-el.getBoundingClientRect().left;var iy=event.offsetY||event.targetTouches&&event.targetTouches[0].pageY-el.getBoundingClientRect().top;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size*2,bottom=el.clientHeight-size*2;var min=2*size;var l=ix<=min||ix>=right;var t=iy<=min||iy>=bottom;var sx=event.x||event.clientX||event.targetTouches&&event.targetTouches[0].clientX||0;var sy=event.y||event.clientY||event.targetTouches&&event.targetTouches[0].clientY||0;var ox=this.get("control.left")||0;var oy=this.get("control.top")||0;var ow=this.host.sizeInPx(this.get("control.width")+"em");var oh=this.host.sizeInPx(this.get("control.height")+"em");var nh=this.host.sizeInPx(this.get("control.naturalHeight")+"em");var nw=this.host.sizeInPx(this.get("control.naturalWidth")+"em");var tm;var _resize=function(ev){ev.preventDefault();var x=ev.x||ev.clientX||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientX||ev.changedTouches&&ev.changedTouches[0].clientX||0;var y=ev.y||ev.clientY||ev.targetTouches&&ev.targetTouches[0]&&ev.targetTouches[0].clientY||ev.changedTouches&&ev.changedTouches[0].clientY||0;var dx=l?x-sx:0;var dy=t?y-sy:0;var set={};if(iy<=size){set["control.top"]=oy+dy;set["control.height"]=oh-dy}else{set["control.height"]=oh+dy}if(ix<=size){set["control.left"]=ox+dx;set["control.width"]=ow-dx}else{set["control.width"]=ow+dx}if(set["control.width"]<nw){delete set["control.width"];delete set["control.left"]}if(set["control.height"]<nh){delete set["control.height"];delete set["control.top"]}if(set["control.left"]<0){set["control.left"]=0}if(set["control.top"]<0){set["control.top"]=0}if(set["control.width"]){set["control.width"]=this$1.host.sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=this$1.host.sizeInEm(set["control.height"])}this$1.set(set);if(ev.type==="touchend"||ev.type==="mouseup"){moveEvents.forEach(function(e){return document.removeEventListener(e,_resize,{passive:false})});this$1.set("control.resizing",false);if(ow!==this$1.get("control.width")||oh!==this$1.get("control.height")){if(tm){clearTimeout(tm)}tm=null;this$1.fire("resize")}}else{if(!tm){tm=setTimeout(function(){this$1.fire("resize");tm=null},200)}}};moveEvents.forEach(function(e){return document.addEventListener(e,_resize,{passive:false})});return false};Window.prototype._sizeHandle=function _sizeHandle(event){if(event.target!==this.wrapper){return}var el=this.wrapper;if(event.type==="mouseout"){return el.style.cursor="auto"}var x=event.offsetX,y=event.offsetY;var size=this.get("@style.window.handleSize")||handleSize;var right=el.clientWidth-size,bottom=el.clientHeight-size;var style=el.style;if(x<=size+size&&y<=size+size||x>=right-size&&y>=bottom-size){style.cursor="nwse-resize"}else if(x>=right-size&&y<=size+size||x<=size+size&&y>=bottom-size){style.cursor="nesw-resize"}else if((x<=size||x>=right)&&(y<bottom||y>size)){style.cursor="ew-resize"}else if((y<=size||y>=bottom)&&(x<right||x>size)){style.cursor="ns-resize"}else{style.cursor="auto"}};Object.defineProperties(Window.prototype,prototypeAccessors$1);return Window}(Base);var buttonAttrs=["left","right","center","condition"];Base.extendWith(Window,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}]}.t,title:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}]}.t,contents:{v:4,t:""}.t,status:{v:4,t:""}.t},data:function data(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function leftButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="left"})},centerButtons:function centerButtons(){return(this.get("buttons")||[]).filter(function(b){return b.where==="center"})},rightButtons:function rightButtons(){return(this.get("buttons")||[]).filter(function(b){return!b.where||b.where==="right"})}},decorators:{button:function button(node){var ctx=this.getContext(node);ctx.add("visibleButtons");return{update:function update(){},teardown:function teardown(){ctx.subtract("visibleButtons")}}}},on:{config:function config(){var parent=Window.prototype.template;var child=this.template;if(typeof parent!=="string"&&!Array.isArray(parent)&&parent.t){parent=parent.t}if(typeof child!=="string"&&!Array.isArray(child)&&child.t){child=child.t}if(parent!==child){if(!this.partials.hasOwnProperty("contents")){this.partials.contents=child}this.template=parent}},construct:function construct(){var wnd=this.constructor;if(!wnd._constructed){wnd._constructed=1;var tpl=wnd.prototype.template.t.slice();var btns=tpl.find(function(e){return e.e==="buttons"});wnd.prototype.template.t=tpl.filter(function(e){return e.e!=="buttons"});function mapButton(b){var attrs=b.m||[];var res={partial:{t:[{t:b.t,e:b.e,f:b.f,m:attrs.filter(function(a){return!~buttonAttrs.indexOf(a.n)})}]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};res.partial.t[0].m.push({t:71,n:"button"});return res}if(btns){wnd._btns=btns.f.filter(function(e){return e.e==="button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"}).map(function(bb){var b=mapButton(bb);var f={t:n.t,n:n.n,f:[b.partial.t[0]]};if(n.r){f.r=n.r}if(n.rx){f.rx=n.rx}if(n.x){f.x=n.x}b.partial={t:[f]};return b})}else{var b=mapButton(n);return[b]}}).reduce(function(a,c){return a.concat(c)},[])}}},init:function init(){var wnd=this.constructor;if(wnd._btns&&!this.get("buttons.length")){this.set("buttons",wnd._btns)}}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function handler(v,o,k){if(!this.get("control.id")){return}var max=this.get("control.max")||this.get("root.userMax")||this.get("root.max");var actual=this.get("control.actual")||{};if(max){if(!actual.max){var root=this.wrapper;if(this.wrapper){this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",this.host.sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",this.host.sizeInEm(v))}}}else{if(typeof v==="number"){if(~k.indexOf("width")){this.set("control.actual.width",v)}else if(~k.indexOf("height")){this.set("control.actual.height",v)}}if(actual.max){this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:max})}this.set("control.actual.max",false)}},init:false,defer:true}}});export function plugin(opts){if(opts===void 0)opts={};return function(ref){var instance=ref.instance;instance.components[opts.name||"host"]=Host}}globalRegister("RMWindowHost","components",Host);globalRegister("RMWindow","components",Window);Host.prototype.Window=Window;export default plugin;
{
"name": "@evs-chris/raui",
"version": "0.5.32",
"version": "0.5.33",
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/evs-chris/raui",

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RMWindow={},t.Ractive)}(this,function(t,n){"use strict";var e="default"in n?n.default:n,o="undefined"!=typeof window?window:null;function i(t,n,e){if(o&&o.Ractive&&"object"==typeof o.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,n){var e=n.split("="),o=e[0],i=e[1];return t[o]=i,t},{})),Ractive[n][r&&r[t]||t]=e}}}function r(t,n){var e=t.processParams(n,{duration:200,easing:"easeInOut"});return new Promise(function(n){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var o="x"===e.axis?"width":"height";if(t.isIntro||e.intro){var i=t.getStyle(o);t.setStyle(o,0),t.setStyle("opacity",0),n(t.animateStyle(o,i,e).then(function(){return t.animateStyle("opacity",1,e)}).then(function(){t.setStyle(o,""),t.setStyle("overflow","")}))}else t.setStyle(o,t.getStyle(o)),t.setStyle("opacity",1),n(t.animateStyle("opacity",0,e).then(function(){return t.animateStyle(o,0,e)}))})})}i("expand","transitions",r);var s={timeout:6e3,top:!0};var a=function(t,n){this.holder=t,this.data=n},c={message:{configurable:!0},more:{configurable:!0},showMore:{configurable:!0},left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0},center:{configurable:!0},context:{configurable:!0},type:{configurable:!0},class:{configurable:!0},dismissable:{configurable:!0},closeButton:{configurable:!0},buttons:{configurable:!0},live:{configurable:!0},closed:{configurable:!0}};a.prototype.close=function(t){var n=this;return this.data===this.holder.active?(clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close()},t):this.data.close()):t?this.data.timeout=time:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?clearTimeout(this.holder.tm):this.data.timeout=0},a.prototype.updateButtons=function(){this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},a.prototype.set=function(t,e){if("object"==typeof t){for(var o in t)this.data[o]=t[o];return this.data===this.holder.active?this.data.instance.update("_toast"):Promise.resolve()}return this.data[t]=e,this.data===this.holder.active?this.data.instance.update("_toast."+n.Ractive.escapeKey(t)):Promise.resolve()},c.message.get=function(){return this.data.message},c.message.set=function(t){this.data.message=t,this.data===this.holder.active&&this.data.instance.update("_toast.message")},c.more.get=function(){return this.data.more},c.more.set=function(t){this.data.more=t,this.data===this.holder.active&&this.data.instance.update("_toast.more")},c.showMore.get=function(){return this.data.showMore},c.showMore.set=function(t){this.data.showMore=t,this.data===this.holder.active&&this.data.instance.update("_toast.showMore")},c.left.get=function(){return this.data.left},c.left.set=function(t){this.data.left=t,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.left")&&this.data.instance.update("_toast.right")},c.right.get=function(){return this.data.right},c.right.set=function(t){this.data.right=t,this.data.left=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right")&&this.data.instance.update("_toast.left")},c.top.get=function(){return!this.data.bottom},c.top.set=function(t){this.data.bottom=!t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.bottom.get=function(){return this.data.bottom},c.bottom.set=function(t){this.data.bottom=t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.center.get=function(){return!this.data.left&&!this.data.right},c.center.set=function(t){this.data.left=!1,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right"),this.data.instance.update("_toast.left")},c.context.get=function(){return this.data.context},c.context.set=function(t){this.data.context=t,this.data===this.holder.active&&this.data.instance.update("_toast.context")},c.type.get=function(){return this.data.type},c.type.set=function(t){this.data.type=t,this.data===this.holder.active&&this.data.instance.update("_toast.type")},c.class.get=function(){return this.data.class},c.class.set=function(t){this.data.class=t,this.data===this.holder.active&&this.data.instance.update("_toast.class")},c.dismissable.get=function(){return this.data.dismissable},c.dismissable.set=function(t){this.data.dismissable=t,this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")},c.closeButton.get=function(){return this.data.closeButton},c.closeButton.set=function(t){this.data.closeButton=t,this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")},c.buttons.get=function(){return this.data.buttons},c.buttons.set=function(t){this.data.buttons=t,this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},c.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},c.closed.get=function(){var t=this;return this._promise||(this._promise=new Promise(function(n){t.data.onclose=n})),this._promise},Object.defineProperties(a.prototype,c);var l,f=e.escapeKey,d=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(e);e.extendWith(d,{css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.window.primary"));return n.action=Object.assign({},t("raui.window.action"),t("raui.window.primary.action")),n.host=Object.assign({},t("raui.window.host"),t("raui.window.primary.host")),n.title=Object.assign({inactive:{}},t("raui.window.title"),t("raui.window.primary.title")),"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(n.host.bg||n.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(n.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(n.minWidth||"6em")+";\n min-height: "+(n.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(n.title.inactive.bg||n.fg||"#222")+";\n color: "+(n.title.inactive.fg||n.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(n.title.bg||n.fga||"#07e")+";\n color: "+(n.title.fg||n.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(n.action.bc||n.bc||"#ccc")+";\n background-color: "+(n.action.bg||n.bg||"#fff")+";\n color: "+(n.action.fg||n.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+("function"==typeof t("raui.window.extra")?t("raui.window.extra").call(this,t):"")+"\n "}.call(this,t)].join(" ")},cssId:"rwindow",noCssTransform:!0,delegate:!1,decorators:{tracked:function(t,n){return this[n]=t,{teardown:function(){this[n]===t&&(this[n]=null)}}}},transitions:{window:function(t,n){if(l)return t.complete();l=t;var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"";o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?(t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0}),setTimeout(function(){t.animateStyle({transform:"none",opacity:1},e).then(function(){t.setStyle("opacity",1),l=!1,t.complete(),o.style&&(o.style.overflow=i)})})):(t.setStyle({transform:"none",opacity:1}),t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},e).then(function(){l=!1,t.complete(),o.style&&(o.style.overflow=i)}))}}});var u,h=0,w=function(t){function n(n){t.call(this,n),this.defaults={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return e.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows")[t].id)},e.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+f(t)+".id")},e.placement.get=function(){return this.get("placement")},e.placement.set=function(t){return this.set("placement",t)},e.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},e.windows.get=function(){return Object.keys(this.get("windows"))},n.prototype.addWindow=function(t,n){var e=this,o=Object.assign({},this.defaults,t.constructor.prototype.options,t.options,t.get("options"),n);if(!(t instanceof m))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+h++),this.get("windows."+f(t.id))||this.set("windows."+f(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0},o,{id:t.id})),t.host=this;var i,r,s=this.attachChild(t,{target:"window"});(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+f(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),"fill"===o.size&&(i||o.block))?(!0===o.block?r=this.find(".rwhost-pane"):(r=this.getWindow(i))&&(r=r.find(".rwindow")),r&&(t.size(r.clientWidth-(o.fillPad||20),r.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))):o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.top&&o.left?t.move(o.top,o.left):this.place(t),this.raise(t,{show:!1!==o.show,parent:o.stickToParent}),t.on("close",function(){var n=t.get("control.blocking");if(n){var o=e.windowGet(n,"blockers");e.splice("windows."+f(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+f(t.id)+".block",!1),e.set("windows."+f(t.id)+".index",-1),e.raise(),e.set("windows."+f(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+f(t.id)+".id",{force:!0}),s.then(function(){return t})},n.prototype.getWindow=function(t){return this.children.byName.window&&this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0]},n.prototype.windowGet=function(t,n){return this.get("windows."+f(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+f(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof m?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows"),r=this,s=Object.keys(i).map(function(t){return i[t]}),a=s.length+1,c=this.get("topLevel");this.get("blocked");function l(t){var n=r.get("windows."+f(t)+".blockers");n&&(n.forEach(function(t){return r.add("windows."+f(t)+".index",a++)}),n.forEach(function(t){return l(t)}))}o&&(!1!==n.parent&&o.get("control.blocking")&&(a=this.get("windows."+o.get("control.blocking")+".index")||0,s.forEach(function(t){t.index>a&&t.index++}),a++),o.set("control.index",!1===n.show?-1:a++),!1===n.show||o.visible||o.show(),l(o.id)),s.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+f(t.id)+".index",(t.index||0)+a),l(t.id)});var d=s.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),u=d.filter(function(t){return t.show});a=d.indexOf(u[u.length-1]);var h={},w=null;if(d.forEach(function(t,n){var e=f(t.id);!0===t.block&&null===w&&(w=n),h["windows."+e+".index"]=null!==w?n+2:n,h["windows."+e+".topmost"]=n===a,h["windows."+e+".stack"]=d.length-n}),h.blocked=null!==w?w+1:0,~a&&d.length?h.topLevel=d[a].id:h.topLevel=null,this.set(h),(a=h.topLevel)&&a!==c&&this.get("currentMax")&&this.rendered){var p=this.get("windows."+f(c));o=this.getWindow(a);var g=this.get("transition");!1===g||p&&p.dialog&&(!p.blocking||p.blocking===a)||o.transition(g||"window",o.find("div"),{intro:!0})}},n.prototype.place=function(t){var n=this;return t.get("control.show")?new Promise(function(e){requestAnimationFrame(function(){var o=t.get("control");void 0===o.width&&t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,c=s.clientHeight,l=o.blocking;if(l){var d="windows."+f(l),u=n.get(d),h=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),w=u.max||n.get("userMax")||n.get("max"),g=w?n.host.clientWidth:n.sizeInPx(u.width+"em"),m=w?n.host.clientHeight:n.sizeInPx(u.height+"em"),b=w?0:u.left,x=w?0:u.top;i=(h?a:g/2)+(h?0:b)-n.sizeInPx(o.width+"em")/2,r=(h?c:m/2)+(h?0:x)-n.sizeInPx(o.height+"em")/2}else{var y,v=n.get("placement");if("function"==typeof v)try{y=v(n,s,o)}catch(t){y=p(n,s,o)}else if("string"==typeof v)switch(v){case"smart":y=function(t,n,e){var o,i,r=n.clientWidth-10,s=n.clientHeight-10,a=Math.floor(s/16),c=Math.floor(r/16),l=new Array(a*c),f=new Array(a*c);for(o=0;o<l.length;o++)l[o]=0;var d,u,h,w,p,g,m,b,x=0,y=t.get("windows");for(var v in y)for(x++,d=y[v],u=Math.floor(d.top/16),h=Math.floor(d.left/16),p=Math.ceil(t.sizeInPx(d.height+"em")/16),w=Math.ceil(t.sizeInPx(d.width+"em")/16),o=u;o<u+p&&o<a;o++)for(i=h;i<h+w&&i<c;i++)l[o*c+i]++;for(w=Math.ceil(t.sizeInPx(e.width+"em")/16),p=Math.ceil(t.sizeInPx(e.height+"em")/16),o=0;o<a;o++)for(i=0;i<c;i++){if(o+p>a||i+w>c)g=x*w*p;else for(g=0,m=0;m<p;m++)for(b=0;b<w;b++)g+=l[(o+m)*c+i+b];if(0===g)return{top:16*o+5,left:16*i+5};f[o*c+i]=g}for(g=x*w*p,m=0,o=0;o<f.length;o++)f[o]<g&&(g=f[o],m=o);return{top:16*Math.floor(m/c)+5,left:m%c*16+5}}(n,s,o);break;default:y=p(n,s,o)}else y=p(n,s,o);r=y.top,i=y.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},n.prototype.sizeInPx=function(t){return this.sizer?(this.sizer.style.width="number"==typeof t?t+"px":t,this.sizer.clientWidth):16*parseFloat(t)},n.prototype.sizeInEm=function(t){return this.sizeInPx(t)/this.sizeInPx("1em")},Object.defineProperties(n.prototype,e),n}(d);function p(t,n,e){var o=n.clientWidth,i=n.clientHeight,r=0,s=0,a=void 0===t._grid1?t._grid1=0:t._grid1>7?t._grid1=0:++t._grid1,c=Math.floor(o/3),l=Math.floor(i/3),f=t.sizeInPx(e.width+"em"),d=t.sizeInPx(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=l+Math.floor((l-d)/2);break;case 0:case 1:case 3:r=10}switch(a){case 3:case 6:case 8:s=o-f-10;break;case 1:case 4:case 7:s=c+Math.floor((c-f)/2);break;case 0:case 2:case 5:s=10}return s+f>o&&(s=o-f-10),r+d>i&&(r=i-d-10),{top:r,left:s}}d.extendWith(w,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(t){return{t:t}},"_0&&_1":function(t,n){return t&&n},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(t,n){return[t.getWindow(n).hide()]},"[_0.getWindow(_1).maximize()]":function(t,n){return[t.getWindow(n).maximize()]},"!_0&&_1&&_2":function(t,n,e){return!t&&n&&e},"[_0.getWindow(_1).close()]":function(t,n){return[t.getWindow(n).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(t){return[t.hide()]},"!_0&&_1":function(t,n){return!t&&n},"[_0.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"(_0||_1||_2)&&_3&&!_4":function(t,n,e,o,i){return(t||n||e)&&o&&!i},'["content"]':function(){return["content"]},"!_0":function(t){return!t},"[_0.call(_1)]":function(t,n){return[t.call(n)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(t){return!1!==t},"_0||_1":function(t,n){return t||n},"(_0||_1||_2)&&!_3":function(t,n,e,o){return(t||n||e)&&!o},"[_0._startResize(_1)]":function(t,n){return[t._startResize(n)]},"[_0._sizeHandle(_1)]":function(t,n){return[t._sizeHandle(n)]},"[_0._startMove(_1)]":function(t,n){return[t._startMove(n)]},"!(_0===false||_1||_2||_3)&&!_4":function(t,n,e,o,i){return!(!1===t||n||e||o||i)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[function(t){void 0===t&&(t={});var n=function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.toast.primary"));return"\n .rtoast {\n position: absolute;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n left: 1em;\n right: 1em;\n top: 1em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: hidden;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 1em;\n top: auto;\n }\n .rtoast-left {\n justify-content: flex-start;\n }\n .rtoast-right {\n justify-content: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 0.5em 1em;\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-success {\n color: "+(t("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(t("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(t("raui.toast.warn.fg")||"#222")+";\n background-color: "+(t("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(t("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,t)].join(" ")},e={v:4,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:".bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:".left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:".right"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.toggle("_toast.showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:54,r:"~/_toast"}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(t){return[t.close()]},"_0!==false":function(t){return!1!==t},"!!_0":function(t){return!!t},"Array.isArray(_0)":function(t){return Array.isArray(t)},"[_0.action()]":function(t){return[t.action()]},'typeof _0==="function"':function(t){return"function"==typeof t},"_0!==false&&_1!==false":function(t,n){return!1!==t&&!1!==n},'[_0.toggle("_toast.showMore"),false]':function(t){return[t.toggle("_toast.showMore"),!1]},"(_0!==false&&_1!==false)||_2||_3":function(t,n,e,o){return!1!==t&&!1!==n||e||o},"[false,false]":function(){return[!1,!1]},"_0&&_1":function(t,n){return t&&n}}};return function(o){var i=o.Ractive,r=o.instance,c=o.proto;r.partials[t.name||"toast"]=e;var l,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n){l!==n?(d.splice(d.indexOf(t),1),"function"==typeof n.onclose&&n.onclose()):(u.tm&&(clearTimeout(u.tm),u.tm=null),l.instance.set("_toast",null).then(function(){u.active=l=null,"function"==typeof n.onclose&&n.onclose(),d.length&&w()}))}function w(){u.active=l=d.shift(),l.instance.set("_toast",l).then(function(){l.timeout&&(u.tm=setTimeout(function(){l.close()},l.timeout))})}if(Object.defineProperty(c,"toastDefaults",{value:f,writable:!1,configurable:!0}),c.toast=function(t,n){var e=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return e.close=function(){return h(e)},d.push(e),l||w(),new a(u,e)},c.on=c.on||{},r.transitions.toast=function(t,n){var e=t.processParams({duration:200},n),o=t.getStyle("opacity");return t.isIntro?(t.setStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"},e))},r.transitions["toast-expand"]=function(t,n){var e=t.processParams({duration:200,nested:!1},n);if(t.isIntro){var o=t.getStyle("height"),i=t.getStyle("width");return t.setStyle("height",0),t.setStyle("width",0),t.animateStyle("width",i,e).then(function(){return t.animateStyle("height",o,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})}var r=t.getStyle("height");return t.setStyle("height",r),t.setStyle("width",t.getStyle("width")),t.animateStyle("height",0,e).then(function(){return t.animateStyle("width",0,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})},c.on["close-toast"]=function(){l&&l.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var p=r.css;r.css=function(t){var e="";return"string"==typeof p?e+=p:"function"==typeof p&&(e+=p(t)),n(t)+e}}return c}}(),(void 0===u&&(u={}),function(t){t.instance.transitions[u.name||"expand"]=r})],cssId:"window-host",noIntro:!0,observe:{"@style.raui.window.maxFrom":function(){var t;(t=this)._media?t._media.fn():(t._media={},t._media.fn=function(){if(t.host){var n=t.sizeInPx(t.get("@style.raui.window.maxFrom")),e=t.transitionsEnabled;t.transitionsEnabled=!1,t.set("max",t.host.clientWidth<=n),t.set("dimensions",{clientWidth:t.host.clientWidth,clientHeight:t.host.clientHeight}),t.transitionsEnabled=e}},t._media.handle=t.root.on("*.resize",t._media.fn),setTimeout(t._media.fn))},topLevel:function(t){t?this.link("windows."+f(t),"current"):this.unlink("current")},currentMax:{handler:function(t){(this.children.byName.window||[]).forEach(function(t){return t.instance.fire("resize")})},defer:!0}},computed:{currentMax:function(){var t=this.get("topLevel"),n=this.get("windows."+f(t)+".max");return this.get("userMax")||this.get("max")||n}},on:{config:function(){var t,n=this,e=this.partials.content;if(e&&Array.isArray(e))for(var o=(e=this.partials.content=e.slice()).length;o--;){var i=e[o];"max-top"===i.e&&(e.splice(o,1),n.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&n.set({_maxAttrsP:{t:i.m}}))}"undefined"!=typeof window&&(this._resizeListener=function(){t||(t=setTimeout(function(){t=null,n.fire("resize")},300))},window.addEventListener("resize",this._resizeListener))},teardown:function(){this._resizeListener&&window.removeEventListener("resize",this._resizeListener)}}}),e.transitions.modal=function(t,n){var e,o=t.processParams(n,{duration:400,easing:"easeOut",x:0,y:-50,event:!0}),i=t.node.offsetLeft,r=t.node.offsetTop,s=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(t.node._modalSrc){var a=t.node._modalSrc||{x:i+o.x,y:r+o.y},c={x:a.x-Math.round(t.node.clientWidth/2)-i,y:a.y-Math.round(t.node.clientHeight/2)-r};t.node.parentNode.style&&(t.node.parentNode.style.overflow="hidden"),t.isIntro?(t.node._modalSrc=a,e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0}}else t.isIntro?(e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0};t.animateStyle(e,o).then(function(){t.node.parentNode.style&&(t.node.parentNode.style.overflow=s),t.complete()})};var g=["mousemove","mouseup","touchmove","touchend"],m=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={resizable:{configurable:!0},title:{configurable:!0},visible:{configurable:!0},pad:{configurable:!0},buttons:{configurable:!0},blocked:{configurable:!0},result:{configurable:!0}};return e.resizable.get=function(){return this.get("control.resizable")},e.resizable.set=function(t){return this.set("control.resizable",t)},e.title.get=function(){return this.get("control.title")},e.title.set=function(t){return this.set("control.title",t)},e.visible.get=function(){return this.get("control.show")},e.visible.set=function(t){t?this.show():this.set("control.show",t,{keep:!0}),this.host.raise(this,{show:t})},e.pad.get=function(){return this.get("pad")},e.pad.set=function(t){this.set("pad",t)},e.buttons.get=function(){return this.get("buttons")},e.buttons.set=function(t){return this.set("buttons",t)},e.blocked.get=function(){return this.get("control.blocked")},e.blocked.set=function(t){return this.set("control.blocked",t)},e.result.get=function(){var t=this;return this._result||(this._result={},this._result.promise=new Promise(function(n){t._result.ok=n})),this._result.promise},n.prototype.setResult=function(t){this.result,this._result.value=t},n.prototype.close=function(t,n){if(!0!==t){if(!this.parent)return!1;if(this.get("control.blockers.length"))return!1;if("function"==typeof this.beforeClose&&!1===this.beforeClose())return!1;if(!1===this.fire("beforeClose"))return!1}return this.fire("close"),this._result&&this._result.ok(this._result.value||n),!0},n.prototype.maximize=function(){this.toggle("root.userMax")},n.prototype.hide=function(){this.visible=!1},n.prototype.raise=function(t){this.host.raise(this,{show:t})},n.prototype.show=function(){this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this)},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(e.visible){var i=e.wrapper;if(i){if("auto"===t){e.set("control.autosize",!0);var r=e.host.sizeInEm(i.clientWidth+16),s=e.host.sizeInEm(i.clientHeight);e.set({"control.width":r,"control.height":s,"control.naturalWidth":r,"control.naturalHeight":s,"control.autosize":!1})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var l=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=c,e.set({"control.width":e.host.sizeInEm(l),"control.height":e.host.sizeInEm(f),"control.naturalWidth":e.host.sizeInEm(l),"control.naturalHeight":e.host.sizeInEm(f),"control.autosize":!1})}e.fire("resize"),o()}}else"number"==typeof t&&"number"==typeof n&&e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1})})})},n.prototype.move=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){"center"===t?t=e.host.modalPane.clientHeight/2-e.wrapper.clientHeight/2:"string"==typeof t&&(t=e.host.sizeInEm(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=e.host.sizeInEm(n));var i={};"number"==typeof t&&(i["control.top"]=t),"number"==typeof n&&(i["control.left"]=n),e.set(i),o()})})},n.prototype._startMove=function(t){var n=this;if("mousedown"!==t.type||0===t.button){if(this.get("control.topmost")||this.raise(),~t.type.indexOf("mouse")){if(!t.ctrlKey&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return}else if(t.targetTouches&&1===t.targetTouches.length&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return;var e=this.pane,o=e.style.cursor;e.style.cursor="move",e.style.userSelect="none";var i=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,r=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,s=this.get("control.left")||0,a=this.get("control.top")||0,c=e.clientWidth,l=e.clientHeight,f=function(t){var d=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,u=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,h=s+(d-i),w=a+(u-r);h<(c<30?0:30-c)&&(h=c<30?0:30-c),w<(l<30?0:30-l)&&(w=l<30?0:30-l),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect=""):t.preventDefault()};return g.forEach(function(t){return document.addEventListener(t,f,{passive:!1})}),0!==t.type.indexOf("mouse")&&void 0}},n.prototype._startResize=function(t){var n=this;if(t.target===this.wrapper&&("mousedown"!==t.type||0===t.button)){this.get("control.autosize")&&this.size("auto"),this.get("control.topmost")||this.raise(),this.set("control.resizing",!0);var e,o=this.wrapper,i=t.offsetX||t.targetTouches&&t.targetTouches[0].pageX-o.getBoundingClientRect().left,r=t.offsetY||t.targetTouches&&t.targetTouches[0].pageY-o.getBoundingClientRect().top,s=this.get("@style.window.handleSize")||7,a=o.clientWidth-2*s,c=o.clientHeight-2*s,l=2*s,f=i<=l||i>=a,d=r<=l||r>=c,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,h=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,w=this.get("control.left")||0,p=this.get("control.top")||0,m=this.host.sizeInPx(this.get("control.width")+"em"),b=this.host.sizeInPx(this.get("control.height")+"em"),x=this.host.sizeInPx(this.get("control.naturalHeight")+"em"),y=this.host.sizeInPx(this.get("control.naturalWidth")+"em"),v=function(t){t.preventDefault();var o=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,a=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,c=f?o-u:0,l=d?a-h:0,_={};r<=s?(_["control.top"]=p+l,_["control.height"]=b-l):_["control.height"]=b+l,i<=s?(_["control.left"]=w+c,_["control.width"]=m-c):_["control.width"]=m+c,_["control.width"]<y&&(delete _["control.width"],delete _["control.left"]),_["control.height"]<x&&(delete _["control.height"],delete _["control.top"]),_["control.left"]<0&&(_["control.left"]=0),_["control.top"]<0&&(_["control.top"]=0),_["control.width"]&&(_["control.width"]=n.host.sizeInEm(_["control.width"])),_["control.height"]&&(_["control.height"]=n.host.sizeInEm(_["control.height"])),n.set(_),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,v,{passive:!1})}),n.set("control.resizing",!1),m===n.get("control.width")&&b===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return g.forEach(function(t){return document.addEventListener(t,v,{passive:!1})}),!1}},n.prototype._sizeHandle=function(t){if(t.target===this.wrapper){var n=this.wrapper;if("mouseout"===t.type)return n.style.cursor="auto";var e=t.offsetX,o=t.offsetY,i=this.get("@style.window.handleSize")||7,r=n.clientWidth-i,s=n.clientHeight-i,a=n.style;a.cursor=e<=i+i&&o<=i+i||e>=r-i&&o>=s-i?"nwse-resize":e>=r-i&&o<=i+i||e<=i+i&&o>=s-i?"nesw-resize":(e<=i||e>=r)&&(o<s||o>i)?"ew-resize":(o<=i||o>=s)&&(e<r||e>i)?"ns-resize":"auto"}},Object.defineProperties(n.prototype,e),n}(d),b=["left","right","center","condition"];function x(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=w}}d.extendWith(m,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],contents:"",status:""},data:function(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"left"===t.where})},centerButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"center"===t.where})},rightButtons:function(){return(this.get("buttons")||[]).filter(function(t){return!t.where||"right"===t.where})}},decorators:{button:function(t){var n=this.getContext(t);return n.add("visibleButtons"),{update:function(){},teardown:function(){n.subtract("visibleButtons")}}}},on:{config:function(){var t=m.prototype.template,n=this.template;"string"!=typeof t&&!Array.isArray(t)&&t.t&&(t=t.t),"string"!=typeof n&&!Array.isArray(n)&&n.t&&(n=n.t),t!==n&&(this.partials.hasOwnProperty("contents")||(this.partials.contents=n),this.template=t)},construct:function(){var t=this.constructor;if(!t._constructed){t._constructed=1;var n=t.prototype.template.t.slice(),e=n.find(function(t){return"buttons"===t.e});function o(t){var n=t.m||[],e={partial:{t:[{t:t.t,e:t.e,f:t.f,m:n.filter(function(t){return!~b.indexOf(t.n)})}]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"};return e.partial.t[0].m.push({t:71,n:"button"}),e}t.prototype.template.t=n.filter(function(t){return"buttons"!==t.e}),e&&(t._btns=e.f.filter(function(t){return"button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e})}).map(function(t){return 4===t.t?t.f.filter(function(t){return"button"===t.e}).map(function(n){var e=o(n),i={t:t.t,n:t.n,f:[e.partial.t[0]]};return t.r&&(i.r=t.r),t.rx&&(i.rx=t.rx),t.x&&(i.x=t.x),e.partial={t:[i]},e}):[o(t)]}).reduce(function(t,n){return t.concat(n)},[]))}},init:function(){var t=this.constructor;t._btns&&!this.get("buttons.length")&&this.set("buttons",t._btns)}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function(t,n,e){if(this.get("control.id")){var o=this.get("control.max")||this.get("root.userMax")||this.get("root.max"),i=this.get("control.actual")||{};if(o)if(i.max)~e.indexOf("client")&&"number"==typeof t&&(~e.indexOf("Width")?this.set("control.actual.width",this.host.sizeInEm(t)):~e.indexOf("Height")&&this.set("control.actual.height",this.host.sizeInEm(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:o})}else"number"==typeof t&&(~e.indexOf("width")?this.set("control.actual.width",t):~e.indexOf("height")&&this.set("control.actual.height",t)),i.max&&this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:o}),this.set("control.actual.max",!1)}},init:!1,defer:!0}}}),i("RMWindowHost","components",w),i("RMWindow","components",m),w.prototype.Window=m,t.Base=d,t.Host=w,t.Window=m,t.plugin=x,t.default=x,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("ractive")):"function"==typeof define&&define.amd?define(["exports","ractive"],n):n(t.RMWindow={},t.Ractive)}(this,function(t,n){"use strict";var e="default"in n?n.default:n,o="undefined"!=typeof window?window:null;function i(t,n,e){if(o&&o.Ractive&&"object"==typeof o.Ractive[n]){var i=document.currentScript;if(i||(i=(i=document.querySelectorAll("script"))[i.length-1]),i){var r=i.getAttribute("data-alias");r&&(r=(r=r.split("&")).reduce(function(t,n){var e=n.split("="),o=e[0],i=e[1];return t[o]=i,t},{})),Ractive[n][r&&r[t]||t]=e}}}function r(t,n){var e=t.processParams(n,{duration:200,easing:"easeInOut"});return new Promise(function(n){requestAnimationFrame(function(){t.setStyle("overflow","hidden");var o="x"===e.axis?"width":"height";if(t.isIntro||e.intro){var i=t.getStyle(o);t.setStyle(o,0),t.setStyle("opacity",0),n(t.animateStyle(o,i,e).then(function(){return t.animateStyle("opacity",1,e)}).then(function(){t.setStyle(o,""),t.setStyle("overflow","")}))}else t.setStyle(o,t.getStyle(o)),t.setStyle("opacity",1),n(t.animateStyle("opacity",0,e).then(function(){return t.animateStyle(o,0,e)}))})})}i("expand","transitions",r);var s={timeout:6e3,top:!0};var a=function(t,n){this.holder=t,this.data=n},c={message:{configurable:!0},more:{configurable:!0},showMore:{configurable:!0},left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0},center:{configurable:!0},context:{configurable:!0},type:{configurable:!0},class:{configurable:!0},dismissable:{configurable:!0},closeButton:{configurable:!0},buttons:{configurable:!0},live:{configurable:!0},closed:{configurable:!0}};a.prototype.close=function(t){var n=this;return this.data===this.holder.active?(clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close()},t):this.data.close()):t?this.data.timeout=time:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?clearTimeout(this.holder.tm):this.data.timeout=0},a.prototype.updateButtons=function(){this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},a.prototype.set=function(t,e){if("object"==typeof t){for(var o in t)this.data[o]=t[o];return this.data===this.holder.active?this.data.instance.update("_toast"):Promise.resolve()}return this.data[t]=e,this.data===this.holder.active?this.data.instance.update("_toast."+n.Ractive.escapeKey(t)):Promise.resolve()},c.message.get=function(){return this.data.message},c.message.set=function(t){this.data.message=t,this.data===this.holder.active&&this.data.instance.update("_toast.message")},c.more.get=function(){return this.data.more},c.more.set=function(t){this.data.more=t,this.data===this.holder.active&&this.data.instance.update("_toast.more")},c.showMore.get=function(){return this.data.showMore},c.showMore.set=function(t){this.data.showMore=t,this.data===this.holder.active&&this.data.instance.update("_toast.showMore")},c.left.get=function(){return this.data.left},c.left.set=function(t){this.data.left=t,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.left")&&this.data.instance.update("_toast.right")},c.right.get=function(){return this.data.right},c.right.set=function(t){this.data.right=t,this.data.left=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right")&&this.data.instance.update("_toast.left")},c.top.get=function(){return!this.data.bottom},c.top.set=function(t){this.data.bottom=!t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.bottom.get=function(){return this.data.bottom},c.bottom.set=function(t){this.data.bottom=t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},c.center.get=function(){return!this.data.left&&!this.data.right},c.center.set=function(t){this.data.left=!1,this.data.right=!1,this.data===this.holder.active&&this.data.instance.update("_toast.right"),this.data.instance.update("_toast.left")},c.context.get=function(){return this.data.context},c.context.set=function(t){this.data.context=t,this.data===this.holder.active&&this.data.instance.update("_toast.context")},c.type.get=function(){return this.data.type},c.type.set=function(t){this.data.type=t,this.data===this.holder.active&&this.data.instance.update("_toast.type")},c.class.get=function(){return this.data.class},c.class.set=function(t){this.data.class=t,this.data===this.holder.active&&this.data.instance.update("_toast.class")},c.dismissable.get=function(){return this.data.dismissable},c.dismissable.set=function(t){this.data.dismissable=t,this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")},c.closeButton.get=function(){return this.data.closeButton},c.closeButton.set=function(t){this.data.closeButton=t,this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")},c.buttons.get=function(){return this.data.buttons},c.buttons.set=function(t){this.data.buttons=t,this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},c.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},c.closed.get=function(){var t=this;return this._promise||(this._promise=new Promise(function(n){t.data.onclose=n})),this._promise},Object.defineProperties(a.prototype,c);var l,f=e.escapeKey,d=function(t){function n(n){t.call(this,n)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(e);e.extendWith(d,{css:function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.window.primary"));return n.action=Object.assign({},t("raui.window.action"),t("raui.window.primary.action")),n.host=Object.assign({},t("raui.window.host"),t("raui.window.primary.host")),n.title=Object.assign({inactive:{}},t("raui.window.title"),t("raui.window.primary.title")),"\n .rwhost {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n \n .rwhost-sizer {\n position: absolute;\n }\n \n .rwhost-pane {\n display: flex;\n position: relative;\n width: 100%;\n box-sizing: border-box;\n flex-grow: 2;\n overflow: auto;\n background-color: "+(n.host.bg||n.bg||"#fff")+";\n z-index: 1;\n }\n .rwhost-pane.blocked {\n overflow: hidden;\n }\n \n .rwhost-pane-content {\n flex-grow: 1;\n }\n \n .rwhost-modal {\n position: absolute;\n position: --webkit-sticky;\n position: sticky;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0;\n transition: opacity 0.2s ease-in-out, z-index 0s linear 0.2s;\n background-color: #000;\n }\n .rwhost-modal-active {\n opacity: 0.5;\n z-index: 1;\n transition: opacity 0.2s ease-in-out, z-index 0s linear;\n }\n \n .rwindow-wrapper {\n display: inline-block;\n box-sizing: border-box;\n position: absolute;\n }\n .rwindow-wrapper.rwindow-resizing {\n transition: none;\n }\n \n .rwindow-wrapper.rwindow-resizable {\n padding: "+(n.handleSize||7)+"px;\n }\n \n .rwindow-topmost > .rwindow {\n box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.3);\n opacity: 1;\n }\n \n .rwindow-modal {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n z-index: -1;\n transition: opacity 0.4s ease-in-out, z-index 0s linear 0.4s;\n }\n .rwindow-modal.rwindow-blocked {\n opacity: 1;\n z-index: 10;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n \n .rwindow {\n position: relative;\n box-sizing: border-box;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n border-radius: 2px;\n overflow: hidden;\n width: 100%;\n height: 100%;\n min-width: "+(n.minWidth||"6em")+";\n min-height: "+(n.minHeight||"6em")+";\n transition: box-shadow 0.4s ease-in-out, opacity 0.4s ease-in-out;\n }\n .rwindow-max > .rwindow {\n border-radius: 0;\n box-shadow: none;\n }\n \n .rwindow-pane-top,\n .rwindow-max-top {\n background-color: "+(n.title.inactive.bg||n.fg||"#222")+";\n color: "+(n.title.inactive.fg||n.bg||"#fff")+";\n flex-shrink: 0;\n }\n \n .rwindow-max-top {\n flex-shrink: 2;\n }\n \n .rwindow-pane-top {\n display: flex;\n align-items: center;\n }\n \n .rwindow-topmost .rwindow-pane-top {\n background-color: "+(n.title.bg||n.fga||"#07e")+";\n color: "+(n.title.fg||n.bg||"#fff")+";\n }\n \n .rwindow-pane {\n display: flex;\n flex-direction: column;\n table-layout: fixed;\n width: 100%;\n height: 100%;\n }\n .rwindow-autosizing {\n display: block;\n box-sizing: border-box;\n }\n .rwindow-content {\n overflow: auto;\n flex-grow: 2;\n position: relative;\n box-sizing: border-box;\n }\n .rwindow-content.rwindow-pad {\n padding: 1em;\n }\n .rwindow-content.rwindow-flex {\n display: flex;\n flex-direction: column;\n }\n \n .rwindow-buttons {\n display: flex;\n flex-shrink: 0;\n padding: 0.5em;\n border-top: 1px solid "+(n.action.bc||n.bc||"#ccc")+";\n background-color: "+(n.action.bg||n.bg||"#fff")+";\n color: "+(n.action.fg||n.fg||"#222")+";\n }\n .rwindow-buttons.no-buttons {\n display: none;\n }\n .rwindow-left-buttons {\n text-align: left;\n flex-grow: 2;\n }\n .rwindow-left-buttons button {\n margin-right: 0.5em;\n }\n .rwindow-center-buttons {\n text-align: center;\n flex-shrink: 2;\n }\n .rwindow-center-buttons button {\n margin: 0 0.25em;\n }\n .rwindow-right-buttons {\n text-align: right;\n flex-grow: 2;\n }\n .rwindow-right-buttons button {\n margin-left: 0.5em;\n }\n \n .rwindow-title {\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0.5em;\n white-space: nowrap;\n box-sizing: border-box;\n flex-grow: 1;\n }\n \n .rwindow-controls {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n }\n .rwindow-controls > div {\n margin: 0 1em 0 0;\n width: 0.7em;\n height: 0.7em;\n cursor: pointer;\n }\n .rwindow-minimize {\n border-bottom: 2px solid;\n }\n .rwindow-maximize {\n border: 2px solid;\n }\n .rwindow-controls > .rwindow-close {\n width: 0.5em;\n height: 1em;\n border-right: 2px solid;\n transform: rotate(45deg);\n transform-origin: center right;\n position: relative;\n margin-right: 1.5em;\n }\n .rwindow-close:before {\n cursor: pointer;\n height: 1.2em;\n width: 1.2em;\n top: 0.3em;\n left: 0.1em;\n content: ' ';\n transform: rotate(-45deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-close:after {\n cursor: pointer;\n height: 100%;\n width: 100%;\n top: 1px;\n left: calc(100% + 1px);\n content: ' ';\n border-left: 2px solid;\n transform: rotate(-90deg);\n transform-origin: center left;\n position: absolute;\n }\n .rwindow-max-top .rwindow-controls > .rwindow-close {\n margin-right: 0.5em;\n }\n "+("function"==typeof t("raui.window.extra")?t("raui.window.extra").call(this,t):"")+"\n "}.call(this,t)].join(" ")},cssId:"rwindow",noCssTransform:!0,delegate:!1,decorators:{tracked:function(t,n){return this[n]=t,{teardown:function(){this[n]===t&&(this[n]=null)}}}},transitions:{window:function(t,n){if(l)return t.complete();l=t;var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"";o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?(t.setStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0}),setTimeout(function(){t.animateStyle({transform:"none",opacity:1},e).then(function(){t.setStyle("opacity",1),l=!1,t.complete(),o.style&&(o.style.overflow=i)})})):(t.setStyle({transform:"none",opacity:1}),t.animateStyle({transform:"translate(30%, 0px) scale(1.1, 1.1)",opacity:0},e).then(function(){l=!1,t.complete(),o.style&&(o.style.overflow=i)}))}}});var u,h=0,w=function(t){function n(n){t.call(this,n),this.defaults={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return e.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows")[t].id)},e.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+f(t)+".id")},e.placement.get=function(){return this.get("placement")},e.placement.set=function(t){return this.set("placement",t)},e.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},e.windows.get=function(){return Object.keys(this.get("windows"))},n.prototype.addWindow=function(t,n){var e=this,o=Object.assign({},this.defaults,t.constructor.prototype.options,t.options,t.get("options"),n);if(!(t instanceof m))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+h++),this.get("windows."+f(t.id))||this.set("windows."+f(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0},o,{id:t.id})),t.host=this;var i,r,s=this.attachChild(t,{target:"window"});(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+f(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),"fill"===o.size&&(i||o.block))?(!0===o.block?r=this.find(".rwhost-pane"):(r=this.getWindow(i))&&(r=r.find(".rwindow")),r&&(t.size(r.clientWidth-(o.fillPad||20),r.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))):o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.top&&o.left?t.move(o.top,o.left):this.place(t),this.raise(t,{show:!1!==o.show,parent:o.stickToParent}),t.on("close",function(){var n=t.get("control.blocking");if(n){var o=e.windowGet(n,"blockers");e.splice("windows."+f(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+f(t.id)+".block",!1),e.set("windows."+f(t.id)+".index",-1),e.raise(),e.set("windows."+f(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+f(t.id)+".id",{force:!0}),s.then(function(){return t})},n.prototype.getWindow=function(t){return this.children.byName.window&&this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0]},n.prototype.windowGet=function(t,n){return this.get("windows."+f(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+f(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof m?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows"),r=this,s=Object.keys(i).map(function(t){return i[t]}),a=s.length+1,c=this.get("topLevel");this.get("blocked");function l(t){var n=r.get("windows."+f(t)+".blockers");n&&n.forEach(function(t){r.add("windows."+f(t)+".index",a++),l(t)})}if(o){if(!1!==n.parent&&o.get("control.blocking")){var d=o.get("control.blocking");a=this.get("windows."+d+".index")||0+(this.get("windows."+d+".blockers.length")||0),s.forEach(function(t){t.index>a&&t.index++}),a++}o.set("control.index",!1===n.show?-1:a++),!1===n.show||o.visible||o.show(),l(o.id)}s.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+f(t.id)+".index",(t.index||0)+a),l(t.id)});var u=s.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),h=u.filter(function(t){return t.show});a=u.indexOf(h[h.length-1]);var w={},p=null;if(u.forEach(function(t,n){var e=f(t.id);!0===t.block&&null===p&&(p=n),w["windows."+e+".index"]=null!==p?n+2:n,w["windows."+e+".topmost"]=n===a,w["windows."+e+".stack"]=u.length-n}),w.blocked=null!==p?p+1:0,~a&&u.length?w.topLevel=u[a].id:w.topLevel=null,this.set(w),(a=w.topLevel)&&a!==c&&this.get("currentMax")&&this.rendered){var g=this.get("windows."+f(c));o=this.getWindow(a);var b=this.get("transition");!1===b||g&&g.dialog&&(!g.blocking||g.blocking===a)||o.transition(b||"window",o.find("div"),{intro:!0})}},n.prototype.place=function(t){var n=this;return t.get("control.show")?new Promise(function(e){requestAnimationFrame(function(){var o=t.get("control");void 0===o.width&&t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,c=s.clientHeight,l=o.blocking;if(l){var d="windows."+f(l),u=n.get(d),h=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),w=u.max||n.get("userMax")||n.get("max"),g=w?n.host.clientWidth:n.sizeInPx(u.width+"em"),m=w?n.host.clientHeight:n.sizeInPx(u.height+"em"),b=w?0:u.left,x=w?0:u.top;i=(h?a:g/2)+(h?0:b)-n.sizeInPx(o.width+"em")/2,r=(h?c:m/2)+(h?0:x)-n.sizeInPx(o.height+"em")/2}else{var y,v=n.get("placement");if("function"==typeof v)try{y=v(n,s,o)}catch(t){y=p(n,s,o)}else if("string"==typeof v)switch(v){case"smart":y=function(t,n,e){var o,i,r=n.clientWidth-10,s=n.clientHeight-10,a=Math.floor(s/16),c=Math.floor(r/16),l=new Array(a*c),f=new Array(a*c);for(o=0;o<l.length;o++)l[o]=0;var d,u,h,w,p,g,m,b,x=0,y=t.get("windows");for(var v in y)for(x++,d=y[v],u=Math.floor(d.top/16),h=Math.floor(d.left/16),p=Math.ceil(t.sizeInPx(d.height+"em")/16),w=Math.ceil(t.sizeInPx(d.width+"em")/16),o=u;o<u+p&&o<a;o++)for(i=h;i<h+w&&i<c;i++)l[o*c+i]++;for(w=Math.ceil(t.sizeInPx(e.width+"em")/16),p=Math.ceil(t.sizeInPx(e.height+"em")/16),o=0;o<a;o++)for(i=0;i<c;i++){if(o+p>a||i+w>c)g=x*w*p;else for(g=0,m=0;m<p;m++)for(b=0;b<w;b++)g+=l[(o+m)*c+i+b];if(0===g)return{top:16*o+5,left:16*i+5};f[o*c+i]=g}for(g=x*w*p,m=0,o=0;o<f.length;o++)f[o]<g&&(g=f[o],m=o);return{top:16*Math.floor(m/c)+5,left:m%c*16+5}}(n,s,o);break;default:y=p(n,s,o)}else y=p(n,s,o);r=y.top,i=y.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},n.prototype.sizeInPx=function(t){return this.sizer?(this.sizer.style.width="number"==typeof t?t+"px":t,this.sizer.clientWidth):16*parseFloat(t)},n.prototype.sizeInEm=function(t){return this.sizeInPx(t)/this.sizeInPx("1em")},Object.defineProperties(n.prototype,e),n}(d);function p(t,n,e){var o=n.clientWidth,i=n.clientHeight,r=0,s=0,a=void 0===t._grid1?t._grid1=0:t._grid1>7?t._grid1=0:++t._grid1,c=Math.floor(o/3),l=Math.floor(i/3),f=t.sizeInPx(e.width+"em"),d=t.sizeInPx(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=l+Math.floor((l-d)/2);break;case 0:case 1:case 3:r=10}switch(a){case 3:case 6:case 8:s=o-f-10;break;case 1:case 4:case 7:s=c+Math.floor((c-f)/2);break;case 0:case 2:case 5:s=10}return s+f>o&&(s=o-f-10),r+d>i&&(r=i-d-10),{top:r,left:s}}d.extendWith(w,{template:{v:4,t:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost",g:1},{n:"tracked",t:71,f:{r:[],s:'["host"]'}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-sizer",g:1},{n:"tracked",t:71,f:{r:[],s:'["sizer"]'}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-max-top",g:1},{t:4,f:[{t:16,r:"~/_maxAttrsP"}],n:50,r:"~/_maxAttrsP"}],f:[{t:16,r:"~/_maxP",z:[{n:"window",x:{r:"~/current"}},{n:"windowControls",x:{x:{r:["@this.partials.windowControls"],s:"{t:_0}"}}},{n:"host",x:{r:"@this"}}]}]}],n:50,x:{r:["~/currentMax","~/_maxP"],s:"_0&&_1"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane",g:1},{n:"class-rwhost-blocked",t:13,f:[{t:2,r:"~/blocked"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-pane-content",g:1}],f:[{t:16}]}," ",{t:4,f:[{t:11,n:"window",m:[{n:"control",f:[{t:2,rx:{r:"~/windows",m:[{t:30,n:".instance.id"}]}}],t:13},{n:"root",t:13,f:[{t:2,r:"~/"}]}]}],n:52,r:"@this.children.byName.window"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwhost-modal",g:1},{n:"tracked",t:71,f:{r:[],s:'["modalPane"]'}},{t:4,f:[{n:"class-rwhost-modal-active",t:13},{n:"style-z-index",f:[{t:2,r:"~/blocked"}],t:13}],n:50,r:"~/blocked"}]}]}," ",{t:8,r:"toast"}]}],e:{'["host"]':function(){return["host"]},'["sizer"]':function(){return["sizer"]},"{t:_0}":function(t){return{t:t}},"_0&&_1":function(t,n){return t&&n},'["modalPane"]':function(){return["modalPane"]},"[_0.getWindow(_1).hide()]":function(t,n){return[t.getWindow(n).hide()]},"[_0.getWindow(_1).maximize()]":function(t,n){return[t.getWindow(n).maximize()]},"!_0&&_1&&_2":function(t,n,e){return!t&&n&&e},"[_0.getWindow(_1).close()]":function(t,n){return[t.getWindow(n).close()]},'["top"]':function(){return["top"]},"[_0.hide()]":function(t){return[t.hide()]},"!_0&&_1":function(t,n){return!t&&n},"[_0.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"(_0||_1||_2)&&_3&&!_4":function(t,n,e,o,i){return(t||n||e)&&o&&!i},'["content"]':function(){return["content"]},"!_0":function(t){return!t},"[_0.call(_1)]":function(t,n){return[t.call(n)]},'["wrapper"]':function(){return["wrapper"]},"_0!==false":function(t){return!1!==t},"_0||_1":function(t,n){return t||n},"(_0||_1||_2)&&!_3":function(t,n,e,o){return(t||n||e)&&!o},"[_0._startResize(_1)]":function(t,n){return[t._startResize(n)]},"[_0._sizeHandle(_1)]":function(t,n){return[t._sizeHandle(n)]},"[_0._startMove(_1)]":function(t,n){return[t._startMove(n)]},"!(_0===false||_1||_2||_3)&&!_4":function(t,n,e,o,i){return!(!1===t||n||e||o||i)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]}},p:{title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],windowControls:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).hide()]"}}]}],n:50,r:"window.minimize"}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).maximize()]"}}]}],n:50,x:{r:["~/window.dialog","window.maximize","host.data.userMax"],s:"!_0&&_1&&_2"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["host","window.id"],s:"[_0.getWindow(_1).close()]"}}]}],n:50,r:"window.close"}]}],pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],window:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[function(t){void 0===t&&(t={});var n=function(t){return[function(t){var n=Object.assign({},t("raui.primary"),t("raui.toast.primary"));return"\n .rtoast {\n position: absolute;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n left: 1em;\n right: 1em;\n top: 1em;\n bottom: auto;\n z-index: 5;\n pointer-events: none;\n overflow: hidden;\n }\n .rtoast-message {\n flex-grow: 2;\n display: flex;\n align-items: center;\n }\n .rtoast-string {\n white-space: pre-wrap;\n line-height: 1.3em;\n padding-top: 0.3em;\n }\n .rtoast-upper .rtoast-string {\n \n }\n .rtoast-expand .rtoast-string {\n padding-top: 0.5em;\n }\n .rtoast-buttons {\n display: flex;\n padding-left: 0.5em;\n flex-shrink: 1;\n align-items: center;\n max-height: max-content;\n margin-left: auto;\n }\n .rtoast-buttons button {\n cursor: pointer;\n }\n .rtoast-button {\n background-color: transparent;\n border: none;\n color: inherit;\n padding: 0.5em 0.75em;\n margin: 0 0 0 0.5em;\n line-height: 1em;\n box-shadow: none;\n }\n .rtoast-more {\n cursor: pointer;\n width: 2em;\n position: relative;\n flex-shrink: 2;\n background-color: transparent;\n border: none;\n color: inherit;\n margin: 0 0 0 0.5em;\n height: 2em;\n }\n .rtoast-more:after {\n content: ' ';\n position: absolute;\n display: block;\n width: 0.6em;\n height: 0.6em;\n top: calc(50% - 0.55em);\n left: calc(50% - 0.3em);\n border-bottom: 0.125em solid;\n border-right: 0.125em solid;\n transform: rotate(45deg);\n transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;\n pointer-events: none;\n }\n .rtoast-expanded .rtoast-more:after {\n transform: rotate(225deg);\n top: calc(50% - 0.1em);\n }\n .rtoast-bottom {\n bottom: 1em;\n top: auto;\n }\n .rtoast-left {\n justify-content: flex-start;\n }\n .rtoast-right {\n justify-content: flex-end;\n }\n .rtoast-body {\n border-radius: 0.2em;\n padding: 0.5em 1em;\n color: "+(n.bg||"#fff")+";\n background-color: "+(n.fg||"#222")+";\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);\n opacity: 0.95;\n pointer-events: all;\n transition: color 0.5s ease-in-out, background 0.5s ease-in-out;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-success {\n color: "+(t("raui.toast.success.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.success.bg")||"#4caf50")+";\n }\n .rtoast-info {\n color: "+(t("raui.toast.info.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.info.bg")||"#07e")+";\n }\n .rtoast-warn {\n color: "+(t("raui.toast.warn.fg")||"#222")+";\n background-color: "+(t("raui.warn.success.bg")||"#ffc107")+";\n }\n .rtoast-error {\n color: "+(t("raui.toast.error.fg")||"#f9f9f9")+";\n background-color: "+(t("raui.toast.error.bg")||"#ff5252")+";\n }\n "}.call(this,t)].join(" ")},e={v:4,t:[{t:4,f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast",g:1},{n:"class-rtoast-expanded",t:13,f:[{t:2,r:".showMore"}]},{n:"class-rtoast-bottom",t:13,f:[{t:2,r:".bottom"}]},{n:"class-rtoast-left",t:13,f:[{t:2,r:".left"}]},{n:"class-rtoast-right",t:13,f:[{t:2,r:".right"}]}],f:[{t:7,e:"div",m:[{n:"toast",t:72,v:"t0"},{n:"class",f:["rtoast-body",{t:4,f:[" rtoast-",{t:2,r:".type"}],n:50,r:".type"},{t:4,f:[{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.close()]"}}],n:50,x:{r:[".dismissable"],s:"_0!==false"}}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-upper",g:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-message",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".message",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".message"}],n:51,l:1}],n:50,x:{r:[".message"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".message"}]}],n:51,l:1}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-buttons",g:1}],f:[{t:4,f:[{t:7,e:"button",m:[{n:"class",f:["rtoast-button",{t:4,f:[" ",{t:2,r:".class"}],n:50,r:".class"}],t:13},{t:4,f:[{n:["click"],t:70,f:{r:["."],s:"[_0.action()]"}}],n:50,x:{r:[".action"],s:'typeof _0==="function"'}}],f:[{t:2,r:".label"}]}],n:52,r:".buttons"},{t:4,f:[{t:7,e:"button",m:[{t:13,n:"class",f:"rtoast-button",g:1}],f:["Close"]}],n:50,x:{r:[".dismissable",".closeButton"],s:"_0!==false&&_1!==false"},l:1}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-more",g:1},{n:"title",f:"Toggle more",t:13,g:1},{n:["click"],t:70,f:{r:["@this"],s:'[_0.toggle("_toast.showMore"),false]'}}]}],n:50,r:".more"}]}],n:50,x:{r:[".dismissable",".closeButton",".buttons.length",".more"],s:"(_0!==false&&_1!==false)||_2||_3"}}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-expand",g:1},{n:"toast-expand",t:72,v:"t0"},{n:["click"],t:70,f:{r:[],s:"[false,false]"}}],f:[{t:4,f:[{t:4,f:[{t:8,r:".more",c:{r:".context"}}],n:50,x:{r:[".context"],s:"!!_0"}},{t:4,f:[{t:8,r:".more"}],n:51,l:1}],n:50,x:{r:[".more"],s:"Array.isArray(_0)"}},{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rtoast-string",g:1}],f:[{t:2,r:".more"}]}],n:51,l:1}]}],n:50,x:{r:[".more",".showMore"],s:"_0&&_1"}}]}]}],n:54,r:"~/_toast"}],n:50,r:"~/_toast"}],e:{"[_0.close()]":function(t){return[t.close()]},"_0!==false":function(t){return!1!==t},"!!_0":function(t){return!!t},"Array.isArray(_0)":function(t){return Array.isArray(t)},"[_0.action()]":function(t){return[t.action()]},'typeof _0==="function"':function(t){return"function"==typeof t},"_0!==false&&_1!==false":function(t,n){return!1!==t&&!1!==n},'[_0.toggle("_toast.showMore"),false]':function(t){return[t.toggle("_toast.showMore"),!1]},"(_0!==false&&_1!==false)||_2||_3":function(t,n,e,o){return!1!==t&&!1!==n||e||o},"[false,false]":function(){return[!1,!1]},"_0&&_1":function(t,n){return t&&n}}};return function(o){var i=o.Ractive,r=o.instance,c=o.proto;r.partials[t.name||"toast"]=e;var l,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n){l!==n?(d.splice(d.indexOf(t),1),"function"==typeof n.onclose&&n.onclose()):(u.tm&&(clearTimeout(u.tm),u.tm=null),l.instance.set("_toast",null).then(function(){u.active=l=null,"function"==typeof n.onclose&&n.onclose(),d.length&&w()}))}function w(){u.active=l=d.shift(),l.instance.set("_toast",l).then(function(){l.timeout&&(u.tm=setTimeout(function(){l.close()},l.timeout))})}if(Object.defineProperty(c,"toastDefaults",{value:f,writable:!1,configurable:!0}),c.toast=function(t,n){var e=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return e.close=function(){return h(e)},d.push(e),l||w(),new a(u,e)},c.on=c.on||{},r.transitions.toast=function(t,n){var e=t.processParams({duration:200},n),o=t.getStyle("opacity");return t.isIntro?(t.setStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(l.bottom?"":"-")+"1em)"},e))},r.transitions["toast-expand"]=function(t,n){var e=t.processParams({duration:200,nested:!1},n);if(t.isIntro){var o=t.getStyle("height"),i=t.getStyle("width");return t.setStyle("height",0),t.setStyle("width",0),t.animateStyle("width",i,e).then(function(){return t.animateStyle("height",o,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})}var r=t.getStyle("height");return t.setStyle("height",r),t.setStyle("width",t.getStyle("width")),t.animateStyle("height",0,e).then(function(){return t.animateStyle("width",0,e)}).then(function(){t.setStyle("height",""),t.setStyle("width","")})},c.on["close-toast"]=function(){l&&l.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var p=r.css;r.css=function(t){var e="";return"string"==typeof p?e+=p:"function"==typeof p&&(e+=p(t)),n(t)+e}}return c}}(),(void 0===u&&(u={}),function(t){t.instance.transitions[u.name||"expand"]=r})],cssId:"window-host",noIntro:!0,observe:{"@style.raui.window.maxFrom":function(){var t;(t=this)._media?t._media.fn():(t._media={},t._media.fn=function(){if(t.host){var n=t.sizeInPx(t.get("@style.raui.window.maxFrom")),e=t.transitionsEnabled;t.transitionsEnabled=!1,t.set("max",t.host.clientWidth<=n),t.set("dimensions",{clientWidth:t.host.clientWidth,clientHeight:t.host.clientHeight}),t.transitionsEnabled=e}},t._media.handle=t.root.on("*.resize",t._media.fn),setTimeout(t._media.fn))},topLevel:function(t){t?this.link("windows."+f(t),"current"):this.unlink("current")},currentMax:{handler:function(t){(this.children.byName.window||[]).forEach(function(t){return t.instance.fire("resize")})},defer:!0}},computed:{currentMax:function(){var t=this.get("topLevel"),n=this.get("windows."+f(t)+".max");return this.get("userMax")||this.get("max")||n}},on:{config:function(){var t,n=this,e=this.partials.content;if(e&&Array.isArray(e))for(var o=(e=this.partials.content=e.slice()).length;o--;){var i=e[o];"max-top"===i.e&&(e.splice(o,1),n.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&n.set({_maxAttrsP:{t:i.m}}))}"undefined"!=typeof window&&(this._resizeListener=function(){t||(t=setTimeout(function(){t=null,n.fire("resize")},300))},window.addEventListener("resize",this._resizeListener))},teardown:function(){this._resizeListener&&window.removeEventListener("resize",this._resizeListener)}}}),e.transitions.modal=function(t,n){var e,o=t.processParams(n,{duration:400,easing:"easeOut",x:0,y:-50,event:!0}),i=t.node.offsetLeft,r=t.node.offsetTop,s=t.node.parentNode.style?t.node.parentNode.style.overflow:"hidden";if(t.node._modalSrc){var a=t.node._modalSrc||{x:i+o.x,y:r+o.y},c={x:a.x-Math.round(t.node.clientWidth/2)-i,y:a.y-Math.round(t.node.clientHeight/2)-r};t.node.parentNode.style&&(t.node.parentNode.style.overflow="hidden"),t.isIntro?(t.node._modalSrc=a,e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+c.x+"px, "+c.y+"px) scale(0.5, 0.5)",opacity:0}}else t.isIntro?(e={transform:"translate(0, 0) scale(1, 1)",opacity:1},t.setStyle({transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+o.x+"px, "+o.y+"px) scale(0.5, 0.5)",opacity:0};t.animateStyle(e,o).then(function(){t.node.parentNode.style&&(t.node.parentNode.style.overflow=s),t.complete()})};var g=["mousemove","mouseup","touchmove","touchend"],m=function(t){function n(n){t.call(this,n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={resizable:{configurable:!0},title:{configurable:!0},visible:{configurable:!0},pad:{configurable:!0},buttons:{configurable:!0},blocked:{configurable:!0},result:{configurable:!0}};return e.resizable.get=function(){return this.get("control.resizable")},e.resizable.set=function(t){return this.set("control.resizable",t)},e.title.get=function(){return this.get("control.title")},e.title.set=function(t){return this.set("control.title",t)},e.visible.get=function(){return this.get("control.show")},e.visible.set=function(t){t?this.show():this.set("control.show",t,{keep:!0}),this.host.raise(this,{show:t})},e.pad.get=function(){return this.get("pad")},e.pad.set=function(t){this.set("pad",t)},e.buttons.get=function(){return this.get("buttons")},e.buttons.set=function(t){return this.set("buttons",t)},e.blocked.get=function(){return this.get("control.blocked")},e.blocked.set=function(t){return this.set("control.blocked",t)},e.result.get=function(){var t=this;return this._result||(this._result={},this._result.promise=new Promise(function(n){t._result.ok=n})),this._result.promise},n.prototype.setResult=function(t){this.result,this._result.value=t},n.prototype.close=function(t,n){if(!0!==t){if(!this.parent)return!1;if(this.get("control.blockers.length"))return!1;if("function"==typeof this.beforeClose&&!1===this.beforeClose())return!1;if(!1===this.fire("beforeClose"))return!1}return this.fire("close"),this._result&&this._result.ok(this._result.value||n),!0},n.prototype.maximize=function(){this.toggle("root.userMax")},n.prototype.hide=function(){this.visible=!1},n.prototype.raise=function(t){this.host.raise(this,{show:t})},n.prototype.show=function(){this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this)},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(e.visible){var i=e.wrapper;if(i){if("auto"===t){e.set("control.autosize",!0);var r=e.host.sizeInEm(i.clientWidth+16),s=e.host.sizeInEm(i.clientHeight);e.set({"control.width":r,"control.height":s,"control.naturalWidth":r,"control.naturalHeight":s,"control.autosize":!1})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var l=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=c,e.set({"control.width":e.host.sizeInEm(l),"control.height":e.host.sizeInEm(f),"control.naturalWidth":e.host.sizeInEm(l),"control.naturalHeight":e.host.sizeInEm(f),"control.autosize":!1})}e.fire("resize"),o()}}else"number"==typeof t&&"number"==typeof n&&e.set({"control.width":e.host.sizeInEm(t),"control.height":e.host.sizeInEm(n),"control.naturalWidth":e.host.sizeInEm(t),"control.naturalHeight":e.host.sizeInEm(n),"control.autosize":!1})})})},n.prototype.move=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){"center"===t?t=e.host.modalPane.clientHeight/2-e.wrapper.clientHeight/2:"string"==typeof t&&(t=e.host.sizeInEm(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=e.host.sizeInEm(n));var i={};"number"==typeof t&&(i["control.top"]=t),"number"==typeof n&&(i["control.left"]=n),e.set(i),o()})})},n.prototype._startMove=function(t){var n=this;if("mousedown"!==t.type||0===t.button){if(this.get("control.topmost")||this.raise(),~t.type.indexOf("mouse")){if(!t.ctrlKey&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return}else if(t.targetTouches&&1===t.targetTouches.length&&t.target!==this.content&&t.target!==this.top&&!this.top.contains(t.target))return;var e=this.pane,o=e.style.cursor;e.style.cursor="move",e.style.userSelect="none";var i=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,r=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,s=this.get("control.left")||0,a=this.get("control.top")||0,c=e.clientWidth,l=e.clientHeight,f=function(t){var d=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,u=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,h=s+(d-i),w=a+(u-r);h<(c<30?0:30-c)&&(h=c<30?0:30-c),w<(l<30?0:30-l)&&(w=l<30?0:30-l),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect=""):t.preventDefault()};return g.forEach(function(t){return document.addEventListener(t,f,{passive:!1})}),0!==t.type.indexOf("mouse")&&void 0}},n.prototype._startResize=function(t){var n=this;if(t.target===this.wrapper&&("mousedown"!==t.type||0===t.button)){this.get("control.autosize")&&this.size("auto"),this.get("control.topmost")||this.raise(),this.set("control.resizing",!0);var e,o=this.wrapper,i=t.offsetX||t.targetTouches&&t.targetTouches[0].pageX-o.getBoundingClientRect().left,r=t.offsetY||t.targetTouches&&t.targetTouches[0].pageY-o.getBoundingClientRect().top,s=this.get("@style.window.handleSize")||7,a=o.clientWidth-2*s,c=o.clientHeight-2*s,l=2*s,f=i<=l||i>=a,d=r<=l||r>=c,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,h=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,w=this.get("control.left")||0,p=this.get("control.top")||0,m=this.host.sizeInPx(this.get("control.width")+"em"),b=this.host.sizeInPx(this.get("control.height")+"em"),x=this.host.sizeInPx(this.get("control.naturalHeight")+"em"),y=this.host.sizeInPx(this.get("control.naturalWidth")+"em"),v=function(t){t.preventDefault();var o=t.x||t.clientX||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientX||t.changedTouches&&t.changedTouches[0].clientX||0,a=t.y||t.clientY||t.targetTouches&&t.targetTouches[0]&&t.targetTouches[0].clientY||t.changedTouches&&t.changedTouches[0].clientY||0,c=f?o-u:0,l=d?a-h:0,_={};r<=s?(_["control.top"]=p+l,_["control.height"]=b-l):_["control.height"]=b+l,i<=s?(_["control.left"]=w+c,_["control.width"]=m-c):_["control.width"]=m+c,_["control.width"]<y&&(delete _["control.width"],delete _["control.left"]),_["control.height"]<x&&(delete _["control.height"],delete _["control.top"]),_["control.left"]<0&&(_["control.left"]=0),_["control.top"]<0&&(_["control.top"]=0),_["control.width"]&&(_["control.width"]=n.host.sizeInEm(_["control.width"])),_["control.height"]&&(_["control.height"]=n.host.sizeInEm(_["control.height"])),n.set(_),"touchend"===t.type||"mouseup"===t.type?(g.forEach(function(t){return document.removeEventListener(t,v,{passive:!1})}),n.set("control.resizing",!1),m===n.get("control.width")&&b===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return g.forEach(function(t){return document.addEventListener(t,v,{passive:!1})}),!1}},n.prototype._sizeHandle=function(t){if(t.target===this.wrapper){var n=this.wrapper;if("mouseout"===t.type)return n.style.cursor="auto";var e=t.offsetX,o=t.offsetY,i=this.get("@style.window.handleSize")||7,r=n.clientWidth-i,s=n.clientHeight-i,a=n.style;a.cursor=e<=i+i&&o<=i+i||e>=r-i&&o>=s-i?"nwse-resize":e>=r-i&&o<=i+i||e<=i+i&&o>=s-i?"nesw-resize":(e<=i||e>=r)&&(o<s||o>i)?"ew-resize":(o<=i||o>=s)&&(e<r||e>i)?"ns-resize":"auto"}},Object.defineProperties(n.prototype,e),n}(d),b=["left","right","center","condition"];function x(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=w}}d.extendWith(m,{template:{v:4,t:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-wrapper",g:1},{n:"tracked",t:71,f:{r:[],s:'["wrapper"]'}},{t:4,f:[" ",{t:4,f:[{n:"window",t:72,v:"t2"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"style-top",f:"0",t:13},{n:"style-left",f:"0",t:13},{n:"style-width",f:"100%",t:13},{n:"style-height",f:"100%",t:13}],n:51,x:{r:["~/control.autosize","~/control.dialog"],s:"_0||_1"}},{n:"class-rwindow-max",t:13}],n:50,x:{r:["~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"(_0||_1||_2)&&!_3"}},{t:4,f:[{t:4,f:[{n:"modal",t:72,v:"t0"}],n:50,x:{r:["~/root.transition"],s:"_0!==false"}}," ",{t:4,f:[{n:"class-rwindow-resizable",t:13},{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startResize(_1)]"}},{n:["mousemove","mouseout"],t:70,f:{r:["@this","@event"],s:"[_0._sizeHandle(_1)]"}}],n:50,r:"~/control.resizable"}," ",{t:4,f:[{n:"class-rwindow-resizing",t:13}],n:50,r:"~/control.resizing"},{n:"style-top",f:[{t:2,r:"~/control.top"},"px"],t:13},{n:"style-left",f:[{t:2,r:"~/control.left"},"px"],t:13},{t:4,f:[{n:"style-width",f:[{t:2,r:"~/control.width"},"em"],t:13},{n:"style-height",f:[{t:2,r:"~/control.height"},"em"],t:13}],n:51,r:"~/control.autosize"}],n:51,l:1},{n:"style-z-index",f:[{t:2,r:"~/control.index"}],t:13},{n:"class-rwindow-topmost",t:13,f:[{t:2,r:"~/control.topmost"}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow",g:1},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this","@event"],s:"[_0._startMove(_1)]"}}],n:50,x:{r:["~/control.movable","~/root.max","~/root.userMax","~/control.max","~/control.dialog"],s:"!(_0===false||_1||_2||_3)&&!_4"}},{t:4,f:[{n:["mousedown","touchstart"],t:70,f:{r:["@this"],s:"[_0.raise()]"}}],n:50,x:{r:["~/control.topmost"],s:"!_0"},l:1}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-modal",g:1},{n:"class-rwindow-blocked",t:13,f:[{t:2,x:{r:["~/control.blockers.length","~/control.blocked"],s:"_0||_1"}}]}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane",g:1},{n:"tracked",t:71,f:{r:[],s:'["pane"]'}},{t:4,f:[{n:"class-rwindow-autosizing",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]},cssId:"window",partials:{pane:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-top",g:1},{n:"tracked",t:71,f:{r:[],s:'["top"]'}}],f:[{t:8,r:"title"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-controls",g:1}],f:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-minimize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.hide()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.minimize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-maximize",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.maximize()]"}}]}],n:50,x:{r:["~/control.dialog","~/control.maximize"],s:"!_0&&_1"}}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-close",g:1},{n:["click"],t:70,f:{r:["@this"],s:"[_0.close()]"}}]}],n:50,r:"~/control.close"}]}]}],n:51,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog"],s:"(_0||_1||_2)&&_3&&!_4"}}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-content",g:1},{n:"tracked",t:71,f:{r:[],s:'["content"]'}},{n:"class-rwindow-pad",t:13,f:[{t:2,r:"~/control.pad"}]},{n:"class-rwindow-flex",t:13,f:[{t:2,r:"~/control.flex"}]},{t:4,f:[{n:"style-overflow",f:"visible",t:13}],n:50,r:"~/control.autosize"}],f:[{t:8,r:"contents"}]}," ",{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-buttons",g:1},{n:"class-no-buttons",t:13,f:[{t:2,x:{r:["~/visibleButtons"],s:"!_0"}}]}],f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-left-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/leftButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-center-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/centerButtons"}]}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-right-buttons",g:1}],f:[{t:4,f:[{t:4,f:[{t:8,r:".partial"}],n:50,r:".partial"},{t:4,f:[{t:7,e:"button",m:[{n:"button",t:71},{n:["click"],t:70,f:{r:[".action","@"],s:"[_0.call(_1)]"}},{t:4,f:[{n:"class",f:[{t:2,r:".class"}],t:13}],n:50,r:".class"}],f:[{t:2,r:".label"}]}],n:51,l:1}],n:52,r:"~/rightButtons"}]}]}],n:50,r:"~/buttons"}," ",{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-pane-bottom",g:1}],f:[{t:8,r:"status"}]}],title:[{t:4,f:[{t:7,e:"div",m:[{t:13,n:"class",f:"rwindow-title",g:1}],f:[{t:3,r:"~/control.title"}]}],n:50,r:"~/control.title"}],contents:"",status:""},data:function(){return{buttons:[],visibleButtons:0}},computed:{leftButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"left"===t.where})},centerButtons:function(){return(this.get("buttons")||[]).filter(function(t){return"center"===t.where})},rightButtons:function(){return(this.get("buttons")||[]).filter(function(t){return!t.where||"right"===t.where})}},decorators:{button:function(t){var n=this.getContext(t);return n.add("visibleButtons"),{update:function(){},teardown:function(){n.subtract("visibleButtons")}}}},on:{config:function(){var t=m.prototype.template,n=this.template;"string"!=typeof t&&!Array.isArray(t)&&t.t&&(t=t.t),"string"!=typeof n&&!Array.isArray(n)&&n.t&&(n=n.t),t!==n&&(this.partials.hasOwnProperty("contents")||(this.partials.contents=n),this.template=t)},construct:function(){var t=this.constructor;if(!t._constructed){t._constructed=1;var n=t.prototype.template.t.slice(),e=n.find(function(t){return"buttons"===t.e});function o(t){var n=t.m||[],e={partial:{t:[{t:t.t,e:t.e,f:t.f,m:n.filter(function(t){return!~b.indexOf(t.n)})}]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"};return e.partial.t[0].m.push({t:71,n:"button"}),e}t.prototype.template.t=n.filter(function(t){return"buttons"!==t.e}),e&&(t._btns=e.f.filter(function(t){return"button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e})}).map(function(t){return 4===t.t?t.f.filter(function(t){return"button"===t.e}).map(function(n){var e=o(n),i={t:t.t,n:t.n,f:[e.partial.t[0]]};return t.r&&(i.r=t.r),t.rx&&(i.rx=t.rx),t.x&&(i.x=t.x),e.partial={t:[i]},e}):[o(t)]}).reduce(function(t,n){return t.concat(n)},[]))}},init:function(){var t=this.constructor;t._btns&&!this.get("buttons.length")&&this.set("buttons",t._btns)}},observe:{"control.max root.max root.userMax control.width control.height root.dimensions.clientHeight root.dimensions.clientWidth":{handler:function(t,n,e){if(this.get("control.id")){var o=this.get("control.max")||this.get("root.userMax")||this.get("root.max"),i=this.get("control.actual")||{};if(o)if(i.max)~e.indexOf("client")&&"number"==typeof t&&(~e.indexOf("Width")?this.set("control.actual.width",this.host.sizeInEm(t)):~e.indexOf("Height")&&this.set("control.actual.height",this.host.sizeInEm(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:this.host.sizeInEm(this.wrapper.clientWidth),height:this.host.sizeInEm(this.wrapper.clientHeight),max:o})}else"number"==typeof t&&(~e.indexOf("width")?this.set("control.actual.width",t):~e.indexOf("height")&&this.set("control.actual.height",t)),i.max&&this.set("control.actual",{width:this.get("control.width"),height:this.get("control.width"),max:o}),this.set("control.actual.max",!1)}},init:!1,defer:!0}}}),i("RMWindowHost","components",w),i("RMWindow","components",m),w.prototype.Window=m,t.Base=d,t.Host=w,t.Window=m,t.plugin=x,t.default=x,Object.defineProperty(t,"__esModule",{value:!0})});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display