Files
Testing/html5-chat1/js/jspanel/jspanel.min.min.min.js
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

1 line
60 KiB
JavaScript

"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function jsPanelError(e){this.name="jsPanelError",this.message=e||"",this.stack=(new Error).stack}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.append=e.append||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){var n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}}),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t=(this.document||this.ownerDocument).querySelectorAll(e),n=void 0,o=this;do{for(n=t.length;--n>=0&&t.item(n)!==o;);}while(n<0&&(o=o.parentElement));return o}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)}),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(void 0!==o&&null!==o){o=Object(o);for(var a=Object.keys(Object(o)),i=0,r=a.length;i<r;i++){var s=a[i],l=Object.getOwnPropertyDescriptor(o,s);void 0!==l&&l.enumerable&&(t[s]=o[s])}}}return t}}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return t<this.length?t|=0:t=this.length,this.substr(t-e.length,e.length)===e}),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(t||0,e.length)===e}),jsPanelError.prototype=Object.create(Error.prototype),jsPanelError.prototype.constructor=jsPanelError;var jsPanel={version:"4.0.0-beta.1.18",date:"2017-12-28 13:01",idCounter:0,ziBase:100,themes:["default","primary","info","success","warning","danger"],mdbthemes:["secondary","elegant","stylish","unique","special"],autopositionSpacing:4,isIE:navigator.appVersion.match(/Trident/),defaults:{boxShadow:3,container:document.body,contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},headerTitle:"jsPanel",headerControls:"all",iconfont:"jsglyph",maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:"center",resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:40,minHeight:40},theme:"default"},defaultSnapConfig:{sensitivity:70,trigger:"panel"},ajaxAlwaysCallbacks:[],extensions:{},ajax:function ajax(obj){var conf=obj.options.contentAjax,configDefaults={method:"GET",async:!0,user:"",pwd:"",done:function(){obj.content.innerHTML=this.responseText},autoresize:!0,autoreposition:!0},config=void 0;if("string"==typeof conf)config=Object.assign({},configDefaults,{url:encodeURI(conf),evalscripttags:!0});else{if("object"!==(void 0===conf?"undefined":_typeof(conf))||!conf.url)return console.info("XMLHttpRequest seems to miss the request url!"),obj;config=Object.assign({},configDefaults,conf),config.url=encodeURI(conf.url),!1===config.async&&(config.timeout=0,config.withCredentials&&(config.withCredentials=void 0),config.responseType&&(config.responseType=void 0))}var xhr=new XMLHttpRequest;return xhr.onreadystatechange=function(){if(4===xhr.readyState){if(200===xhr.status){if(config.done.call(xhr,obj),config.evalscripttags){var scripttags=xhr.responseText.match(/<script\b[^>]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/<script\b[^>]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}}else config.fail&&config.fail.call(xhr,obj);config.always&&config.always.call(xhr,obj);var oContentSize=obj.options.contentSize;if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){var parts=oContentSize.split(" "),sizes=Object.assign({},{width:parts[0],height:parts[1]});config.autoresize&&obj.resize(sizes),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}else if("object"===(void 0===oContentSize?"undefined":_typeof(oContentSize))&&("auto"===oContentSize.width||"auto"===oContentSize.height)){var _sizes=Object.assign({},oContentSize);config.autoresize&&obj.resize(_sizes),obj.classList.contains("jsPanel-contextmenu")||config.autoreposition&&obj.reposition()}jsPanel.ajaxAlwaysCallbacks.length&&jsPanel.ajaxAlwaysCallbacks.forEach(function(e){e.call(obj,obj)})}},xhr.open(config.method,config.url,config.async,config.user,config.pwd),xhr.timeout=config.timeout||0,config.withCredentials&&(xhr.withCredentials=config.withCredentials),config.responseType&&(xhr.responseType=config.responseType),config.beforeSend&&config.beforeSend.call(xhr),config.data?xhr.send(config.data):xhr.send(null),obj},calcColors:function(e){var t=this.color(e),n=this.lighten(e,.81),o=this.darken(e,.5),a=this.perceivedBrightness(e)<=.556?"#ffffff":"#000000",i=this.perceivedBrightness(n)<=.556?"#ffffff":"#000000",r=this.perceivedBrightness(o)<=.556?"#000000":"#ffffff";return[t.hsl.css,n,o,a,i,r]},color:function(e){var t=e.toLowerCase(),n=void 0,o=void 0,a=void 0,i=void 0,r=void 0,s=void 0,l=void 0,c=void 0,d=void 0,f={},p=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/gi,h=/^rgba?\(([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3}),?(0|1|0\.[0-9]{1,2}|\.[0-9]{1,2})?\)$/gi,u=/^hsla?\(([0-9]{1,3}),([0-9]{1,3}%),([0-9]{1,3}%),?(0|1|0\.[0-9]{1,2}|\.[0-9]{1,2})?\)$/gi,m={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};return m[t]&&(t=m[t]),null!==t.match(p)?(t=t.replace("#",""),t.length%2==1?(n=String(t.substr(0,1))+t.substr(0,1),o=String(t.substr(1,1))+t.substr(1,1),a=String(t.substr(2,1))+t.substr(2,1),f.rgb={r:parseInt(n,16),g:parseInt(o,16),b:parseInt(a,16)},f.hex="#"+n+o+a):(f.rgb={r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16)},f.hex="#"+t),d=this.rgbToHsl(f.rgb.r,f.rgb.g,f.rgb.b),f.hsl=d,f.rgb.css="rgb("+f.rgb.r+","+f.rgb.g+","+f.rgb.b+")"):t.match(h)?(l=h.exec(t),f.rgb={css:t,r:l[1],g:l[2],b:l[3]},f.hex=this.rgbToHex(l[1],l[2],l[3]),d=this.rgbToHsl(l[1],l[2],l[3]),f.hsl=d):t.match(u)?(i=(l=u.exec(t))[1]/360,r=l[2].substr(0,l[2].length-1)/100,s=l[3].substr(0,l[3].length-1)/100,c=this.hslToRgb(i,r,s),f.rgb={css:"rgb("+c[0]+","+c[1]+","+c[2]+")",r:c[0],g:c[1],b:c[2]},f.hex=this.rgbToHex(f.rgb.r,f.rgb.g,f.rgb.b),f.hsl={css:"hsl("+l[1]+","+l[2]+","+l[3]+")",h:l[1],s:l[2],l:l[3]}):(f.hex="#f5f5f5",f.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},f.hsl={css:"hsl(0,0%,96.08%)",h:0,s:"0%",l:"96.08%"}),f},createPanelTemplate:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=document.createElement("div");return t.className="jsPanel",e&&["close","maximize","normalize","minimize","smallify","smallifyrev"].forEach(function(e){t.setAttribute("data-btn"+e,"enabled")}),t.innerHTML='<div class="jsPanel-hdr">\n <div class="jsPanel-headerbar">\n <div class="jsPanel-headerlogo"></div>\n <div class="jsPanel-titlebar">\n <h3 class="jsPanel-title"></h3>\n </div>\n <div class="jsPanel-controlbar">\n <div class="jsPanel-btn jsPanel-btn-smallify"><span class="jsglyph jsglyph-chevron-up"></span></div>\n <div class="jsPanel-btn jsPanel-btn-smallifyrev"><span class="jsglyph jsglyph-chevron-down"></span></div>\n <div class="jsPanel-btn jsPanel-btn-minimize"><span class="jsglyph jsglyph-minimize"></span></div>\n <div class="jsPanel-btn jsPanel-btn-normalize"><span class="jsglyph jsglyph-normalize"></span></div>\n <div class="jsPanel-btn jsPanel-btn-maximize"><span class="jsglyph jsglyph-maximize"></span></div>\n <div class="jsPanel-btn jsPanel-btn-close"><span class="jsglyph jsglyph-close"></span></div>\n </div>\n </div>\n <div class="jsPanel-hdr-toolbar"></div>\n </div>\n <div class="jsPanel-content jsPanel-content-nofooter"></div>\n <div class="jsPanel-minimized-box"></div>\n <div class="jsPanel-ftr"></div>',t},createMinimizedTemplate:function(){var e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML='<div class="jsPanel-hdr">\n <div class="jsPanel-headerbar">\n <div class="jsPanel-headerlogo"></div>\n <div class="jsPanel-titlebar">\n <h3 class="jsPanel-title"></h3>\n </div>\n <div class="jsPanel-controlbar">\n <div class="jsPanel-btn jsPanel-btn-normalize"><span class="jsglyph jsglyph-normalize"></span></div>\n <div class="jsPanel-btn jsPanel-btn-maximize"><span class="jsglyph jsglyph-maximize"></span></div>\n <div class="jsPanel-btn jsPanel-btn-close"><span class="jsglyph jsglyph-close"></span></div>\n </div>\n </div>\n </div>',e},createSnapArea:function(e,t,n){var o=document.createElement("div"),a=e.parentNode;o.className="jsPanel-snap-area jsPanel-snap-area-"+t,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(o.style.width=n+"px",o.style.height=n+"px"):"ct"===t||"cb"===t?o.style.height=n+"px":"lc"!==t&&"rc"!==t||(o.style.width=n+"px"),a!==document.body&&(o.style.position="absolute"),document.querySelector(".jsPanel-snap-area.jsPanel-snap-area-"+t)||e.parentNode.appendChild(o)},darken:function(e,t){var n=this.color(e).hsl,o=parseFloat(n.l),a=o-o*t+"%";return"hsl("+n.h+","+n.s+","+a+")"},dragit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0,o=Object.assign({},this.defaults.dragit,t),a=void 0,i=void 0,r=[],s=new CustomEvent("dragstart",{detail:e.id}),l=new CustomEvent("drag",{detail:e.id}),c=new CustomEvent("dragstop",{detail:e.id});return o.grid&&Array.isArray(o.grid)&&1===o.grid.length&&(o.grid[1]=o.grid[0]),i=this.pOcontainment(o.containment),e.querySelectorAll(o.handles).forEach(function(t){t.style.touchAction="none",t.style.cursor=o.cursor,t.classList.add("jsPanel-dragit-handle"),jsPanel.pointerdown.forEach(function(c){t.addEventListener(c,function(t){if(t.preventDefault(),!t.target.closest(".jsPanel-ftr-btn")){e.controlbar.style.pointerEvents="none",(r=document.querySelectorAll("iframe")).length&&r.forEach(function(e){e.style.pointerEvents="none"});var c=window.getComputedStyle(e),d=parseFloat(c.left),f=parseFloat(c.top),p=t.touches?t.touches[0].clientX:t.clientX,h=t.touches?t.touches[0].clientY:t.clientY,u=e.parentNode,m=u.getBoundingClientRect(),g=window.getComputedStyle(u),y=0;a=function(t){if(t.preventDefault(),!n){if(document.dispatchEvent(s),e.style.opacity=o.opacity,e.snapped&&o.snap.resizeToPreSnap&&e.currentData.beforeSnap){e.resize(e.currentData.beforeSnap.width+" "+e.currentData.beforeSnap.height);var a=e.getBoundingClientRect(),r=p-(a.left+a.width),c=a.width/2;r>-c&&(y=r+c)}"function"==typeof o.start&&o.start.call(e,e,{left:d,top:f}),jsPanel.front(e),e.snapped=!1}if(n=1,o.disableOnMaximized&&"maximized"===e.status)return!1;var b=void 0,v=void 0,w=void 0,j=void 0,P=void 0,z=void 0,E=void 0,x=void 0,S=t.touches?t.touches[0].clientX:t.clientX,C=t.touches?t.touches[0].clientY:t.clientY,T=window.getComputedStyle(e);o.snap&&("panel"===o.snap.trigger?(b=parseFloat(T.left),v=Math.pow(b,2),w=parseFloat(T.top),j=Math.pow(w,2),P=parseFloat(T.right),z=Math.pow(P,2),E=parseFloat(T.bottom),x=Math.pow(E,2)):"pointer"===o.snap.trigger&&(b=S,v=Math.pow(S,2),w=C,j=Math.pow(w,2),P=window.innerWidth-S,z=Math.pow(P,2),E=window.innerHeight-C,x=Math.pow(E,2)));var L=Math.sqrt(v+j),F=Math.sqrt(v+x),A=Math.sqrt(z+j),k=Math.sqrt(z+x),q=Math.abs(b-P)/2,O=Math.abs(w-E)/2,M=Math.sqrt(v+Math.pow(O,2)),R=Math.sqrt(j+Math.pow(q,2)),W=Math.sqrt(z+Math.pow(O,2)),D=Math.sqrt(x+Math.pow(q,2));if(window.getSelection().removeAllRanges(),document.dispatchEvent(l),o.axis&&"x"!==o.axis||(e.style.left=d+(S-p)+y+"px"),o.axis&&"y"!==o.axis||(e.style.top=f+(C-h)+"px"),o.grid){var H=parseFloat(T.left),N=parseFloat(T.top),B=H%o.grid[0],I=N%o.grid[1];B<o.grid[0]/2?e.style.left=H-B+"px":e.style.left=H+(o.grid[0]-B)+"px",I<o.grid[1]/2?e.style.top=N-I+"px":e.style.top=N+(o.grid[1]-I)+"px"}if(o.containment||0===o.containment){var $=void 0,X=void 0;if(e.options.container===document.body)$=window.innerWidth-parseFloat(T.width)-i[1],X=window.innerHeight-parseFloat(T.height)-i[2];else{var Y=parseFloat(g.borderLeftWidth)+parseFloat(g.borderRightWidth),_=parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth);$=m.width-parseFloat(T.width)-i[1]-Y,X=m.height-parseFloat(T.height)-i[2]-_}parseFloat(e.style.left)<=i[3]&&(e.style.left=i[3]+"px"),parseFloat(e.style.top)<=i[0]&&(e.style.top=i[0]+"px"),parseFloat(e.style.left)>=$&&(e.style.left=$+"px"),parseFloat(e.style.top)>=X&&(e.style.top=X+"px")}if("function"==typeof o.drag&&o.drag.call(e,e,{left:b,top:w,right:P,bottom:E}),o.snap){var V=o.snap.sensitivity,U=u===document.body?window.innerWidth/8:m.width/8,Z=u===document.body?window.innerHeight/8:m.height/8;e.snappableTo=!1,jsPanel.removeSnapAreas(e),L<V?(e.snappableTo="left-top",!1!==o.snap.snapLeftTop&&jsPanel.createSnapArea(e,"lt",V)):F<V?(e.snappableTo="left-bottom",!1!==o.snap.snapLeftBottom&&jsPanel.createSnapArea(e,"lb",V)):A<V?(e.snappableTo="right-top",!1!==o.snap.snapRightTop&&jsPanel.createSnapArea(e,"rt",V)):k<V?(e.snappableTo="right-bottom",!1!==o.snap.snapRightBottom&&jsPanel.createSnapArea(e,"rb",V)):w<V&&R<U?(e.snappableTo="center-top",!1!==o.snap.snapCenterTop&&jsPanel.createSnapArea(e,"ct",V)):b<V&&M<Z?(e.snappableTo="left-center",!1!==o.snap.snapLeftCenter&&jsPanel.createSnapArea(e,"lc",V)):P<V&&W<Z?(e.snappableTo="right-center",!1!==o.snap.snapRightCenter&&jsPanel.createSnapArea(e,"rc",V)):E<V&&D<U&&(e.snappableTo="center-bottom",!1!==o.snap.snapCenterBottom&&jsPanel.createSnapArea(e,"cb",V))}},jsPanel.pointermove.forEach(function(e){document.addEventListener(e,a)})}})}),jsPanel.pointerup.forEach(function(t){document.addEventListener(t,function(){jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,a)}),document.body.style.overflow="inherit",jsPanel.removeSnapAreas(e),n&&(document.dispatchEvent(c),e.style.opacity=1,n=void 0,e.saveCurrentPosition(),o.snap&&("left-top"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapLeftTop):"center-top"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapCenterTop):"right-top"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapRightTop):"right-center"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapRightCenter):"right-bottom"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapRightBottom):"center-bottom"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapCenterBottom):"left-bottom"===e.snappableTo?jsPanel.snapPanel(e,o.snap.snapLeftBottom):"left-center"===e.snappableTo&&jsPanel.snapPanel(e,o.snap.snapLeftCenter),o.snap.callback&&e.snappableTo&&"function"==typeof o.snap.callback&&o.snap.callback.call(e,e),e.snappableTo&&o.snap.repositionOnSnap&&e.repositionOnSnap(e.snappableTo)),"function"==typeof o.stop&&o.stop.call(e,e,{left:parseFloat(e.style.left),top:parseFloat(e.style.top)})),e.controlbar.style.pointerEvents="inherit",r.length&&r.forEach(function(e){e.style.pointerEvents="inherit"})})}),o.disable&&(t.style.pointerEvents="none")}),e},emptyNode:function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},extend:function(e){if("[object Object]"===Object.prototype.toString.call(e))for(var t in e)e.hasOwnProperty(t)&&(this.extensions[t]=e[t])},fetch:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(obj){var conf=obj.options.contentFetch,confDefaults={bodyMethod:"text",evalscripttags:!0,autoresize:!0,autoreposition:!0,done:function(e,t){e.content.innerHTML=t}};conf="string"==typeof conf?Object.assign({resource:obj.options.contentFetch},confDefaults):Object.assign(confDefaults,conf);var fetchInit=conf.fetchInit||{};conf.beforeSend&&conf.beforeSend.call(obj,obj),fetch(conf.resource,fetchInit).then(function(e){if(e.ok)return e[conf.bodyMethod]();throw new Error("Network response was not ok.")}).then(function(response){if(conf.done.call(obj,obj,response),conf.evalscripttags){var scripttags=response.match(/<script\b[^>]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/<script\b[^>]*>/i,"").replace(/<\/script>/i,"").trim();eval(js)})}var oContentSize=obj.options.contentSize;if(conf.autoresize||conf.autoreposition)if("string"==typeof oContentSize&&oContentSize.match(/auto/i)){var parts=oContentSize.split(" "),sizes=Object.assign({},{width:parts[0],height:parts[1]});conf.autoresize&&obj.resize(sizes),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}else if("object"===(void 0===oContentSize?"undefined":_typeof(oContentSize))&&("auto"===oContentSize.width||"auto"===oContentSize.height)){var _sizes2=Object.assign({},oContentSize);conf.autoresize&&obj.resize(_sizes2),obj.classList.contains("jsPanel-contextmenu")||conf.autoreposition&&obj.reposition()}}).catch(function(e){console.error("There has been a problem with your fetch operation: "+e.message)})}),front:function(e){if("minimized"===e.status)"maximized"===e.statusBefore?e.maximize():e.normalize();else{var t=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(function(e){return e.style.zIndex});Math.max.apply(Math,_toConsumableArray(t))>e.style.zIndex&&(e.style.zIndex=jsPanel.zi.next()),this.resetZi()}},getPanels:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return this.classList.contains("jsPanel-standard")};return Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(function(t){return e.call(t,t)}).sort(function(e,t){return t.style.zIndex-e.style.zIndex})},hslToRgb:function(e,t,n){var o=void 0,a=void 0,i=void 0;if(0===t)o=a=i=n;else{var r=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=r(l,s,e+1/3),a=r(l,s,e),i=r(l,s,e-1/3)}return[Math.round(255*o),Math.round(255*a),Math.round(255*i)]},lighten:function(e,t){var n=this.color(e).hsl,o=parseFloat(n.l),a=o+(100-o)*t+"%";return"hsl("+n.h+","+n.s+","+a+")"},perceivedBrightness:function(e){var t=this.color(e).rgb;return t.r/255*.2627+t.g/255*.678+t.b/255*.0593},pOcontainer:function(e,t){if(e){var n=void 0;if("string"==typeof e?n=document.querySelector(e):1===e.nodeType?n=e:e.length&&(n=e[0]),n&&1===n.nodeType)return n}var o=new jsPanelError("\nNO NEW PANEL CREATED!\nThe container to append the panel to does not exist or a container was not specified!");try{throw o}catch(e){t&&t.call(e,e)}return o},pOcontainment:function(e){if("number"==typeof e)return[e,e,e,e];if(Array.isArray(e)){if(1===e.length)return[e[0],e[0],e[0],e[0]];if(2===e.length)return e.concat(e);3===e.length&&(e[3]=e[1])}return e},pOsize:function(e,t){var n=t||this.defaults.contentSize,o=e.parentNode;if("string"==typeof n){var a=n.trim().split(" ");(n={}).width=a[0],2===a.length?n.height=a[1]:n.height=a[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[0-9]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(o===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{var i=window.getComputedStyle(o),r=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth);n.width=(parseFloat(i.width)-r)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width(),"number"==typeof n.width?n.width+="px":"string"==typeof n.width&&n.width.match(/^[0-9]+$/gi)&&(n.width+="px"));if(String(n.height).match(/^[0-9]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(o===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{var s=window.getComputedStyle(o),l=parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth);n.height=(parseFloat(s.height)-l)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height(),"number"==typeof n.height?n.height+="px":"string"==typeof n.height&&n.height.match(/^[0-9]+$/gi)&&(n.height+="px"));return n},position:function(e,t){var n=void 0,o=void 0,a=void 0,i={left:0,top:0},r=0,s=0,l=0,c=0,d={my:"center",at:"center",of:"window",offsetX:"0px",offsetY:"0px"},f={width:document.documentElement.clientWidth,height:window.innerHeight},p=pageXOffset,h=pageYOffset;if(n="string"==typeof e?document.querySelector(e):e,!t)return n.style.opacity=1,n;var u=n.getBoundingClientRect();if("string"==typeof t){var m=t.match(/\b[a-z]{4,6}-{1}[a-z]{3,6}\b/i),g=t.match(/down|up|right([^-]|$)|left([^-]|$)/i),y=t.match(/[+-]?\d?\.?\d+([a-z%]{2,4}\b|%?)/gi),b=void 0;b=m?{my:m[0].toLowerCase(),at:m[0].toLowerCase()}:{my:"center",at:"center"},g&&(b.autoposition=g[0].toLowerCase()),y&&(y.forEach(function(e,t){e.match(/^[+-]?[0-9]*$/)&&(y[t]+="px"),y[t]=y[t].toLowerCase()}),1===y.length?(b.offsetX=y[0],b.offsetY=y[0]):(b.offsetX=y[0],b.offsetY=y[1])),o=Object.assign({},d,b)}else o=Object.assign({},d,t);var v=n.parentElement,w=window.getComputedStyle(v),j=v.getBoundingClientRect(),P=v.tagName.toLowerCase();if(o.of&&"window"!==o.of&&(a="string"==typeof o.of?document.querySelector(o.of):o.of),o.my.match(/^center-top$|^center$|^center-bottom$/i)?r=u.width/2:o.my.match(/right/i)&&(r=u.width),o.my.match(/^left-center$|^center$|^right-center$/i)?s=u.height/2:o.my.match(/bottom/i)&&(s=u.height),"body"===P&&"window"===o.of)o.at.match(/^center-top$|^center$|^center-bottom$/i)?l=f.width/2:o.at.match(/right/i)&&(l=f.width),o.at.match(/^left-center$|^center$|^right-center$/i)?c=f.height/2:o.at.match(/bottom/i)&&(c=f.height),i.left=l-r-parseFloat(w.borderLeftWidth),i.top=c-s-parseFloat(w.borderTopWidth),n.style.position="fixed";else if("body"===P&&"window"!==o.of){var z=a.getBoundingClientRect();l=o.at.match(/^center-top$|^center$|^center-bottom$/i)?z.width/2+z.left+p:o.at.match(/right/i)?z.width+z.left+p:z.left+p,c=o.at.match(/^left-center$|^center$|^right-center$/i)?z.height/2+z.top+h:o.at.match(/bottom/i)?z.height+z.top+h:z.top+h,i.left=l-r-parseFloat(w.borderLeftWidth),i.top=c-s-parseFloat(w.borderTopWidth)}else if("body"===P||"window"!==o.of&&o.of){if("body"!==P&&v.contains(a)){var E=a.getBoundingClientRect();l=o.at.match(/^center-top$|^center$|^center-bottom$/i)?E.left-j.left+E.width/2:o.at.match(/right/i)?E.left-j.left+E.width:E.left-j.left,c=o.at.match(/^left-center$|^center$|^right-center$/i)?E.top-j.top+E.height/2:o.at.match(/bottom/i)?E.top-j.top+E.height:E.top-j.top,i.left=l-r-parseFloat(w.borderLeftWidth),i.top=c-s-parseFloat(w.borderTopWidth)}}else{var x=parseFloat(w.borderLeftWidth)+parseFloat(w.borderRightWidth),S=parseFloat(w.borderTopWidth)+parseFloat(w.borderBottomWidth);o.at.match(/^center-top$|^center$|^center-bottom$/i)?l=j.width/2-x/2:o.at.match(/right/i)&&(l=j.width-x),o.at.match(/^left-center$|^center$|^right-center$/i)?c=j.height/2-S/2:o.at.match(/bottom/i)&&(c=j.height-S),i.left=l-r,i.top=c-s}if(o.autoposition&&o.my===o.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(o.my)>=0){var C=o.my+"-"+o.autoposition.toLowerCase();n.classList.add(C);var T=Array.prototype.slice.call(document.querySelectorAll("."+C)),L=T.indexOf(n);T.length>1&&("down"===o.autoposition?T.forEach(function(e,t){t>0&&t<=L&&(i.top+=T[--t].getBoundingClientRect().height+jsPanel.autopositionSpacing)}):"up"===o.autoposition?T.forEach(function(e,t){t>0&&t<=L&&(i.top-=T[--t].getBoundingClientRect().height+jsPanel.autopositionSpacing)}):"right"===o.autoposition?T.forEach(function(e,t){t>0&&t<=L&&(i.left+=T[--t].getBoundingClientRect().width+jsPanel.autopositionSpacing)}):"left"===o.autoposition&&T.forEach(function(e,t){t>0&&t<=L&&(i.left-=T[--t].getBoundingClientRect().width+jsPanel.autopositionSpacing)}))}return(o.minLeft||0===o.minLeft)&&"number"==typeof o.minLeft&&i.left<o.minLeft&&(i.left=o.minLeft),(o.maxLeft||0===o.maxLeft)&&"number"==typeof o.maxLeft&&i.left>o.maxLeft&&(i.left=o.maxLeft),(o.minTop||0===o.minTop)&&"number"==typeof o.minTop&&i.top<o.minTop&&(i.top=o.minTop),(o.maxTop||0===o.maxTop)&&"number"==typeof o.maxTop&&i.top>o.maxTop&&(i.top=o.maxTop),"function"==typeof o.modify&&(i=o.modify.call(i,i)),"number"==typeof o.offsetX&&(o.offsetX+="px"),"number"==typeof o.offsetY&&(o.offsetY+="px"),n.style.left="calc("+i.left+"px + "+o.offsetX+")",n.style.top="calc("+i.top+"px + "+o.offsetY+")",n.style.opacity=1,n.style.left=window.getComputedStyle(n).left,n.style.top=window.getComputedStyle(n).top,n},rgbToHsl:function(e,t,n){e/=255,t/=255,n/=255;var o=Math.max(e,t,n),a=Math.min(e,t,n),i=void 0,r=void 0,s=(o+a)/2;if(o===a)i=r=0;else{var l=o-a;switch(r=s>.5?l/(2-o-a):l/(o+a),o){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4}i/=6}return i*=360,r=100*r+"%",s=100*s+"%",{css:"hsl("+i+","+r+","+s+")",h:i,s:r,l:s}},rgbToHex:function(e,t,n){var o=Number(e).toString(16),a=Number(t).toString(16),i=Number(n).toString(16);return 1===o.length&&(o="0"+o),1===a.length&&(a="0"+a),1===i.length&&(i="0"+i),"#"+o+a+i},removeSnapAreas:function(e){document.querySelectorAll(".jsPanel-snap-area").forEach(function(t){e.parentNode&&e.parentNode.removeChild(t)})},resetZi:function(){this.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort(function(e,t){return e.style.zIndex-t.style.zIndex}).forEach(function(e){e.style.zIndex=jsPanel.zi.next()})},resizeit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.defaults.resizeit,t),o=e.parentElement,a=o.tagName.toLowerCase(),i="function"==typeof n.maxWidth?n.maxWidth():n.maxWidth||1e4,r="function"==typeof n.maxHeight?n.maxHeight():n.maxHeight||1e4,s="function"==typeof n.minWidth?n.minWidth():n.minWidth,l="function"==typeof n.minHeight?n.minHeight():n.minHeight,c=new CustomEvent("resizestart",{detail:e.id}),d=new CustomEvent("resize",{detail:e.id}),f=new CustomEvent("resizestop",{detail:e.id}),p=void 0,h=void 0,u=void 0,m=void 0,g=void 0,y=[];return p=this.pOcontainment(n.containment),n.handles.split(",").forEach(function(t){var n=document.createElement("DIV");n.className="jsPanel-resizeit-handle jsPanel-resizeit-"+t.trim(),n.style.zIndex=90,e.append(n)}),Array.prototype.slice.call(e.getElementsByClassName("jsPanel-resizeit-handle")).forEach(function(t){jsPanel.pointerdown.forEach(function(f){t.addEventListener(f,function(t){t.preventDefault(),(y=document.querySelectorAll("iframe")).length&&y.forEach(function(e){e.style.pointerEvents="none"});var f=e.getBoundingClientRect(),b=o.getBoundingClientRect(),v=window.getComputedStyle(o,null),w=parseInt(v.borderLeftWidth,10),j=parseInt(v.borderTopWidth,10),P=v.getPropertyValue("position"),z=t.clientX||t.touches[0].clientX,E=t.clientY||t.touches[0].clientY,x=f.width,S=f.height,C=t.target.classList,T=f.left,L=f.top,F=1e4,A=1e4,k=1e4,q=1e4;e.content.style.pointerEvents="none","body"!==a&&(T=f.left-b.left+o.scrollLeft,L=f.top-b.top+o.scrollTop),"body"===a&&p?(F=document.documentElement.clientWidth-f.left,k=document.documentElement.clientHeight-f.top,A=f.width+f.left,q=f.height+f.top):p&&("static"===P?(F=b.width-f.left+w,k=b.height+b.top-f.top+j,A=f.width+(f.left-b.left)-w,q=f.height+(f.top-b.top)-j):(F=o.clientWidth-(f.left-b.left)+w,k=o.clientHeight-(f.top-b.top)+j,A=f.width+(f.left-b.left)-w,q=e.clientHeight+(f.top-b.top)-j)),p&&(A-=p[3],q-=p[0],F-=p[1],k-=p[2]);var O=window.getComputedStyle(e),M=parseFloat(O.width)-f.width,R=parseFloat(O.height)-f.height,W=parseFloat(O.left)-f.left,D=parseFloat(O.top)-f.top;o!==document.body&&(W+=b.left,D+=b.top),h=function(t){u||(document.dispatchEvent(c),"function"==typeof n.start&&n.start.call(e,e,{width:x,height:S}),jsPanel.front(e)),u=1,document.dispatchEvent(d),(C.contains("jsPanel-resizeit-e")||C.contains("jsPanel-resizeit-se")||C.contains("jsPanel-resizeit-ne"))&&((m=x+(t.clientX||t.touches[0].clientX)-z+M)>=F&&(m=F),m>=i?m=i:m<=s&&(m=s),e.style.width=m+"px"),(C.contains("jsPanel-resizeit-s")||C.contains("jsPanel-resizeit-se")||C.contains("jsPanel-resizeit-sw"))&&((g=S+(t.clientY||t.touches[0].clientY)-E+R)>=k&&(g=k),g>=r?g=r:g<=l&&(g=l),e.style.height=g+"px"),(C.contains("jsPanel-resizeit-w")||C.contains("jsPanel-resizeit-nw")||C.contains("jsPanel-resizeit-sw"))&&((m=x+z-(t.clientX||t.touches[0].clientX)+M)<=i&&m>=s&&m<=A&&(e.style.left=T+(t.clientX||t.touches[0].clientX)-z+W+"px"),m>=A&&(m=A),m>=i?m=i:m<=s&&(m=s),e.style.width=m+"px"),(C.contains("jsPanel-resizeit-n")||C.contains("jsPanel-resizeit-nw")||C.contains("jsPanel-resizeit-ne"))&&((g=S+E-(t.clientY||t.touches[0].clientY)+R)<=r&&g>=l&&g<=q&&(e.style.top=L+(t.clientY||t.touches[0].clientY)-E+D+"px"),g>=q&&(g=q),g>=r?g=r:g<=l&&(g=l),e.style.height=g+"px"),e&&e.contentResize(),window.getSelection().removeAllRanges();var o=window.getComputedStyle(e),a={left:parseFloat(o.left),top:parseFloat(o.top),right:parseFloat(o.right),bottom:parseFloat(o.bottom),width:parseFloat(o.width),height:parseFloat(o.height)};"function"==typeof n.resize&&n.resize.call(e,e,a)},jsPanel.pointermove.forEach(function(e){document.addEventListener(e,h,!1)}),window.addEventListener("mouseout",function(e){null===e.relatedTarget&&jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,h,!1)})},!1)})})}),jsPanel.pointerup.forEach(function(t){document.addEventListener(t,function(t){if(jsPanel.pointermove.forEach(function(e){document.removeEventListener(e,h,!1)}),t.target.classList&&t.target.classList.contains("jsPanel-resizeit-handle")){var o=void 0,a=void 0,i=t.target.className;if(i.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(o=!0),i.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(a=!0),n.grid&&Array.isArray(n.grid)){1===n.grid.length&&(n.grid[1]=n.grid[0]);var r=parseFloat(e.style.width),s=parseFloat(e.style.height),l=r%n.grid[0],c=s%n.grid[1],d=parseFloat(e.style.left),p=parseFloat(e.style.top),m=d%n.grid[0],g=p%n.grid[1];l<n.grid[0]/2?e.style.width=r-l+"px":e.style.width=r+(n.grid[0]-l)+"px",c<n.grid[1]/2?e.style.height=s-c+"px":e.style.height=s+(n.grid[1]-c)+"px",o&&(m<n.grid[0]/2?e.style.left=d-m+"px":e.style.left=d+(n.grid[0]-m)+"px"),a&&(g<n.grid[1]/2?e.style.top=p-g+"px":e.style.top=p+(n.grid[1]-g)+"px")}e&&e.contentResize()}u&&(e.content.style.pointerEvents="inherit",document.dispatchEvent(f),u=void 0,e.saveCurrentDimensions(),"function"==typeof n.stop&&n.stop.call(e,e,{width:parseFloat(e.style.width),height:parseFloat(e.style.height)})),y.length&&y.forEach(function(e){e.style.pointerEvents="inherit"})},!1)}),n.disable&&e.querySelectorAll(".jsPanel-resizeit-handle").forEach(function(e){e.style.pointerEvents="none"}),e},setClass:function(e,t){return t.split(" ").forEach(function(t){return e.classList.add(t)}),e},remClass:function(e,t){return t.split(" ").forEach(function(t){return e.classList.remove(t)}),e},setStyle:function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var o=String(n).replace(/-\w/gi,function(e){return e.substr(-1).toUpperCase()});e.style[o]=t[n]}return e},snapPanel:function(e,t){if(e.currentData.beforeSnap={width:e.currentData.width,height:e.currentData.height},t&&"function"==typeof t)t.call(e,e,e.snappableTo);else if(!1!==t){var n=[0,0];if(e.options.dragit.snap.containment&&e.options.dragit.containment){var o=this.pOcontainment(e.options.dragit.containment),a=e.snappableTo;a.startsWith("left")?n[0]=o[3]:a.startsWith("right")&&(n[0]=-o[1]),a.endsWith("top")?n[1]=o[0]:a.endsWith("bottom")&&(n[1]=-o[2])}e.reposition(e.snappableTo+" "+n[0]+" "+n[1]),e.snapped=e.snappableTo}},create:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],o=void 0,a=void 0;t.config?delete(o=Object.assign({},this.defaults,t.config,t)).config:o=Object.assign({},this.defaults,t),o.id?"function"==typeof o.id&&(o.id=o.id()):o.id="jsPanel-"+(jsPanel.idCounter+=1);var i=document.getElementById(o.id);if(null!==i){i.classList.contains("jsPanel")&&i.front();var r=new jsPanelError("\nNO NEW PANEL CREATED!\nAn element with the ID <"+o.id+"> already exists in the document.");try{throw r}catch(e){n&&n.call(e,e)}return console.error(r.name+":",r.message)}var s=this.pOcontainer(o.container,n);if(s&&s.message)return console.error(s.name+":",s.message);o.maximizedMargin=this.pOcontainment(o.maximizedMargin),o.dragit&&o.dragit.snap&&("object"===_typeof(o.dragit.snap)?o.dragit.snap=Object.assign({},this.defaultSnapConfig,o.dragit.snap):o.dragit.snap=this.defaultSnapConfig),o.template=o.template||!1;var l=o.template?o.template:this.createPanelTemplate();l.options=o,l.status="initialized",l.currentData={},l.header=l.querySelector(".jsPanel-hdr"),l.headerbar=l.header.querySelector(".jsPanel-headerbar"),l.titlebar=l.header.querySelector(".jsPanel-titlebar"),l.headerlogo=l.headerbar.querySelector(".jsPanel-headerlogo"),l.headertitle=l.headerbar.querySelector(".jsPanel-title"),l.controlbar=l.headerbar.querySelector(".jsPanel-controlbar"),l.headertoolbar=l.header.querySelector(".jsPanel-hdr-toolbar"),l.content=l.querySelector(".jsPanel-content"),l.footer=l.querySelector(".jsPanel-ftr"),l.snappableTo=!1,l.snapped=!1;var c=new CustomEvent("jspanelloaded",{detail:o.id}),d=new CustomEvent("jspanelbeforeclose",{detail:o.id}),f=new CustomEvent("jspanelclosed",{detail:o.id}),p=new CustomEvent("jspanelstatuschange",{detail:o.id}),h=new CustomEvent("jspanelbeforenormalize",{detail:o.id}),u=new CustomEvent("jspanelnormalized",{detail:o.id}),m=new CustomEvent("jspanelbeforemaximize",{detail:o.id}),g=new CustomEvent("jspanelmaximized",{detail:o.id}),y=new CustomEvent("jspanelbeforeminimize",{detail:o.id}),b=new CustomEvent("jspanelminimized",{detail:o.id}),v=new CustomEvent("jspanelbeforesmallify",{detail:o.id}),w=new CustomEvent("jspanelsmallified",{detail:o.id}),j=new CustomEvent("jspanelsmallifiedmax",{detail:o.id}),P=new CustomEvent("jspanelbeforeunsmallify",{detail:o.id}),z=new CustomEvent("jspanelfronted",{detail:o.id}),E=l.querySelector(".jsPanel-btn-close"),x=l.querySelector(".jsPanel-btn-maximize"),S=l.querySelector(".jsPanel-btn-normalize"),C=l.querySelector(".jsPanel-btn-smallify"),T=l.querySelector(".jsPanel-btn-smallifyrev"),L=l.querySelector(".jsPanel-btn-minimize");E&&jsPanel.pointerup.forEach(function(e){E.addEventListener(e,function(e){e.preventDefault(),l.close()})}),x&&jsPanel.pointerup.forEach(function(e){x.addEventListener(e,function(e){e.preventDefault(),l.maximize()})}),S&&jsPanel.pointerup.forEach(function(e){S.addEventListener(e,function(e){e.preventDefault(),l.normalize()})}),C&&jsPanel.pointerup.forEach(function(e){C.addEventListener(e,function(e){e.preventDefault(),l.smallify()})}),T&&jsPanel.pointerup.forEach(function(e){T.addEventListener(e,function(e){e.preventDefault(),l.unsmallify()})}),L&&jsPanel.pointerup.forEach(function(e){L.addEventListener(e,function(e){e.preventDefault(),l.minimize()})});var F=jsPanel.extensions;for(var A in F)F.hasOwnProperty(A)&&(l[A]=F[A]);if(l.addToolbar=function(e,t,n){if("header"===e?e=l.headertoolbar:"footer"===e&&(e=l.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(function(t){"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){var o=t.call(l,l);"string"==typeof o?e.innerHTML=o:e.append(o)}else e.append(t);return e.classList.add("active"),e===l.footer&&l.content.classList.remove("jsPanel-content-nofooter"),l.contentResize(),n&&n.call(l,l),l},l.applyBuiltInTheme=function(e){return l.classList.add("jsPanel-theme-"+e.color),l.header.classList.add("jsPanel-theme-"+e.color),e.filling&&(l.content.style.background="",l.content.classList.add("jsPanel-content-"+e.filling)),o.headerToolbar||(l.content.style.background="",l.content.style.borderTop="1px solid "+l.headertitle.style.color),l},l.applyArbitraryTheme=function(e){return l.header.style.backgroundColor=e.colors[0],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(function(t){l.querySelector(t).style.color=e.colors[3]},l),l.querySelectorAll(".jsPanel-controlbar .jsPanel-btn .jsglyph").forEach(function(t){t.style.color=e.colors[3]}),o.headerToolbar?jsPanel.setStyle(l.headertoolbar,{boxShadow:"0 0 1px "+e.colors[3]+" inset",width:"calc(100% + 4px)",marginLeft:"-1px"}):l.content.style.borderTop="1px solid "+e.colors[3],"filled"===e.filling?(l.content.style.backgroundColor=e.colors[0],l.content.style.color=e.colors[3]):"filledlight"===e.filling&&(l.content.style.backgroundColor=e.colors[1]),l},l.applyBootstrapTheme=function(e){var t=e.bstheme,n=$.fn.button.Constructor.VERSION[0];if("4"===n?l.classList.add("bg-"+t):(["panel","panel-"+t].forEach(function(e){l.classList.add(e)}),l.header.classList.add("panel-heading")),"mdb"===e.bs){var o=t+"-color";e.mdbStyle&&(o+="-dark"),l.classList.add(o)}var a=void 0;return a="4"===n?window.getComputedStyle(l).backgroundColor.replace(/\s+/g,""):window.getComputedStyle(l.header).backgroundColor.replace(/\s+/g,""),e.filling?l.setTheme(a+" "+e.filling):l.setTheme(a),l},l.applyThemeBorder=function(e){var t=o.border.split(" ");if(l.style.borderWidth=t[0],l.style.borderStyle=t[1],l.style.borderColor=t[2],l.header.style.borderTopLeftRadius="1px",l.header.style.borderTopRightRadius="1px",e.bs){var n=void 0;n="transparent"===window.getComputedStyle(l.header).backgroundColor?window.getComputedStyle(l).backgroundColor.replace(/\s+/g,""):window.getComputedStyle(l.header).backgroundColor.replace(/\s+/g,""),t[2]?l.style.borderColor=t[2]:l.style.borderColor=n}else-1===jsPanel.themes.indexOf(e.color)&&(t[2]?l.style.borderColor=t[2]:l.style.borderColor=e.colors[0]);return l},l.autopositionRemaining=function(){var e=void 0;["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(function(t){l.classList.contains(t)&&(e=t)}),e&&o.container.querySelectorAll("."+e).forEach(function(e){e.reposition()})},l.calcSizeFactors=function(){var e=window.getComputedStyle(l);if(o.container===document.body)l.hf=parseFloat(l.style.left)/(document.body.clientWidth-parseFloat(l.style.width)),l.vf=parseFloat(l.style.top)/(window.innerHeight-parseFloat(e.height));else{var t=window.getComputedStyle(l.parentElement);l.hf=parseFloat(l.style.left)/(parseFloat(t.width)-parseFloat(l.style.width)),l.vf=parseFloat(l.style.top)/(parseFloat(t.height)-parseFloat(e.height))}},l.clearTheme=function(e){return jsPanel.themes.concat(jsPanel.mdbthemes).forEach(function(e){["panel","jsPanel-theme-"+e,"panel-"+e,e+"-color"].forEach(function(e){l.classList.remove(e)}),l.header.classList.remove("panel-heading","jsPanel-theme-"+e)},l),l.headertitle.classList.remove("panel-title"),l.content.classList.remove("panel-body","jsPanel-content-filled","jsPanel-content-filledlight"),l.footer.classList.remove("panel-footer"),jsPanel.setStyle(l,{backgroundColor:"",borderWidth:"",borderStyle:"",borderColor:""}),jsPanel.setStyle(l.content,{background:"",border:""}),jsPanel.setStyle(l.headertoolbar,{boxShadow:"",width:"",marginLeft:""}),l.header.style.background="",Array.prototype.slice.call(l.controlbar.querySelectorAll(".jsglyph")).concat([l.headerlogo,l.headertitle,l.headertoolbar,l.content]).forEach(function(e){e.style.color=""}),e&&e.call(l,l),l},l.close=function(e){var t=function(){var t=o.id;if(a&&window.clearTimeout(a),l.closeChildpanels(),l.parentNode&&l.parentNode.removeChild(l),document.getElementById(t))return!1;l.removeMinimizedReplacement(),document.dispatchEvent(f),e&&e.call(t,t),o.onclosed&&o.onclosed.call(t,t),l.autopositionRemaining()};if(document.dispatchEvent(d),o.onbeforeclose&&!1===o.onbeforeclose.call(l,l))return l;o.animateOut?(o.animateIn&&jsPanel.remClass(l,o.animateIn),jsPanel.setClass(l,o.animateOut),l.addEventListener("animationend",function(){t()})):t()},l.closeChildpanels=function(e){return l.getChildpanels().forEach(function(e){return e.close()}),e&&e.call(l,l),l},l.contentRemove=function(e){return jsPanel.emptyNode(l.content),e&&e.call(l,l),l},l.contentResize=function(e){var t=window.getComputedStyle(l),n=window.getComputedStyle(l.header),a=window.getComputedStyle(l.footer),i=o.headerRemove?0:n.height,r="none"===a.display?0:a.height,s=parseFloat(t.height)-parseFloat(i)-parseFloat(r)-parseFloat(t.borderTopWidth)-parseFloat(t.borderBottomWidth);return l.content.style.height=s+"px",e&&e.call(l,l),l},l.createMinimizedReplacement=function(){var e=jsPanel.createMinimizedTemplate(),t=window.getComputedStyle(l.headertitle).color,n=o.iconfont,a=e.querySelector(".jsPanel-controlbar");return e.style.backgroundColor="transparent"===window.getComputedStyle(l.header).backgroundColor?window.getComputedStyle(l).backgroundColor:window.getComputedStyle(l.header).backgroundColor,e.id=l.id+"-min",e.querySelector(".jsPanel-headerbar").replaceChild(l.headerlogo.cloneNode(!0),e.querySelector(".jsPanel-headerlogo")),e.querySelector(".jsPanel-titlebar").replaceChild(l.headertitle.cloneNode(!0),e.querySelector(".jsPanel-title")),e.querySelector(".jsPanel-title").style.color=t,a.style.color=t,l.setIconfont(n,e),"enabled"===l.dataset.btnnormalize?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-normalize").addEventListener(t,function(){l.normalize().removeMinimizedReplacement()})}):a.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===l.dataset.btnmaximize?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-maximize").addEventListener(t,function(){l.maximize().removeMinimizedReplacement()})}):a.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===l.dataset.btnclose?jsPanel.pointerup.forEach(function(t){e.querySelector(".jsPanel-btn-close").addEventListener(t,function(){l.removeMinimizedReplacement().close()})}):a.querySelector(".jsPanel-btn-close").style.display="none",e},l.front=function(e){return jsPanel.front(l),document.dispatchEvent(z),e&&e.call(l,l),o.onfronted&&o.onfronted.call(l,l),l},l.getChildpanels=function(){return Array.prototype.slice.call(l.content.querySelectorAll(".jsPanel"))},l.getThemeDetails=function(e){var t=e.toLowerCase().replace(/ /g,""),n={color:!1,colors:!1,filling:!1,bs:!1,bstheme:!1};if("filled"===t.substr(-6,6)?(n.filling="filled",n.color=t.substr(0,t.length-6)):"filledlight"===t.substr(-11,11)?(n.filling="filledlight",n.color=t.substr(0,t.length-11)):(n.filling="",n.color=t),n.colors=jsPanel.calcColors(n.color),n.color.match("-")){var o=n.color.split("-");n.bs=o[0],n.bstheme=o[1],n.mdbStyle=o[2]||void 0}return n},l.isChildpanel=function(){var e=l.closest(".jsPanel-content");return!!e&&e.parentNode},l.maximize=function(e){if(o.onbeforemaximize&&!1===o.onbeforemaximize.call(l,l))return l;document.dispatchEvent(m);var t=l.parentNode,n=o.maximizedMargin;return t===document.body?(l.style.width=document.documentElement.clientWidth-n[1]-n[3]+"px",l.style.height=document.documentElement.clientHeight-n[0]-n[2]+"px",l.style.left=n[3]+"px",l.style.top=n[0]+"px",o.position.fixed||(l.style.left=window.pageXOffset+n[3]+"px",l.style.top=window.pageYOffset+n[0]+"px")):(l.style.width=t.clientWidth-n[1]-n[3]+"px",l.style.height=t.clientHeight-n[0]-n[2]+"px",l.style.left=n[3]+"px",l.style.top=n[0]+"px"),l.contentResize(),l.removeMinimizedReplacement(),l.status="maximized",l.setControls([".jsPanel-btn-maximize",".jsPanel-btn-smallifyrev"]),jsPanel.front(l),document.dispatchEvent(g),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l)?l:(e&&e.call(l,l),o.onmaximized&&o.onmaximized.call(l,l),l)},l.minimize=function(e){if("minimized"===l.status)return l;if(o.onbeforeminimize&&!1===o.onbeforeminimize.call(l,l))return l;if(document.dispatchEvent(y),!document.getElementById("jsPanel-replacement-container")){var t=document.createElement("div");t.id="jsPanel-replacement-container",document.body.append(t)}if(l.style.left="-9999px",l.statusBefore=l.status,l.status="minimized",document.dispatchEvent(b),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l))return l;if(o.minimizeTo){var n=l.createMinimizedReplacement();if("default"===o.minimizeTo)document.getElementById("jsPanel-replacement-container").append(n);else{var a=void 0;if("string"==typeof o.minimizeTo)if("parentpanel"===o.minimizeTo){var i=l.closest(".jsPanel-content").parentNode.querySelectorAll(".jsPanel-minimized-box");a=i[i.length-1]}else a=document.querySelector(o.minimizeTo);else a=o.minimizeTo;a.append(n)}}return e&&e.call(l,l),o.onminimized&&o.onminimized.call(l,l),l},l.normalize=function(e){return"normalized"===l.status?l:o.onbeforenormalize&&!1===o.onbeforenormalize.call(l,l)?l:(document.dispatchEvent(h),l.style.width=l.currentData.width,l.style.height=l.currentData.height,l.contentResize(),l.style.left=l.currentData.left,l.style.top=l.currentData.top,l.removeMinimizedReplacement(),l.status="normalized",l.setControls([".jsPanel-btn-normalize",".jsPanel-btn-smallifyrev"]),jsPanel.front(l),document.dispatchEvent(u),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l)?l:(e&&e.call(l,l),o.onnormalized&&o.onnormalized.call(l,l),l))},l.removeMinimizedReplacement=function(){var e=document.getElementById(l.id+"-min");return e&&e.parentNode.removeChild(e),l},l.reposition=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var a=o.position,i=!0,r=void 0;return t.forEach(function(e){"string"==typeof e||"object"===(void 0===e?"undefined":_typeof(e))?a=e:"boolean"==typeof e?i=e:"function"==typeof e&&(r=e)}),jsPanel.position(l,a),i&&l.saveCurrentPosition(),r&&r.call(l,l),l},l.repositionOnSnap=function(e){var t="0",n="0",a=jsPanel.pOcontainment(o.dragit.containment);o.dragit.snap.containment&&("left-top"===e?(t=a[3],n=a[0]):"right-top"===e?(t=-a[1],n=a[0]):"right-bottom"===e?(t=-a[1],n=-a[2]):"left-bottom"===e?(t=a[3],n=-a[2]):"center-top"===e?(t=a[3]/2-a[1]/2,n=a[0]):"center-bottom"===e?(t=a[3]/2-a[1]/2,n=-a[2]):"left-center"===e?(t=a[3],n=a[0]/2-a[2]/2):"right-center"===e&&(t=-a[1],n=a[0]/2-a[2]/2)),jsPanel.position(l,e),jsPanel.setStyle(l,{left:"calc("+l.style.left+" + "+t+"px)",top:"calc("+l.style.top+" + "+n+"px)"})},l.resize=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=window.getComputedStyle(l),a={width:o.width,height:o.height},i=!0,r=void 0;t.forEach(function(e){"string"==typeof e?a=e:"object"===(void 0===e?"undefined":_typeof(e))?a=Object.assign(a,e):"boolean"==typeof e?i=e:"function"==typeof e&&(r=e)});var s=jsPanel.pOsize(l,a);return l.style.width=s.width,l.style.height=s.height,l.contentResize(),i&&l.saveCurrentDimensions(),r&&r.call(l,l),l},l.saveCurrentDimensions=function(){var e=window.getComputedStyle(l);l.currentData.width=e.width,"normalized"===l.status&&(l.currentData.height=e.height)},l.saveCurrentPosition=function(){var e=window.getComputedStyle(l);l.currentData.left=e.left,l.currentData.top=e.top},l.setControls=function(e,t){return l.header.querySelectorAll(".jsPanel-btn").forEach(function(e){e.style.display="block"}),e.forEach(function(e){var t=l.controlbar.querySelector(e);t&&(t.style.display="none")}),t&&t.call(l,l),l},l.setControlStatus=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"enable",n=arguments[2];if("disable"===t){if("removed"!==l.getAttribute("data-btn"+e)){l.setAttribute("data-btn"+e,"disabled");var o=l.controlbar.querySelector(".jsPanel-btn-"+e);o.style.pointerEvents="none",o.style.opacity=.4,o.style.cursor="default"}}else if("enable"===t){if("removed"!==l.getAttribute("data-btn"+e)){l.setAttribute("data-btn"+e,"enabled");var a=l.controlbar.querySelector(".jsPanel-btn-"+e);a.style.pointerEvents="auto",a.style.opacity=1,a.style.cursor="pointer"}}else if("remove"===t){var i=l.controlbar.querySelector(".jsPanel-btn-"+e);l.controlbar.removeChild(i),l.setAttribute("data-btn"+e,"removed")}return n&&n.call(l,l),l},l.setHeaderControls=function(e){var t=["close","maximize","normalize","minimize","smallify","smallifyrev"],n=o.headerControls;return"string"==typeof n?"none"===n?t.forEach(function(e){l.setControlStatus(e,"remove")}):"closeonly"===n&&t.forEach(function(e){"close"!==e&&l.setControlStatus(e,"remove")}):t.forEach(function(e){n[e]&&l.setControlStatus(e,n[e])}),e&&e.call(l,l),l},l.setHeaderLogo=function(e,t){if("string"==typeof e)if("<"!==e.substr(0,1)){var n=document.createElement("img");n.style.maxHeight=getComputedStyle(l.headerbar).height,n.src=e,jsPanel.emptyNode(l.headerlogo),l.headerlogo.append(n)}else l.headerlogo.innerHTML=e;else jsPanel.emptyNode(l.headerlogo),l.headerlogo.append(e);return t&&t.call(l,l),l},l.setHeaderRemove=function(e){return l.removeChild(l.header),l.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify","smallifyrev"].forEach(function(e){l.setAttribute("data-btn"+e,"removed")}),e&&e.call(l,l),l},l.setHeaderTitle=function(e,t){return"string"==typeof e?l.headertitle.innerHTML=e:"function"==typeof e?(jsPanel.emptyNode(l.headertitle),l.headertitle.innerHTML=e()):(jsPanel.emptyNode(l.headertitle),l.headertitle.append(e)),t&&t.call(l,l),l},l.setIconfont=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"jsglyph",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,n=arguments[2];if("jsglyph"!==e){var o=void 0,a=void 0;if("bootstrap"===e||"glyphicon"===e)o=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-down","glyphicon glyphicon-chevron-up"];else if("fa"===e||"far"===e||"fal"===e||"fas"===e)o=[e+" fa-window-close",e+" fa-window-maximize",e+" fa-window-restore",e+" fa-window-minimize",e+" fa-chevron-down",e+" fa-chevron-up"];else if("material-icons"===e)o=[e,e,e,e,e,e],a=["close","fullscreen","fullscreen_exit","call_received","expand_more","expand_less"];else{if(!Array.isArray(e))return t;o=["custom-control-icon "+e[5],"custom-control-icon "+e[4],"custom-control-icon "+e[3],"custom-control-icon "+e[2],"custom-control-icon "+e[1],"custom-control-icon "+e[0]]}Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach(function(t,n){t.className=o[n],"material-icons"===e&&(t.textContent=a[n])})}return n&&n.call(t,t),t},l.setRtl=function(){[l.header,l.headerbar,l.titlebar,l.controlbar,l.headertoolbar,l.footer].forEach(function(e){e.classList.add("jsPanel-rtl")}),[l.headertitle,l.headertoolbar,l.content,l.footer].forEach(function(e){e.dir="rtl",o.rtl.lang&&(e.lang=o.rtl.lang)})},l.setSize=function(){if(o.panelSize){var e=jsPanel.pOsize(l,o.panelSize);l.style.width=e.width,l.style.height=e.height,l.contentResize()}else if(o.contentSize){var t=jsPanel.pOsize(l,o.contentSize);l.content.style.width=t.width,l.content.style.height=t.height,l.style.width=t.width,l.content.style.width="100%"}return l},l.setTheme=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.theme,t=arguments[1];if(l.clearTheme(),"none"===e)return l.style.backgroundColor="#fff",l;var n=l.getThemeDetails(e);return n.bs?l.applyBootstrapTheme(n):-1!==jsPanel.themes.indexOf(n.color)?l.applyBuiltInTheme(n):l.applyArbitraryTheme(n),o.border?l.applyThemeBorder(n):(l.style.borderWidth="",l.style.borderStyle="",l.style.borderColor=""),t&&t.call(l,l),l},l.smallify=function(e){if("smallified"===l.status||"smallifiedmax"===l.status)return l;if(o.onbeforesmallify&&!1===o.onbeforesmallify.call(l,l))return l;if(document.dispatchEvent(v),"normalized"===l.status&&l.saveCurrentDimensions(),l.style.overflow="hidden",l.style.height=window.getComputedStyle(l.headerbar).height,"normalized"===l.status){if(l.setControls([".jsPanel-btn-normalize",".jsPanel-btn-smallify"]),l.status="smallified",document.dispatchEvent(w),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l))return l}else if("maximized"===l.status&&(l.setControls([".jsPanel-btn-maximize",".jsPanel-btn-smallify"]),l.status="smallifiedmax",document.dispatchEvent(j),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l)))return l;return e&&e.call(l,l),o.onsmallified&&o.onsmallified.call(l,l),l},l.unsmallify=function(e){if("smallified"===l.status||"smallifiedmax"===l.status){if(o.onbeforeunsmallify&&!1===o.onbeforeunsmallify.call(l,l))return l;if(document.dispatchEvent(P),l.style.overflow="visible",jsPanel.front(l),"smallified"===l.status){if(l.style.height=l.currentData.height,l.setControls([".jsPanel-btn-normalize",".jsPanel-btn-smallifyrev"]),l.status="normalized",document.dispatchEvent(u),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l))return l}else"smallifiedmax"===l.status?l.maximize():"minimized"===l.status&&l.normalize();e&&e.call(l,l),o.onunsmallified&&o.onunsmallified.call(l,l)}return l},l.dragit=function(e){var t=Object.assign({},jsPanel.defaults.dragit,o.dragit),n=l.querySelectorAll(t.handles);return"disable"===e?n.forEach(function(e){e.style.pointerEvents="none"}):n.forEach(function(e){e.style.pointerEvents="auto"}),l},l.resizeit=function(e){var t=l.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(function(e){e.style.pointerEvents="none"}):t.forEach(function(e){e.style.pointerEvents="auto"}),l},l.id=o.id,l.classList.add("jsPanel-"+o.paneltype),"standard"===o.paneltype&&(l.style.zIndex=this.zi.next()),s.append(l),l.setTheme(o.theme),o.boxShadow&&l.classList.add("jsPanel-depth-"+o.boxShadow),o.headerRemove?l.setHeaderRemove():(o.headerLogo&&l.setHeaderLogo(o.headerLogo),l.setIconfont(o.iconfont),l.setHeaderTitle(o.headerTitle),l.setHeaderControls()),o.headerToolbar&&l.addToolbar(l.headertoolbar,o.headerToolbar),o.footerToolbar&&l.addToolbar(l.footer,o.footerToolbar),o.content&&("function"==typeof o.content?o.content.call(l,l):"string"==typeof o.content?l.content.innerHTML=o.content:l.content.append(o.content)),o.contentAjax&&this.ajax(l),o.contentFetch&&this.fetch(l),o.rtl&&l.setRtl(),l.setSize(),l.status="normalized",o.position||"cursor"!==o.position?this.position(l,o.position):l.style.opacity=1,document.dispatchEvent(u),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l))return l;if(l.calcSizeFactors(),o.animateIn&&(l.addEventListener("animationend",function(){e.remClass(l,o.animateIn)}),this.setClass(l,o.animateIn)),o.syncMargins){var k=this.pOcontainment(o.maximizedMargin);o.dragit&&(o.dragit.containment=k,o.dragit.snap&&(o.dragit.snap.containment=!0)),o.resizeit&&(o.resizeit.containment=k)}if(o.dragit?(this.dragit(l,o.dragit),document.addEventListener("dragstop",function(e){e.detail===l.id&&l.calcSizeFactors()},!1)):l.titlebar.style.cursor="default",o.resizeit){this.resizeit(l,o.resizeit);var q=void 0;document.addEventListener("resizestart",function(e){e.detail===l.id&&(q=l.status)},!1),document.addEventListener("resizestop",function(e){if(e.detail===l.id&&("smallified"===q||"smallifiedmax"===q||"maximized"===q)&&parseFloat(l.style.height)>parseFloat(window.getComputedStyle(l.header).height)){if(l.setControls([".jsPanel-btn-normalize",".jsPanel-btn-smallifyrev"]),l.status="normalized",document.dispatchEvent(u),document.dispatchEvent(p),o.onstatuschange&&!1===o.onstatuschange.call(l,l))return l;l.calcSizeFactors()}},!1)}if(l.saveCurrentDimensions(),l.saveCurrentPosition(),o.setStatus){var O=o.setStatus;if("smallifiedmax"===O)l.maximize().smallify();else if("smallified"===O)l.smallify();else{var M=O.substr(0,O.length-1);l[M]()}}return o.autoclose&&(a=window.setTimeout(function(){l&&l.close()},o.autoclose)),this.pointerdown.forEach(function(e){l.addEventListener(e,function(e){e.target.closest(".jsPanel-btn-close")||e.target.closest(".jsPanel-btn-minimize")||"standard"!==o.paneltype||l.front()},!1)}),o.onwindowresize&&window.addEventListener("resize",function(e){if(e.target===window){var t=o.onwindowresize,n=l.status,a=window.getComputedStyle(l.parentNode);"maximized"===n&&!0===t?l.maximize():"normalized"!==n&&"smallified"!==n&&"maximized"!==n||("function"==typeof t?t.call(l,e,l):(l.style.left=function(){var e=void 0;return(e=o.container===document.body?(document.body.clientWidth-parseFloat(l.style.width))*l.hf:(parseFloat(a.width)-parseFloat(l.style.width))*l.hf)<=0?0:e+"px"}(),l.style.top=function(){var e=void 0;return(e=o.container===document.body?(window.innerHeight-parseFloat(l.currentData.height))*l.vf:(parseFloat(a.height)-parseFloat(l.currentData.height))*l.vf)<=0?0:e+"px"}()))}},!1),this.pointerup.forEach(function(e){l.addEventListener(e,function(){l.content.style.pointerEvents="inherit"})}),o.callback&&Array.isArray(o.callback)?o.callback.forEach(function(e){e.call(l,l)}):o.callback&&o.callback.call(l,l),n&&n.call(l,l),document.dispatchEvent(c),l}};jsPanel.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}(),window.PointerEvent?(jsPanel.pointerdown=["pointerdown"],jsPanel.pointermove=["pointermove"],jsPanel.pointerup=["pointerup"]):"ontouchend"in window?(jsPanel.pointerdown=["touchstart","mousedown"],jsPanel.pointermove=["touchmove","mousemove"],jsPanel.pointerup=["touchend","mouseup"]):(jsPanel.pointerdown=["mousedown"],jsPanel.pointermove=["mousemove"],jsPanel.pointerup=["mouseup"]),document.addEventListener("keydown",function(e){"Escape"!==e.key&&"Esc"!==e.code&&27!==e.keyCode||jsPanel.getPanels(function(){return this.classList.contains("jsPanel")}).some(function(e){return!!e.options.closeOnEscape&&(e.close(),!0)})},!1);