Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@evs-chris/raui

Package Overview
Dependencies
Maintainers
1
Versions
173
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 0.13.1 to 0.13.2

2

es/Window.min.js

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

import Ractive from"ractive";import expand from"./transition-expand";import toast from"./Toast";import globalRegister from"./globalRegister";import{sizeInEm,sizeInPx}from"./watch-size";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 background-color: "+(primary.host.bg||primary.bg||"#fff")+";\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 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 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 width: 100%;\n height: 100%;\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-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\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: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\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 min-height: 2em;\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}})}},slide:function slide(t,params){var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";var done=function(){t.complete();if(parent.style){setTimeout(function(){return parent.style.overflow=overflow})}};if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){if(p.from==="top"){t.setStyle({transform:"translateY(-100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(-100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}}else{if(p.from==="top"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(-100%)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(100%)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(-100%)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(100%)"},p).then(done)}}}}});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."+escape(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 windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this.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,minWidth:"5em",minHeight:"5em"},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}}window.minSize(options.minWidth||"5em",options.minHeight||"5em");if(options.slide){}else 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.slide){}else 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});this.fire("add",{},{window:window,options:options});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",{virtual:false});var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=(wnds.length+1)*2;var last=this.get("topLevel");var wasBlocked=this.get("blocked");var id=wnd?wnd.get("control.id"):wnds.reduce(function(a,c){return!a?c:c.index>a.index?c:a},null);if(!wnd&&id){wnd=this.children.byName.window.find(function(a){return a.instance.id===id})}function blocks(ctrl){if(ctrl.blockers){ctrl.blockers.forEach(function(b,i){var w=wnds.find(function(w){return w.id===b});if(!w){return}w.index=ctrl.index+i+1;blocks(w)})}}function liftBlocked(control,pos){if(!control){return}control.index=pos--;if(control.blocking){liftBlocked(wnds.find(function(w){return w.id===control.blocking}),pos)}blocks(control)}if(wnd){var ctrl=wnd.get("control");ctrl.index=opts.show===false?-1:top;blocks(ctrl);if(ctrl.blocking){liftBlocked(wnds.find(function(w){return w.id===ctrl.blocking}),top-1)}if(opts.show!==false&&!ctrl.show){wnd.show()}}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)});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"]=w.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&&!wnd.get("control.slide")&&(!leaving||!leaving.dialog&&!leaving.slide&&(!leaving.blocking||leaving.blocking&&leaving.blocking!==top))){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}this.fire("raise",{},{top:this.topmost});if(last!==this.get("topLevel")){var wnd$1=this.current;wnd$1&&wnd$1.fire("raise",{},{last:this.getWindow(last)})}};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&&!local.dialog){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 lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.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:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/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()})})};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=sizeInPx(node.width);var localHeight=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(sizeInPx(win.height)/cell);w=Math.ceil(sizeInPx(win.width)/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(sizeInPx(node.width)/cell);h=Math.ceil(sizeInPx(node.height)/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"]'}},{t:16,r:"extra-attributes"}],f:[{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:"moving",f:[{t:2,r:"~/moving"}],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"]},"{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&&_1":function(_0,_1){return!_0&&_1},"[_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.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(_0,_1,_2,_3,_4,_5,_6){return!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6},'["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&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&!_3&&!_4},"[{from:_0}]":function(_0){return[{from:_0}]},"[_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)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(_0,_1,_2,_3,_4,_5){return!(_4===false||(_0||_1)&&!_3||_2)&&(!_3||_4===true)&&!_5},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(_0,_1){return _0&&!_1}},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,x:{r:["window.dialog","window.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:["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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,attributes:["placement","windows","transition"],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.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this.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=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{if(this.get("control.show")){try{this.fire("hide")}catch(e){}}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(){var shown=this.get("control.show");this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}if(!shown){try{this.fire("show")}catch(e){}}};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":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":sizeInEm(h),"control.autosize":false})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){this$1.set("control.autosize",true);var nw=Math.ceil(sizeInEm(el.clientWidth+16));var nh=Math.ceil(sizeInEm(el.clientHeight+8));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":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":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":sizeInEm(nw$1),"control.height":sizeInEm(nh$1),"control.naturalWidth":sizeInEm(nw$1),"control.naturalHeight":sizeInEm(nh$1),"control.autosize":false})}var hel=this$1.host.host;if(hel){var maxw=sizeInEm(hel.clientWidth-16);var maxh=sizeInEm(hel.clientHeight-16);if(this$1.get("control.width")>maxw){this$1.set("control.width",maxw)}if(this$1.get("control.height")>maxh){this$1.set("control.height",maxh)}}var minw=this$1.get("control.minWidth")||5;var minh=this$1.get("control.minHeight")||5;if(this$1.get("control.width")<minw){this$1.set("control.width",minw)}if(this$1.get("control.height")<minh){this$1.set("control.height",minh)}this$1.fire("resize");ok()})})};Window.prototype.minSize=function minSize(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.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){var auto=this$1.get("control.autosize");this$1.set("control.autosize",true);var nw=sizeInEm(el.clientWidth+16);var nh=sizeInEm(el.clientHeight);this$1.set({"control.minWidth":nw,"control.minHeight":nh,"control.autosize":auto})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}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.minWidth":sizeInEm(nw$1),"control.minHeight":sizeInEm(nh$1)})}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=sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=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(!this.top||!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}}this.set("moving",true);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="";this$1.set("moving",false)}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);this.set("moving",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=sizeInPx(this.get("control.width"));var oh=sizeInPx(this.get("control.height"));var nh=sizeInPx(this.get("control.minHeight"));var nw=sizeInPx(this.get("control.minWidth"));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"]=sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=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);this$1.set("moving",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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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.e==="not-button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"||e.e==="not-button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"||e.e==="not-button"}).map(function(bb){var attrs=bb.m||[];var b=bb.e==="button"?mapButton(bb):{partial:{t:bb.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};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 if(n.e==="not-button"){var attrs=n.m||[];return[{partial:{t:n.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"}]}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:sizeInEm(this.wrapper.clientWidth),height:sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",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("RauiWindowHost","components",Host);globalRegister("RauiWindow","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";import{sizeInEm,sizeInPx}from"./watch-size";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 background-color: "+(primary.host.bg||primary.bg||"#fff")+";\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 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 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 width: 100%;\n height: 100%;\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-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\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: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\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 min-height: 2em;\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}})}},slide:function slide(t,params){var p=t.processParams(params,{duration:400,easing:"easeInOut"});var parent=t.node.parentNode;var overflow=parent.style?parent.style.overflow:"";var done=function(){t.complete();if(parent.style){setTimeout(function(){return parent.style.overflow=overflow})}};if(parent.style){parent.style.overflow="hidden"}if(t.isIntro||p.intro){if(p.from==="top"){t.setStyle({transform:"translateY(-100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(100%)"});t.animateStyle({transform:"translateY(0)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(-100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(100%)"});t.animateStyle({transform:"translateX(0)"},p).then(done)}}else{if(p.from==="top"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(-100%)"},p).then(done)}else if(p.from==="bottom"){t.setStyle({transform:"translateY(0)"});t.animateStyle({transform:"translateY(100%)"},p).then(done)}else if(p.from==="left"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(-100%)"},p).then(done)}else if(p.from==="right"){t.setStyle({transform:"translateX(0)"});t.animateStyle({transform:"translateX(100%)"},p).then(done)}}}}});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."+escape(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 windows=this.get("windows");for(var k in windows){if(windows[k].topmost){return this.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,minWidth:"5em",minHeight:"5em"},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}}window.minSize(options.minWidth||"5em",options.minHeight||"5em");if(options.slide){}else 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.slide){}else 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});this.fire("add",{},{window:window,options:options});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",{virtual:false});var host=this;var wnds=Object.keys(object).map(function(k){return object[k]});var top=(wnds.length+1)*2;var last=this.get("topLevel");var wasBlocked=this.get("blocked");var id=wnd?wnd.get("control.id"):wnds.reduce(function(a,c){return!a?c:c.index>a.index?c:a},null);if(!wnd&&id){wnd=this.children.byName.window.find(function(a){return a.instance.id===id})}function blocks(ctrl){if(ctrl.blockers){ctrl.blockers.forEach(function(b,i){var w=wnds.find(function(w){return w.id===b});if(!w){return}w.index=ctrl.index+i+1;blocks(w)})}}function liftBlocked(control,pos){if(!control){return}control.index=pos--;if(control.blocking){liftBlocked(wnds.find(function(w){return w.id===control.blocking}),pos)}blocks(control)}if(wnd){var ctrl=wnd.get("control");ctrl.index=opts.show===false?-1:top;blocks(ctrl);if(ctrl.blocking){liftBlocked(wnds.find(function(w){return w.id===ctrl.blocking}),top-1)}if(opts.show!==false&&!ctrl.show){wnd.show()}}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)});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"]=w.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&&!wnd.get("control.slide")&&(!leaving||!leaving.dialog&&!leaving.slide&&(!leaving.blocking||leaving.blocking&&leaving.blocking!==top))){wnd.transition(transition||"window",wnd.find("div"),{intro:true})}}this.fire("raise",{},{top:this.topmost});if(last!==this.get("topLevel")){var wnd$1=this.current;wnd$1&&wnd$1.fire("raise",{},{last:this.getWindow(last)})}};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&&!local.dialog){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 lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.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:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/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.placeAll=function placeAll(){var this$1=this;if(!(this.fragment&&this.fragment.rendered)){return}var winids=Object.keys(this.get("windows")||{}).filter(function(k){return this$1.get("windows."+Ractive.escapeKey(k)+".show")});var host=this.find(".rwhost");return new Promise(function(ok){requestAnimationFrame(function(){var maxw=host.clientWidth;var maxh=host.clientHeight;var winid;while(winid=winids[0]){var wnd=this$1.getWindow(winid);var local=wnd.get("control");if(local.width===undefined&&!local.dialog){wnd.size("auto")}var left=0;var top=0;var lw=local.width;var lh=local.height;if(local.dialog&&(!local.size||local.size==="auto"||!local.width||!local.height)){lw=sizeInEm(wnd.pane.clientWidth);lh=sizeInEm(wnd.pane.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:sizeInPx(blocked.width+"em");var bh=bmax?this$1.host.clientHeight:sizeInPx(blocked.height+"em");var bl=bmax?0:blocked.left;var bt=bmax?0:blocked.top;left=(max?maxw:bw/2)+(max?0:bl)-sizeInPx(lw)/2;top=(max?maxh:bh/2)+(max?0:bt)-sizeInPx(lh)/2}else{var place=this$1.get("placement");var pos=void 0;if(typeof place==="function"){try{pos=place(this$1,host,local,winids)}catch(e){pos=placeGrid(this$1,host,local,winids)}}else if(typeof place==="string"){switch(place){case"smart":pos=placeSmart(this$1,host,local,winids);break;default:pos=placeGrid(this$1,host,local,winids);break}}else{pos=placeGrid(this$1,host,local,winids)}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});winids.shift()}ok()})})};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=sizeInPx(node.width);var localHeight=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,ignore){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){if(ignore&&~ignore.indexOf(k)){continue}wins++;win=windows[k];t=Math.floor(win.top/cell);l=Math.floor(win.left/cell);h=Math.ceil(sizeInPx(win.height)/cell);w=Math.ceil(sizeInPx(win.width)/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(sizeInPx(node.width)/cell);h=Math.ceil(sizeInPx(node.height)/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"]'}},{t:16,r:"extra-attributes"}],f:[{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:"moving",f:[{t:2,r:"~/moving"}],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"]},"{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&&_1":function(_0,_1){return!_0&&_1},"[_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.maximize()]":function(_0){return[_0.maximize()]},"[_0.close()]":function(_0){return[_0.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(_0,_1,_2,_3,_4,_5,_6){return!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6},'["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&&!_4":function(_0,_1,_2,_3,_4){return(_0||_1||_2)&&!_3&&!_4},"[{from:_0}]":function(_0){return[{from:_0}]},"[_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)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(_0,_1,_2,_3,_4,_5){return!(_4===false||(_0||_1)&&!_3||_2)&&(!_3||_4===true)&&!_5},"[_0.raise()]":function(_0){return[_0.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(_0,_1){return _0&&!_1}},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,x:{r:["window.dialog","window.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:["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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],f:[{t:8,r:"pane"}]}]}]}],n:50,r:"~/control.show"}]}},use:[toast(),expand()],cssId:"window-host",noIntro:true,attributes:["placement","windows","transition"],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.set({_maxP:{t:e.f},hideTitleMax:true});if(e.m){this.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=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{if(this.get("control.show")){try{this.fire("hide")}catch(e){}}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(){var shown=this.get("control.show");this.set("control.show",true);if(this.get("control.top")===undefined){this.host.place(this)}if(!shown){try{this.fire("show")}catch(e){}}};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":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":sizeInEm(h),"control.autosize":false})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){this$1.set("control.autosize",true);var nw=Math.ceil(sizeInEm(el.clientWidth+16));var nh=Math.ceil(sizeInEm(el.clientHeight+8));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":sizeInEm(w),"control.height":sizeInEm(h),"control.naturalWidth":sizeInEm(w),"control.naturalHeight":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":sizeInEm(nw$1),"control.height":sizeInEm(nh$1),"control.naturalWidth":sizeInEm(nw$1),"control.naturalHeight":sizeInEm(nh$1),"control.autosize":false})}var hel=this$1.host.host;if(hel){var maxw=sizeInEm(hel.clientWidth-16);var maxh=sizeInEm(hel.clientHeight-16);if(this$1.get("control.width")>maxw){this$1.set("control.width",maxw)}if(this$1.get("control.height")>maxh){this$1.set("control.height",maxh)}}var minw=this$1.get("control.minWidth")||5;var minh=this$1.get("control.minHeight")||5;if(this$1.get("control.width")<minw){this$1.set("control.width",minw)}if(this$1.get("control.height")<minh){this$1.set("control.height",minh)}this$1.fire("resize");ok()})})};Window.prototype.minSize=function minSize(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.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}return ok()}var el=this$1.wrapper;if(!el){return ok()}if(w==="auto"){var auto=this$1.get("control.autosize");this$1.set("control.autosize",true);var nw=sizeInEm(el.clientWidth+16);var nh=sizeInEm(el.clientHeight);this$1.set({"control.minWidth":nw,"control.minHeight":nh,"control.autosize":auto})}else if(typeof w==="number"&&typeof h==="number"){this$1.set({"control.minWidth":sizeInEm(w),"control.minHeight":sizeInEm(h)})}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.minWidth":sizeInEm(nw$1),"control.minHeight":sizeInEm(nh$1)})}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=sizeInEm(top)}if(left==="center"){left=this$1.host.modalPane.clientWidth/2-this$1.wrapper.clientWidth/2}if(typeof left==="string"){left=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(!this.top||!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}}this.set("moving",true);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="";this$1.set("moving",false)}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);this.set("moving",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=sizeInPx(this.get("control.width"));var oh=sizeInPx(this.get("control.height"));var nh=sizeInPx(this.get("control.minHeight"));var nw=sizeInPx(this.get("control.minWidth"));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"]=sizeInEm(set["control.width"])}if(set["control.height"]){set["control.height"]=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);this$1.set("moving",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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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.e==="not-button"||e.t===4&&(e.n===50||e.n===51)&&e.f.find(function(e){return e.e==="button"||e.e==="not-button"})}).map(function(n){if(n.t===4){return n.f.filter(function(e){return e.e==="button"||e.e==="not-button"}).map(function(bb){var attrs=bb.m||[];var b=bb.e==="button"?mapButton(bb):{partial:{t:bb.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"};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 if(n.e==="not-button"){var attrs=n.m||[];return[{partial:{t:n.f||[]},where:attrs.find(function(a){return a.n==="left"})?"left":attrs.find(function(a){return a.n==="center"})?"center":"right"}]}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:sizeInEm(this.wrapper.clientWidth),height:sizeInEm(this.wrapper.clientHeight),max:max})}}else if(~k.indexOf("client")&&typeof v==="number"){if(~k.indexOf("Width")){this.set("control.actual.width",sizeInEm(v))}else if(~k.indexOf("Height")){this.set("control.actual.height",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("RauiWindowHost","components",Host);globalRegister("RauiWindow","components",Window);Host.prototype.Window=Window;export default plugin;
{
"name": "@evs-chris/raui",
"version": "0.13.1",
"version": "0.13.2",
"description": "Components, decorators, and helpers for Ractive apps that are generally Material-ish",

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

@@ -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.RauiWindow={},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},l={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.timeout=t,this.data===this.holder.active?(this.holder.tm&&clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close(),n.holder.tm=null},t):this.data.close()):t?this.data.timeout=t:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?(clearTimeout(this.holder.tm),this.holder.tm=null):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()},l.message.get=function(){return this.data.message},l.message.set=function(t){this.data.message=t,this.data===this.holder.active&&this.data.instance.update("_toast.message")},l.more.get=function(){return this.data.more},l.more.set=function(t){this.data.more=t,this.data===this.holder.active&&this.data.instance.update("_toast.more")},l.showMore.get=function(){return this.data.showMore},l.showMore.set=function(t){this.data.showMore=t,this.data===this.holder.active&&this.data.instance.update("_toast.showMore")},l.left.get=function(){return this.data.left},l.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")},l.right.get=function(){return this.data.right},l.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")},l.top.get=function(){return!this.data.bottom},l.top.set=function(t){this.data.bottom=!t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},l.bottom.get=function(){return this.data.bottom},l.bottom.set=function(t){this.data.bottom=t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},l.center.get=function(){return!this.data.left&&!this.data.right},l.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")},l.context.get=function(){return this.data.context},l.context.set=function(t){this.data.context=t,this.data===this.holder.active&&this.data.instance.update("_toast.context")},l.type.get=function(){return this.data.type},l.type.set=function(t){this.data.type=t,this.data===this.holder.active&&this.data.instance.update("_toast.type")},l.class.get=function(){return this.data.class},l.class.set=function(t){this.data.class=t,this.data===this.holder.active&&this.data.instance.update("_toast.class")},l.dismissable.get=function(){return this.data.dismissable},l.dismissable.set=function(t){this.data.dismissable=t,this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")},l.closeButton.get=function(){return this.data.closeButton},l.closeButton.set=function(t){this.data.closeButton=t,this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")},l.buttons.get=function(){return this.data.buttons},l.buttons.set=function(t){this.data.buttons=t,this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},l.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},l.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,l);var c,f=16;function d(t){f=t}function u(){var t,n,e;!c&&window&&"document"in window&&"function"==typeof document.createElement&&((c=document.createElement("div")).setAttribute("style","position: absolute; left: -2em; width: 1em; height: 1em;"),t=c,n=function(){return d(c.getBoundingClientRect().width)},(e=document.createElement("object")).setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),e.setAttribute("tabindex","-1"),e.type="text/html",e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",n),n()},/Trident/.test(navigator.userAgent)?(t.appendChild(e),e.data="about:blank"):(e.data="about:blank",t.appendChild(e)),window.addEventListener("resize",function(){u(),d(c.getBoundingClientRect().width)})),c&&!c.parent&&document.body.appendChild(c)}function h(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t/f}function w(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t*f}var g,m=e.escapeKey,p=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(p,{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 background-color: "+(n.host.bg||n.bg||"#fff")+";\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 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 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 width: 100%;\n height: 100%;\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-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\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: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\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 min-height: 2em;\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(g)return t.complete();g=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),g=!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(){g=!1,t.complete(),o.style&&(o.style.overflow=i)}))},slide:function(t,n){var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"",r=function(){t.complete(),o.style&&setTimeout(function(){return o.style.overflow=i})};o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?"top"===e.from?(t.setStyle({transform:"translateY(-100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(-100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"top"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(-100%)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(100%)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(-100%)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(100%)"},e).then(r))}}});var b,y=0,x=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."+m(t)+".id"))},e.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+m(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 z))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+y++),this.get("windows."+m(t.id))||this.set("windows."+m(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0,minWidth:"5em",minHeight:"5em"},o,{id:t.id})),t.host=this;var i,r=this.attachChild(t,{target:"window"});if(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+m(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),t.minSize(o.minWidth||"5em",o.minHeight||"5em"),o.slide);else if("fill"===o.size&&(i||o.block)){var s;!0===o.block?s=this.find(".rwhost-pane"):(s=this.getWindow(i))&&(s=s.find(".rwindow")),s&&(t.size(s.clientWidth-(o.fillPad||20),s.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))}else o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.slide||(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."+m(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+m(t.id)+".block",!1),e.set("windows."+m(t.id)+".index",-1),e.raise(),e.set("windows."+m(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+m(t.id)+".id",{force:!0}),this.fire("add",{},{window:t,options:o}),r.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."+m(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+m(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof z?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows",{virtual:!1}),r=Object.keys(i).map(function(t){return i[t]}),s=2*(r.length+1),a=this.get("topLevel"),l=(this.get("blocked"),o?o.get("control.id"):r.reduce(function(t,n){return t?n.index>t.index?n:t:n},null));function c(t){t.blockers&&t.blockers.forEach(function(n,e){var o=r.find(function(t){return t.id===n});o&&(o.index=t.index+e+1,c(o))})}if(!o&&l&&(o=this.children.byName.window.find(function(t){return t.instance.id===l})),o){var f=o.get("control");f.index=!1===n.show?-1:s,c(f),f.blocking&&function t(n,e){n&&(n.index=e--,n.blocking&&t(r.find(function(t){return t.id===n.blocking}),e),c(n))}(r.find(function(t){return t.id===f.blocking}),s-1),!1===n.show||f.show||o.show()}r.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+m(t.id)+".index",(t.index||0)+s),c(t)});var d=r.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),u=d.filter(function(t){return t.show});s=d.indexOf(u[u.length-1]);var h={},w=null;if(d.forEach(function(t,n){var e=m(t.id);!0===t.block&&null===w&&(w=n),h["windows."+e+".index"]=t.index=null!==w?n+2:n,h["windows."+e+".topmost"]=n===s,h["windows."+e+".stack"]=d.length-n}),h.blocked=null!==w?w+1:0,~s&&d.length?h.topLevel=d[s].id:h.topLevel=null,this.set(h),(s=h.topLevel)&&s!==a&&this.get("currentMax")&&this.rendered){var g=this.get("windows."+m(a));o=this.getWindow(s);var p=this.get("transition");!1===p||o.get("control.slide")||g&&(g.dialog||g.slide||g.blocking&&(!g.blocking||g.blocking===s))||o.transition(p||"window",o.find("div"),{intro:!0})}if(this.fire("raise",{},{top:this.topmost}),a!==this.get("topLevel")){var b=this.current;b&&b.fire("raise",{},{last:this.getWindow(a)})}},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||o.dialog||t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,l=s.clientHeight,c=o.width,f=o.height;!o.dialog||o.size&&"auto"!==o.size&&o.width&&o.height||(c=h(t.pane.clientWidth),f=h(t.pane.clientHeight));var d=o.blocking;if(d){var u="windows."+m(d),g=n.get(u),p=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),b=g.max||n.get("userMax")||n.get("max"),y=b?n.host.clientWidth:w(g.width+"em"),x=b?n.host.clientHeight:w(g.height+"em"),_=b?0:g.left,z=b?0:g.top;i=(p?a:y/2)+(p?0:_)-w(c)/2,r=(p?l:x/2)+(p?0:z)-w(f)/2}else{var k,S=n.get("placement");if("function"==typeof S)try{k=S(n,s,o)}catch(t){k=v(n,s,o)}else if("string"==typeof S)switch(S){case"smart":k=function(t,n,e){var o,i,r=n.clientWidth-10,s=n.clientHeight-10,a=Math.floor(s/16),l=Math.floor(r/16),c=new Array(a*l),f=new Array(a*l);for(o=0;o<c.length;o++)c[o]=0;var d,u,h,g,m,p,b,y,x=0,v=t.get("windows");for(var _ in v)for(x++,d=v[_],u=Math.floor(d.top/16),h=Math.floor(d.left/16),m=Math.ceil(w(d.height)/16),g=Math.ceil(w(d.width)/16),o=u;o<u+m&&o<a;o++)for(i=h;i<h+g&&i<l;i++)c[o*l+i]++;for(g=Math.ceil(w(e.width)/16),m=Math.ceil(w(e.height)/16),o=0;o<a;o++)for(i=0;i<l;i++){if(o+m>a||i+g>l)p=x*g*m;else for(p=0,b=0;b<m;b++)for(y=0;y<g;y++)p+=c[(o+b)*l+i+y];if(0===p)return{top:16*o+5,left:16*i+5};f[o*l+i]=p}for(p=x*g*m,b=0,o=0;o<f.length;o++)f[o]<p&&(p=f[o],b=o);return{top:16*Math.floor(b/l)+5,left:b%l*16+5}}(n,s,o);break;default:k=v(n,s,o)}else k=v(n,s,o);r=k.top,i=k.left}(isNaN(i)||i<0)&&(i=10),(isNaN(r)||r<0)&&(r=10),t.set({"control.top":r,"control.left":i}),e()}})}):Promise.resolve()},Object.defineProperties(n.prototype,e),n}(p);function v(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,l=Math.floor(o/3),c=Math.floor(i/3),f=w(e.width),d=w(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=c+Math.floor((c-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=l+Math.floor((l-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}}p.extendWith(x,{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"]'}},{t:16,r:"extra-attributes"}],f:[{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:"moving",f:[{t:2,r:"~/moving"}],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"]},"{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&&_1":function(t,n){return!t&&n},"[_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.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(t,n,e,o,i,r,s){return!((t||n||e)&&o&&!i||r||s)},'["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&&!_4":function(t,n,e,o,i){return(t||n||e)&&!o&&!i},"[{from:_0}]":function(t){return[{from:t}]},"[_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)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(t,n,e,o,i,r){return!(!1===i||(t||n)&&!o||e||o&&!0!==i||r)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(t,n){return t&&!n}},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,x:{r:["window.dialog","window.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:["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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],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 max-height: 80%;\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: 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 flex-shrink: 1;\n display: flex;\n flex-direction: column;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-expand {\n margin-top: 1em;\n border-radius: 0.2em;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n overflow: auto;\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:[".","@context"],s:'[_0.expand(),(_1).toggle(".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.expand(),(_1).toggle(".showMore"),false]':function(t,n){return[t.expand(),n.toggle(".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,l=o.proto;r.partials[t.name||"toast"]=e;var c,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n,e){c!==n?(d.splice(d.indexOf(t),1),"function"==typeof n.onclose&&n.onclose()):(u.tm&&(clearTimeout(u.tm),u.tm=null),c.instance.set("_toast",null).then(function(){u.active=c=null,"function"==typeof n.onclose&&n.onclose(),d.length&&w()})),e&&e.fire("toasted",null,n)}function w(){u.active=c=d.shift(),c.instance.set("_toast",c).then(function(){c.timeout&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){c.close(),u.tm=null},c.timeout))})}if(Object.defineProperty(l,"toastDefaults",{value:f,writable:!1,configurable:!0}),l.toast=function(t,n){var e=this,o=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return o.close=function(){return h(o,e)},o.expand=function(){u.active===o&&(u.tm&&(clearTimeout(u.tm),u.tm=null),o.showMore&&o.timeout&&(u.tm=setTimeout(function(){o.close(),u.tm=null},o.timeout)))},d.push(o),c||w(),new a(u,o)},l.on=l.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("+(c.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(c.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","")})},l.on["close-toast"]=function(){c&&c.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var g=r.css;r.css=function(t){var e="";return"string"==typeof g?e+=g:"function"==typeof g&&(e+=g(t)),n(t)+e}}return l}}(),(void 0===b&&(b={}),function(t){t.instance.transitions[b.name||"expand"]=r})],cssId:"window-host",noIntro:!0,attributes:["placement","windows","transition"],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=w(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."+m(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."+m(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),this.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&this.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},l={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("+l.x+"px, "+l.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+l.x+"px, "+l.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 _=["mousemove","mouseup","touchmove","touchend"],z=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){if(t)this.show();else{if(this.get("control.show"))try{this.fire("hide")}catch(t){}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(){var t=this.get("control.show");if(this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this),!t)try{this.fire("show")}catch(t){}},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.width":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){e.set("control.autosize",!0);var r=Math.ceil(h(i.clientWidth+16)),s=Math.ceil(h(i.clientHeight+8));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":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,l=i.style.height;i.style.width=t,i.style.height=n;var c=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=l,e.set({"control.width":h(c),"control.height":h(f),"control.naturalWidth":h(c),"control.naturalHeight":h(f),"control.autosize":!1})}var d=e.host.host;if(d){var u=h(d.clientWidth-16),w=h(d.clientHeight-16);e.get("control.width")>u&&e.set("control.width",u),e.get("control.height")>w&&e.set("control.height",w)}var g=e.get("control.minWidth")||5,m=e.get("control.minHeight")||5;e.get("control.width")<g&&e.set("control.width",g),e.get("control.height")<m&&e.set("control.height",m),e.fire("resize"),o()})})},n.prototype.minSize=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.minWidth":h(t),"control.minHeight":h(n)}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){var r=e.get("control.autosize");e.set("control.autosize",!0);var s=h(i.clientWidth+16),a=h(i.clientHeight);e.set({"control.minWidth":s,"control.minHeight":a,"control.autosize":r})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.minWidth":h(t),"control.minHeight":h(n)});else if("string"==typeof t&&"string"==typeof n){var l=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var f=i.clientWidth,d=i.clientHeight;i.style.width=l,i.style.height=c,e.set({"control.minWidth":h(f),"control.minHeight":h(d)})}o()})})},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=h(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=h(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(!this.top||!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;this.set("moving",!0);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,l=e.clientWidth,c=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<(l<30?0:30-l)&&(h=l<30?0:30-l),w<(c<30?0:30-c)&&(w=c<30?0:30-c),h<0&&(h=0),w<0&&(w=0),n.set({"control.top":w,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(_.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect="",n.set("moving",!1)):t.preventDefault()};return _.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),this.set("moving",!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,l=o.clientHeight-2*s,c=2*s,f=i<=c||i>=a,d=r<=c||r>=l,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,g=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,m=this.get("control.left")||0,p=this.get("control.top")||0,b=w(this.get("control.width")),y=w(this.get("control.height")),x=w(this.get("control.minHeight")),v=w(this.get("control.minWidth")),z=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,l=f?o-u:0,c=d?a-g:0,w={};r<=s?(w["control.top"]=p+c,w["control.height"]=y-c):w["control.height"]=y+c,i<=s?(w["control.left"]=m+l,w["control.width"]=b-l):w["control.width"]=b+l,w["control.width"]<v&&(delete w["control.width"],delete w["control.left"]),w["control.height"]<x&&(delete w["control.height"],delete w["control.top"]),w["control.left"]<0&&(w["control.left"]=0),w["control.top"]<0&&(w["control.top"]=0),w["control.width"]&&(w["control.width"]=h(w["control.width"])),w["control.height"]&&(w["control.height"]=h(w["control.height"])),n.set(w),"touchend"===t.type||"mouseup"===t.type?(_.forEach(function(t){return document.removeEventListener(t,z,{passive:!1})}),n.set("control.resizing",!1),n.set("moving",!1),b===n.get("control.width")&&y===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return _.forEach(function(t){return document.addEventListener(t,z,{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}(p),k=["left","right","center","condition"];function S(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=x}}p.extendWith(z,{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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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=z.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!~k.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||"not-button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e||"not-button"===t.e})}).map(function(t){if(4===t.t)return t.f.filter(function(t){return"button"===t.e||"not-button"===t.e}).map(function(n){var e=n.m||[],i="button"===n.e?o(n):{partial:{t:n.f||[]},where:e.find(function(t){return"left"===t.n})?"left":e.find(function(t){return"center"===t.n})?"center":"right"},r={t:t.t,n:t.n,f:[i.partial.t[0]]};return t.r&&(r.r=t.r),t.rx&&(r.rx=t.rx),t.x&&(r.x=t.x),i.partial={t:[r]},i});if("not-button"===t.e){var n=t.m||[];return[{partial:{t:t.f||[]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"}]}return[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",h(t)):~e.indexOf("Height")&&this.set("control.actual.height",h(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:h(this.wrapper.clientWidth),height:h(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("RauiWindowHost","components",x),i("RauiWindow","components",z),x.prototype.Window=z,t.Base=p,t.Host=x,t.Window=z,t.plugin=S,t.default=S,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.RauiWindow={},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},l={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.timeout=t,this.data===this.holder.active?(this.holder.tm&&clearTimeout(this.holder.tm),t?this.holder.tm=setTimeout(function(){n.data.close(),n.holder.tm=null},t):this.data.close()):t?this.data.timeout=t:this.data.close(),this.closed},a.prototype.cancelClose=function(){this.data===this.holder.active?(clearTimeout(this.holder.tm),this.holder.tm=null):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()},l.message.get=function(){return this.data.message},l.message.set=function(t){this.data.message=t,this.data===this.holder.active&&this.data.instance.update("_toast.message")},l.more.get=function(){return this.data.more},l.more.set=function(t){this.data.more=t,this.data===this.holder.active&&this.data.instance.update("_toast.more")},l.showMore.get=function(){return this.data.showMore},l.showMore.set=function(t){this.data.showMore=t,this.data===this.holder.active&&this.data.instance.update("_toast.showMore")},l.left.get=function(){return this.data.left},l.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")},l.right.get=function(){return this.data.right},l.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")},l.top.get=function(){return!this.data.bottom},l.top.set=function(t){this.data.bottom=!t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},l.bottom.get=function(){return this.data.bottom},l.bottom.set=function(t){this.data.bottom=t,this.data===this.holder.active&&this.data.instance.update("_toast.bottom")},l.center.get=function(){return!this.data.left&&!this.data.right},l.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")},l.context.get=function(){return this.data.context},l.context.set=function(t){this.data.context=t,this.data===this.holder.active&&this.data.instance.update("_toast.context")},l.type.get=function(){return this.data.type},l.type.set=function(t){this.data.type=t,this.data===this.holder.active&&this.data.instance.update("_toast.type")},l.class.get=function(){return this.data.class},l.class.set=function(t){this.data.class=t,this.data===this.holder.active&&this.data.instance.update("_toast.class")},l.dismissable.get=function(){return this.data.dismissable},l.dismissable.set=function(t){this.data.dismissable=t,this.data===this.holder.active&&this.data.instance.update("_toast.dismissable")},l.closeButton.get=function(){return this.data.closeButton},l.closeButton.set=function(t){this.data.closeButton=t,this.data===this.holder.active&&this.data.instance.update("_toast.closeButton")},l.buttons.get=function(){return this.data.buttons},l.buttons.set=function(t){this.data.buttons=t,this.data===this.holder.active&&this.data.instance.update("_toast.buttons")},l.live.get=function(){return this.data===this.holder.active||~this.holder.toasts.indexOf(this.data)},l.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,l);var c,f=16;function d(t){f=t}function u(){var t,n,e;!c&&window&&"document"in window&&"function"==typeof document.createElement&&((c=document.createElement("div")).setAttribute("style","position: absolute; left: -2em; width: 1em; height: 1em;"),t=c,n=function(){return d(c.getBoundingClientRect().width)},(e=document.createElement("object")).setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;"),e.setAttribute("tabindex","-1"),e.type="text/html",e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",n),n()},/Trident/.test(navigator.userAgent)?(t.appendChild(e),e.data="about:blank"):(e.data="about:blank",t.appendChild(e)),window.addEventListener("resize",function(){u(),d(c.getBoundingClientRect().width)})),c&&!c.parent&&document.body.appendChild(c)}function h(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t/f}function g(t){return c||u(),"string"==typeof t&&(t=t.replace(/[^-.\d]/g,"")),+t*f}var w,m=e.escapeKey,p=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(p,{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 background-color: "+(n.host.bg||n.bg||"#fff")+";\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 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 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 width: 100%;\n height: 100%;\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-slide-left {\n height: 100%;\n left: 0;\n }\n .rwindow-slide-right {\n height: 100%;\n right: 0;\n }\n .rwindow-slide-top {\n width: 100%;\n top: 0;\n }\n .rwindow-slide-bottom {\n width: 100%;\n bottom: 0;\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: 50;\n transition: opacity 0.4s ease-in-out, z-index 0s linear;\n }\n .rwindow-modal.rwindow-move {\n z-index: 50;\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 min-height: 2em;\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(w)return t.complete();w=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),w=!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(){w=!1,t.complete(),o.style&&(o.style.overflow=i)}))},slide:function(t,n){var e=t.processParams(n,{duration:400,easing:"easeInOut"}),o=t.node.parentNode,i=o.style?o.style.overflow:"",r=function(){t.complete(),o.style&&setTimeout(function(){return o.style.overflow=i})};o.style&&(o.style.overflow="hidden"),t.isIntro||e.intro?"top"===e.from?(t.setStyle({transform:"translateY(-100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(100%)"}),t.animateStyle({transform:"translateY(0)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(-100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(100%)"}),t.animateStyle({transform:"translateX(0)"},e).then(r)):"top"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(-100%)"},e).then(r)):"bottom"===e.from?(t.setStyle({transform:"translateY(0)"}),t.animateStyle({transform:"translateY(100%)"},e).then(r)):"left"===e.from?(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(-100%)"},e).then(r)):"right"===e.from&&(t.setStyle({transform:"translateX(0)"}),t.animateStyle({transform:"translateX(100%)"},e).then(r))}}});var b,v=0,y=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 o={current:{configurable:!0},currentId:{configurable:!0},placement:{configurable:!0},topmost:{configurable:!0},windows:{configurable:!0}};return o.current.get=function(){var t=this.get("topLevel");return this.getWindow(this.get("windows."+m(t)+".id"))},o.currentId.get=function(){var t=this.get("topLevel");return this.get("windows."+m(t)+".id")},o.placement.get=function(){return this.get("placement")},o.placement.set=function(t){return this.set("placement",t)},o.topmost.get=function(){var t=this.get("windows");for(var n in t)if(t[n].topmost)return this.getWindow(t[n].id)},o.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 k))throw new Error("Windows must be instances of Window");t.id||t.set("@.id",o.id||"window"+v++),this.get("windows."+m(t.id))||this.set("windows."+m(t.id),Object.assign({show:!1!==o.show,autosize:!0,id:t.id,blockers:[],close:!0,minimize:!0,maximize:!0,minWidth:"5em",minHeight:"5em"},o,{id:t.id})),t.host=this;var i,r=this.attachChild(t,{target:"window"});if(o.block&&("string"==typeof(i=o.block.id||o.block)&&i in this.get("windows")?(this.push("windows."+m(i)+".blockers",t.id),t.set("control.blocking",i)):i=!1),t.minSize(o.minWidth||"5em",o.minHeight||"5em"),o.slide);else if("fill"===o.size&&(i||o.block)){var s;!0===o.block?s=this.find(".rwhost-pane"):(s=this.getWindow(i))&&(s=s.find(".rwindow")),s&&(t.size(s.clientWidth-(o.fillPad||20),s.clientHeight-(o.fillPad||20)),!o.block||o.top||o.left||(o.top=o.left=Math.floor((o.fillPad||20)/2)))}else o.width&&o.height?t.size(o.width,o.height):t.size("auto");return o.slide||(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."+m(n)+".blockers",o.indexOf(t.id),1)}e.detachChild(t).then(function(){return t.teardown()}),e.set("windows."+m(t.id)+".block",!1),e.set("windows."+m(t.id)+".index",-1),e.raise(),e.set("windows."+m(t.id),void 0),delete e.get("windows")[t.id]}),this.update("windows."+m(t.id)+".id",{force:!0}),this.fire("add",{},{window:t,options:o}),r.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."+m(t)+"."+n)},n.prototype.windowSet=function(t,n,e){return this.set("windows."+m(t)+"."+n,e)},n.prototype.raise=function(t,n){var e=this;void 0===n&&(n={});var o=t instanceof k?t:this.children.byName.window.filter(function(n){return n.instance.id===t}).map(function(t){return t.instance})[0],i=this.get("windows",{virtual:!1}),r=Object.keys(i).map(function(t){return i[t]}),s=2*(r.length+1),a=this.get("topLevel"),l=(this.get("blocked"),o?o.get("control.id"):r.reduce(function(t,n){return t?n.index>t.index?n:t:n},null));function c(t){t.blockers&&t.blockers.forEach(function(n,e){var o=r.find(function(t){return t.id===n});o&&(o.index=t.index+e+1,c(o))})}if(!o&&l&&(o=this.children.byName.window.find(function(t){return t.instance.id===l})),o){var f=o.get("control");f.index=!1===n.show?-1:s,c(f),f.blocking&&function t(n,e){n&&(n.index=e--,n.blocking&&t(r.find(function(t){return t.id===n.blocking}),e),c(n))}(r.find(function(t){return t.id===f.blocking}),s-1),!1===n.show||f.show||o.show()}r.filter(function(t){return!1!==t.show&&!0===t.block}).forEach(function(t){e.set("windows."+m(t.id)+".index",(t.index||0)+s),c(t)});var d=r.sort(function(t,n){return t.show?n.show&&t.index<n.index?-1:1:-1}),u=d.filter(function(t){return t.show});s=d.indexOf(u[u.length-1]);var h={},g=null;if(d.forEach(function(t,n){var e=m(t.id);!0===t.block&&null===g&&(g=n),h["windows."+e+".index"]=t.index=null!==g?n+2:n,h["windows."+e+".topmost"]=n===s,h["windows."+e+".stack"]=d.length-n}),h.blocked=null!==g?g+1:0,~s&&d.length?h.topLevel=d[s].id:h.topLevel=null,this.set(h),(s=h.topLevel)&&s!==a&&this.get("currentMax")&&this.rendered){var w=this.get("windows."+m(a));o=this.getWindow(s);var p=this.get("transition");!1===p||o.get("control.slide")||w&&(w.dialog||w.slide||w.blocking&&(!w.blocking||w.blocking===s))||o.transition(p||"window",o.find("div"),{intro:!0})}if(this.fire("raise",{},{top:this.topmost}),a!==this.get("topLevel")){var b=this.current;b&&b.fire("raise",{},{last:this.getWindow(a)})}},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||o.dialog||t.size("auto");var i=0,r=0;if(n.fragment&&n.fragment.rendered){var s=n.find(".rwhost"),a=s.clientWidth,l=s.clientHeight,c=o.width,f=o.height;!o.dialog||o.size&&"auto"!==o.size&&o.width&&o.height||(c=h(t.pane.clientWidth),f=h(t.pane.clientHeight));var d=o.blocking;if(d){var u="windows."+m(d),w=n.get(u),p=o.max||!o.dialog&&(n.get("max")||n.get("userMax")),b=w.max||n.get("userMax")||n.get("max"),v=b?n.host.clientWidth:g(w.width+"em"),y=b?n.host.clientHeight:g(w.height+"em"),z=b?0:w.left,k=b?0:w.top;i=(p?a:v/2)+(p?0:z)-g(c)/2,r=(p?l:y/2)+(p?0:k)-g(f)/2}else{var S,W=n.get("placement");if("function"==typeof W)try{S=W(n,s,o)}catch(t){S=x(n,s,o)}else if("string"==typeof W)switch(W){case"smart":S=_(n,s,o);break;default:S=x(n,s,o)}else S=x(n,s,o);r=S.top,i=S.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.placeAll=function(){var t=this;if(this.fragment&&this.fragment.rendered){var n=Object.keys(this.get("windows")||{}).filter(function(n){return t.get("windows."+e.escapeKey(n)+".show")}),o=this.find(".rwhost");return new Promise(function(e){requestAnimationFrame(function(){for(var i,r=o.clientWidth,s=o.clientHeight;i=n[0];){var a=t.getWindow(i),l=a.get("control");void 0!==l.width||l.dialog||a.size("auto");var c=0,f=0,d=l.width,u=l.height;!l.dialog||l.size&&"auto"!==l.size&&l.width&&l.height||(d=h(a.pane.clientWidth),u=h(a.pane.clientHeight));var w=l.blocking;if(w){var p="windows."+m(w),b=t.get(p),v=l.max||!l.dialog&&(t.get("max")||t.get("userMax")),y=b.max||t.get("userMax")||t.get("max"),z=y?t.host.clientWidth:g(b.width+"em"),k=y?t.host.clientHeight:g(b.height+"em"),S=y?0:b.left,W=y?0:b.top;c=(v?r:z/2)+(v?0:S)-g(d)/2,f=(v?s:k/2)+(v?0:W)-g(u)/2}else{var M=t.get("placement"),T=void 0;if("function"==typeof M)try{T=M(t,o,l,n)}catch(n){T=x(t,o,l)}else if("string"==typeof M)switch(M){case"smart":T=_(t,o,l,n);break;default:T=x(t,o,l)}else T=x(t,o,l);f=T.top,c=T.left}(isNaN(c)||c<0)&&(c=10),(isNaN(f)||f<0)&&(f=10),a.set({"control.top":f,"control.left":c}),n.shift()}e()})})}},Object.defineProperties(n.prototype,o),n}(p);function x(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,l=Math.floor(o/3),c=Math.floor(i/3),f=g(e.width),d=g(e.height+"em");switch(a){case 5:case 7:case 8:r=i-d-10;break;case 2:case 4:case 6:r=c+Math.floor((c-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=l+Math.floor((l-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}}function _(t,n,e,o){var i,r,s=n.clientWidth-10,a=n.clientHeight-10,l=Math.floor(a/16),c=Math.floor(s/16),f=new Array(l*c),d=new Array(l*c);for(i=0;i<f.length;i++)f[i]=0;var u,h,w,m,p,b,v,y,x=0,_=t.get("windows");for(var z in _)if(!o||!~o.indexOf(z))for(x++,u=_[z],h=Math.floor(u.top/16),w=Math.floor(u.left/16),p=Math.ceil(g(u.height)/16),m=Math.ceil(g(u.width)/16),i=h;i<h+p&&i<l;i++)for(r=w;r<w+m&&r<c;r++)f[i*c+r]++;for(m=Math.ceil(g(e.width)/16),p=Math.ceil(g(e.height)/16),i=0;i<l;i++)for(r=0;r<c;r++){if(i+p>l||r+m>c)b=x*m*p;else for(b=0,v=0;v<p;v++)for(y=0;y<m;y++)b+=f[(i+v)*c+r+y];if(0===b)return{top:16*i+5,left:16*r+5};d[i*c+r]=b}for(b=x*m*p,v=0,i=0;i<d.length;i++)d[i]<b&&(b=d[i],v=i);return{top:16*Math.floor(v/c)+5,left:v%c*16+5}}p.extendWith(y,{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"]'}},{t:16,r:"extra-attributes"}],f:[{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:"moving",f:[{t:2,r:"~/moving"}],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"]},"{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&&_1":function(t,n){return!t&&n},"[_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.maximize()]":function(t){return[t.maximize()]},"[_0.close()]":function(t){return[t.close()]},"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6":function(t,n,e,o,i,r,s){return!((t||n||e)&&o&&!i||r||s)},'["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&&!_4":function(t,n,e,o,i){return(t||n||e)&&!o&&!i},"[{from:_0}]":function(t){return[{from:t}]},"[_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)]},"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5":function(t,n,e,o,i,r){return!(!1===i||(t||n)&&!o||e||o&&!0!==i||r)},"[_0.raise()]":function(t){return[t.raise()]},'["pane"]':function(){return["pane"]},"_0&&!_1":function(t,n){return t&&!n}},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,x:{r:["window.dialog","window.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:["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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],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 max-height: 80%;\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: 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 flex-shrink: 1;\n display: flex;\n flex-direction: column;\n }\n .rtoast-upper {\n display: flex;\n flex-shrink: 2;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n \n .rtoast-expand {\n margin-top: 1em;\n border-radius: 0.2em;\n background-color: "+(n.bg||"#fff")+";\n color: "+(n.fg||"#222")+";\n overflow: auto;\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:[".","@context"],s:'[_0.expand(),(_1).toggle(".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.expand(),(_1).toggle(".showMore"),false]':function(t,n){return[t.expand(),n.toggle(".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,l=o.proto;r.partials[t.name||"toast"]=e;var c,f=Object.assign({},s,t),d=[],u={toasts:d};function h(n,e){c!==n?(d.splice(d.indexOf(t),1),"function"==typeof n.onclose&&n.onclose()):(u.tm&&(clearTimeout(u.tm),u.tm=null),c.instance.set("_toast",null).then(function(){u.active=c=null,"function"==typeof n.onclose&&n.onclose(),d.length&&g()})),e&&e.fire("toasted",null,n)}function g(){u.active=c=d.shift(),c.instance.set("_toast",c).then(function(){c.timeout&&(u.tm&&clearTimeout(u.tm),u.tm=setTimeout(function(){c.close(),u.tm=null},c.timeout))})}if(Object.defineProperty(l,"toastDefaults",{value:f,writable:!1,configurable:!0}),l.toast=function(t,n){var e=this,o=Object.assign({message:t,instance:this},f,this.toastDefaults,n);return o.close=function(){return h(o,e)},o.expand=function(){u.active===o&&(u.tm&&(clearTimeout(u.tm),u.tm=null),o.showMore&&o.timeout&&(u.tm=setTimeout(function(){o.close(),u.tm=null},o.timeout)))},d.push(o),c||g(),new a(u,o)},l.on=l.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("+(c.bottom?"":"-")+"1em)"}),t.animateStyle({opacity:o,transform:"none"},e)):(t.setStyle({opacity:o,transform:"none"}),t.animateStyle({opacity:0,transform:"translateY("+(c.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","")})},l.on["close-toast"]=function(){c&&c.close()},r===i||i.isInstance(r))i.hasCSS("toast-css")||i.addCSS("toast",n);else{var w=r.css;r.css=function(t){var e="";return"string"==typeof w?e+=w:"function"==typeof w&&(e+=w(t)),n(t)+e}}return l}}(),(void 0===b&&(b={}),function(t){t.instance.transitions[b.name||"expand"]=r})],cssId:"window-host",noIntro:!0,attributes:["placement","windows","transition"],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=g(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."+m(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."+m(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),this.set({_maxP:{t:i.f},hideTitleMax:!0}),i.m&&this.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},l={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("+l.x+"px, "+l.y+"px) scale(0.5, 0.5)",opacity:0})):e={transform:"translate("+l.x+"px, "+l.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 z=["mousemove","mouseup","touchmove","touchend"],k=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){if(t)this.show();else{if(this.get("control.show"))try{this.fire("hide")}catch(t){}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(){var t=this.get("control.show");if(this.set("control.show",!0),void 0===this.get("control.top")&&this.host.place(this),!t)try{this.fire("show")}catch(t){}},n.prototype.size=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.width":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){e.set("control.autosize",!0);var r=Math.ceil(h(i.clientWidth+16)),s=Math.ceil(h(i.clientHeight+8));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":h(t),"control.height":h(n),"control.naturalWidth":h(t),"control.naturalHeight":h(n),"control.autosize":!1});else if("string"==typeof t&&"string"==typeof n){var a=i.style.width,l=i.style.height;i.style.width=t,i.style.height=n;var c=i.clientWidth,f=i.clientHeight;i.style.width=a,i.style.height=l,e.set({"control.width":h(c),"control.height":h(f),"control.naturalWidth":h(c),"control.naturalHeight":h(f),"control.autosize":!1})}var d=e.host.host;if(d){var u=h(d.clientWidth-16),g=h(d.clientHeight-16);e.get("control.width")>u&&e.set("control.width",u),e.get("control.height")>g&&e.set("control.height",g)}var w=e.get("control.minWidth")||5,m=e.get("control.minHeight")||5;e.get("control.width")<w&&e.set("control.width",w),e.get("control.height")<m&&e.set("control.height",m),e.fire("resize"),o()})})},n.prototype.minSize=function(t,n){var e=this;return new Promise(function(o){requestAnimationFrame(function(){if(!e.visible)return"number"==typeof t&&"number"==typeof n&&e.set({"control.minWidth":h(t),"control.minHeight":h(n)}),o();var i=e.wrapper;if(!i)return o();if("auto"===t){var r=e.get("control.autosize");e.set("control.autosize",!0);var s=h(i.clientWidth+16),a=h(i.clientHeight);e.set({"control.minWidth":s,"control.minHeight":a,"control.autosize":r})}else if("number"==typeof t&&"number"==typeof n)e.set({"control.minWidth":h(t),"control.minHeight":h(n)});else if("string"==typeof t&&"string"==typeof n){var l=i.style.width,c=i.style.height;i.style.width=t,i.style.height=n;var f=i.clientWidth,d=i.clientHeight;i.style.width=l,i.style.height=c,e.set({"control.minWidth":h(f),"control.minHeight":h(d)})}o()})})},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=h(t)),"center"===n&&(n=e.host.modalPane.clientWidth/2-e.wrapper.clientWidth/2),"string"==typeof n&&(n=h(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(!this.top||!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;this.set("moving",!0);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,l=e.clientWidth,c=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),g=a+(u-r);h<(l<30?0:30-l)&&(h=l<30?0:30-l),g<(c<30?0:30-c)&&(g=c<30?0:30-c),h<0&&(h=0),g<0&&(g=0),n.set({"control.top":g,"control.left":h}),"touchend"===t.type||"mouseup"===t.type?(z.forEach(function(t){return document.removeEventListener(t,f,{passive:!1})}),e.style.cursor=o,e.style.userSelect="",n.set("moving",!1)):t.preventDefault()};return z.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),this.set("moving",!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,l=o.clientHeight-2*s,c=2*s,f=i<=c||i>=a,d=r<=c||r>=l,u=t.x||t.clientX||t.targetTouches&&t.targetTouches[0].clientX||0,w=t.y||t.clientY||t.targetTouches&&t.targetTouches[0].clientY||0,m=this.get("control.left")||0,p=this.get("control.top")||0,b=g(this.get("control.width")),v=g(this.get("control.height")),y=g(this.get("control.minHeight")),x=g(this.get("control.minWidth")),_=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,l=f?o-u:0,c=d?a-w:0,g={};r<=s?(g["control.top"]=p+c,g["control.height"]=v-c):g["control.height"]=v+c,i<=s?(g["control.left"]=m+l,g["control.width"]=b-l):g["control.width"]=b+l,g["control.width"]<x&&(delete g["control.width"],delete g["control.left"]),g["control.height"]<y&&(delete g["control.height"],delete g["control.top"]),g["control.left"]<0&&(g["control.left"]=0),g["control.top"]<0&&(g["control.top"]=0),g["control.width"]&&(g["control.width"]=h(g["control.width"])),g["control.height"]&&(g["control.height"]=h(g["control.height"])),n.set(g),"touchend"===t.type||"mouseup"===t.type?(z.forEach(function(t){return document.removeEventListener(t,_,{passive:!1})}),n.set("control.resizing",!1),n.set("moving",!1),b===n.get("control.width")&&v===n.get("control.height")||(e&&clearTimeout(e),e=null,n.fire("resize"))):e||(e=setTimeout(function(){n.fire("resize"),e=null},200))};return z.forEach(function(t){return document.addEventListener(t,_,{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}(p),S=["left","right","center","condition"];function W(t){return void 0===t&&(t={}),function(n){n.instance.components[t.name||"host"]=y}}p.extendWith(k,{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","~/control.slide"],s:"(_0||_1||_2)&&!_3&&!_4"}},{t:4,f:[{n:"class",f:["rwindow-slide rwindow-slide-",{t:2,r:"~/control.slide"}],t:13},{n:"slide",t:72,f:{r:["~/control.slide"],s:"[{from:_0}]"},v:"t0"}],n:50,r:"~/control.slide",l:1},{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:["~/root.max","~/root.userMax","~/control.max","~/control.dialog","~/control.movable","~/control.slide"],s:"!(_4===false||((_0||_1)&&!_3)||_2)&&(!_3||_4===true)&&!_5"}},{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"}}]},{n:"class-rwindow-move",t:13,f:[{t:2,r:"~/moving"}]}]}," ",{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,x:{r:["~/control.autosize","~/control.slide"],s:"_0&&!_1"}}],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:50,x:{r:["~/control.max","~/root.userMax","~/root.max","~/root.hideTitleMax","~/control.dialog","~/control.hideTitle","~/control.slide"],s:"!((_0||_1||_2)&&_3&&!_4)&&!_5&&!_6"}}," ",{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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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"},{t:4,f:[{n:"title",f:[{t:2,r:".title"}],t:13}],n:50,r:".title"}],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=k.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!~S.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||"not-button"===t.e||4===t.t&&(50===t.n||51===t.n)&&t.f.find(function(t){return"button"===t.e||"not-button"===t.e})}).map(function(t){if(4===t.t)return t.f.filter(function(t){return"button"===t.e||"not-button"===t.e}).map(function(n){var e=n.m||[],i="button"===n.e?o(n):{partial:{t:n.f||[]},where:e.find(function(t){return"left"===t.n})?"left":e.find(function(t){return"center"===t.n})?"center":"right"},r={t:t.t,n:t.n,f:[i.partial.t[0]]};return t.r&&(r.r=t.r),t.rx&&(r.rx=t.rx),t.x&&(r.x=t.x),i.partial={t:[r]},i});if("not-button"===t.e){var n=t.m||[];return[{partial:{t:t.f||[]},where:n.find(function(t){return"left"===t.n})?"left":n.find(function(t){return"center"===t.n})?"center":"right"}]}return[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",h(t)):~e.indexOf("Height")&&this.set("control.actual.height",h(t)));else{this.wrapper;this.wrapper&&this.set("control.actual",{width:h(this.wrapper.clientWidth),height:h(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("RauiWindowHost","components",y),i("RauiWindow","components",k),y.prototype.Window=k,t.Base=p,t.Host=y,t.Window=k,t.plugin=W,t.default=W,Object.defineProperty(t,"__esModule",{value:!0})});

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

Sorry, the diff of this file is not supported yet

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc