@hpcc-js/layout 2.51.5 → 2.51.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +6 -6
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid2"),require("@hpcc-js/api")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/dgrid2","@hpcc-js/api"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/layout"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid2"],t["@hpcc-js/api"])}(this,function(t,e,i,o){"use strict";function r(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}var l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},l(t,e)};function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var s=function(){return s=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},s.apply(this,arguments)};function a(t,e,i,o){return new(i||(i=Promise))(function(r,l){function n(t){try{a(o.next(t))}catch(t){l(t)}}function s(t){try{a(o.throw(t))}catch(t){l(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,s)}a((o=o.apply(t,e||[])).next())})}function h(t,e){var i,o,r,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},n=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return n.next=s(0),n.throw=s(1),n.return=s(2),"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,s[0]&&(l=0)),l;)try{if(i=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,o=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=e.call(t,l)}catch(t){s=[6,t],o=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(t,e,i){if(i||2===arguments.length)for(var o,r=0,l=e.length;r<l;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function p(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}"function"==typeof SuppressedError&&SuppressedError;p(".layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{overflow:hidden;pointer-events:all;position:relative}");var c=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return n(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=0,r=0,l=this.clientWidth(),n=this.clientHeight();switch(this.units()){case"pixels":o=this.widgetX(),r=this.widgetY(),l=""===this.widgetWidth()?l-o:Number(this.widgetWidth()),n=""===this.widgetHeight()?n-r:Number(this.widgetHeight());break;case"percent":o=this.widgetX()*l/100,r=this.widgetY()*n/100,l=""===this.widgetWidth()?l-o:Number(this.widgetWidth())*l/100,n=""===this.widgetHeight()?n-r:Number(this.widgetHeight())*n/100}i.style("opacity",this.opacity());var s=i.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(s).style("left",o+"px").style("top",r+"px").style("width",l+"px").style("bottom",n+"px").each(function(t){t.resize({width:l,height:n})}),s.exit().each(function(t){t.target(null)}).remove()},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e}(e.HTMLWidget);c.prototype._class+=" layout_AbsoluteSurface",c.prototype.publish("units","percent","set","Units",["pixels","percent"]),c.prototype.publish("widgetX",0,"number","Widget XPos"),c.prototype.publish("widgetY",0,"number","Widget YPos"),c.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),c.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),c.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),c.prototype.publish("opacity",1,"number","Opacity");p(".layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0;overflow:hidden}.layout_Accordion.open>ul{display:block}.layout_Accordion>.collapsible-icon,.layout_Accordion>.collapsible-title{box-sizing:border-box;cursor:pointer}.layout_Accordion>.collapsible-title{-webkit-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);-moz-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);color:#fff;display:block;font-size:13px;height:26px;padding:4px 8px;width:100%}.layout_Accordion li{background-color:#fff}.layout_Accordion>.collapsible-title,.layout_Accordion>ul{background-color:#333}.layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion>ul{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ddd}.layout_Accordion>span,.layout_Accordion>ul{padding-left:0}.layout_Accordion .layout_Accordion>span,.layout_Accordion .layout_Accordion>ul{padding-left:12px}.layout_Accordion>.collapsible-title:before{left:0;padding:4px 8px;position:absolute;top:0}.layout_Accordion>.collapsible-icon{color:#fff;height:24px;position:absolute;right:0;top:0;width:24px}");var u=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._isClosed=!1,e}return n(i,t),i.prototype.pushListItem=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var o=this.content();return t._protected=i,e?o.unshift(t):o.push(t),this.content(o),this},i.prototype.clearListItems=function(){var t=[];for(var e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this},i.prototype.collapseClick=function(t){t.classed("closed")?(this._isClosed=!1,t.classed("open",!0),t.classed("closed",!1)):(this._isClosed=!0,t.classed("open",!1),t.classed("closed",!0))},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var r=this;this._isClosed=this.defaultCollapsed(),o.classed(this._isClosed?"closed":"open",!0),this.titleSpan=o.append("span").classed("collapsible-title",!0),this.iconDiv=o.append("div").classed("collapsible-icon",!0),this.ul=o.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){r.collapseClick(o),r.render()}),this.titleSpan.on("click",function(){r.collapseClick(o),r.render()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this.titleSpan.text(o.title().length>0?o.title()+"":"Accordion ["+o._id+"]");var r=this.ul.selectAll("#"+o._id+" > ul > li").data(this.content(),function(t){return t._id});r.enter().append(function(t){var e=document.createElement("li");if(null!==t._target)return t._target;var i=t.size();if(0===i.width||0===i.height){var r=o.size();t.size({width:r.width,height:r.width})}return t.target(e),e}),r.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);u.prototype._class+=" layout_Accordion",u.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),u.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),u.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),u.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),u.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),u.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),u.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});p('.layout_Surface{border:1px solid #e5e5e5;box-sizing:border-box;height:100%;margin:0;overflow:hidden;width:100%}.layout_Surface.shadow2{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}.layout_Surface>h3{background-color:#e5e5e5;margin:0;padding:2px}.layout_Surface .html-button-container{position:absolute;right:0;top:3px}.layout_Surface>div{padding:8px}.layout_Surface .html-button-container .surface-button{margin-right:5px}.layout_Surface .html-button-container .surface-button i{opacity:.8}.layout_Surface .html-button-container .surface-button:hover{opacity:1}.layout_Surface .html-button-container .surface-button:active{opacity:.5}div[draggable=true].hideDragCellContent.content-icon:before{content:"\\f080";font-family:FontAwesome;font-size:100px;left:calc(50% - 56px);position:absolute;top:calc(50% - 74px)}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:"\\f201"}div[draggable=true].hideDragCellContent.content-icon-Pie:before{content:"\\f200";left:calc(50% - 45px);top:calc(50% - 72px)}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:"\\f1fe"}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:"\\f0e4"}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:"\\f0ce"}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:"\\f11c"}div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before{content:"\\f247"}div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before{content:"\\f278"}');var g=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return n(i,t),i.prototype.widgetSize=function(t,e){var i=this.clientWidth(),o=this.clientHeight();return this.title()&&(o-=this.calcHeight(t)),o-=this.calcFrameHeight(e),{width:i-=this.calcFrameWidth(e),height:o}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var r=this;o.classed("shadow2",this.surfaceShadow()).style("border-width",this.surfaceBorderWidth_exists()?this.surfaceBorderWidth()+"px":null).style("border-color",this.surfaceBorderColor()).style("border-radius",this.surfaceBorderRadius_exists()?this.surfaceBorderRadius()+"px":null).style("background-color",this.surfaceBackgroundColor());var l=o.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);l.enter().insert("h3","div").attr("class","surfaceTitle").merge(l).text(function(t){return t}).style("text-align",this.surfaceTitleAlignment()).style("color",this.surfaceTitleFontColor()).style("font-size",this.surfaceTitleFontSize_exists()?this.surfaceTitleFontSize()+"px":null).style("font-family",this.surfaceTitleFontFamily()).style("font-weight",this.surfaceTitleFontBold()?"bold":"normal").style("background-color",this.surfaceTitleBackgroundColor()).style("padding",this.surfaceTitlePadding_exists()?this.surfaceTitlePadding()+"px":null).style("title",this.altText_exists()?this.altText():null),l.exit().remove();var n=o.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());n.enter().append("button").classed("surface-button",!0).each(function(t,i){var o=r._surfaceButtons[i]=e.select(this).attr("class","surface-button"+(t.class?" "+t.class:"")).attr("id",t.id).style("padding",t.padding).style("width",t.width).style("height",t.height).style("cursor","pointer");"FontAwesome"===t.font?o.style("background","transparent").style("border","none").on("click",function(t){r.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):o.text(function(){return t.label}).on("click",function(t){r.click(t)})}),n.exit().each(function(t,i){var o=e.select(this);delete r._surfaceButtons[i],o.remove()});var s=o.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(r.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(s).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){var i=r.widgetSize(o.select("h3"),e.select(this));i.width<0&&(i.width=0),i.height<0&&(i.height=0),t.resize({width:i.width,height:i.height})}),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},i.prototype.click=function(t){},i}(e.HTMLWidget);g.prototype._class+=" layout_Surface",g.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),g.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),g.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),g.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),g.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),g.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),g.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),g.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),g.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),g.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});p(".layout_Cell .update-indicator{border-style:solid;border-width:0;box-sizing:border-box;left:0;padding:0;pointer-events:none;position:absolute;top:0;z-index:1000}");var f=function(t){function i(){var e=t.call(this)||this;return e._indicateTheseIds=[],e}return n(i,t),i.prototype.indicateTheseIds=function(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;i.classed("layout_Surface",!0).on("mouseenter",function(){o.onMouseEnter()}).on("mouseleave",function(){o.onMouseLeave()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i)},i.prototype.onMouseEnter=function(){for(var t=this.indicateTheseIds(),i=this.indicatorOpacity(),o=this.indicatorBorderColor(),r=this.indicatorGlowColor(),l=0;l<t.length;l++){var n=e.select("#"+t[l]),s=n.datum();n&&s&&n.append("div").attr("class","update-indicator").style("width",s.width()+"px").style("height",s.height()+"px").style("opacity",i).style("border-color",o).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+r).style("-moz-box-shadow","inset 0px 0px 30px 0px "+r).style("box-shadow","inset 0px 0px 30px 0px "+r)}},i.prototype.onMouseLeave=function(){for(var t=this.indicateTheseIds(),i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()},i}(g);f.prototype._class+=" layout_Cell",f.prototype.publish("gridRow",0,"number","Grid Row Position",null,{tags:["Private"]}),f.prototype.publish("gridCol",0,"number","Grid Column Position",null,{tags:["Private"]}),f.prototype.publish("gridRowSpan",1,"number","Grid Row Span",null,{tags:["Private"]}),f.prototype.publish("gridColSpan",1,"number","Grid Column Span",null,{tags:["Private"]}),f.prototype.publish("indicatorGlowColor","#EEEE11","html-color","Glow color of update-indicator",null,{tags:["Basic"]}),f.prototype.publish("indicatorBorderColor","#F48A00","html-color","Border color of update-indicator",null,{tags:["Basic"]}),f.prototype.publish("indicatorOpacity",.8,"number","Opacity of update-indicator",null,{tags:["Basic"]});p(".layout_Border{height:100%;width:100%}.layout_Border>.border-content{height:100%;position:relative;width:100%}.layout_Border>.borderHandle{background-color:#444;height:6px;opacity:.3;position:absolute;visibility:hidden;width:6px}.layout_Border.design-mode>.borderHandle{visibility:visible}.layout_Border>.borderHandle:hover{background-color:#666}.layout_Border>.borderHandle.borderHandleDisabled{display:none}.layout_Border>.borderHandle_bottom,.layout_Border>.borderHandle_top{cursor:ns-resize}.layout_Border>.borderHandle_left,.layout_Border>.borderHandle_right{cursor:ew-resize}.layout_Border .cell{border:1px solid #e5e5e5;border-radius:5px;display:inline-block;overflow:hidden}.layout_Border .cell h2{margin:0;-webkit-margin:0;padding-top:4px;text-align:center}.layout_Border .layout_BorderCell.over{border:2px dashed #000}.layout_Border .dragItem{opacity:.33;z-index:-1}.layout_Border .notDragItem{opacity:1;z-index:-1}.layout_Border div[draggable=true]{cursor:default;opacity:.75}.layout_Border div[draggable=true] .dragHandle{opacity:1}.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_n,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_ne,.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_se,.layout_Border div[draggable=true] .dragHandle_sw{background-color:#333}.layout_Border div[draggable=true] .dragHandle_nw{cursor:nw-resize}.layout_Border div[draggable=true] .dragHandle_n{cursor:n-resize}.layout_Border div[draggable=true] .dragHandle_ne{cursor:ne-resize}.layout_Border div[draggable=true] .dragHandle_e{cursor:e-resize}.layout_Border div[draggable=true] .dragHandle_se{cursor:se-resize}.layout_Border div[draggable=true] .dragHandle_s{cursor:s-resize}.layout_Border div[draggable=true] .dragHandle_sw{cursor:sw-resize}.layout_Border div[draggable=true] .dragHandle_w{cursor:w-resize}.layout_Border div[draggable=false]>div>.dragHandle{display:none}.layout_Border .grid-drop-target{background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 8px);border:2px dashed #7f8c8d;border-radius:0;box-sizing:border-box;position:fixed}.layout_Border .grid-drop-target.drop-target-over{background:repeating-linear-gradient(-45deg,transparent,transparent 6px,rgba(17,155,215,.1) 0,rgba(17,155,215,.1) 12px);border:2px dashed #179bd7}");var y=function(t){function i(){var i=t.call(this)||this;return i.lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100),i._tag="div",i._colCount=0,i._rowCount=0,i._colSize=0,i._rowSize=0,i._shrinkWrapBoxes={},i.content([]),i.sectionTypes([]),i}return n(i,t),i.prototype.watchWidget=function(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){var e=this;this._watch[t.id()]=t.monitor(function(t,i,o){o!==i&&e.lazyPostUpdate()})}},i.prototype.applyLayoutType=function(){var t=this.borderLayoutObject();this.content().forEach(function(e,i){e._fixedLeft=t[this.sectionTypes()[i]].left,e._fixedTop=t[this.sectionTypes()[i]].top,e._fixedWidth=t[this.sectionTypes()[i]].width,e._fixedHeight=t[this.sectionTypes()[i]].height,e._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[i])},this)},i.prototype.cellSpecificDragHandles=function(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}},i.prototype.borderLayoutObject=function(t){var e,i,o,r,l,n,s,a,h={},d=this,p=this.target().getBoundingClientRect();p.top,p.left,p.bottom,p.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute("width")),parseFloat(this.target().getAttribute("height"))):(p.width,p.height),-1!==this.sectionTypes().indexOf("top")&&(e=this.topSize(),i=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(e=this._shrinkWrapBoxes.top.height+this.gutter(),i=0)),-1!==this.sectionTypes().indexOf("bottom")&&(o=this.bottomSize(),r=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(o=this._shrinkWrapBoxes.bottom.height+this.gutter(),r=0)),-1!==this.sectionTypes().indexOf("left")&&(l=this.leftSize(),n=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(l=this._shrinkWrapBoxes.left.width+this.gutter(),n=0)),-1!==this.sectionTypes().indexOf("right")&&(s=this.rightSize(),a=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(s=this._shrinkWrapBoxes.right.width+this.gutter(),a=0));var c=b({width:{px:0,"%":100},height:{px:e,"%":i},top:{px:0,"%":0},left:{px:0,"%":0}}),u=b({width:{px:0,"%":100},height:{px:o,"%":r},top:{px:0,"%":100},left:{px:0,"%":0}});u.top-=u.height;var g=b({width:{px:l,"%":n},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":0}}),f=b({width:{px:s,"%":a},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":100}});f.left-=f.width;var y=b({width:{px:-f.width-g.width,"%":100},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:g.width,"%":0}});return h.top=c,h.bottom=u,h.right=f,h.left=g,h.center=y,h;function b(t){return t.width.px=void 0!==t.width.px?t.width.px:0,t.width["%"]=void 0!==t.width["%"]?t.width["%"]:0,t.height.px=void 0!==t.height.px?t.height.px:0,t.height["%"]=void 0!==t.height["%"]?t.height["%"]:0,{width:t.width.px+t.width["%"]/100*d.width(),height:t.height.px+t.height["%"]/100*d.height(),top:t.top.px+t.top["%"]/100*d.height()+d.gutter()/2,left:t.left.px+t.left["%"]/100*d.width()+d.gutter()/2}}},i.prototype.clearContent=function(t){if(t){var i=this.sectionTypes().indexOf(t);i>=0&&(this._watch&&this.content()[i]&&delete this._watch[this.content()[i].id()],this.content()[i].target(null),e.select("#"+this.id()+" > div.borderHandle_"+t).classed("borderHandleDisabled",!0),this.content().splice(i,1),this.sectionTypes().splice(i,1))}else this.content().forEach(function(t){return t.target(null),!1}),e.select("#"+this.id()+" > div.borderHandle").classed("borderHandleDisabled",!0),delete this._watch,this.content([]),this.sectionTypes([])},i.prototype.hasContent=function(t,e,i){return this.sectionTypes().indexOf(t)>=0},i.prototype.setContent=function(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){var o=(new f).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(o),this.sectionTypes().push(t)}return this},i.prototype.getCell=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null},i.prototype.getContent=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null},i.prototype.setLayoutOffsets=function(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2},i.prototype.dragStart=function(t){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=this;this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));var r=e.select("#"+o.id()+" > div.borderHandle_"+t);o._handleTop=parseFloat(r.style("top").split("px")[0]),o._handleLeft=parseFloat(r.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY},i.prototype.dragTick=function(t){var i=this,o=e.d3Event(),r=this._dragPrevX-o.sourceEvent.clientX,l=this._dragPrevY-o.sourceEvent.clientY;switch(t){case"top":case"bottom":n(t,l);break;case"right":case"left":n(t,r)}function n(t,o){if(0!==o){var r=e.selectAll("#"+i.id()+" > div.borderHandle"),l=e.select("#"+i.id()+" > div.borderHandle_"+t);l.classed("borderHandle_top")?(l.style("top",i._handleTop-o+"px"),i._cellSizes.topHeight=i._handleTop-o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_right")?(l.style("left",i._handleLeft-o+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+o):l.classed("borderHandle_bottom")?(l.style("top",i._handleTop-o+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_left")&&(l.style("left",i._handleLeft-o+"px"),i._cellSizes.leftWidth=i._handleLeft-o),r.each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",i._cellSizes.width-i._cellSizes.rightWidth+"px"),t.style("top",i._cellSizes.topHeight+3+"px"),t.style("height",i._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.height-i._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",i._cellSizes.leftWidth+"px"),t.style("height",i._cellSizes.leftHeight+"px"),t.style("top",i._cellSizes.topHeight+3+"px"))})}}},i.prototype.dragEnd=function(t){if(t){var i=e.d3Event(),o=this._dragPrevX-i.sourceEvent.clientX,r=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==r&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-r:this.topSize()-r));break;case"right":0!==o&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+o:this.rightSize()+o));break;case"bottom":0!==r&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+r:this.bottomSize()+r));break;case"left":0!==o&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-o:this.leftSize()-o))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()},i.prototype.size=function(t){var i=e.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this.contentDiv&&this.contentDiv.style("width",this._size.width+"px").style("height",this._size.height+"px"),i},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var r=this;o.style("position","relative"),this.contentDiv=o.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"],o.selectAll("div.borderHandle").data(this._borderHandles).enter().append("div").classed("borderHandle",!0).each(function(t){e.select(this).classed("borderHandle_"+t,!0).classed("borderHandleDisabled",null===r.getContent(t))})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._sectionTypeArr=this.sectionTypes();var r=this;o.classed("design-mode",this.designMode()),this.setLayoutOffsets();var l=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),n=l.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+r._sectionTypeArr[i],!0),t.target(this),e.select("#"+r.id()+" > div.borderHandle_"+r._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(l);n.each(function(t,e){var i=r.sectionTypes()[e];void 0!==r[i+"ShrinkWrap"]&&r[i+"ShrinkWrap"]()?(t.render(),r._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete r._shrinkWrapBoxes[i]});var s=e.drag().on("start",function(t,e){r.dragStart.call(r,t,e)}).on("drag",function(t,e){r.dragTick.call(r,t,e)}).on("end",function(t,e){r.dragEnd.call(r,t,e)});this.designMode()?o.selectAll("#"+this.id()+" > div.borderHandle").call(s):o.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);var a=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=a[this.sectionTypes()[e]].left,t._fixedTop=a[this.sectionTypes()[e]].top,t._fixedWidth=a[this.sectionTypes()[e]].width,t._fixedHeight=a[this.sectionTypes()[e]].height,t._dragHandles=[]},this),n.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-r.gutter()+"px"}).style("height",function(t){return t._fixedHeight-r.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",r.designMode()).selectAll(".dragHandle").attr("draggable",r.designMode()),t.surfacePadding(r.surfacePadding()).resize()}),l.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),o.selectAll("#"+this.id()+" > div.borderHandle").each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",r._cellSizes.width+"px"),t.style("top",r._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",r._cellSizes.width-r._cellSizes.rightWidth+"px"),t.style("top",r._cellSizes.topHeight+3+"px"),t.style("height",r._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",r._cellSizes.width+"px"),t.style("top",r._cellSizes.height-r._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",r._cellSizes.leftWidth+"px"),t.style("height",r._cellSizes.leftHeight+"px"),t.style("top",r._cellSizes.topHeight+3+"px"))})},i.prototype.getCellSizes=function(){var t=this;t._cellSizes={};var i=this.element().node().getBoundingClientRect();t._cellSizes.width=i.width,t._cellSizes.height=i.height,this.element().selectAll("#"+this.id()+" > div > div.border-cell").each(function(){var i=e.select(this);if("function"==typeof i.node){var o=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=o.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=o.width,t._cellSizes.leftHeight=o.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=o.width,t._cellSizes.rightHeight=o.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=o.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})},i.prototype.postUpdate=function(t,e){var i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){var e=t.widget().getBBox(!1,!0),o=t.widget().getBBox(!0,!0);e.width===o.width&&e.height===o.height||i.lazyRender()}})},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);y.prototype._class+=" layout_Border",y.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),y.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),y.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),y.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),y.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),y.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),y.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),y.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),y.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});p(".layout_Border2{display:flex;flex-direction:column}.layout_Border2>.body{display:flex;flex-flow:row;margin:0;padding:0}.layout_Border2>.body>.center{flex:1}.layout_Border2>.footer,.layout_Border2>.header{display:block}");var b=function(){function t(t){this._overlay=!1,this._overflowX="visible",this._overflowY="visible",this._div=t}return t.prototype.overlay=function(t){return arguments.length?(this._overlay=t,this):this._overlay},t.prototype.overflowX=function(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX},t.prototype.overflowY=function(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY},t.prototype.element=function(){return this._div},t.prototype.node=function(){return this._div.node()},t.prototype.widget=function(t){return arguments.length?(this._widget!==t&&(this._widget&&this._widget.target(null),this._widget=t,this._widget&&this._widget.target(this._div.node())),this):this._widget},t.prototype.resize=function(t){return this._widget&&(this._div.style("width","".concat(t.width,"px")).style("height","".concat(t.height,"px")),this._widget.resize(t)),this},t.prototype.render=function(t,i,o){return a(this,void 0,void 0,function(){var r,l,n=this;return h(this,function(s){return r=this.overflowX(),this.overlay()||"visible"!==r||(r=null),l=this.overflowY(),this.overlay()||"visible"!==l||(l=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",r).style("overflow-y",l),this._widget?[2,this._widget.renderPromise().then(function(r){if(t&&n._widget.visible()){var l=n._widget.getBBox();return l.width+=8,void 0!==i&&l.height>i&&(l.width+=e.Platform.getScrollbarWidth()),void 0!==o&&l.width>o&&(l.height+=e.Platform.getScrollbarWidth()),n.overlay()?l.height=0:l.height+=4,l}return t?{x:0,y:0,width:0,height:0}:void 0})]:[2,Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)]})})},t}(),_=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return n(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=i.append("header");this._bodyElement=i.append("div").attr("class","body");var r=this._bodyElement.append("div").attr("class","center"),l=this._bodyElement.append("div").attr("class","lhs"),n=this._bodyElement.append("div").attr("class","rhs"),s=i.append("div").attr("class","footer");this._topWA=new b(o),this._centerWA=new b(r),this._leftWA=new b(l),this._rightWA=new b(n),this._bottomWA=new b(s)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topWA.element().style("display",this.showTop()?null:"none"),this._rightWA.element().style("display",this.showRight()?null:"none"),this._bottomWA.element().style("display",this.showBottom()?null:"none"),this._leftWA.element().style("display",this.showLeft()?null:"none"),this.topOverflowX()!==this._topWA.overflowX()&&this._topWA.overflowX(this.topOverflowX()),this.rightOverflowX()!==this._rightWA.overflowX()&&this._rightWA.overflowX(this.rightOverflowX()),this.bottomOverflowX()!==this._bottomWA.overflowX()&&this._bottomWA.overflowX(this.bottomOverflowX()),this.leftOverflowX()!==this._leftWA.overflowX()&&this._leftWA.overflowX(this.leftOverflowX()),this.topOverflowY()!==this._topWA.overflowY()&&this._topWA.overflowY(this.topOverflowY()),this.rightOverflowY()!==this._rightWA.overflowY()&&this._rightWA.overflowY(this.rightOverflowY()),this.bottomOverflowY()!==this._bottomWA.overflowY()&&this._bottomWA.overflowY(this.bottomOverflowY()),this.leftOverflowY()!==this._leftWA.overflowY()&&this._leftWA.overflowY(this.leftOverflowY()),this.element().style("width","".concat(this.width(),"px")).style("height","".concat(this.height(),"px"))},e.prototype.targetNull=function(t){t&&t.target(null)},e.prototype.exit=function(e,i){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),t.prototype.exit.call(this,e,i)},e.prototype.swap=function(t,e){var i=this[t](),o=this[e]();return this.targetNull(i),this.targetNull(o),this["_".concat(t,"WA")].widget(null),this["_".concat(e,"WA")].widget(null),this[t](o),this[e](i),this},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){i._topWA?i._topWA.widget(i.top()).overlay(i.topOverlay()).render(!0).then(function(t){return a(i,void 0,void 0,function(){var i,o,r,l,n,s,a,d,p,c,u,g=this;return h(this,function(h){switch(h.label){case 0:return[4,this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width())];case 1:return i=h.sent(),o=this.height()-(t.height+i.height),[4,this._leftWA.widget(this.left()).render(!0,o)];case 2:return r=h.sent(),[4,this._rightWA.widget(this.right()).render(!0,o)];case 3:return l=h.sent(),this.bottomHeight_exists()&&(i.height=this.bottomHeight()),n=this.width()-(r.width+l.width),s=this.height()-(t.height+i.height),a=this.centerOverflowX(),d=this.centerOverflowY(),p=-1!==["auto","scroll"].indexOf(a),c=-1!==["auto","scroll"].indexOf(d),(p||c)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bodyElement.style("height","".concat(s,"px")),u=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:t.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:r.width,height:s}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:l.width,height:s}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()],Promise.all(u).then(function(t){e&&e(g)}),[2]}})})}):e&&e(i)})},e}(e.HTMLWidget);_.prototype._class+=" layout_Border2",_.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),_.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),_.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),_.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),_.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),_.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),_.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),_.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),_.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),_.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),_.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});p(".layout_Carousel>div{overflow:hidden;position:relative}.layout_Carousel>div>.carouselItem{position:absolute}");var v=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._prevActive=0,e}return n(i,t),i.prototype.activeWidget=function(){return this.widgets()[this.active()]},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._root=i.append("div").attr("id","".concat(this.id(),"_root"))},i.prototype.update=function(i,o){var r=this;t.prototype.update.call(this,i,o);var l=this.active(),n=this.width();this._root.style("width","".concat(n,"px")).style("height","".concat(this.height(),"px"));var s=this._root.selectAll("#".concat(this.id(),"_root > .carouselItem")).data(this.widgets(),function(t){return t.id()}),a=s.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(s).style("left",function(t,e){return"".concat((e-r._prevActive)*n,"px")}).style("width","".concat(n,"px"));this._prevActive!==l&&(a.style("display",function(t,e){return e===r._prevActive||e===l?null:"none"}).transition().duration(this.transitionDuration()).style("left",function(t,e){return"".concat((e-l)*n,"px")}).on("end",function(t,i){e.select(this).style("display",function(){return i===l?null:"none"})}),this._prevActive=l),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widgets().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){if(!i.visible()||i.isDOMHidden())e&&e(t);else{var o=i.activeWidget();o&&o.resize(i.size()).render(function(i){e&&e(t)})}})},i}(e.HTMLWidget);v.prototype._class+=" layout_Carousel",v.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),v.prototype.publish("active",0,"number","Active widget"),v.prototype.publish("transitionDuration",500,"number","Transition duration");var w=Math.PI,m=2*w,x=1e-6,C=m-x;function S(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function T(){return new S}function B(t){return function(){return t}}S.prototype=T.prototype={constructor:S,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,o){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+o)},bezierCurveTo:function(t,e,i,o,r,l){this._+="C"+ +t+","+ +e+","+ +i+","+ +o+","+(this._x1=+r)+","+(this._y1=+l)},arcTo:function(t,e,i,o,r){t=+t,e=+e,i=+i,o=+o,r=+r;var l=this._x1,n=this._y1,s=i-t,a=o-e,h=l-t,d=n-e,p=h*h+d*d;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>x)if(Math.abs(d*s-a*h)>x&&r){var c=i-l,u=o-n,g=s*s+a*a,f=c*c+u*u,y=Math.sqrt(g),b=Math.sqrt(p),_=r*Math.tan((w-Math.acos((g+p-f)/(2*y*b)))/2),v=_/b,m=_/y;Math.abs(v-1)>x&&(this._+="L"+(t+v*h)+","+(e+v*d)),this._+="A"+r+","+r+",0,0,"+ +(d*c>h*u)+","+(this._x1=t+m*s)+","+(this._y1=e+m*a)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,i,o,r,l){t=+t,e=+e,l=!!l;var n=(i=+i)*Math.cos(o),s=i*Math.sin(o),a=t+n,h=e+s,d=1^l,p=l?o-r:r-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+a+","+h:(Math.abs(this._x1-a)>x||Math.abs(this._y1-h)>x)&&(this._+="L"+a+","+h),i&&(p<0&&(p=p%m+m),p>C?this._+="A"+i+","+i+",0,1,"+d+","+(t-n)+","+(e-s)+"A"+i+","+i+",0,1,"+d+","+(this._x1=a)+","+(this._y1=h):p>x&&(this._+="A"+i+","+i+",0,"+ +(p>=w)+","+d+","+(this._x1=t+i*Math.cos(r))+","+(this._y1=e+i*Math.sin(r))))},rect:function(t,e,i,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +o+"h"+-i+"Z"},toString:function(){return this._}};var P=Math.PI,z=2*P,A={draw:function(t,e){var i=Math.sqrt(e/P);t.moveTo(i,0),t.arc(0,0,i,0,z)}},W={draw:function(t,e){var i=Math.sqrt(e/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},H=Math.sqrt(1/3),k=2*H,I={draw:function(t,e){var i=Math.sqrt(e/k),o=i*H;t.moveTo(0,-i),t.lineTo(o,0),t.lineTo(0,i),t.lineTo(-o,0),t.closePath()}},M=Math.sin(P/10)/Math.sin(7*P/10),O=Math.sin(z/10)*M,F=-Math.cos(z/10)*M,D={draw:function(t,e){var i=Math.sqrt(.8908130915292852*e),o=O*i,r=F*i;t.moveTo(0,-i),t.lineTo(o,r);for(var l=1;l<5;++l){var n=z*l/5,s=Math.cos(n),a=Math.sin(n);t.lineTo(a*i,-s*i),t.lineTo(s*o-a*r,a*o+s*r)}t.closePath()}},L={draw:function(t,e){var i=Math.sqrt(e),o=-i/2;t.rect(o,o,i,i)}},R=Math.sqrt(3),G={draw:function(t,e){var i=-Math.sqrt(e/(3*R));t.moveTo(0,2*i),t.lineTo(-R*i,-i),t.lineTo(R*i,-i),t.closePath()}},E=-.5,Y=Math.sqrt(3)/2,X=1/Math.sqrt(12),V=3*(X/2+1),N={draw:function(t,e){var i=Math.sqrt(e/V),o=i/2,r=i*X,l=o,n=i*X+i,s=-l,a=n;t.moveTo(o,r),t.lineTo(l,n),t.lineTo(s,a),t.lineTo(E*o-Y*r,Y*o+E*r),t.lineTo(E*l-Y*n,Y*l+E*n),t.lineTo(E*s-Y*a,Y*s+E*a),t.lineTo(E*o+Y*r,E*r-Y*o),t.lineTo(E*l+Y*n,E*n-Y*l),t.lineTo(E*s+Y*a,E*a-Y*s),t.closePath()}};function j(){var t=B(A),e=B(64),i=null;function o(){var o;if(i||(i=o=T()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),o)return i=null,o+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:B(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:B(+t),o):e},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o}var U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q=function(t){return t},K=function(t){for(var e=[],i=0,o=t.length;i<o;i++)e[i]=t[o-i-1];return e},J=function(t,i){t.each(function(){var t,o=e.select(this),r=o.text().split(/\s+/).reverse(),l=[];o.attr("y");for(var n=parseFloat(o.attr("dy"))||0,s=o.text(null).append("tspan").attr("x",0).attr("dy",n+"em");t=r.pop();)l.push(t),s.text(l.join(" ")),s.node().getComputedTextLength()>i&&l.length>1&&(l.pop(),s.text(l.join(" ")),l=[t],s=o.append("tspan").attr("x",0).attr("dy",1.2+n+"em").text(t))})},Z={d3_drawShapes:function(t,e,i,o,r,l){"rect"===t?e.attr("height",i).attr("width",o):"circle"===t?e.attr("r",r):"line"===t?e.attr("x1",0).attr("x2",o).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",l)},d3_addText:function(t,e,i,o,r){e.append("text").attr("class",o+"label");var l=t.selectAll("g."+o+"cell text."+o+"label").data(i).text(q);return r&&t.selectAll("g."+o+"cell text."+o+"label").call(J,r),l},d3_calcType:function(t,e,i,o,r,l){var n=t.invertExtent?function(t,e,i){var o=t.range().map(function(o){var r=t.invertExtent(o);return e(r[0])+" "+i+" "+e(r[1])});return{data:t.range(),labels:o,feature:q}}(t,r,l):t.ticks?function(t,e,i){var o=[];if(e.length>1)o=e;else for(var r=t.domain(),l=(r[r.length-1]-r[0])/(e-1),n=0;n<e;n++)o.push(r[0]+n*l);var s=o.map(i);return{data:o,labels:s,feature:function(e){return t(e)}}}(t,i,r):function(t){return{data:t.domain(),labels:t.domain(),feature:function(e){return t(e)}}}(t),s=t.range&&t.range()||t.domain();return n.labels=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],o=arguments[3],r=arguments[4];if("object"===(void 0===e?"undefined":U(e))){if(0===e.length)return t;for(var l=e.length;l<t.length;l++)e.push(t[l]);return e}if("function"==typeof e){for(var n=[],s=t.length,a=0;a<s;a++)n.push(e({i:a,genLength:s,generatedLabels:t,domain:i,range:o,labelDelimiter:r}));return n}return t}(n.labels,o,t.domain(),s,l),e&&(n.labels=K(n.labels),n.data=K(n.data)),n},d3_filterCells:function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),o=i.map(function(t){return t.data}),r=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==o.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==r.indexOf(t)}),t},d3_placement:function(t,e,i,o,r,l){e.attr("transform",i),o.attr("transform",r),"horizontal"===t&&o.style("text-anchor",l)},d3_addEvents:function(t,e){t.on("mouseover.legend",function(t){!function(t,e,i){t.call("cellover",i,e)}(e,t,this)}).on("mouseout.legend",function(t){!function(t,e,i){t.call("cellout",i,e)}(e,t,this)}).on("click.legend",function(t){!function(t,e,i){t.call("cellclick",i,e)}(e,t,this)})},d3_title:function(t,e,i,o){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),o&&t.selectAll("text."+i+"legendTitle").call(J,o);var r=t.select("."+i+"legendCells"),l=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],n=-r.nodes().map(function(t){return t.getBBox().x})[0];r.attr("transform","translate("+n+","+l+")")}},d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};var Q=function(t){function i(i){var o=t.call(this)||this;o._disabled=[],o._symbolTypeMap={circle:A,cross:W,diamond:I,square:L,star:D,triangle:G,wye:N},o._owner=i,o._drawStartPos="origin";var r=o;return o._legendOrdinal=function(){var t=e.scaleLinear(),i="rect",o=15,r=15,l=10,n=2,s=[5],a=void 0,h=[],d="",p=!1,c="",u=Z.d3_defaultLocale,g=Z.d3_defaultFormatSpecifier,f=10,y="middle",b=Z.d3_defaultDelimiter,_=void 0,v="vertical",w=!1,m=void 0,x=void 0,C=e.dispatch("cellover","cellout","cellclick");function S(S){var T=Z.d3_calcType(t,w,s,h,u.format(g),b);S.selectAll("g").data([t]).enter().append("g").attr("class",d+"legendCells"),a&&Z.d3_filterCells(T,a);var B=S.select("."+d+"legendCells").selectAll("."+d+"cell").data(T.data),P=B.enter().append("g").attr("class",d+"cell");P.append(i).attr("class",d+"swatch");var z=S.selectAll("g."+d+"cell "+i+"."+d+"swatch").data(T.data);Z.d3_addEvents(P,C),B.exit().transition().style("opacity",0).remove(),z.exit().transition().style("opacity",0).remove(),z=z.merge(z),Z.d3_drawShapes(i,z,r,o,l,m);var A=Z.d3_addText(S,P,T.labels,d,_);B=P.merge(B);var W=A.nodes().map(function(t){return t.getBBox()}),H=z.nodes().map(function(t){return t.getBBox()});p?z.attr("class",function(t){return d+"swatch "+T.feature(t)}):"line"==i?z.style("stroke",T.feature):z.style("fill",T.feature);var k,I=void 0,M=void 0,O="start"==y?0:"middle"==y?.5:1;"vertical"===v?(k=W.map(function(t,e){return Math.max(t.height,H[e].height)}),I=function(t,i){return"translate(0, "+(e.sum(k.slice(0,i))+i*n)+")"},M=function(t,e){return"translate( "+(H[e].width+H[e].x+f)+", "+(H[e].y+H[e].height/2+5)+")"}):"horizontal"===v&&(I=function(t,e){return"translate("+e*(H[e].width+n)+",0)"},M=function(t,e){return"translate("+(H[e].width*O+H[e].x)+",\n "+(H[e].height+H[e].y+f+8)+")"}),Z.d3_placement(v,B,I,A,M,y),Z.d3_title(S,c,d,x),B.transition().style("opacity",1)}return S.scale=function(e){return arguments.length?(t=e,S):t},S.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(s=t),S):s},S.cellFilter=function(t){return arguments.length?(a=t,S):a},S.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,m=e),S):i},S.shapeWidth=function(t){return arguments.length?(o=+t,S):o},S.shapeHeight=function(t){return arguments.length?(r=+t,S):r},S.shapeRadius=function(t){return arguments.length?(l=+t,S):l},S.shapePadding=function(t){return arguments.length?(n=+t,S):n},S.labels=function(t){return arguments.length?(h=t,S):h},S.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),S):y},S.locale=function(t){return arguments.length?(u=e.formatLocale(t),S):u},S.labelFormat=function(t){return arguments.length?(g=e.formatSpecifier(t),S):S.locale().format(g)},S.labelOffset=function(t){return arguments.length?(f=+t,S):f},S.labelDelimiter=function(t){return arguments.length?(b=t,S):b},S.labelWrap=function(t){return arguments.length?(_=t,S):_},S.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(p=t),S):p},S.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(v=t),S):v},S.ascending=function(t){return arguments.length?(w=!!t,S):w},S.classPrefix=function(t){return arguments.length?(d=t,S):d},S.title=function(t){return arguments.length?(c=t,S):c},S.titleWidth=function(t){return arguments.length?(x=t,S):x},S.textWrap=function(t){return arguments.length?(textWrap=t,S):textWrap},S.on=function(){var t=C.on.apply(C,arguments);return t===C?S:t},S}().shape("path",j().type(A).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){r.onClick(t,this)}).on("cellover",function(t){r.onOver(t,o)}).on("cellout",function(t){r.onOut(t,o)}),o}return n(i,t),i.prototype.isDisabled=function(t){return void 0!==t&&("string"==typeof t?0===t.indexOf("__")||this._disabled.indexOf(t)>=0:t instanceof e.Database.Field?0===t.id().indexOf("__")||this._disabled.indexOf(t.id())>=0:this._disabled.indexOf(t)>=0)},i.prototype.filteredFields=function(){var t=this;switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(function(e){return!t.isDisabled(e)})}return this.fields()},i.prototype.filteredColumns=function(){var t=this;switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(function(e){return!t.isDisabled(e)})}return this.columns()},i.prototype.filteredData=function(){var t=this;switch(this.dataFamily()){case"2D":return this.data().filter(function(e){return!t.isDisabled(e[0])});case"ND":var e={},i=!1;return this.columns().forEach(function(o,r){var l=t.isDisabled(o);e[r]=l,l&&(i=!0)}),i?this.data().map(function(t){return t.filter(function(t,i){return!e[i]})}):this.data()}return this.data()},i.prototype.isRainbow=function(){var t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()},i.prototype.targetWidget=function(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){var e=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(t,i,o,r){switch(t){case"chart":case"columns":case"data":case"paletteID":e.lazyRender()}})}return this},i.prototype.getWidget=function(){return this._targetWidget&&"composite_MultiChart"===this._targetWidget.classID()?this._targetWidget.chart():this._targetWidget},i.prototype.getPalette=function(){var t=this.getWidget();if(t&&t._palette)switch(t._palette.type()){case"ordinal":return e.Palette.ordinal(t._palette.id());case"rainbow":return e.Palette.rainbow(t._palette.id())}return e.Palette.ordinal("default")},i.prototype.getPaletteType=function(){return this.getPalette().type()},i.prototype.fillColorFunc=function(){var t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),function(e,i,o){return t.fillColor(e,i,o)};var i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return function(t,e,o){return i(e)}},i.prototype.fillColor=function(t,e,i){return this.fillColorFunc()(t,e,i)},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._g=i.append("g").attr("class","legendOrdinal")},i.prototype.calcMetaData=function(){var t=[],i=0,o=0,r=this.columns().length;if(this._targetWidget){var l=this.columns();switch(this.getPaletteType()){case"ordinal":var n=this.fillColorFunc(),s=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){s=this.data()[e].slice(1,r).reduce(function(t,e){return t+e},0);var l=this.isDisabled(t[0]);l||(i+=s);var a=t[0]+(!l&&this.showSeriesTotal()?" (".concat(s,")"):""),h=this.textSize(a);return o<h.width&&(o=h.width),[n(t,t[0],!1),t[0],a]},this);break;case"ND":t=this.columns().filter(function(t){return 0!==t.indexOf("__")}).filter(function(t,e){return e>0}).map(function(t,e){s=this.data().reduce(function(t,i){return t+i[e+1]},0);var r=this.isDisabled(l[e+1]),a=t+(!r&&this.showSeriesTotal()?" (".concat(s,")"):"");r||(i+=s);var h=this.textSize(a);return o<h.width&&(o=h.width),[n(void 0,t,!1),t,a]},this);break;default:t=this.columns().map(function(t){return[n(void 0,t,!1),t]},this)}break;case"rainbow":var a=this.getPalette(),h=e.format(this.rainbowFormat()),d=this.getWidget(),p=this.rainbowBins(),c=d._dataMinWeight,u=d._dataMaxWeight,g=(u-c)/(p-1);t.push([a(c,c,u),h(c)]);for(var f=1;f<p-1;++f){var y=g*f;Math.floor(y)>parseInt(t[0][1])&&(y=Math.floor(y)),t.push([a(y,c,u),h(y)])}t.push([a(u,c,u),h(u)])}}return{dataArr:t,total:i,maxLabelWidth:o}},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var r=this.calcMetaData(),l=r.dataArr,n=r.maxLabelWidth,s=r.total,a=this.shapeRadius(),h=this.radiusToSymbolSize(a),d=this.itemPadding();"horizontal"===this.orientation()&&(d+=n-2*a);var p=e.scaleOrdinal().domain(l.map(function(t){return t[1]})).range(l.map(function(t){return t[0]}));this._legendOrdinal.shape("path",j().type(this._symbolTypeMap[this.symbolType()]).size(h)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(d).scale(p).labels(function(t){return l[t.i][2]}),this._g.call(this._legendOrdinal),this.updateDisabled(o,l);var c=this._g.select(".legendCells").node().getBBox(),u=Math.abs(c.x),g=Math.abs(c.y)+1;if("horizontal"===this.orientation())"start"===this.labelAlign()?u+=1:"end"===this.labelAlign()&&(u-=1),this.width()>c.width&&(u+=(this.width()-c.width)/2);else if("vertical"===this.orientation()){if(u+=1,this._containerSize.height>c.height)g+=(this.height()-c.height)/2}this._g.attr("transform","translate(".concat(u,", ").concat(g,")")),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());var f=this._g.selectAll(".legendTotal").data(l.length&&this.showLegendTotal()?[s]:[]),y="Total: ".concat(s),b=-u,_=c.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),f.enter().append("text").classed("legendTotal",!0).merge(f).attr("transform","translate(".concat(b,", ").concat(_,")")).text(y),f.exit().remove()},i.prototype.updateDisabled=function(t,e){var i=this;t.style("cursor","pointer").selectAll("path.swatch").filter(function(t,i){return i<e.length}).style("stroke",function(t,i){return e[i][0]}).style("fill",function(t,o){return i._disabled.indexOf(t)<0?e[o][0]:"white"})},i.prototype.postUpdate=function(e,i){var o;this._boundingBox&&(o=this._boundingBox.width,this._boundingBox.width=this._size.width),t.prototype.postUpdate.call(this,e,i),void 0!==o&&(this._boundingBox.width=o),this._parentRelativeDiv.style("overflow","hidden")},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.radiusToSymbolSize=function(t){var e=Math.pow(t,2)*Math.PI;switch(this.symbolType()){case"star":return.45*e;case"triangle":return.65*e;case"cross":case"diamond":case"wye":return.75*e;case"circle":return e;case"square":return 1.3*e}},i.prototype.onClick=function(t,e){if("ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":var i=this._disabled.indexOf(t);i<0?this._disabled.push(t):this._disabled.splice(i,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}},i.prototype.onOver=function(t,e){if(o.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}},i.prototype.onOut=function(t,e){if(o.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}},i.prototype.onDblClick=function(t,e){},i.prototype.onMouseOver=function(t,e){},i.prototype.resize=function(e){var i;if(this.fitToContent()){this._containerSize=e;var o=this.getBBox();e.width>o.width&&(o.width=e.width),e.height>o.height&&(o.height=e.height),i=t.prototype.resize.apply(this,[s({},o)])}else i=t.prototype.resize.apply(this,arguments);return i},i}(e.SVGWidget);Q.prototype._class+=" layout_Legend",Q.prototype.publish("title","","string","Title"),Q.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),Q.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),Q.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),Q.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),Q.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:function(t){return!t.isRainbow()}}),Q.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:function(t){return!t.isRainbow()}}),Q.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),Q.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),Q.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),Q.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),Q.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),Q.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:function(t){return"vertical"===t.orientation()}});p(".layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-x:hidden;overflow-y:scroll}.layout_Modal-annotations,.layout_Modal-title{position:absolute}.layout_Modal-closeButton{cursor:pointer}.layout_Modal-closeButton:hover{opacity:.7}.layout_Modal-closeButton:active{opacity:.5}.layout_Modal-fade{background-color:#000;opacity:.5;position:fixed;z-index:10000}.layout_Modal-content{background-color:#fff;position:fixed;z-index:10100}.layout_Modal-fade-hidden{display:none}.layout_Modal-fadeClickable{cursor:pointer}");var $=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return n(e,t),e.prototype.closeModal=function(){this.visible(!1)},e.prototype.getRelativeTarget=function(){var t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()))?t:!t&&(t=this.locateAncestor("layout_Grid"))&&t.element?t.element().node():document.body},e.prototype.setModalSize=function(){null!==this.fixedHeight()&&null!==this.fixedWidth()?this._modal.style("height",this.fixedHeight()).style("width",this.fixedWidth()).style("min-height",null).style("min-width",null).style("max-height",null).style("max-width",null):(this.minHeight()||this.minWidth())&&this._modal.style("min-height",this.minHeight()).style("min-width",this.minWidth()).style("max-height",this.maxHeight()).style("max-width",this.maxWidth());var t=this._modal.node().getBoundingClientRect(),e=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style("height",t.height-e.height+"px").style("width",t.width),t},e.prototype.setFadePosition=function(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")},e.prototype.setModalPosition=function(t){var e=this.setModalSize();if(null!==this.fixedTop()&&null!==this.fixedLeft())this._modal.style("top","calc(".concat(this.fixedTop()," + ").concat(t.top,"px)")).style("left","calc(".concat(this.fixedLeft()," + ").concat(t.left,"px)"));else if(null!==this.fixedHeight()&&null!==this.fixedWidth())this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px");else if(this.minHeight()||this.minWidth()){var i=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-i.height/2+"px").style("left",t.left+t.width/2-i.width/2+"px")}},e.prototype.resize=function(e){return t.prototype.resize.call(this),this._modal&&this.setModalSize(),this},e.prototype.resizeBodySync=function(t,e){var i=this._modalHeader.node().getBoundingClientRect();return this._modal.style("width",t+"px").style("height",e+i.height+"px").style("min-width",t+"px").style("min-height",e+i.height+"px"),this._modalHeader.style("width",t+"px"),this._modalBody.style("width",t+"px").style("height",e+"px"),this.minWidth(t+"px").minHeight(e+i.height+"px").resize({height:e+i.height,width:t})},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._fade=i.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());var r=2*this.titleFontSize();this._modal=i.append("div").classed("layout_Modal-content",!0),this._modalHeader=this._modal.append("div").classed("layout_Modal-header",!0).style("color",this.titleFontColor()).style("font-size",this.titleFontSize()+"px").style("height",r+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height","calc( 100% - ".concat(r,"px )")).style("overflow-x",this.overflowX()).style("overflow-y",this.overflowY()),this._modalHeader.append("div").classed("layout_Modal-title",!0).style("line-height",this.titleFontSize()+"px").style("top",this.titleFontSize()/2+"px").style("left",this.titleFontSize()/2+"px").text(this.formattedTitle()),this._modalHeaderAnnotations=this._modalHeader.append("div").classed("layout_Modal-annotations",!0),this._modalHeaderCloseButton=this._modalHeaderAnnotations.append("div").classed("layout_Modal-closeButton",!0).html('<i class="fa fa-close"></i>'),this._modalHeaderAnnotations.style("line-height",this.titleFontSize()+"px").style("right",this.titleFontSize()/2+"px").style("top",this.titleFontSize()/2+"px"),this._modalHeaderCloseButton.on("click",function(){o.closeModal()}),this._fade.on("click",function(t){o.enableClickFadeToClose()&&o.closeModal()})},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();var o=this._relativeTarget.getBoundingClientRect();this.setFadePosition(o),this.setModalPosition(o),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()},e.prototype.exit=function(e,i){this._widget&&this._widget.target(null),t.prototype.exit.call(this,e,i)},e.prototype.formattedTitle=function(){var t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()},e}(e.HTMLWidget);$.prototype._class+=" layout_Modal",$.prototype.publish("title",null,"string","title"),$.prototype.publish("widget",null,"widget","widget"),$.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),$.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),$.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),$.prototype.publish("show",!0,"boolean","show"),$.prototype.publish("showFade",!0,"boolean","showFade"),$.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),$.prototype.publish("minWidth","400px","string","minWidth"),$.prototype.publish("minHeight","400px","string","minHeight"),$.prototype.publish("maxWidth","800px","string","maxWidth"),$.prototype.publish("maxHeight","800px","string","maxHeight"),$.prototype.publish("fixedWidth",null,"string","fixedWidth"),$.prototype.publish("fixedHeight",null,"string","fixedHeight"),$.prototype.publish("fixedTop",null,"string","fixedTop"),$.prototype.publish("fixedLeft",null,"string","fixedLeft"),$.prototype.publish("overflowX","hidden","string","overflowX"),$.prototype.publish("overflowY","scroll","string","overflowY");p(".layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}");var tt=function(t){function o(){var o=t.call(this)||this;return o._legend=new Q(o).enableOverflow(!0),o._progressBar=new e.ProgressBar,o._autoScale=!1,o._resolutions={tiny:{width:100,height:100},small:{width:300,height:300}},o._modal=new $,o._toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",function(){return""!==o.description()}).on("click",function(){if(o._toggleInfo.selected()){o._modal.title(o.title()).widget((new e.Text).text(o.description())).show(!0).render();var t=o._modal._close;o._modal._close=function(){o._toggleInfo.selected(!1).render(),o._modal._close=t}}}).on("mouseMove",function(){}).on("mouseOut",function(){}),o._toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",function(){o.dataVisible(o._toggleData.selected()),o.render()}),o._buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",function(){o.downloadCSV()}),o._buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",function(){o.downloadPNG()}),o._toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",function(){var t=o._toggleLegend.selected();"bottom"===o.legendPosition()?o.showBottom(t):"right"===o.legendPosition()&&o.showRight(t),o.legendVisible(t),o.render()}),o._spacer=new e.Spacer,o._titleBar=(new e.TitleBar).buttons([o._toggleData,o._buttonDownload,o._buttonDownloadImage,o._spacer,o._toggleLegend]),o._carousel=new v,o._table=new i.Table,o._hideLegendToggleList=["dgrid_Table"],o._tag="div",o}return n(o,t),o.prototype.fields=function(e){return arguments.length?(t.prototype.fields.call(this,e),this._legend.fields(e),this.refreshFields(),this):t.prototype.fields.call(this)},o.prototype.refreshFields=function(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this},o.prototype.columns=function(e,i){return arguments.length?(t.prototype.columns.call(this,e,i),this._legend.columns(e,i),this.refreshColumns(),this):t.prototype.columns.call(this)},o.prototype.refreshColumns=function(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this},o.prototype.data=function(e){return arguments.length?(t.prototype.data.call(this,e),this._legend.data(e),this.refreshData(),this):t.prototype.data.call(this)},o.prototype.refreshData=function(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this},o.prototype.highlight=function(t){return arguments.length?(this._highlight=t,this):this._highlight},o.prototype.startProgress=function(){this._progressBar.start()},o.prototype.finishProgress=function(){this._progressBar.finish()},o.prototype.buttons=function(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()},o.prototype.downloadCSV=function(){var t=this.downloadTitle()?this.downloadTitle():this.title()?this.title():"data",i=this.downloadTimestampSuffix()?"_"+e.Utility.timestamp():"";return e.Utility.downloadString("CSV",this._widget.export("CSV"),t+i),this},o.prototype.downloadPNG=function(){var t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this},o.prototype.highlightColumn=function(t){if(t){var i="series-".concat(this.cssTag(t));this._centerWA.element().selectAll(".series").each(function(){var t=e.select(this),o=t.classed(i);t.classed("highlight",o).classed("lowlight",!o)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this},o.prototype.getResponsiveMode=function(){return this.enableAutoscaling()?this._autoScale?this.size().width<=this._resolutions.tiny.width||this.size().height<=this._resolutions.tiny.height?"tiny":this.size().width<=this._resolutions.small.width||this.size().height<=this._resolutions.small.height?"small":"regular":"regular":"none"},o.prototype.setOrigSize=function(){this._orig_size=JSON.parse(JSON.stringify(this.size()))},o.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._modal.target(this.target()).relativeTargetId(this.id()),this.top(this._titleBar),this.center(this._carousel),this._legend.targetWidget(this._widget).orientation("vertical").title("").visible(!1),this._progressBar.enter(e,i),this.setOrigSize()},o.prototype.preUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")},o.prototype.preUpdateSmall=function(t){var e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);var o=this._scale===e;this.size({width:o?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:o?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),t.select("div.title-icon").style("position","static"),t.selectAll("lhs").style("display","none"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.style("transform","scale(".concat(this._scale,")"))},o.prototype.preUpdateRegular=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.select("div.title-icon").style("position","static"),t.style("transform","translate(0px,0px) scale(1)")},o.prototype.update=function(e,i){var o=this;if(t.prototype.update.call(this,e,i),this._table&&this.widget_exists()&&this.widget().class().indexOf("chart_XYAxis")>=0){var r=this.widget();this._table.columns().forEach(function(t,e){switch(0===e?r.xAxisType():r.yAxisType()){case"linear":case"log":case"pow":o._table.columnType(t,"number");break;case"time":o._table.columnType(t,"time");break;default:o._table.columnType(t,"string")}o._table.columnPattern(t,0===e?r.xAxisTypeTimePattern():r.yAxisTypeTimePattern()),o._table.columnFormat(t,0===e?r.xAxisTickFormat():r.yAxisTickFormat())})}},o.prototype.preUpdate=function(i,o){switch(t.prototype.preUpdate.call(this,i,o),this._prevLegendPosition!==this.legendPosition()&&(null!==this._legend.target()&&this._legend.target(null),void 0!==this._prevLegendPosition?this.swap(this._prevLegendPosition,this.legendPosition()):this[this.legendPosition()](this._legend),"right"===this.legendPosition()?(this.rightOverflowX("hidden"),this.rightOverflowY("auto"),this.bottomOverflowX("visible"),this.bottomOverflowY("visible")):(this.rightOverflowX("visible"),this.rightOverflowY("visible"),this.bottomOverflowX("auto"),this.bottomOverflowY("hidden")),this._prevLegendPosition=this.legendPosition()),this._prevdataVisible!==this.dataVisible()&&(this._prevdataVisible=this.dataVisible(),this._toggleData.selected(this._prevdataVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible),this._carousel.active(this._prevdataVisible?1:0)),this._prevlegendVisible!==this.legendVisible()&&(this._prevlegendVisible=this.legendVisible(),this._toggleLegend.selected(this._prevlegendVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(o);break;case"small":this.preUpdateSmall(o);break;case"regular":this.preUpdateRegular(o)}var r="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(r._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily()&&(this._prevChartDataFamily=this._legend.dataFamily(),"any"===this._prevChartDataFamily))this._toggleLegend.selected(!1),this._legend.visible(!1);if(o.style("box-shadow",this.highlight()?"inset 0px 0px 0px ".concat(this.highlightSize(),"px ").concat(this.highlightColor()):"none"),-1!==this._hideLegendToggleList.indexOf(r.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==r){this._prevChart=r;var l=r?r._titleBar||r._iconBar:void 0;if(l&&l instanceof e.IconBar){this._prevButtons=this._prevButtons||d([],this.buttons(),!0);var n=d(d(d([],l.buttons(),!0),[new e.Spacer],!1),this._prevButtons,!0);l.buttons([]).render(),this.buttons(n)}else this._prevButtons&&this.buttons(this._prevButtons)}var s=[];this.dataButtonVisible()||s.push(this._toggleData),this.downloadButtonVisible()||s.push(this._buttonDownload),this.downloadImageButtonVisible()||s.push(this._buttonDownloadImage),this.legendButtonVisible()||s.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(s).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())},o.prototype.postUpdate=function(e,i){switch(t.prototype.postUpdate.call(this,e,i),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(i);break;case"small":this.postUpdateSmall(i);break;case"regular":this.postUpdateRegular(i)}},o.prototype.postUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none"),t.selectAll("div.data-count").style("visibility","visible").style("font-size",this.titleIconFontSize()/3+"px").style("line-height",this.titleIconFontSize()/3+"px").style("left",this.titleIconFontSize()+"px").text(this.data().length),t.style("transform","translate(0px,0px) scale(1)");var e=t.selectAll("div.title-icon"),i=e.node(),o=t.node().parentElement.getBoundingClientRect();if(i){var r=e.node().getBoundingClientRect(),l=o.height/2;e.style("position","absolute").style("left","calc(50% - ".concat(r.width/2,"px)")).style("top","".concat(l-r.height/2,"px")),t.selectAll("div.data-count").style("position","absolute").style("left","calc(50% + ".concat(r.width/2,"px)")).style("top","".concat(l-r.height/2,"px"))}},o.prototype.postUpdateSmall=function(t){t.selectAll("lhs").style("display","none"),t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden");var e=t.node().getBoundingClientRect(),i=t.node().parentElement.getBoundingClientRect();t.style("transform","translate(".concat(i.x-e.x,"px, ").concat(i.y-e.y,"px) scale(").concat(this._scale,")"))},o.prototype.postUpdateRegular=function(t){t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden")},o.prototype.exit=function(e,i){this._progressBar.exit(e,i),this.right(null),this._legend.target(null),this.center(null),this._carousel.target(null),this.top(null),this._titleBar.target(null),this._modal.target(null),delete this._prevChart,delete this._prevButtons,delete this._prevChartDataFamily,delete this._prevPos,delete this._prevdataVisible,delete this._prevlegendVisible,t.prototype.exit.call(this,e,i)},o.prototype.click=function(t,e,i){},o.prototype.dblclick=function(t,e,i){},o.prototype.vertex_click=function(t,e,i,o){o&&o.vertex},o.prototype.vertex_dblclick=function(t,e,i,o){o&&o.vertex},o.prototype.edge_click=function(t,e,i,o){o&&o.edge},o.prototype.edge_dblclick=function(t,e,i,o){o&&o.edge},o}(_);tt.prototype._class+=" layout_ChartPanel",tt.prototype.publishReset(),tt.prototype.publishProxy("title","_titleBar"),tt.prototype.publish("titleVisible",!0,"boolean"),tt.prototype.publish("titleOverlay",!1,"boolean"),tt.prototype.publishProxy("titleIcon","_titleBar"),tt.prototype.publishProxy("titleIconFont","_titleBar"),tt.prototype.publishProxy("titleFont","_titleBar"),tt.prototype.publishProxy("titleIconFontSize","_titleBar"),tt.prototype.publishProxy("titleFontSize","_titleBar"),tt.prototype.publishProxy("description","_titleBar"),tt.prototype.publishProxy("descriptionFont","_titleBar"),tt.prototype.publishProxy("descriptionFontSize","_titleBar"),tt.prototype.publish("dataVisible",!1,"boolean","Show data table"),tt.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),tt.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),tt.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),tt.prototype.publish("downloadTitle","","string","File name when downloaded"),tt.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),tt.prototype.publish("legendVisible",!1,"boolean","Show legend"),tt.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),tt.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),tt.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),tt.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),tt.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),tt.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),tt.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),tt.prototype.publishProxy("legend_symbolType","_legend","symbolType"),tt.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),tt.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),tt.prototype.publish("enableAutoscaling",!1,"boolean"),tt.prototype.publish("highlightSize",4,"number"),tt.prototype.publish("highlightColor","#e67e22","html-color"),tt.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),tt.prototype.publishProxy("progress_decay","_progressBar","decay"),tt.prototype.publishProxy("progress_size","_progressBar","size"),tt.prototype.publishProxy("progress_color","_progressBar","color"),tt.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),tt.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),tt.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),tt.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),tt.prototype.widget=function(t){if(!arguments.length)return this._widget;this._carousel.widgets([t,this._table]),this._widget=t,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());var e=this,i=this._widget;return i.click=function(){e.click.apply(e,arguments)},i.dblclick=function(){e.dblclick.apply(e,arguments)},i.vertex_click=function(){e.vertex_click.apply(e,arguments)},i.vertex_dblclick=function(){e.vertex_dblclick.apply(e,arguments)},i.edge_click=function(){e.edge_click.apply(e,arguments)},i.edge_dblclick=function(){e.edge_dblclick.apply(e,arguments)},this};p(".layout_FlexGrid{display:flex}.FlexGrid-list-item{border-style:solid;flex-grow:1;overflow:hidden}");var et=function(t){function i(){return t.call(this)||this}return n(i,t),i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),e.select(i.parentNode).style("height","100%").style("width","100%")},i.prototype.update=function(e,i){var o=this;t.prototype.update.call(this,e,i);var r=this,l=[];this.updateFlexParent(i);var n=i.selectAll(".FlexGrid-list-item").data(this.widgets(),function(t){return t.id()});n.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(n).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",function(t,e){var i=o.widgetsFlexBasis()[e];return void 0!==i?i:o.flexBasis()}).style("flex-grow",function(t,e){var i=o.widgetsFlexGrow()[e];return void 0!==i?i:o.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){var t=this.getBoundingClientRect();l.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:l[e][0]-2*r.borderWidth(),height:l[e][1]-2*r.borderWidth()})}),n.exit().remove()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.updateFlexParent=function(t){var e=this;t.style("height","100%").style("flex-direction","horizontal"===this.orientation()?"row":"column").style("flex-wrap",this.flexWrap()).style("align-items",this.alignItems()).style("align-content",this.alignContent()).style("overflow-x",function(){return e.forceXScroll()||"horizontal"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"}).style("overflow-y",function(){return e.forceYScroll()||"vertical"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"})},i}(e.HTMLWidget);function it(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}et.prototype._class+=" layout_FlexGrid",et.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),et.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),et.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),et.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),et.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:function(t){return"nowrap"!==t.flexWrap()}}),et.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),et.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),et.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),et.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),et.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),et.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),et.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),et.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),et.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),et.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),et.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items");var ot,rt={exports:{}};var lt=(ot||(ot=1,function(t){t.exports=function(){var t=function(t,e){for(var i in this._options=e,this.defaults)this._options.hasOwnProperty(i)||(this._options[i]=this.defaults[i]);this.items=t,this._adjustSizeOfItems(),this.generateGrid()};t.cloneItems=function(t,e){var i,o;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(o in e[i]||(e[i]={}),t[i])e[i][o]=t[i][o];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:function(){var t,e,i,o=this.grid.length,r="\n #|",l="\n --";for(e=0;e<o;e++)r+=" "+this._padNumber(e," "),l+="---";for(r+=l,e=0;e<this._options.lanes;e++)for(r+="\n"+this._padNumber(e," ")+"|",i=0;i<o;i++)r+=" ",r+=(t=this.grid[i][e])?this._padNumber(this.items.indexOf(t),"0"):"--";return r+="\n"},generateGrid:function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},resizeGrid:function(t){var e=0;this._options.lanes=t,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var i=0;i<this.items.length;i++){var o=this.items[i],r=this._getItemPosition(o);this._updateItemPosition(o,this.findPositionForItem(o,{x:e,y:0})),e=Math.max(e,r.x)}this._pullItemsToLeft()},findPositionForItem:function(t,e,i){var o,r,l;for(o=e.x;o<this.grid.length;o++)if(void 0!==i){if(l=[o,i],this._itemFitsAtPosition(t,l))return l}else for(r=e.y;r<this._options.lanes;r++)if(l=[o,r],this._itemFitsAtPosition(t,l))return l;var n=this.grid.length,s=0;return void 0!==i&&this._itemFitsAtPosition(t,[n,i])&&(s=i),[n,s]},moveItemToPosition:function(t,e){var i=this._getItemPosition({x:e[0],y:e[1],w:t.w,h:t.h});this._updateItemPosition(t,[i.x,i.y]),this._resolveCollisions(t)},resizeItem:function(t,e){var i=e.w||t.w,o=e.h||t.h;this._updateItemSize(t,i,o),this._resolveCollisions(t),this._pullItemsToLeft()},getChangedItems:function(t,e){for(var i=[],o=0;o<t.length;o++){var r=this._getItemByAttribute(e,t[o][e]);r.x===t[o].x&&r.y===t[o].y&&r.w===t[o].w&&r.h===t[o].h||i.push(r)}return i},_sortItemsByPosition:function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return i.x!=o.x?i.x-o.x:i.y!=o.y?i.y-o.y:0}.bind(this))},_adjustSizeOfItems:function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];void 0===e.autoSize&&(e.autoSize=0===e.w||0===e.h),e.autoSize&&("horizontal"===this._options.direction?e.h=this._options.lanes:e.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(t,e){var i,o,r=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+r.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+r.w;i++){var l=this.grid[i];if(l)for(o=e[1];o<e[1]+r.h;o++)if(l[o]&&l[o]!==t)return!1}return!0},_updateItemPosition:function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},_updateItemSize:function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},_markItemPositionToGrid:function(t){var e,i,o=this._getItemPosition(t);for(this._ensureColumns(o.x+o.w),e=o.x;e<o.x+o.w;e++)for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]=t},_deleteItemPositionFromGrid:function(t){var e,i,o=this._getItemPosition(t);for(e=o.x;e<o.x+o.w;e++)if(this.grid[e])for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},_ensureColumns:function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},_getItemsCollidingWithItem:function(t){for(var e=[],i=0;i<this.items.length;i++)t!=this.items[i]&&this._itemsAreColliding(t,this.items[i])&&e.push(i);return e},_itemsAreColliding:function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return!(o.x>=i.x+i.w||o.x+o.w<=i.x||o.y>=i.y+i.h||o.y+o.h<=i.y)},_resolveCollisions:function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var o,r,l,n,s=new t([],this._options);t.cloneItems(this.items,s.items),s.generateGrid();for(var a=0;a<i.length;a++){var h=s.items[i[a]],d=this._getItemPosition(h),p=this._getItemPosition(e);if(o=[p.x-d.w,d.y],r=[p.x+p.w,d.y],l=[d.x,p.y-d.h],n=[d.x,p.y+p.h],s._itemFitsAtPosition(h,o))s._updateItemPosition(h,o);else if(s._itemFitsAtPosition(h,l))s._updateItemPosition(h,l);else if(s._itemFitsAtPosition(h,n))s._updateItemPosition(h,n);else{if(!s._itemFitsAtPosition(h,r))return!1;s._updateItemPosition(h,r)}}return t.cloneItems(s.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(t){if(this._sortItemsByPosition(),this._resetGrid(),t){var e=this._getItemPosition(t);this._updateItemPosition(t,[e.x,e.y])}for(var i=0;i<this.items.length;i++){var o=this.items[i],r=this._getItemPosition(o);if(!t||o!=t){var l=this._findLeftMostPositionForItem(o),n=this.findPositionForItem(o,{x:l,y:0},r.y);this._updateItemPosition(o,n)}}},_findLeftMostPositionForItem:function(t){for(var e=0,i=this._getItemPosition(t),o=0;o<this.grid.length;o++)for(var r=i.y;r<i.y+i.h;r++){var l=this.grid[o][r];if(l){var n=this._getItemPosition(l);this.items.indexOf(l)<this.items.indexOf(t)&&(e=n.x+n.w)}}return e},_getItemByAttribute:function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},_padNumber:function(t,e){return t>=10?t:e+t},_getItemPosition:function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},_setItemPosition:function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])}};var e=function(t){for(var e=0;e<t;e++)this.push(null)};return e.prototype=[],t}()}(rt)),rt.exports),nt=it(lt),st=r({__proto__:null,default:nt},[lt]);p('.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{background:#f5f5f5;border-style:solid;border-width:1px;position:absolute}.layout_Grid>.lane{border-radius:0;border-style:none;opacity:.25;pointer-events:none;position:absolute}.layout_Grid>.ddCell.draggable{background-color:#f8f8ff;border-radius:0;border-style:solid;border-width:1px;cursor:move}.layout_Grid>.ddCell.draggable>.resizeHandle{border-style:none;bottom:0;cursor:nwse-resize;height:8px;position:absolute;right:0;width:8px}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{background-color:none;border-color:#a9a9a9;border-style:solid;border-width:0 2px 2px 0;bottom:2px;height:4px;position:absolute;right:2px;width:4px}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 8px)}.layout_Grid>.dragging,.layout_Grid>.resizing{border:1px solid gray;border-radius:0;position:absolute}.layout_Grid>.resizing{background-color:orange;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,orange 0,orange 8px);opacity:.3}.layout_Grid>.ddCell.draggable .common_Widget.selected{background-color:gray;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,rgba(100,0,0,.1) 0,rgba(100,0,0,.1) 8px);border:1px solid red;border-radius:0;position:absolute}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}');var at=st&&nt||st,ht=function(t){function i(){var i=t.call(this)||this;return i._tag="div",i._selectionBag=new e.Utility.Selection(i),i.content([]),i}return n(i,t),i.prototype.getDimensions=function(){var t={width:0,height:0};return this.content().forEach(function(e){t.width<e.gridCol()+e.gridColSpan()&&(t.width=e.gridCol()+e.gridColSpan()),t.height<e.gridRow()+e.gridRowSpan()&&(t.height=e.gridRow()+e.gridRowSpan())},this),t},i.prototype.clearContent=function(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;for(var i=e;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))},i.prototype.setContent=function(t,e,i,o,r,l){if(r=r||1,l=l||1,o=o||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){var n=(new f).gridRow(t).gridCol(e).widget(i).title(o).gridRowSpan(r).gridColSpan(l);this.content().push(n)}return this},i.prototype.sortedContent=function(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})},i.prototype.getCell=function(t,e){var i=null;return this.content().some(function(o){return t>=o.gridRow()&&t<o.gridRow()+o.gridRowSpan()&&e>=o.gridCol()&&e<o.gridCol()+o.gridColSpan()&&(i=o,!0)}),i},i.prototype.getWidgetCell=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e},i.prototype.getContent=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e},i.prototype.cellToGridItem=function(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}},i.prototype.gridItemToCell=function(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)},i.prototype.resetItemsPos=function(){this.origItems.forEach(function(t){var e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)},i.prototype.initGridList=function(){this.itemsMap={},this.items=this.content().map(function(t){var e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new at(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})},i.prototype.killGridList=function(){this.gridList=null,delete this.items,delete this.itemsMap},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),this._scrollBarWidth=e.Platform.getScrollbarWidth();var r=this;this._d3Drag=e.drag().subject(function(t){var e=r.cellToGridItem(t);return{x:e.x*r.cellWidth,y:e.y*r.cellHeight}}).on("start",function(t){if(r.designMode()){e.d3Event().sourceEvent.stopPropagation(),r.initGridList();var i=r.itemsMap[t.id()];r.dragItem=o.append("div").attr("class","dragging").style("transform",function(){return"translate("+i.x*r.cellWidth+"px, "+i.y*r.cellHeight+"px)"}).style("width",function(){return i.w*r.cellWidth-r.gutter()+"px"}).style("height",function(){return i.h*r.cellHeight-r.gutter()+"px"}),r.selectionBagClick(t)}}).on("drag",function(t){if(r.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=r.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+o.w*r.cellWidth>r.snappingColumns()*r.cellWidth&&(i.x=r.snappingColumns()*r.cellWidth-o.w*r.cellWidth),i.y<0&&(i.y=0),i.y+o.h*r.cellWidth>r.snappingRows()*r.cellWidth&&(i.y=r.snappingRows()*r.cellWidth-o.h*r.cellWidth);var l=[Math.max(0,Math.floor((i.x+r.cellWidth/2)/r.cellWidth)),Math.max(0,Math.floor((i.y+r.cellHeight/2)/r.cellHeight))];o.x===l[0]&&o.y===l[1]||("none"!==r.snapping()?(r.resetItemsPos(),r.gridList.moveItemToPosition(o,l)):(o.x=l[0],o.y=l[1]),t.gridCol()===o.x&&t.gridRow()===o.y||(r.items.forEach(r.gridItemToCell),r.updateGrid(!1,100))),r.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return o.w*r.cellWidth+"px"}).style("height",function(){return o.h*r.cellHeight+"px"})}}).on("end",function(){r.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())}),this._d3DragResize=e.drag().subject(function(t){var e=r.cellToGridItem(t);return{x:(e.x+e.w-1)*r.cellWidth,y:(e.y+e.h-1)*r.cellHeight}}).on("start",function(t){if(r.designMode()){e.d3Event().sourceEvent.stopPropagation(),r.initGridList();var i=r.itemsMap[t.id()];r.dragItem=o.append("div").attr("class","resizing").style("transform",function(){return"translate("+i.x*r.cellWidth+"px, "+i.y*r.cellHeight+"px)"}).style("width",function(){return i.w*r.cellWidth-r.gutter()+"px"}).style("height",function(){return i.h*r.cellHeight-r.gutter()+"px"}),r.dragItemPos={x:i.x,y:i.y}}}).on("drag",function(t){if(r.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=r.itemsMap[t.id()],l=[Math.max(0,Math.round(i.x/r.cellWidth)),Math.max(0,Math.round(i.y/r.cellHeight))],n={w:Math.max(1,l[0]-o.x+1),h:Math.max(1,l[1]-o.y+1)};o.w===n.w&&o.h===n.h||("none"!==r.snapping()?(r.resetItemsPos(),r.gridList.resizeItem(o,n)):(o.w=n.w,o.h=n.h),t.gridColSpan()===o.w&&t.gridRowSpan()===o.h||(r.items.forEach(r.gridItemToCell),r.updateGrid(o.id,100))),r.dragItem.style("width",function(){return(1-o.x)*r.cellWidth+i.x-r.gutter()+"px"}).style("height",function(){return(1-o.y)*r.cellHeight+i.y-r.gutter()+"px"})}}).on("end",function(){r.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())})},i.prototype.updateGrid=function(t,e,i){void 0===e&&(e=0),e=e||0;var o=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*o.cellWidth+o.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*o.cellHeight+o.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*o.cellWidth-o.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*o.cellHeight-o.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(o.surfaceShadow()).surfacePadding_default(o.surfacePadding()).surfaceBorderWidth_default(o.surfaceBorderWidth()).surfaceBackgroundColor_default(o.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);var r=this.getDimensions(),l=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=l/r.width,this.cellHeight="all"===this.fitTo()?this.height()/r.height:this.cellWidth,this.designMode()){var n=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),s=Math.floor(n);this.cellWidth=s,this.cellHeight=this.cellWidth}var a=this,h=o.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=h.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,o){!a._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===o||a.gridList||(a.initGridList(),"none"!==a.snapping()&&a.gridList.resizeGrid("horizontal"===a.snapping()?a.snappingRows():a.snappingColumns()),a.items.forEach(a.gridItemToCell),a.updateGrid(t.id(),100),a.killGridList())}),e.select(this).append("div").attr("class","resizeHandle").call(a._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(h),this.divItems.each(function(t){var i=e.select(this);a.designMode()?i.call(a._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),h.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();var d=o.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);d.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){a.selectionBagClear()}).merge(d).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),d.exit().each(function(){a.selectionBagClear()}).remove();var p=o.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);p.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),p.style("display",this.showLanes()?null:"none").style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px").style("background-image","linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)").style("background-size",this.cellWidth+"px "+this.cellHeight+"px"),p.exit().remove()},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype._createSelectionObject=function(t){return{_id:t._id,element:function(){return t._element},widget:t}},i.prototype.selection=function(t){return arguments.length?(this._selectionBag.set(t.map(function(t){return this._createSelectionObject(t)},this)),this):this._selectionBag.get().map(function(t){return t._id})},i.prototype.selectionBagClear=function(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())},i.prototype.selectionBagClick=function(t){if(null!==t){var i=this._createSelectionObject(t);if(e.d3Event().sourceEvent.ctrlKey)this._selectionBag.isSelected(i)?(this._selectionBag.remove(i),this.postSelectionChange()):(this._selectionBag.append(i),this.postSelectionChange());else{var o=this._selectionBag.get();1===o.length&&o[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}},i.prototype.postSelectionChange=function(){},i.prototype.applyLayout=function(t){this.divItems.each(function(e,i){if(t[i]){var o=t[i],r=o[0],l=o[1],n=o[2],s=o[3];e.gridCol(r).gridRow(l).gridColSpan(n).gridRowSpan(s)}}),this.updateGrid(!0)},i.prototype.vizActivation=function(t){},i}(e.HTMLWidget);ht.prototype._class+=" layout_Grid",ht.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),ht.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:function(t){return!t.designMode()}}),ht.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),ht.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),ht.prototype.publish("snappingColumns",12,"number","Snapping Columns"),ht.prototype.publish("snappingRows",16,"number","Snapping Rows"),ht.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),ht.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),ht.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),ht.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),ht.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),ht.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});var dt=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("horizontal"),e.flexWrap_default("nowrap"),e}return n(e,t),e}(et);dt.prototype._class+=" layout_HorizontalList";p(".layout_Layered{pointer-events:none}.layout_Layered>.container>.content{position:absolute}.layout_Layered>.container>.content>div>.common_Widget,.layout_Layered>.container>.content>div>svg>.common_Widget{pointer-events:all}");var pt=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._widgetPlacements=[],e._widgetRatios=[],e}return n(i,t),i.prototype.addLayer=function(t,i,o,r){void 0===i&&(i="default"),void 0===o&&(o=1),void 0===r&&(r=1);var l=this.widgets();return l.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(l),this._widgetPlacements.push(i),this._widgetRatios.push([o,r]),this},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._contentContainer=i.append("div").attr("class","container")},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;i.style("padding",this.surfacePadding()+"px");var r=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});r.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(r).each(function(t,e){var i={width:o.clientWidth(),height:o.clientHeight()},r=o.widgetSize(e,i),l=o.widgetPosition(e,i,r);this.style.top=l.y+"px",this.style.left=l.x+"px",t.resize(r).render()}),r.exit().each(function(t,e){t.target(null)}).remove(),r.order()},i.prototype.widgetSize=function(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}},i.prototype.widgetPosition=function(t,e,i){switch(this._widgetPlacements[t]){default:return{x:0,y:0};case"top":return{x:e.width/2-i.width/2,y:0};case"bottom":return{x:e.width/2-i.width/2,y:e.height-i.height};case"left":return{x:0,y:e.height/2-i.height/2};case"right":return{x:e.width-i.width,y:e.height/2-i.height/2};case"center":return{x:e.width/2-i.width/2,y:e.height/2-i.height/2}}},i}(e.HTMLWidget);pt.prototype._class+=" layout_Layered",pt.prototype.publish("surfacePadding",0,"number","Padding"),pt.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});var ct=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return n(e,t),e.prototype.updateState=function(t){t=t||!this.popupState(),this.popupState(t).render()},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this.widget().target(e),this._originalPosition=this.position()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("visibility",this.popupState()?null:"hidden").style("opacity",this.popupState()?null:0).style("width",this.shrinkWrap()?this.widget().width()+"px":this._size.width+"px").style("height",this.shrinkWrap()?this.widget().height()+"px":this._size.height+"px"),0===this.widget().size().height&&this.widget().resize(this.size())},e.prototype.postUpdate=function(e,i){var o,r;switch(this.centerPopup()){case"container":this._placeholderElement&&(o=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,r=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":o=window.innerWidth/2-this.widget().width()/2,r=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:o=0,r=0,this.position(this._originalPosition)}this.pos({x:o,y:r}),t.prototype.postUpdate.call(this,e,i),i.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e.prototype.click=function(t){},e}(e.HTMLWidget);ct.prototype._class+=" layout_Popup",ct.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),ct.prototype.publish("shrinkWrap",!1,"boolean","The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)",null,{}),ct.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),ct.prototype.publish("top",null,"number","Top position property of popup",null,{}),ct.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),ct.prototype.publish("left",null,"number","Left position property of popup",null,{}),ct.prototype.publish("right",null,"number","Right position property of popup",null,{}),ct.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),ct.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});p(".layout_Tabbed .tab-button{background-color:transparent;background-color:#ccc;border-left:1px solid #ddd;border-right:1px solid #ddd;border-top:1px solid #ddd;display:inline-block;margin-right:4px;padding:2px 2px 4px;position:relative;top:1px}.layout_Tabbed .tab-button.active{background-color:#fff;z-index:999}.layout_Tabbed .on_bottom .tab-button{border-bottom:1px solid #ddd;border-top:none;top:-1px}");var ut=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e}return n(i,t),i.prototype.clearTabs=function(){return this.labels([]),this.widgets([]),this},i.prototype.addTab=function(t,i,o,r){var l=t.size();0===l.width&&0===l.height&&t.size({width:"100%",height:"100%"});var n=this.labels(),s=this.widgets();o&&this.activeTabIdx(this.widgets().length),n.push(i);var a=(new g).widget(t||(new e.Text).text("No widget defined for tab"));return s.push(a),this.labels(n),this.widgets(s),r&&r(a),this},i.prototype.widgetSize=function(t){var e=this.clientWidth(),i=this.clientHeight(),o=this._tabContainer.node().getBoundingClientRect();return void 0!==o.height&&(i-=o.height),{width:e,height:i}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._tabContainer=i.append("div"),this._contentContainer=i.append("div")},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var r=this;o.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);var l=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});l.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){r.click(r.widgets()[e].widget(),t,e),r.activeTabIdx(e).render()}).merge(l).classed("active",function(t,e){return r.activeTabIdx()===e}).text(function(t){return t}),l.exit().remove();var n=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});if(n.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(n).classed("active",function(t,e){return r.activeTabIdx()===e}).style("display",function(t,e){return r.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(r.activeTabIdx()===i),r.activeTabIdx()===i){var o=r.widgetSize(e.select(this));t.surfaceBorderWidth(r.showTabs()?null:0).surfacePadding(r.showTabs()?null:0).resize(o)}}),n.exit().each(function(t,e){t.target(null)}).remove(),"bottom"===this.tabLocation())this._tabContainer.attr("class","on_bottom").style("top",this._contentContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute"),this._contentContainer.style("top",this.surfacePadding_exists()?this.surfacePadding()+"px":null).style("position","absolute");else this._tabContainer.attr("class","on_top").style("top",null).style("position","relative"),this._contentContainer.style("top",this._tabContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute")},i.prototype.click=function(t,e,i){},i}(e.HTMLWidget);ut.prototype._class+=" layout_Tabbed",ut.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),ut.prototype.publish("surfacePadding",4,"number","Padding"),ut.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),ut.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),ut.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),ut.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});function gt(){e.HTMLWidget.call(this),this._tag="div"}p(".layout_Toolbar{background-color:#ddd;height:100%;overflow:hidden;white-space:nowrap}.layout_Toolbar .toolbar-title{display:inline-block;font-weight:700;margin-left:4px;overflow:hidden;position:relative;text-overflow:ellipsis;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);white-space:nowrap}.layout_Toolbar .toolbar-child{float:right;line-height:16px;margin-left:4px;margin-right:4px;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%)}"),gt.prototype=Object.create(e.HTMLWidget.prototype),gt.prototype.constructor=gt,gt.prototype._class+=" layout_Toolbar",gt.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),gt.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),gt.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),gt.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),gt.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]}),gt.prototype.enter=function(t,i){e.HTMLWidget.prototype.enter.apply(this,arguments)},gt.prototype.update=function(t,i){e.HTMLWidget.prototype.update.apply(this,arguments);var o=this;i.attr("title",o.title()).style("background-color",this.backgroundColor());var r=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);r.enter().append("div").classed("toolbar-title",!0).append("span"),r.selectAll("div.toolbar-title > span").style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("color",this.fontColor_exists()?this.fontColor():null).style("font-family",this.fontFamily_exists()?this.fontFamily():null).style("font-weight",this.fontBold_exists()?this.fontBold()?"bold":"normal":null).style("background-color",this.backgroundColor_exists()?this.backgroundColor():null).text(o.title()),r.exit().remove();var l=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});l.enter().insert("div","div.toolbar-title").each(function(t,i){var r=o.widgetClasses()[i]?o.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(r,!0),t.target(this)}),l.exit().each(function(t){t.target(null)}).remove(),l.order()},gt.prototype.render=function(t){var i=this;e.HTMLWidget.prototype.render.call(this,function(e){var o=i.element().node().getBoundingClientRect(),r=o.left+o.width;i.element().selectAll("div.toolbar-child").each(function(t,e){var i=this.getBoundingClientRect();r>i.left&&(r=i.left)}),i.element().select(".toolbar-title").style("width",r-o.left-4+"px"),t&&t(e)})},gt.prototype.exit=function(t,i){e.HTMLWidget.prototype.exit.apply(this,arguments),this.widgets().forEach(function(t){t.target(null)})};var ft=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("vertical"),e.flexWrap_default("nowrap"),e}return n(e,t),e}(et);ft.prototype._class+=" layout_VerticalList",t.AbsoluteSurface=c,t.Accordion=u,t.BUILD_VERSION="2.108.9",t.Border=y,t.Border2=_,t.Carousel=v,t.Cell=f,t.ChartPanel=tt,t.FlexGrid=et,t.Grid=ht,t.HorizontalList=dt,t.Layered=pt,t.Legend=Q,t.Modal=$,t.PKG_NAME="@hpcc-js/layout",t.PKG_VERSION="2.51.5",t.Popup=ct,t.Surface=g,t.Tabbed=ut,t.Toolbar=gt,t.VerticalList=ft,t.WidgetDiv=b});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/dgrid2"),require("@hpcc-js/api")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/dgrid2","@hpcc-js/api"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/layout"]={},t["@hpcc-js/common"],t["@hpcc-js/dgrid2"],t["@hpcc-js/api"])}(this,function(t,e,i,o){"use strict";function r(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}var l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},l(t,e)};function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var s=function(){return s=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},s.apply(this,arguments)};function a(t,e,i,o){return new(i||(i=Promise))(function(r,l){function n(t){try{a(o.next(t))}catch(t){l(t)}}function s(t){try{a(o.throw(t))}catch(t){l(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,s)}a((o=o.apply(t,e||[])).next())})}function h(t,e){var i,o,r,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},n=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return n.next=s(0),n.throw=s(1),n.return=s(2),"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,s[0]&&(l=0)),l;)try{if(i=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,o=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=e.call(t,l)}catch(t){s=[6,t],o=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(t,e,i){if(i||2===arguments.length)for(var o,r=0,l=e.length;r<l;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function p(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}"function"==typeof SuppressedError&&SuppressedError;p(".layout_AbsoluteSurface{pointer-events:none!important}.layout_AbsoluteSurface>.placeholder{overflow:hidden;pointer-events:all;position:relative}");var c=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return n(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=0,r=0,l=this.clientWidth(),n=this.clientHeight();switch(this.units()){case"pixels":o=this.widgetX(),r=this.widgetY(),l=""===this.widgetWidth()?l-o:Number(this.widgetWidth()),n=""===this.widgetHeight()?n-r:Number(this.widgetHeight());break;case"percent":o=this.widgetX()*l/100,r=this.widgetY()*n/100,l=""===this.widgetWidth()?l-o:Number(this.widgetWidth())*l/100,n=""===this.widgetHeight()?n-r:Number(this.widgetHeight())*n/100}i.style("opacity",this.opacity());var s=i.selectAll("#"+this._id+" > .placeholder").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","placeholder").each(function(t){t.target(this)}).merge(s).style("left",o+"px").style("top",r+"px").style("width",l+"px").style("bottom",n+"px").each(function(t){t.resize({width:l,height:n})}),s.exit().each(function(t){t.target(null)}).remove()},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e}(e.HTMLWidget);c.prototype._class+=" layout_AbsoluteSurface",c.prototype.publish("units","percent","set","Units",["pixels","percent"]),c.prototype.publish("widgetX",0,"number","Widget XPos"),c.prototype.publish("widgetY",0,"number","Widget YPos"),c.prototype.publish("widgetWidth","100","string","Widget Width, omit for full"),c.prototype.publish("widgetHeight","100","string","Widget Height, omit for full"),c.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]}),c.prototype.publish("opacity",1,"number","Opacity");p(".layout_Accordion>ul{position:relative}.layout_Accordion.open>span{font-style:italic}.layout_Accordion.closed>ul{height:0;overflow:hidden}.layout_Accordion.open>ul{display:block}.layout_Accordion>.collapsible-icon,.layout_Accordion>.collapsible-title{box-sizing:border-box;cursor:pointer}.layout_Accordion>.collapsible-title{-webkit-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);-moz-box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);box-shadow:inset 0 -1px 1px 0 rgba(0,0,0,.2);color:#fff;display:block;font-size:13px;height:26px;padding:4px 8px;width:100%}.layout_Accordion li{background-color:#fff}.layout_Accordion>.collapsible-title,.layout_Accordion>ul{background-color:#333}.layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion>ul{background-color:#555}.layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#777}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#999}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#bbb}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ccc}.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>.collapsible-title,.layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion .layout_Accordion>ul{background-color:#ddd}.layout_Accordion>span,.layout_Accordion>ul{padding-left:0}.layout_Accordion .layout_Accordion>span,.layout_Accordion .layout_Accordion>ul{padding-left:12px}.layout_Accordion>.collapsible-title:before{left:0;padding:4px 8px;position:absolute;top:0}.layout_Accordion>.collapsible-icon{color:#fff;height:24px;position:absolute;right:0;top:0;width:24px}");var u=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._isClosed=!1,e}return n(i,t),i.prototype.pushListItem=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var o=this.content();return t._protected=i,e?o.unshift(t):o.push(t),this.content(o),this},i.prototype.clearListItems=function(){var t=[];for(var e in this.content())this.content()[e]._protected&&t.push(this.content()[e]);return this.content(t),this},i.prototype.collapseClick=function(t){t.classed("closed")?(this._isClosed=!1,t.classed("open",!0),t.classed("closed",!1)):(this._isClosed=!0,t.classed("open",!1),t.classed("closed",!0))},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var r=this;this._isClosed=this.defaultCollapsed(),o.classed(this._isClosed?"closed":"open",!0),this.titleSpan=o.append("span").classed("collapsible-title",!0),this.iconDiv=o.append("div").classed("collapsible-icon",!0),this.ul=o.append("ul"),this.icon=(new e.FAChar).size({height:24,width:24}).target(this.iconDiv.node()),this.iconDiv.on("click",function(){r.collapseClick(o),r.render()}),this.titleSpan.on("click",function(){r.collapseClick(o),r.render()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;this.titleSpan.text(o.title().length>0?o.title()+"":"Accordion ["+o._id+"]");var r=this.ul.selectAll("#"+o._id+" > ul > li").data(this.content(),function(t){return t._id});r.enter().append(function(t){var e=document.createElement("li");if(null!==t._target)return t._target;var i=t.size();if(0===i.width||0===i.height){var r=o.size();t.size({width:r.width,height:r.width})}return t.target(e),e}),r.exit().remove(),this.icon.text_colorFill(this.titleFontColor()).char(this._isClosed?this.closedIcon():this.openIcon()).render()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);u.prototype._class+=" layout_Accordion",u.prototype.publish("content",[],"widgetArray","Array of widgets",null,{tags:["Basic"]}),u.prototype.publish("title","","string","Title of collapsible section",null,{tags:["Private"]}),u.prototype.publish("openIcon","","string","Icon to display when list is open",null,{tags:["Private"]}),u.prototype.publish("closedIcon","","string","Icon to display when list is closed",null,{tags:["Private"]}),u.prototype.publish("titleFontColor","#FFFFFF","html-color","Title font color",null,{tags:["Private"]}),u.prototype.publish("titleBackgroundColor","#333333","html-color","Title background color",null,{tags:["Private"]}),u.prototype.publish("defaultCollapsed",!1,"boolean","Collapsed by default if true",null,{tags:["Private"]});p('.layout_Surface{border:1px solid #e5e5e5;box-sizing:border-box;height:100%;margin:0;overflow:hidden;width:100%}.layout_Surface.shadow2{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}.layout_Surface>h3{background-color:#e5e5e5;margin:0;padding:2px}.layout_Surface .html-button-container{position:absolute;right:0;top:3px}.layout_Surface>div{padding:8px}.layout_Surface .html-button-container .surface-button{margin-right:5px}.layout_Surface .html-button-container .surface-button i{opacity:.8}.layout_Surface .html-button-container .surface-button:hover{opacity:1}.layout_Surface .html-button-container .surface-button:active{opacity:.5}div[draggable=true].hideDragCellContent.content-icon:before{content:"\\f080";font-family:FontAwesome;font-size:100px;left:calc(50% - 56px);position:absolute;top:calc(50% - 74px)}div[draggable=true].hideDragCellContent.content-icon-Line:before{content:"\\f201"}div[draggable=true].hideDragCellContent.content-icon-Pie:before{content:"\\f200";left:calc(50% - 45px);top:calc(50% - 72px)}div[draggable=true].hideDragCellContent.content-icon-Area:before{content:"\\f1fe"}div[draggable=true].hideDragCellContent.content-icon-Gauge:before{content:"\\f0e4"}div[draggable=true].hideDragCellContent.content-icon-Table:before{content:"\\f0ce"}div[draggable=true].hideDragCellContent.content-icon-Form:before{content:"\\f11c"}div[draggable=true].hideDragCellContent.content-icon-Accordion:before,div[draggable=true].hideDragCellContent.content-icon-Border:before,div[draggable=true].hideDragCellContent.content-icon-Graph:before,div[draggable=true].hideDragCellContent.content-icon-Grid:before,div[draggable=true].hideDragCellContent.content-icon-MultiChart:before,div[draggable=true].hideDragCellContent.content-icon-MultiChartSurface:before,div[draggable=true].hideDragCellContent.content-icon-Tabbed:before{content:"\\f247"}div[draggable=true].hideDragCellContent.content-icon-ChoroplethCounties:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethCountries:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStates:before,div[draggable=true].hideDragCellContent.content-icon-ChoroplethStatesHeat:before,div[draggable=true].hideDragCellContent.content-icon-FAChar:before,div[draggable=true].hideDragCellContent.content-icon-GMap:before,div[draggable=true].hideDragCellContent.content-icon-GMapGraph:before,div[draggable=true].hideDragCellContent.content-icon-GMapHeat:before,div[draggable=true].hideDragCellContent.content-icon-Text:before,div[draggable=true].hideDragCellContent.content-icon-TextBox:before{content:"\\f278"}');var g=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return n(i,t),i.prototype.widgetSize=function(t,e){var i=this.clientWidth(),o=this.clientHeight();return this.title()&&(o-=this.calcHeight(t)),o-=this.calcFrameHeight(e),{width:i-=this.calcFrameWidth(e),height:o}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i)},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var r=this;o.classed("shadow2",this.surfaceShadow()).style("border-width",this.surfaceBorderWidth_exists()?this.surfaceBorderWidth()+"px":null).style("border-color",this.surfaceBorderColor()).style("border-radius",this.surfaceBorderRadius_exists()?this.surfaceBorderRadius()+"px":null).style("background-color",this.surfaceBackgroundColor());var l=o.selectAll(".surfaceTitle").data(this.title()?[this.title()]:[]);l.enter().insert("h3","div").attr("class","surfaceTitle").merge(l).text(function(t){return t}).style("text-align",this.surfaceTitleAlignment()).style("color",this.surfaceTitleFontColor()).style("font-size",this.surfaceTitleFontSize_exists()?this.surfaceTitleFontSize()+"px":null).style("font-family",this.surfaceTitleFontFamily()).style("font-weight",this.surfaceTitleFontBold()?"bold":"normal").style("background-color",this.surfaceTitleBackgroundColor()).style("padding",this.surfaceTitlePadding_exists()?this.surfaceTitlePadding()+"px":null).style("title",this.altText_exists()?this.altText():null),l.exit().remove();var n=o.select(".surfaceTitle").append("div").attr("class","html-button-container").selectAll(".surface-button").data(this.buttonAnnotations());n.enter().append("button").classed("surface-button",!0).each(function(t,i){var o=r._surfaceButtons[i]=e.select(this).attr("class","surface-button"+(t.class?" "+t.class:"")).attr("id",t.id).style("padding",t.padding).style("width",t.width).style("height",t.height).style("cursor","pointer");"FontAwesome"===t.font?o.style("background","transparent").style("border","none").on("click",function(t){r.click(t)}).append("i").attr("class","fa").text(function(){return t.label}):o.text(function(){return t.label}).on("click",function(t){r.click(t)})}),n.exit().each(function(t,i){var o=e.select(this);delete r._surfaceButtons[i],o.remove()});var s=o.selectAll("#"+this._id+" > .surfaceWidget").data(this.widget()?[this.widget()]:[],function(t){return t._id});s.enter().append("div").attr("class","surfaceWidget").each(function(t){e.select(r.element().node().parentElement).classed("content-icon content-icon-"+t.classID().split("_")[1],!0),t.target(this)}).merge(s).style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null).each(function(t){var i=r.widgetSize(o.select("h3"),e.select(this));i.width<0&&(i.width=0),i.height<0&&(i.height=0),t.resize({width:i.width,height:i.height})}),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},i.prototype.click=function(t){},i}(e.HTMLWidget);g.prototype._class+=" layout_Surface",g.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),g.prototype.publish("altText",null,"string","Alt text",null,{optional:!0}),g.prototype.publish("surfaceTitlePadding",null,"number","Title Padding (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleBackgroundColor",null,"html-color","Title Background Color",null,{tags:["Advanced"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceTitleAlignment","center","set","Title Alignment",["left","right","center"],{tags:["Basic"],disable:function(t){return!t.title()}}),g.prototype.publish("surfaceShadow",!1,"boolean","3D Shadow"),g.prototype.publish("surfacePadding",null,"string","Surface Padding (px)",null,{tags:["Intermediate"]}),g.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),g.prototype.publish("surfaceBorderWidth",null,"number","Surface Border Width (px)",null,{tags:["Advanced"]}),g.prototype.publish("surfaceBorderColor",null,"html-color","Surface Border Color",null,{tags:["Advanced"]}),g.prototype.publish("surfaceBorderRadius",null,"number","Surface Border Radius (px)",null,{tags:["Advanced"]}),g.prototype.publish("buttonAnnotations",[],"array","Button Array",null,{tags:["Private"]}),g.prototype.publish("widget",null,"widget","Widget",null,{tags:["Basic"]});p(".layout_Cell .update-indicator{border-style:solid;border-width:0;box-sizing:border-box;left:0;padding:0;pointer-events:none;position:absolute;top:0;z-index:1000}");var f=function(t){function i(){var e=t.call(this)||this;return e._indicateTheseIds=[],e}return n(i,t),i.prototype.indicateTheseIds=function(t){return arguments.length?(this._indicateTheseIds=t,this):this._indicateTheseIds},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=this;i.classed("layout_Surface",!0).on("mouseenter",function(){o.onMouseEnter()}).on("mouseleave",function(){o.onMouseLeave()})},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i)},i.prototype.onMouseEnter=function(){for(var t=this.indicateTheseIds(),i=this.indicatorOpacity(),o=this.indicatorBorderColor(),r=this.indicatorGlowColor(),l=0;l<t.length;l++){var n=e.select("#"+t[l]),s=n.datum();n&&s&&n.append("div").attr("class","update-indicator").style("width",s.width()+"px").style("height",s.height()+"px").style("opacity",i).style("border-color",o).style("-webkit-box-shadow","inset 0px 0px 30px 0px "+r).style("-moz-box-shadow","inset 0px 0px 30px 0px "+r).style("box-shadow","inset 0px 0px 30px 0px "+r)}},i.prototype.onMouseLeave=function(){for(var t=this.indicateTheseIds(),i=0;i<t.length;i++)e.selectAll("#"+t[i]+" > div.update-indicator").remove()},i}(g);f.prototype._class+=" layout_Cell",f.prototype.publish("gridRow",0,"number","Grid Row Position",null,{tags:["Private"]}),f.prototype.publish("gridCol",0,"number","Grid Column Position",null,{tags:["Private"]}),f.prototype.publish("gridRowSpan",1,"number","Grid Row Span",null,{tags:["Private"]}),f.prototype.publish("gridColSpan",1,"number","Grid Column Span",null,{tags:["Private"]}),f.prototype.publish("indicatorGlowColor","#EEEE11","html-color","Glow color of update-indicator",null,{tags:["Basic"]}),f.prototype.publish("indicatorBorderColor","#F48A00","html-color","Border color of update-indicator",null,{tags:["Basic"]}),f.prototype.publish("indicatorOpacity",.8,"number","Opacity of update-indicator",null,{tags:["Basic"]});p(".layout_Border{height:100%;width:100%}.layout_Border>.border-content{height:100%;position:relative;width:100%}.layout_Border>.borderHandle{background-color:#444;height:6px;opacity:.3;position:absolute;visibility:hidden;width:6px}.layout_Border.design-mode>.borderHandle{visibility:visible}.layout_Border>.borderHandle:hover{background-color:#666}.layout_Border>.borderHandle.borderHandleDisabled{display:none}.layout_Border>.borderHandle_bottom,.layout_Border>.borderHandle_top{cursor:ns-resize}.layout_Border>.borderHandle_left,.layout_Border>.borderHandle_right{cursor:ew-resize}.layout_Border .cell{border:1px solid #e5e5e5;border-radius:5px;display:inline-block;overflow:hidden}.layout_Border .cell h2{margin:0;-webkit-margin:0;padding-top:4px;text-align:center}.layout_Border .layout_BorderCell.over{border:2px dashed #000}.layout_Border .dragItem{opacity:.33;z-index:-1}.layout_Border .notDragItem{opacity:1;z-index:-1}.layout_Border div[draggable=true]{cursor:default;opacity:.75}.layout_Border div[draggable=true] .dragHandle{opacity:1}.layout_Border div[draggable=true] .dragHandle_e,.layout_Border div[draggable=true] .dragHandle_n,.layout_Border div[draggable=true] .dragHandle_s,.layout_Border div[draggable=true] .dragHandle_w{background-color:#aaa}.layout_Border div[draggable=true] .dragHandle_ne,.layout_Border div[draggable=true] .dragHandle_nw,.layout_Border div[draggable=true] .dragHandle_se,.layout_Border div[draggable=true] .dragHandle_sw{background-color:#333}.layout_Border div[draggable=true] .dragHandle_nw{cursor:nw-resize}.layout_Border div[draggable=true] .dragHandle_n{cursor:n-resize}.layout_Border div[draggable=true] .dragHandle_ne{cursor:ne-resize}.layout_Border div[draggable=true] .dragHandle_e{cursor:e-resize}.layout_Border div[draggable=true] .dragHandle_se{cursor:se-resize}.layout_Border div[draggable=true] .dragHandle_s{cursor:s-resize}.layout_Border div[draggable=true] .dragHandle_sw{cursor:sw-resize}.layout_Border div[draggable=true] .dragHandle_w{cursor:w-resize}.layout_Border div[draggable=false]>div>.dragHandle{display:none}.layout_Border .grid-drop-target{background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 8px);border:2px dashed #7f8c8d;border-radius:0;box-sizing:border-box;position:fixed}.layout_Border .grid-drop-target.drop-target-over{background:repeating-linear-gradient(-45deg,transparent,transparent 6px,rgba(17,155,215,.1) 0,rgba(17,155,215,.1) 12px);border:2px dashed #179bd7}");var y=function(t){function i(){var i=t.call(this)||this;return i.lazyPostUpdate=e.Utility.debounce(function(){this.postUpdate()},100),i._tag="div",i._colCount=0,i._rowCount=0,i._colSize=0,i._rowSize=0,i._shrinkWrapBoxes={},i.content([]),i.sectionTypes([]),i}return n(i,t),i.prototype.watchWidget=function(t){if(void 0===this._watch&&(this._watch={}),this._watch[t.id()]&&(this._watch[t.id()].remove(),delete this._watch[t.id()]),t){var e=this;this._watch[t.id()]=t.monitor(function(t,i,o){o!==i&&e.lazyPostUpdate()})}},i.prototype.applyLayoutType=function(){var t=this.borderLayoutObject();this.content().forEach(function(e,i){e._fixedLeft=t[this.sectionTypes()[i]].left,e._fixedTop=t[this.sectionTypes()[i]].top,e._fixedWidth=t[this.sectionTypes()[i]].width,e._fixedHeight=t[this.sectionTypes()[i]].height,e._dragHandles=this.cellSpecificDragHandles(this.sectionTypes()[i])},this)},i.prototype.cellSpecificDragHandles=function(t){switch(t){case"top":return["s"];case"right":return["w"];case"bottom":return["n"];case"left":return["e"];case"center":return[]}},i.prototype.borderLayoutObject=function(t){var e,i,o,r,l,n,s,a,h={},d=this,p=this.target().getBoundingClientRect();p.top,p.left,p.bottom,p.right,this.target()instanceof SVGElement?(parseFloat(this.target().getAttribute("width")),parseFloat(this.target().getAttribute("height"))):(p.width,p.height),-1!==this.sectionTypes().indexOf("top")&&(e=this.topSize(),i=this.topPercentage(),void 0!==this._shrinkWrapBoxes.top&&(e=this._shrinkWrapBoxes.top.height+this.gutter(),i=0)),-1!==this.sectionTypes().indexOf("bottom")&&(o=this.bottomSize(),r=this.bottomPercentage(),void 0!==this._shrinkWrapBoxes.bottom&&(o=this._shrinkWrapBoxes.bottom.height+this.gutter(),r=0)),-1!==this.sectionTypes().indexOf("left")&&(l=this.leftSize(),n=this.leftPercentage(),void 0!==this._shrinkWrapBoxes.left&&(l=this._shrinkWrapBoxes.left.width+this.gutter(),n=0)),-1!==this.sectionTypes().indexOf("right")&&(s=this.rightSize(),a=this.rightPercentage(),void 0!==this._shrinkWrapBoxes.right&&(s=this._shrinkWrapBoxes.right.width+this.gutter(),a=0));var c=b({width:{px:0,"%":100},height:{px:e,"%":i},top:{px:0,"%":0},left:{px:0,"%":0}}),u=b({width:{px:0,"%":100},height:{px:o,"%":r},top:{px:0,"%":100},left:{px:0,"%":0}});u.top-=u.height;var g=b({width:{px:l,"%":n},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":0}}),f=b({width:{px:s,"%":a},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:0,"%":100}});f.left-=f.width;var y=b({width:{px:-f.width-g.width,"%":100},height:{px:-c.height-u.height,"%":100},top:{px:c.height,"%":0},left:{px:g.width,"%":0}});return h.top=c,h.bottom=u,h.right=f,h.left=g,h.center=y,h;function b(t){return t.width.px=void 0!==t.width.px?t.width.px:0,t.width["%"]=void 0!==t.width["%"]?t.width["%"]:0,t.height.px=void 0!==t.height.px?t.height.px:0,t.height["%"]=void 0!==t.height["%"]?t.height["%"]:0,{width:t.width.px+t.width["%"]/100*d.width(),height:t.height.px+t.height["%"]/100*d.height(),top:t.top.px+t.top["%"]/100*d.height()+d.gutter()/2,left:t.left.px+t.left["%"]/100*d.width()+d.gutter()/2}}},i.prototype.clearContent=function(t){if(t){var i=this.sectionTypes().indexOf(t);i>=0&&(this._watch&&this.content()[i]&&delete this._watch[this.content()[i].id()],this.content()[i].target(null),e.select("#"+this.id()+" > div.borderHandle_"+t).classed("borderHandleDisabled",!0),this.content().splice(i,1),this.sectionTypes().splice(i,1))}else this.content().forEach(function(t){return t.target(null),!1}),e.select("#"+this.id()+" > div.borderHandle").classed("borderHandleDisabled",!0),delete this._watch,this.content([]),this.sectionTypes([])},i.prototype.hasContent=function(t,e,i){return this.sectionTypes().indexOf(t)>=0},i.prototype.setContent=function(t,e,i){if(this.clearContent(t),i=void 0!==i?i:"",e){var o=(new f).surfaceBorderWidth(0).widget(e).title(i);this.watchWidget(e),this.content().push(o),this.sectionTypes().push(t)}return this},i.prototype.getCell=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e]:null},i.prototype.getContent=function(t){var e=this.sectionTypes().indexOf(t);return e>=0?this.content()[e].widget():null},i.prototype.setLayoutOffsets=function(){this._offsetX=this._element.node().getBoundingClientRect().left+this.gutter()/2,this._offsetY=this._element.node().getBoundingClientRect().top+this.gutter()/2},i.prototype.dragStart=function(t){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=this;this._dragCell=t,this._dragCellStartSize=this[t+"Size"](),this[t+"ShrinkWrap"]()&&(this[t+"Percentage"](0),this[t+"ShrinkWrap"](!1));var r=e.select("#"+o.id()+" > div.borderHandle_"+t);o._handleTop=parseFloat(r.style("top").split("px")[0]),o._handleLeft=parseFloat(r.style("left").split("px")[0]),this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY},i.prototype.dragTick=function(t){var i=this,o=e.d3Event(),r=this._dragPrevX-o.sourceEvent.clientX,l=this._dragPrevY-o.sourceEvent.clientY;switch(t){case"top":case"bottom":n(t,l);break;case"right":case"left":n(t,r)}function n(t,o){if(0!==o){var r=e.selectAll("#"+i.id()+" > div.borderHandle"),l=e.select("#"+i.id()+" > div.borderHandle_"+t);l.classed("borderHandle_top")?(l.style("top",i._handleTop-o+"px"),i._cellSizes.topHeight=i._handleTop-o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_right")?(l.style("left",i._handleLeft-o+"px"),i._cellSizes.rightWidth=i._cellSizes.width-i._handleLeft+o):l.classed("borderHandle_bottom")?(l.style("top",i._handleTop-o+"px"),i._cellSizes.bottomHeight=i._cellSizes.height-i._handleTop+o,i._cellSizes.leftHeight=i._cellSizes.height,i._cellSizes.leftHeight-=i._cellSizes.bottomHeight,i._cellSizes.leftHeight-=i._cellSizes.topHeight,i._cellSizes.rightHeight=i._cellSizes.leftHeight):l.classed("borderHandle_left")&&(l.style("left",i._handleLeft-o+"px"),i._cellSizes.leftWidth=i._handleLeft-o),r.each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",i._cellSizes.width-i._cellSizes.rightWidth+"px"),t.style("top",i._cellSizes.topHeight+3+"px"),t.style("height",i._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",i._cellSizes.width+"px"),t.style("top",i._cellSizes.height-i._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",i._cellSizes.leftWidth+"px"),t.style("height",i._cellSizes.leftHeight+"px"),t.style("top",i._cellSizes.topHeight+3+"px"))})}}},i.prototype.dragEnd=function(t){if(t){var i=e.d3Event(),o=this._dragPrevX-i.sourceEvent.clientX,r=this._dragPrevY-i.sourceEvent.clientY;switch(t){case"top":0!==r&&(this.topPercentage(0),this.topSize(0===this.topSize()?this.getContent("top").getBBox().height-r:this.topSize()-r));break;case"right":0!==o&&(this.rightPercentage(0),this.rightSize(0===this.rightSize()?this.getContent("right").getBBox().width+o:this.rightSize()+o));break;case"bottom":0!==r&&(this.bottomPercentage(0),this.bottomSize(0===this.bottomSize()?this.getContent("bottom").getBBox().height+r:this.bottomSize()+r));break;case"left":0!==o&&(this.leftPercentage(0),this.leftSize(0===this.leftSize()?this.getContent("left").getBBox().width-o:this.leftSize()-o))}this._dragPrevX=i.sourceEvent.clientX,this._dragPrevY=i.sourceEvent.clientY}this.render()},i.prototype.size=function(t){var i=e.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this.contentDiv&&this.contentDiv.style("width",this._size.width+"px").style("height",this._size.height+"px"),i},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var r=this;o.style("position","relative"),this.contentDiv=o.append("div").classed("border-content",!0),this._scrollBarWidth=e.Platform.getScrollbarWidth(),this._borderHandles=["top","left","right","bottom"],o.selectAll("div.borderHandle").data(this._borderHandles).enter().append("div").classed("borderHandle",!0).each(function(t){e.select(this).classed("borderHandle_"+t,!0).classed("borderHandleDisabled",null===r.getContent(t))})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._sectionTypeArr=this.sectionTypes();var r=this;o.classed("design-mode",this.designMode()),this.setLayoutOffsets();var l=this.contentDiv.selectAll(".cell_"+this._id).data(this.content(),function(t){return t._id}),n=l.enter().append("div").classed("cell_"+this._id,!0).style("position","absolute").each(function(t,i){e.select(this).classed("border-cell border-cell-"+r._sectionTypeArr[i],!0),t.target(this),e.select("#"+r.id()+" > div.borderHandle_"+r._sectionTypeArr[i]).classed("borderHandleDisabled",!1)}).merge(l);n.each(function(t,e){var i=r.sectionTypes()[e];void 0!==r[i+"ShrinkWrap"]&&r[i+"ShrinkWrap"]()?(t.render(),r._shrinkWrapBoxes[i]=t.widget().getBBox(!0)):delete r._shrinkWrapBoxes[i]});var s=e.drag().on("start",function(t,e){r.dragStart.call(r,t,e)}).on("drag",function(t,e){r.dragTick.call(r,t,e)}).on("end",function(t,e){r.dragEnd.call(r,t,e)});this.designMode()?o.selectAll("#"+this.id()+" > div.borderHandle").call(s):o.selectAll("#"+this.id()+" > div.borderHandle").on(".drag",null);var a=this.borderLayoutObject();this.content().forEach(function(t,e){t._fixedLeft=a[this.sectionTypes()[e]].left,t._fixedTop=a[this.sectionTypes()[e]].top,t._fixedWidth=a[this.sectionTypes()[e]].width,t._fixedHeight=a[this.sectionTypes()[e]].height,t._dragHandles=[]},this),n.style("left",function(t){return t._fixedLeft+"px"}).style("top",function(t){return t._fixedTop+"px"}).style("width",function(t){return t._fixedWidth-r.gutter()+"px"}).style("height",function(t){return t._fixedHeight-r.gutter()+"px"}).each(function(t){t._placeholderElement.attr("draggable",r.designMode()).selectAll(".dragHandle").attr("draggable",r.designMode()),t.surfacePadding(r.surfacePadding()).resize()}),l.exit().each(function(t){t.target(null)}).remove(),this.getCellSizes(),o.selectAll("#"+this.id()+" > div.borderHandle").each(function(){var t=e.select(this);t.classed("borderHandle_top")?(t.style("width",r._cellSizes.width+"px"),t.style("top",r._cellSizes.topHeight-3+"px")):t.classed("borderHandle_right")?(t.style("left",r._cellSizes.width-r._cellSizes.rightWidth+"px"),t.style("top",r._cellSizes.topHeight+3+"px"),t.style("height",r._cellSizes.rightHeight+"px")):t.classed("borderHandle_bottom")?(t.style("width",r._cellSizes.width+"px"),t.style("top",r._cellSizes.height-r._cellSizes.bottomHeight-3+"px")):t.classed("borderHandle_left")&&(t.style("left",r._cellSizes.leftWidth+"px"),t.style("height",r._cellSizes.leftHeight+"px"),t.style("top",r._cellSizes.topHeight+3+"px"))})},i.prototype.getCellSizes=function(){var t=this;t._cellSizes={};var i=this.element().node().getBoundingClientRect();t._cellSizes.width=i.width,t._cellSizes.height=i.height,this.element().selectAll("#"+this.id()+" > div > div.border-cell").each(function(){var i=e.select(this);if("function"==typeof i.node){var o=i.node().getBoundingClientRect();i.classed("border-cell-top")?t._cellSizes.topHeight=o.height:i.classed("border-cell-left")?(t._cellSizes.leftWidth=o.width,t._cellSizes.leftHeight=o.height):i.classed("border-cell-right")?(t._cellSizes.rightWidth=o.width,t._cellSizes.rightHeight=o.height):i.classed("border-cell-bottom")&&(t._cellSizes.bottomHeight=o.height)}});["height","width","topHeight","bottomHeight","leftHeight","rightHeight","leftWidth","rightWidth"].forEach(function(e){t._cellSizes[e]=void 0===t._cellSizes[e]?0:t._cellSizes[e]})},i.prototype.postUpdate=function(t,e){var i=this;this.content().forEach(function(t){if(null!==t._element.node()&&t.widget()){var e=t.widget().getBBox(!1,!0),o=t.widget().getBBox(!0,!0);e.width===o.width&&e.height===o.height||i.lazyRender()}})},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i}(e.HTMLWidget);y.prototype._class+=" layout_Border",y.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),y.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Intermediate"]}),y.prototype.publish("gutter",0,"number","Gap Between Widgets",null,{tags:["Basic"]}),y.prototype.publish("topShrinkWrap",!1,"boolean","'Top' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("leftShrinkWrap",!1,"boolean","'Left' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("rightShrinkWrap",!1,"boolean","'Right' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("bottomShrinkWrap",!1,"boolean","'Bottom' Cell shrinks to fit content",null,{tags:["Intermediate"]}),y.prototype.publish("topSize",0,"number","Height of the 'Top' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("leftSize",0,"number","Width of the 'Left' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("rightSize",0,"number","Width of the 'Right' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("bottomSize",0,"number","Height of the 'Bottom' Cell (px)",null,{tags:["Private"]}),y.prototype.publish("topPercentage",20,"number","Percentage (of parent) Height of the 'Top' Cell",null,{tags:["Private"]}),y.prototype.publish("leftPercentage",20,"number","Percentage (of parent) Width of the 'Left' Cell",null,{tags:["Private"]}),y.prototype.publish("rightPercentage",20,"number","Percentage (of parent) Width of the 'Right' Cell",null,{tags:["Private"]}),y.prototype.publish("bottomPercentage",20,"number","Percentage (of parent) Height of the 'Bottom' Cell",null,{tags:["Private"]}),y.prototype.publish("surfacePadding",0,"number","Cell Padding (px)",null,{tags:["Intermediate"]}),y.prototype.publish("sectionTypes",[],"array","Section Types sharing an index with 'content' - Used to determine position/size.",null,{tags:["Private"]});p(".layout_Border2{display:flex;flex-direction:column}.layout_Border2>.body{display:flex;flex-flow:row;margin:0;padding:0}.layout_Border2>.body>.center{flex:1}.layout_Border2>.footer,.layout_Border2>.header{display:block}");var b=function(){function t(t){this._overlay=!1,this._overflowX="visible",this._overflowY="visible",this._div=t}return t.prototype.overlay=function(t){return arguments.length?(this._overlay=t,this):this._overlay},t.prototype.overflowX=function(t){return arguments.length?(this._overflowX=t,this._div.style("overflow-x",t),this):this._overflowX},t.prototype.overflowY=function(t){return arguments.length?(this._overflowY=t,this._div.style("overflow-y",t),this):this._overflowY},t.prototype.element=function(){return this._div},t.prototype.node=function(){return this._div.node()},t.prototype.widget=function(t){return arguments.length?(this._widget!==t&&(this._widget&&this._widget.target(null),this._widget=t,this._widget&&this._widget.target(this._div.node())),this):this._widget},t.prototype.resize=function(t){return this._widget&&(this._div.style("width","".concat(t.width,"px")).style("height","".concat(t.height,"px")),this._widget.resize(t)),this},t.prototype.render=function(t,i,o){return a(this,void 0,void 0,function(){var r,l,n=this;return h(this,function(s){return r=this.overflowX(),this.overlay()||"visible"!==r||(r=null),l=this.overflowY(),this.overlay()||"visible"!==l||(l=null),this._div.style("height",this.overlay()?"0px":null).style("overflow-x",r).style("overflow-y",l),this._widget?[2,this._widget.renderPromise().then(function(r){if(t&&n._widget.visible()){var l=n._widget.getBBox();return l.width+=8,void 0!==i&&l.height>i&&(l.width+=e.Platform.getScrollbarWidth()),void 0!==o&&l.width>o&&(l.height+=e.Platform.getScrollbarWidth()),n.overlay()?l.height=0:l.height+=4,l}return t?{x:0,y:0,width:0,height:0}:void 0})]:[2,Promise.resolve(t?{x:0,y:0,width:0,height:0}:void 0)]})})},t}(),_=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return n(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i);var o=i.append("header");this._bodyElement=i.append("div").attr("class","body");var r=this._bodyElement.append("div").attr("class","center"),l=this._bodyElement.append("div").attr("class","lhs"),n=this._bodyElement.append("div").attr("class","rhs"),s=i.append("div").attr("class","footer");this._topWA=new b(o),this._centerWA=new b(r),this._leftWA=new b(l),this._rightWA=new b(n),this._bottomWA=new b(s)},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._topWA.element().style("display",this.showTop()?null:"none"),this._rightWA.element().style("display",this.showRight()?null:"none"),this._bottomWA.element().style("display",this.showBottom()?null:"none"),this._leftWA.element().style("display",this.showLeft()?null:"none"),this.topOverflowX()!==this._topWA.overflowX()&&this._topWA.overflowX(this.topOverflowX()),this.rightOverflowX()!==this._rightWA.overflowX()&&this._rightWA.overflowX(this.rightOverflowX()),this.bottomOverflowX()!==this._bottomWA.overflowX()&&this._bottomWA.overflowX(this.bottomOverflowX()),this.leftOverflowX()!==this._leftWA.overflowX()&&this._leftWA.overflowX(this.leftOverflowX()),this.topOverflowY()!==this._topWA.overflowY()&&this._topWA.overflowY(this.topOverflowY()),this.rightOverflowY()!==this._rightWA.overflowY()&&this._rightWA.overflowY(this.rightOverflowY()),this.bottomOverflowY()!==this._bottomWA.overflowY()&&this._bottomWA.overflowY(this.bottomOverflowY()),this.leftOverflowY()!==this._leftWA.overflowY()&&this._leftWA.overflowY(this.leftOverflowY()),this.element().style("width","".concat(this.width(),"px")).style("height","".concat(this.height(),"px"))},e.prototype.targetNull=function(t){t&&t.target(null)},e.prototype.exit=function(e,i){this.targetNull(this.center()),this.targetNull(this.bottom()),this.targetNull(this.right()),this.targetNull(this.left()),this.targetNull(this.top()),t.prototype.exit.call(this,e,i)},e.prototype.swap=function(t,e){var i=this[t](),o=this[e]();return this.targetNull(i),this.targetNull(o),this["_".concat(t,"WA")].widget(null),this["_".concat(e,"WA")].widget(null),this[t](o),this[e](i),this},e.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){i._topWA?i._topWA.widget(i.top()).overlay(i.topOverlay()).render(!0).then(function(t){return a(i,void 0,void 0,function(){var i,o,r,l,n,s,a,d,p,c,u,g=this;return h(this,function(h){switch(h.label){case 0:return[4,this._bottomWA.widget(this.bottom()).render(!0,void 0,this.width())];case 1:return i=h.sent(),o=this.height()-(t.height+i.height),[4,this._leftWA.widget(this.left()).render(!0,o)];case 2:return r=h.sent(),[4,this._rightWA.widget(this.right()).render(!0,o)];case 3:return l=h.sent(),this.bottomHeight_exists()&&(i.height=this.bottomHeight()),n=this.width()-(r.width+l.width),s=this.height()-(t.height+i.height),a=this.centerOverflowX(),d=this.centerOverflowY(),p=-1!==["auto","scroll"].indexOf(a),c=-1!==["auto","scroll"].indexOf(d),(p||c)&&this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bodyElement.style("height","".concat(s,"px")),u=[this._topWA.overflowX(this.topOverflowX()).overflowY(this.topOverflowY()).resize({width:this.width(),height:t.height}).render(),this._leftWA.overflowX(this.leftOverflowX()).overflowY(this.leftOverflowY()).resize({width:r.width,height:s}).render(),this._rightWA.overflowX(this.rightOverflowX()).overflowY(this.rightOverflowY()).resize({width:l.width,height:s}).render(),this._centerWA.overflowX(this.centerOverflowX()).overflowY(this.centerOverflowY()).widget(this.center()).resize({width:n,height:s}).render(),this._bottomWA.overflowX(this.bottomOverflowX()).overflowY(this.bottomOverflowY()).resize({width:this.width(),height:i.height}).render()],Promise.all(u).then(function(t){e&&e(g)}),[2]}})})}):e&&e(i)})},e}(e.HTMLWidget);_.prototype._class+=" layout_Border2",_.prototype.publish("showTop",!0,"boolean","If true, top widget adapter will display"),_.prototype.publish("showRight",!0,"boolean","If true, right widget adapter will display"),_.prototype.publish("showBottom",!0,"boolean","If true, bottom widget adapter will display"),_.prototype.publish("showLeft",!0,"boolean","If true, left widget adapter will display"),_.prototype.publish("topOverflowX","visible","set","Sets the overflow-x css style for the top widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("rightOverflowX","visible","set","Sets the overflow-x css style for the right widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("bottomOverflowX","visible","set","Sets the overflow-x css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("leftOverflowX","visible","set","Sets the overflow-x css style for the left widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("centerOverflowX","visible","set","Sets the overflow-x css style for the center widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("topOverflowY","visible","set","Sets the overflow-y css style for the top widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("rightOverflowY","visible","set","Sets the overflow-y css style for the right widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("bottomOverflowY","visible","set","Sets the overflow-y css style for the bottom widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("leftOverflowY","visible","set","Sets the overflow-y css style for the left widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("centerOverflowY","visible","set","Sets the overflow-y css style for the center widget adapter",["hidden","scroll","visible","auto"]),_.prototype.publish("top",null,"widget","Top Widget",void 0,{render:!1}),_.prototype.publish("topOverlay",!1,"boolean","Overlay Top Widget"),_.prototype.publish("left",null,"widget","Left Widget",void 0,{render:!1}),_.prototype.publish("center",null,"widget","Center Widget",void 0,{render:!1}),_.prototype.publish("right",null,"widget","Right Widget",void 0,{render:!1}),_.prototype.publish("bottom",null,"widget","Bottom Widget",void 0,{render:!1}),_.prototype.publish("bottomHeight",null,"number","Bottom Fixed Height",void 0,{optional:!0});p(".layout_Carousel>div{overflow:hidden;position:relative}.layout_Carousel>div>.carouselItem{position:absolute}");var v=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._prevActive=0,e}return n(i,t),i.prototype.activeWidget=function(){return this.widgets()[this.active()]},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._root=i.append("div").attr("id","".concat(this.id(),"_root"))},i.prototype.update=function(i,o){var r=this;t.prototype.update.call(this,i,o);var l=this.active(),n=this.width();this._root.style("width","".concat(n,"px")).style("height","".concat(this.height(),"px"));var s=this._root.selectAll("#".concat(this.id(),"_root > .carouselItem")).data(this.widgets(),function(t){return t.id()}),a=s.enter().append("div").attr("class","carouselItem").each(function(t){t.target(this)}).merge(s).style("left",function(t,e){return"".concat((e-r._prevActive)*n,"px")}).style("width","".concat(n,"px"));this._prevActive!==l&&(a.style("display",function(t,e){return e===r._prevActive||e===l?null:"none"}).transition().duration(this.transitionDuration()).style("left",function(t,e){return"".concat((e-l)*n,"px")}).on("end",function(t,i){e.select(this).style("display",function(){return i===l?null:"none"})}),this._prevActive=l),s.exit().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this.widgets().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype.render=function(e){var i=this;return t.prototype.render.call(this,function(t){if(!i.visible()||i.isDOMHidden())e&&e(t);else{var o=i.activeWidget();o&&o.resize(i.size()).render(function(i){e&&e(t)})}})},i}(e.HTMLWidget);v.prototype._class+=" layout_Carousel",v.prototype.publish("widgets",[],"widgetArray","Widgets",null,{render:!1}),v.prototype.publish("active",0,"number","Active widget"),v.prototype.publish("transitionDuration",500,"number","Transition duration");var w=Math.PI,m=2*w,x=1e-6,C=m-x;function S(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function T(){return new S}function B(t){return function(){return t}}S.prototype=T.prototype={constructor:S,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,o){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+o)},bezierCurveTo:function(t,e,i,o,r,l){this._+="C"+ +t+","+ +e+","+ +i+","+ +o+","+(this._x1=+r)+","+(this._y1=+l)},arcTo:function(t,e,i,o,r){t=+t,e=+e,i=+i,o=+o,r=+r;var l=this._x1,n=this._y1,s=i-t,a=o-e,h=l-t,d=n-e,p=h*h+d*d;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(p>x)if(Math.abs(d*s-a*h)>x&&r){var c=i-l,u=o-n,g=s*s+a*a,f=c*c+u*u,y=Math.sqrt(g),b=Math.sqrt(p),_=r*Math.tan((w-Math.acos((g+p-f)/(2*y*b)))/2),v=_/b,m=_/y;Math.abs(v-1)>x&&(this._+="L"+(t+v*h)+","+(e+v*d)),this._+="A"+r+","+r+",0,0,"+ +(d*c>h*u)+","+(this._x1=t+m*s)+","+(this._y1=e+m*a)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,i,o,r,l){t=+t,e=+e,l=!!l;var n=(i=+i)*Math.cos(o),s=i*Math.sin(o),a=t+n,h=e+s,d=1^l,p=l?o-r:r-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+a+","+h:(Math.abs(this._x1-a)>x||Math.abs(this._y1-h)>x)&&(this._+="L"+a+","+h),i&&(p<0&&(p=p%m+m),p>C?this._+="A"+i+","+i+",0,1,"+d+","+(t-n)+","+(e-s)+"A"+i+","+i+",0,1,"+d+","+(this._x1=a)+","+(this._y1=h):p>x&&(this._+="A"+i+","+i+",0,"+ +(p>=w)+","+d+","+(this._x1=t+i*Math.cos(r))+","+(this._y1=e+i*Math.sin(r))))},rect:function(t,e,i,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +o+"h"+-i+"Z"},toString:function(){return this._}};var P=Math.PI,z=2*P,A={draw:function(t,e){var i=Math.sqrt(e/P);t.moveTo(i,0),t.arc(0,0,i,0,z)}},W={draw:function(t,e){var i=Math.sqrt(e/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},H=Math.sqrt(1/3),k=2*H,I={draw:function(t,e){var i=Math.sqrt(e/k),o=i*H;t.moveTo(0,-i),t.lineTo(o,0),t.lineTo(0,i),t.lineTo(-o,0),t.closePath()}},M=Math.sin(P/10)/Math.sin(7*P/10),O=Math.sin(z/10)*M,F=-Math.cos(z/10)*M,D={draw:function(t,e){var i=Math.sqrt(.8908130915292852*e),o=O*i,r=F*i;t.moveTo(0,-i),t.lineTo(o,r);for(var l=1;l<5;++l){var n=z*l/5,s=Math.cos(n),a=Math.sin(n);t.lineTo(a*i,-s*i),t.lineTo(s*o-a*r,a*o+s*r)}t.closePath()}},L={draw:function(t,e){var i=Math.sqrt(e),o=-i/2;t.rect(o,o,i,i)}},R=Math.sqrt(3),G={draw:function(t,e){var i=-Math.sqrt(e/(3*R));t.moveTo(0,2*i),t.lineTo(-R*i,-i),t.lineTo(R*i,-i),t.closePath()}},E=-.5,Y=Math.sqrt(3)/2,X=1/Math.sqrt(12),V=3*(X/2+1),N={draw:function(t,e){var i=Math.sqrt(e/V),o=i/2,r=i*X,l=o,n=i*X+i,s=-l,a=n;t.moveTo(o,r),t.lineTo(l,n),t.lineTo(s,a),t.lineTo(E*o-Y*r,Y*o+E*r),t.lineTo(E*l-Y*n,Y*l+E*n),t.lineTo(E*s-Y*a,Y*s+E*a),t.lineTo(E*o+Y*r,E*r-Y*o),t.lineTo(E*l+Y*n,E*n-Y*l),t.lineTo(E*s+Y*a,E*a-Y*s),t.closePath()}};function j(){var t=B(A),e=B(64),i=null;function o(){var o;if(i||(i=o=T()),t.apply(this,arguments).draw(i,+e.apply(this,arguments)),o)return i=null,o+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:B(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:B(+t),o):e},o.context=function(t){return arguments.length?(i=null==t?null:t,o):i},o}var U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q=function(t){return t},K=function(t){for(var e=[],i=0,o=t.length;i<o;i++)e[i]=t[o-i-1];return e},J=function(t,i){t.each(function(){var t,o=e.select(this),r=o.text().split(/\s+/).reverse(),l=[];o.attr("y");for(var n=parseFloat(o.attr("dy"))||0,s=o.text(null).append("tspan").attr("x",0).attr("dy",n+"em");t=r.pop();)l.push(t),s.text(l.join(" ")),s.node().getComputedTextLength()>i&&l.length>1&&(l.pop(),s.text(l.join(" ")),l=[t],s=o.append("tspan").attr("x",0).attr("dy",1.2+n+"em").text(t))})},Z={d3_drawShapes:function(t,e,i,o,r,l){"rect"===t?e.attr("height",i).attr("width",o):"circle"===t?e.attr("r",r):"line"===t?e.attr("x1",0).attr("x2",o).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",l)},d3_addText:function(t,e,i,o,r){e.append("text").attr("class",o+"label");var l=t.selectAll("g."+o+"cell text."+o+"label").data(i).text(q);return r&&t.selectAll("g."+o+"cell text."+o+"label").call(J,r),l},d3_calcType:function(t,e,i,o,r,l){var n=t.invertExtent?function(t,e,i){var o=t.range().map(function(o){var r=t.invertExtent(o);return e(r[0])+" "+i+" "+e(r[1])});return{data:t.range(),labels:o,feature:q}}(t,r,l):t.ticks?function(t,e,i){var o=[];if(e.length>1)o=e;else for(var r=t.domain(),l=(r[r.length-1]-r[0])/(e-1),n=0;n<e;n++)o.push(r[0]+n*l);var s=o.map(i);return{data:o,labels:s,feature:function(e){return t(e)}}}(t,i,r):function(t){return{data:t.domain(),labels:t.domain(),feature:function(e){return t(e)}}}(t),s=t.range&&t.range()||t.domain();return n.labels=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],i=arguments[2],o=arguments[3],r=arguments[4];if("object"===(void 0===e?"undefined":U(e))){if(0===e.length)return t;for(var l=e.length;l<t.length;l++)e.push(t[l]);return e}if("function"==typeof e){for(var n=[],s=t.length,a=0;a<s;a++)n.push(e({i:a,genLength:s,generatedLabels:t,domain:i,range:o,labelDelimiter:r}));return n}return t}(n.labels,o,t.domain(),s,l),e&&(n.labels=K(n.labels),n.data=K(n.data)),n},d3_filterCells:function(t,e){var i=t.data.map(function(e,i){return{data:e,label:t.labels[i]}}).filter(e),o=i.map(function(t){return t.data}),r=i.map(function(t){return t.label});return t.data=t.data.filter(function(t){return-1!==o.indexOf(t)}),t.labels=t.labels.filter(function(t){return-1!==r.indexOf(t)}),t},d3_placement:function(t,e,i,o,r,l){e.attr("transform",i),o.attr("transform",r),"horizontal"===t&&o.style("text-anchor",l)},d3_addEvents:function(t,e){t.on("mouseover.legend",function(t){!function(t,e,i){t.call("cellover",i,e)}(e,t,this)}).on("mouseout.legend",function(t){!function(t,e,i){t.call("cellout",i,e)}(e,t,this)}).on("click.legend",function(t){!function(t,e,i){t.call("cellclick",i,e)}(e,t,this)})},d3_title:function(t,e,i,o){if(""!==e){t.selectAll("text."+i+"legendTitle").data([e]).enter().append("text").attr("class",i+"legendTitle"),t.selectAll("text."+i+"legendTitle").text(e),o&&t.selectAll("text."+i+"legendTitle").call(J,o);var r=t.select("."+i+"legendCells"),l=t.select("."+i+"legendTitle").nodes().map(function(t){return t.getBBox().height})[0],n=-r.nodes().map(function(t){return t.getBBox().x})[0];r.attr("transform","translate("+n+","+l+")")}},d3_defaultLocale:{format:e.format,formatPrefix:e.formatPrefix},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};var Q=function(t){function i(i){var o=t.call(this)||this;o._disabled=[],o._symbolTypeMap={circle:A,cross:W,diamond:I,square:L,star:D,triangle:G,wye:N},o._owner=i,o._drawStartPos="origin";var r=o;return o._legendOrdinal=function(){var t=e.scaleLinear(),i="rect",o=15,r=15,l=10,n=2,s=[5],a=void 0,h=[],d="",p=!1,c="",u=Z.d3_defaultLocale,g=Z.d3_defaultFormatSpecifier,f=10,y="middle",b=Z.d3_defaultDelimiter,_=void 0,v="vertical",w=!1,m=void 0,x=void 0,C=e.dispatch("cellover","cellout","cellclick");function S(S){var T=Z.d3_calcType(t,w,s,h,u.format(g),b);S.selectAll("g").data([t]).enter().append("g").attr("class",d+"legendCells"),a&&Z.d3_filterCells(T,a);var B=S.select("."+d+"legendCells").selectAll("."+d+"cell").data(T.data),P=B.enter().append("g").attr("class",d+"cell");P.append(i).attr("class",d+"swatch");var z=S.selectAll("g."+d+"cell "+i+"."+d+"swatch").data(T.data);Z.d3_addEvents(P,C),B.exit().transition().style("opacity",0).remove(),z.exit().transition().style("opacity",0).remove(),z=z.merge(z),Z.d3_drawShapes(i,z,r,o,l,m);var A=Z.d3_addText(S,P,T.labels,d,_);B=P.merge(B);var W=A.nodes().map(function(t){return t.getBBox()}),H=z.nodes().map(function(t){return t.getBBox()});p?z.attr("class",function(t){return d+"swatch "+T.feature(t)}):"line"==i?z.style("stroke",T.feature):z.style("fill",T.feature);var k,I=void 0,M=void 0,O="start"==y?0:"middle"==y?.5:1;"vertical"===v?(k=W.map(function(t,e){return Math.max(t.height,H[e].height)}),I=function(t,i){return"translate(0, "+(e.sum(k.slice(0,i))+i*n)+")"},M=function(t,e){return"translate( "+(H[e].width+H[e].x+f)+", "+(H[e].y+H[e].height/2+5)+")"}):"horizontal"===v&&(I=function(t,e){return"translate("+e*(H[e].width+n)+",0)"},M=function(t,e){return"translate("+(H[e].width*O+H[e].x)+",\n "+(H[e].height+H[e].y+f+8)+")"}),Z.d3_placement(v,B,I,A,M,y),Z.d3_title(S,c,d,x),B.transition().style("opacity",1)}return S.scale=function(e){return arguments.length?(t=e,S):t},S.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(s=t),S):s},S.cellFilter=function(t){return arguments.length?(a=t,S):a},S.shape=function(t,e){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof e)&&(i=t,m=e),S):i},S.shapeWidth=function(t){return arguments.length?(o=+t,S):o},S.shapeHeight=function(t){return arguments.length?(r=+t,S):r},S.shapeRadius=function(t){return arguments.length?(l=+t,S):l},S.shapePadding=function(t){return arguments.length?(n=+t,S):n},S.labels=function(t){return arguments.length?(h=t,S):h},S.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(y=t),S):y},S.locale=function(t){return arguments.length?(u=e.formatLocale(t),S):u},S.labelFormat=function(t){return arguments.length?(g=e.formatSpecifier(t),S):S.locale().format(g)},S.labelOffset=function(t){return arguments.length?(f=+t,S):f},S.labelDelimiter=function(t){return arguments.length?(b=t,S):b},S.labelWrap=function(t){return arguments.length?(_=t,S):_},S.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(p=t),S):p},S.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(v=t),S):v},S.ascending=function(t){return arguments.length?(w=!!t,S):w},S.classPrefix=function(t){return arguments.length?(d=t,S):d},S.title=function(t){return arguments.length?(c=t,S):c},S.titleWidth=function(t){return arguments.length?(x=t,S):x},S.textWrap=function(t){return arguments.length?(textWrap=t,S):textWrap},S.on=function(){var t=C.on.apply(C,arguments);return t===C?S:t},S}().shape("path",j().type(A).size(150)()).shapePadding(10).shapeRadius(10).on("cellclick",function(t){r.onClick(t,this)}).on("cellover",function(t){r.onOver(t,o)}).on("cellout",function(t){r.onOut(t,o)}),o}return n(i,t),i.prototype.isDisabled=function(t){return void 0!==t&&("string"==typeof t?0===t.indexOf("__")||this._disabled.indexOf(t)>=0:t instanceof e.Database.Field?0===t.id().indexOf("__")||this._disabled.indexOf(t.id())>=0:this._disabled.indexOf(t)>=0)},i.prototype.filteredFields=function(){var t=this;switch(this.dataFamily()){case"2D":return this.fields();case"ND":return this.fields().filter(function(e){return!t.isDisabled(e)})}return this.fields()},i.prototype.filteredColumns=function(){var t=this;switch(this.dataFamily()){case"2D":return this.columns();case"ND":return this.columns().filter(function(e){return!t.isDisabled(e)})}return this.columns()},i.prototype.filteredData=function(){var t=this;switch(this.dataFamily()){case"2D":return this.data().filter(function(e){return!t.isDisabled(e[0])});case"ND":var e={},i=!1;return this.columns().forEach(function(o,r){var l=t.isDisabled(o);e[r]=l,l&&(i=!0)}),i?this.data().map(function(t){return t.filter(function(t,i){return!e[i]})}):this.data()}return this.data()},i.prototype.isRainbow=function(){var t=this.getWidget();return t&&t._palette&&"rainbow"===t._palette.type()},i.prototype.targetWidget=function(t){if(!arguments.length)return this._targetWidget;if(this._targetWidget=t,this._targetWidgetMonitor&&(this._targetWidgetMonitor.remove(),delete this._targetWidgetMonitor),this._targetWidget){var e=this;this._targetWidgetMonitor=this._targetWidget.monitor(function(t,i,o,r){switch(t){case"chart":case"columns":case"data":case"paletteID":e.lazyRender()}})}return this},i.prototype.getWidget=function(){return this._targetWidget&&"composite_MultiChart"===this._targetWidget.classID()?this._targetWidget.chart():this._targetWidget},i.prototype.getPalette=function(){var t=this.getWidget();if(t&&t._palette)switch(t._palette.type()){case"ordinal":return e.Palette.ordinal(t._palette.id());case"rainbow":return e.Palette.rainbow(t._palette.id())}return e.Palette.ordinal("default")},i.prototype.getPaletteType=function(){return this.getPalette().type()},i.prototype.fillColorFunc=function(){var t=this.getWidget();if(t&&t.fillColor)return t._palette&&t.paletteID&&t._palette.name!==t.paletteID()&&(t._palette=t._palette.switch(t.paletteID())),function(e,i,o){return t.fillColor(e,i,o)};var i=e.Palette.ordinal(t&&t.paletteID&&t.paletteID()||"default");return function(t,e,o){return i(e)}},i.prototype.fillColor=function(t,e,i){return this.fillColorFunc()(t,e,i)},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._g=i.append("g").attr("class","legendOrdinal")},i.prototype.calcMetaData=function(){var t=[],i=0,o=0,r=this.columns().length;if(this._targetWidget){var l=this.columns();switch(this.getPaletteType()){case"ordinal":var n=this.fillColorFunc(),s=0;switch(this.dataFamily()){case"2D":t=this.data().map(function(t,e){s=this.data()[e].slice(1,r).reduce(function(t,e){return t+e},0);var l=this.isDisabled(t[0]);l||(i+=s);var a=t[0]+(!l&&this.showSeriesTotal()?" (".concat(s,")"):""),h=this.textSize(a);return o<h.width&&(o=h.width),[n(t,t[0],!1),t[0],a]},this);break;case"ND":t=this.columns().filter(function(t){return 0!==t.indexOf("__")}).filter(function(t,e){return e>0}).map(function(t,e){s=this.data().reduce(function(t,i){return t+i[e+1]},0);var r=this.isDisabled(l[e+1]),a=t+(!r&&this.showSeriesTotal()?" (".concat(s,")"):"");r||(i+=s);var h=this.textSize(a);return o<h.width&&(o=h.width),[n(void 0,t,!1),t,a]},this);break;default:t=this.columns().map(function(t){return[n(void 0,t,!1),t]},this)}break;case"rainbow":var a=this.getPalette(),h=e.format(this.rainbowFormat()),d=this.getWidget(),p=this.rainbowBins(),c=d._dataMinWeight,u=d._dataMaxWeight,g=(u-c)/(p-1);t.push([a(c,c,u),h(c)]);for(var f=1;f<p-1;++f){var y=g*f;Math.floor(y)>parseInt(t[0][1])&&(y=Math.floor(y)),t.push([a(y,c,u),h(y)])}t.push([a(u,c,u),h(u)])}}return{dataArr:t,total:i,maxLabelWidth:o}},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var r=this.calcMetaData(),l=r.dataArr,n=r.maxLabelWidth,s=r.total,a=this.shapeRadius(),h=this.radiusToSymbolSize(a),d=this.itemPadding();"horizontal"===this.orientation()&&(d+=n-2*a);var p=e.scaleOrdinal().domain(l.map(function(t){return t[1]})).range(l.map(function(t){return t[0]}));this._legendOrdinal.shape("path",j().type(this._symbolTypeMap[this.symbolType()]).size(h)()).orient(this.orientation()).title(this.title()).labelWrap(this.labelMaxWidth()).labelAlign(this.labelAlign()).shapePadding(d).scale(p).labels(function(t){return l[t.i][2]}),this._g.call(this._legendOrdinal),this.updateDisabled(o,l);var c=this._g.select(".legendCells").node().getBBox(),u=Math.abs(c.x),g=Math.abs(c.y)+1;if("horizontal"===this.orientation())"start"===this.labelAlign()?u+=1:"end"===this.labelAlign()&&(u-=1),this.width()>c.width&&(u+=(this.width()-c.width)/2);else if("vertical"===this.orientation()){if(u+=1,this._containerSize.height>c.height)g+=(this.height()-c.height)/2}this._g.attr("transform","translate(".concat(u,", ").concat(g,")")),this.pos({x:0,y:0}),this._legendOrdinal.labelOffset(this.itemPadding());var f=this._g.selectAll(".legendTotal").data(l.length&&this.showLegendTotal()?[s]:[]),y="Total: ".concat(s),b=-u,_=c.height+this.itemPadding()+1;this.enableOverflowScroll(!1),this.enableOverflow(!0),f.enter().append("text").classed("legendTotal",!0).merge(f).attr("transform","translate(".concat(b,", ").concat(_,")")).text(y),f.exit().remove()},i.prototype.updateDisabled=function(t,e){var i=this;t.style("cursor","pointer").selectAll("path.swatch").filter(function(t,i){return i<e.length}).style("stroke",function(t,i){return e[i][0]}).style("fill",function(t,o){return i._disabled.indexOf(t)<0?e[o][0]:"white"})},i.prototype.postUpdate=function(e,i){var o;this._boundingBox&&(o=this._boundingBox.width,this._boundingBox.width=this._size.width),t.prototype.postUpdate.call(this,e,i),void 0!==o&&(this._boundingBox.width=o),this._parentRelativeDiv.style("overflow","hidden")},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.radiusToSymbolSize=function(t){var e=Math.pow(t,2)*Math.PI;switch(this.symbolType()){case"star":return.45*e;case"triangle":return.65*e;case"cross":case"diamond":case"wye":return.75*e;case"circle":return e;case"square":return 1.3*e}},i.prototype.onClick=function(t,e){if("ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":var i=this._disabled.indexOf(t);i<0?this._disabled.push(t):this._disabled.splice(i,1),this._owner.refreshColumns(),this._owner.refreshData(),this._owner.render()}},i.prototype.onOver=function(t,e){if(o.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._disabled.indexOf(t)<0&&this._owner.highlightColumn(t)}},i.prototype.onOut=function(t,e){if(o.instanceOfIHighlight(this._owner)&&"ordinal"===this.getPaletteType())switch(this.dataFamily()){case"2D":case"ND":this._owner.highlightColumn()}},i.prototype.onDblClick=function(t,e){},i.prototype.onMouseOver=function(t,e){},i.prototype.resize=function(e){var i;if(this.fitToContent()){this._containerSize=e;var o=this.getBBox();e.width>o.width&&(o.width=e.width),e.height>o.height&&(o.height=e.height),i=t.prototype.resize.apply(this,[s({},o)])}else i=t.prototype.resize.apply(this,arguments);return i},i}(e.SVGWidget);Q.prototype._class+=" layout_Legend",Q.prototype.publish("title","","string","Title"),Q.prototype.publish("symbolType","circle","set","Shape of each legend item",["circle","cross","diamond","square","star","triangle","wye"]),Q.prototype.publish("labelMaxWidth",null,"number","Max Label Width (pixels)",null,{optional:!0}),Q.prototype.publish("orientation","vertical","set","Orientation of Legend rows",["vertical","horizontal"],{tags:["Private"]}),Q.prototype.publish("dataFamily","ND","set","Type of data",["1D","2D","ND","map","graph","any"],{tags:["Private"]}),Q.prototype.publish("rainbowFormat",",","string","Rainbow number formatting",null,{tags:["Private"],optional:!0,disable:function(t){return!t.isRainbow()}}),Q.prototype.publish("rainbowBins",8,"number","Number of rainbow bins",null,{tags:["Private"],disable:function(t){return!t.isRainbow()}}),Q.prototype.publish("showSeriesTotal",!1,"boolean","Show value next to series"),Q.prototype.publish("showLegendTotal",!1,"boolean","Show a total of the series values under the legend",null),Q.prototype.publish("itemPadding",8,"number","Padding between legend items (pixels)"),Q.prototype.publish("shapeRadius",7,"number","Radius of legend shape (pixels)"),Q.prototype.publish("fitToContent",!0,"boolean","If true, resize will simply reapply the bounding box dimensions"),Q.prototype.publish("labelAlign","start","set","Horizontal alignment of legend item label (for horizontal orientation only)",["start","middle","end"],{optional:!0,disable:function(t){return"vertical"===t.orientation()}});p(".layout_Modal-header{background-color:#3f51b5;overflow:hidden}.layout_Modal-body{background-color:#fff;overflow-x:hidden;overflow-y:scroll}.layout_Modal-annotations,.layout_Modal-title{position:absolute}.layout_Modal-closeButton{cursor:pointer}.layout_Modal-closeButton:hover{opacity:.7}.layout_Modal-closeButton:active{opacity:.5}.layout_Modal-fade{background-color:#000;opacity:.5;position:fixed;z-index:10000}.layout_Modal-content{background-color:#fff;position:fixed;z-index:10100}.layout_Modal-fade-hidden{display:none}.layout_Modal-fadeClickable{cursor:pointer}");var $=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e}return n(e,t),e.prototype.closeModal=function(){this.visible(!1)},e.prototype.getRelativeTarget=function(){var t;return this.relativeTargetId()&&(t=document.getElementById(this.relativeTargetId()))?t:!t&&(t=this.locateAncestor("layout_Grid"))&&t.element?t.element().node():document.body},e.prototype.setModalSize=function(){null!==this.fixedHeight()&&null!==this.fixedWidth()?this._modal.style("height",this.fixedHeight()).style("width",this.fixedWidth()).style("min-height",null).style("min-width",null).style("max-height",null).style("max-width",null):(this.minHeight()||this.minWidth())&&this._modal.style("min-height",this.minHeight()).style("min-width",this.minWidth()).style("max-height",this.maxHeight()).style("max-width",this.maxWidth());var t=this._modal.node().getBoundingClientRect(),e=this._modalHeader.node().getBoundingClientRect();return this._modalBody.style("height",t.height-e.height+"px").style("width",t.width),t},e.prototype.setFadePosition=function(t){this._fade.style("top",t.top+"px").style("left",t.left+"px").style("width",t.width+"px").style("height",t.height+"px")},e.prototype.setModalPosition=function(t){var e=this.setModalSize();if(null!==this.fixedTop()&&null!==this.fixedLeft())this._modal.style("top","calc(".concat(this.fixedTop()," + ").concat(t.top,"px)")).style("left","calc(".concat(this.fixedLeft()," + ").concat(t.left,"px)"));else if(null!==this.fixedHeight()&&null!==this.fixedWidth())this._modal.style("top",t.top+t.height/2-e.height/2+"px").style("left",t.left+t.width/2-e.width/2+"px");else if(this.minHeight()||this.minWidth()){var i=this._modal.node().getBoundingClientRect();this._modal.style("top",t.top+t.height/2-i.height/2+"px").style("left",t.left+t.width/2-i.width/2+"px")}},e.prototype.resize=function(e){return t.prototype.resize.call(this),this._modal&&this.setModalSize(),this},e.prototype.resizeBodySync=function(t,e){var i=this._modalHeader.node().getBoundingClientRect();return this._modal.style("width",t+"px").style("height",e+i.height+"px").style("min-width",t+"px").style("min-height",e+i.height+"px"),this._modalHeader.style("width",t+"px"),this._modalBody.style("width",t+"px").style("height",e+"px"),this.minWidth(t+"px").minHeight(e+i.height+"px").resize({height:e+i.height,width:t})},e.prototype.enter=function(e,i){var o=this;t.prototype.enter.call(this,e,i),this._fade=i.append("div").classed("layout_Modal-fade",!0).classed("layout_Modal-fadeClickable",this.enableClickFadeToClose()).classed("layout_Modal-fade-hidden",!this.showFade());var r=2*this.titleFontSize();this._modal=i.append("div").classed("layout_Modal-content",!0),this._modalHeader=this._modal.append("div").classed("layout_Modal-header",!0).style("color",this.titleFontColor()).style("font-size",this.titleFontSize()+"px").style("height",r+"px"),this._modalBody=this._modal.append("div").classed("layout_Modal-body",!0).style("height","calc( 100% - ".concat(r,"px )")).style("overflow-x",this.overflowX()).style("overflow-y",this.overflowY()),this._modalHeader.append("div").classed("layout_Modal-title",!0).style("line-height",this.titleFontSize()+"px").style("top",this.titleFontSize()/2+"px").style("left",this.titleFontSize()/2+"px").text(this.formattedTitle()),this._modalHeaderAnnotations=this._modalHeader.append("div").classed("layout_Modal-annotations",!0),this._modalHeaderCloseButton=this._modalHeaderAnnotations.append("div").classed("layout_Modal-closeButton",!0).html('<i class="fa fa-close"></i>'),this._modalHeaderAnnotations.style("line-height",this.titleFontSize()+"px").style("right",this.titleFontSize()/2+"px").style("top",this.titleFontSize()/2+"px"),this._modalHeaderCloseButton.on("click",function(){o.closeModal()}),this._fade.on("click",function(t){o.enableClickFadeToClose()&&o.closeModal()})},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("display",this.show()?null:"none"),this._fade.classed("layout_Modal-fade-hidden",!this.showFade()),this._relativeTarget=this.getRelativeTarget(),this.setModalSize();var o=this._relativeTarget.getBoundingClientRect();this.setFadePosition(o),this.setModalPosition(o),this.show()?(this._widget.target()||this._widget.target(this._modalBody.node()),this._widget.resize().render()):this._widget.target(null).render()},e.prototype.exit=function(e,i){this._widget&&this._widget.target(null),t.prototype.exit.call(this,e,i)},e.prototype.formattedTitle=function(){var t=this.title_exists()?this.title().trim():"";return t.length>0&&"("===t.slice(0,1)&&")"===t.slice(-1)?t.slice(1,-1):this.title()},e}(e.HTMLWidget);$.prototype._class+=" layout_Modal",$.prototype.publish("title",null,"string","title"),$.prototype.publish("widget",null,"widget","widget"),$.prototype.publish("titleFontSize",18,"number","titleFontSize (in pixels)"),$.prototype.publish("titleFontColor","#ffffff","html-color","titleFontColor"),$.prototype.publish("relativeTargetId",null,"string","relativeTargetId"),$.prototype.publish("show",!0,"boolean","show"),$.prototype.publish("showFade",!0,"boolean","showFade"),$.prototype.publish("enableClickFadeToClose",!0,"boolean","enableClickFadeToClose"),$.prototype.publish("minWidth","400px","string","minWidth"),$.prototype.publish("minHeight","400px","string","minHeight"),$.prototype.publish("maxWidth","800px","string","maxWidth"),$.prototype.publish("maxHeight","800px","string","maxHeight"),$.prototype.publish("fixedWidth",null,"string","fixedWidth"),$.prototype.publish("fixedHeight",null,"string","fixedHeight"),$.prototype.publish("fixedTop",null,"string","fixedTop"),$.prototype.publish("fixedLeft",null,"string","fixedLeft"),$.prototype.publish("overflowX","hidden","string","overflowX"),$.prototype.publish("overflowY","scroll","string","overflowY");p(".layout_ChartPanel .series.highlight{stroke-width:2px;opacity:1}.layout_ChartPanel .series.lowlight{opacity:.3!important}");var tt=function(t){function o(){var o=t.call(this)||this;return o._legend=new Q(o).enableOverflow(!0),o._progressBar=new e.ProgressBar,o._autoScale=!1,o._resolutions={tiny:{width:100,height:100},small:{width:300,height:300}},o._modal=new $,o._toggleInfo=(new e.ToggleButton).faChar("fa-info-circle").tooltip(".Description").selected(!1).on("enabled",function(){return""!==o.description()}).on("click",function(){if(o._toggleInfo.selected()){o._modal.title(o.title()).widget((new e.Text).text(o.description())).show(!0).render();var t=o._modal._close;o._modal._close=function(){o._toggleInfo.selected(!1).render(),o._modal._close=t}}}).on("mouseMove",function(){}).on("mouseOut",function(){}),o._toggleData=(new e.ToggleButton).faChar("fa-table").tooltip("Data").on("click",function(){o.dataVisible(o._toggleData.selected()),o.render()}),o._buttonDownload=(new e.Button).faChar("fa-download").tooltip("Download").on("click",function(){o.downloadCSV()}),o._buttonDownloadImage=(new e.Button).faChar("fa-image").tooltip("Download Image").on("click",function(){o.downloadPNG()}),o._toggleLegend=(new e.ToggleButton).faChar("fa-list-ul").tooltip("Legend").selected(!1).on("click",function(){var t=o._toggleLegend.selected();"bottom"===o.legendPosition()?o.showBottom(t):"right"===o.legendPosition()&&o.showRight(t),o.legendVisible(t),o.render()}),o._spacer=new e.Spacer,o._titleBar=(new e.TitleBar).buttons([o._toggleData,o._buttonDownload,o._buttonDownloadImage,o._spacer,o._toggleLegend]),o._carousel=new v,o._table=new i.Table,o._hideLegendToggleList=["dgrid_Table"],o._tag="div",o}return n(o,t),o.prototype.fields=function(e){return arguments.length?(t.prototype.fields.call(this,e),this._legend.fields(e),this.refreshFields(),this):t.prototype.fields.call(this)},o.prototype.refreshFields=function(){return this._widget.fields(this._legend.filteredFields()),this._table.fields(this._legend.filteredFields()),this},o.prototype.columns=function(e,i){return arguments.length?(t.prototype.columns.call(this,e,i),this._legend.columns(e,i),this.refreshColumns(),this):t.prototype.columns.call(this)},o.prototype.refreshColumns=function(){return this._widget.columns(this._legend.filteredColumns()),this._table.columns(this._legend.filteredColumns()),this},o.prototype.data=function(e){return arguments.length?(t.prototype.data.call(this,e),this._legend.data(e),this.refreshData(),this):t.prototype.data.call(this)},o.prototype.refreshData=function(){return this._widget.data(this._legend.filteredData()),this._table.data(this._legend.filteredData()),this},o.prototype.highlight=function(t){return arguments.length?(this._highlight=t,this):this._highlight},o.prototype.startProgress=function(){this._progressBar.start()},o.prototype.finishProgress=function(){this._progressBar.finish()},o.prototype.buttons=function(t){return arguments.length?(this._titleBar.buttons(t),this):this._titleBar.buttons()},o.prototype.downloadCSV=function(){var t=this.downloadTitle()?this.downloadTitle():this.title()?this.title():"data",i=this.downloadTimestampSuffix()?"_"+e.Utility.timestamp():"";return e.Utility.downloadString("CSV",this._widget.export("CSV"),t+i),this},o.prototype.downloadPNG=function(){var t=this.widget();return t instanceof e.SVGWidget&&(this.legendVisible()?t.downloadPNG(this.title(),void 0,this._legend):t.downloadPNG(this.title())),this},o.prototype.highlightColumn=function(t){if(t){var i="series-".concat(this.cssTag(t));this._centerWA.element().selectAll(".series").each(function(){var t=e.select(this),o=t.classed(i);t.classed("highlight",o).classed("lowlight",!o)})}else this._centerWA.element().selectAll(".series").classed("highlight",!1).classed("lowlight",!1);return this},o.prototype.getResponsiveMode=function(){return this.enableAutoscaling()?this._autoScale?this.size().width<=this._resolutions.tiny.width||this.size().height<=this._resolutions.tiny.height?"tiny":this.size().width<=this._resolutions.small.width||this.size().height<=this._resolutions.small.height?"small":"regular":"regular":"none"},o.prototype.setOrigSize=function(){this._orig_size=JSON.parse(JSON.stringify(this.size()))},o.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._modal.target(this.target()).relativeTargetId(this.id()),this.top(this._titleBar),this.center(this._carousel),this._legend.targetWidget(this._widget).orientation("vertical").title("").visible(!1),this._progressBar.enter(e,i),this.setOrigSize()},o.prototype.preUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none")},o.prototype.preUpdateSmall=function(t){var e=this._orig_size.width/this._resolutions.small.width,i=this._orig_size.height/this._resolutions.small.height;this._scale=Math.min(e,i);var o=this._scale===e;this.size({width:o?this._resolutions.small.width:this._orig_size.width*(1/this._scale),height:o?this._orig_size.height*(1/this._scale):this._resolutions.small.height}),t.select("div.title-icon").style("position","static"),t.selectAll("lhs").style("display","none"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.style("transform","scale(".concat(this._scale,")"))},o.prototype.preUpdateRegular=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden"),t.select("div.title-icon").style("position","static"),t.style("transform","translate(0px,0px) scale(1)")},o.prototype.update=function(e,i){var o=this;if(t.prototype.update.call(this,e,i),this._table&&this.widget_exists()&&this.widget().class().indexOf("chart_XYAxis")>=0){var r=this.widget();this._table.columns().forEach(function(t,e){switch(0===e?r.xAxisType():r.yAxisType()){case"linear":case"log":case"pow":o._table.columnType(t,"number");break;case"time":o._table.columnType(t,"time");break;default:o._table.columnType(t,"string")}o._table.columnPattern(t,0===e?r.xAxisTypeTimePattern():r.yAxisTypeTimePattern()),o._table.columnFormat(t,0===e?r.xAxisTickFormat():r.yAxisTickFormat())})}},o.prototype.preUpdate=function(i,o){switch(t.prototype.preUpdate.call(this,i,o),this._prevLegendPosition!==this.legendPosition()&&(null!==this._legend.target()&&this._legend.target(null),void 0!==this._prevLegendPosition?this.swap(this._prevLegendPosition,this.legendPosition()):this[this.legendPosition()](this._legend),"right"===this.legendPosition()?(this.rightOverflowX("hidden"),this.rightOverflowY("auto"),this.bottomOverflowX("visible"),this.bottomOverflowY("visible")):(this.rightOverflowX("visible"),this.rightOverflowY("visible"),this.bottomOverflowX("auto"),this.bottomOverflowY("hidden")),this._prevLegendPosition=this.legendPosition()),this._prevdataVisible!==this.dataVisible()&&(this._prevdataVisible=this.dataVisible(),this._toggleData.selected(this._prevdataVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible),this._carousel.active(this._prevdataVisible?1:0)),this._prevlegendVisible!==this.legendVisible()&&(this._prevlegendVisible=this.legendVisible(),this._toggleLegend.selected(this._prevlegendVisible),this._legend.visible(this._prevlegendVisible&&!this._prevdataVisible)),this._legend.orientation("bottom"===this.legendPosition()?"horizontal":"vertical"),this.showLeft(!this.left()),this.getResponsiveMode()){case"tiny":this.preUpdateTiny(o);break;case"small":this.preUpdateSmall(o);break;case"regular":this.preUpdateRegular(o)}var r="composite_MultiChart"===this._widget.classID()?this._widget.chart():this._widget;if(this._legend.dataFamily(r._dataFamily||"any"),this._prevChartDataFamily!==this._legend.dataFamily()&&(this._prevChartDataFamily=this._legend.dataFamily(),"any"===this._prevChartDataFamily))this._toggleLegend.selected(!1),this._legend.visible(!1);if(o.style("box-shadow",this.highlight()?"inset 0px 0px 0px ".concat(this.highlightSize(),"px ").concat(this.highlightColor()):"none"),-1!==this._hideLegendToggleList.indexOf(r.classID())?(this._spacer.visible(!1),this._toggleLegend.visible(!1)):(this._spacer.visible(!0),this._toggleLegend.visible(!0)),this._prevChart!==r){this._prevChart=r;var l=r?r._titleBar||r._iconBar:void 0;if(l&&l instanceof e.IconBar){this._prevButtons=this._prevButtons||d([],this.buttons(),!0);var n=d(d(d([],l.buttons(),!0),[new e.Spacer],!1),this._prevButtons,!0);l.buttons([]).render(),this.buttons(n)}else this._prevButtons&&this.buttons(this._prevButtons)}var s=[];this.dataButtonVisible()||s.push(this._toggleData),this.downloadButtonVisible()||s.push(this._buttonDownload),this.downloadImageButtonVisible()||s.push(this._buttonDownloadImage),this.legendButtonVisible()||s.push(this._toggleLegend),this._buttonDownloadImage.enabled(this.widget()instanceof e.SVGWidget),this._titleBar.hiddenButtons(s).visible(this.titleVisible()),this.topOverlay(this.titleOverlay()||!this.titleVisible())},o.prototype.postUpdate=function(e,i){switch(t.prototype.postUpdate.call(this,e,i),this.getResponsiveMode()){case"tiny":this.postUpdateTiny(i);break;case"small":this.postUpdateSmall(i);break;case"regular":this.postUpdateRegular(i)}},o.prototype.postUpdateTiny=function(t){t.selectAll("div.body,div.title-text,div.icon-bar").style("display","none"),t.selectAll("div.data-count").style("visibility","visible").style("font-size",this.titleIconFontSize()/3+"px").style("line-height",this.titleIconFontSize()/3+"px").style("left",this.titleIconFontSize()+"px").text(this.data().length),t.style("transform","translate(0px,0px) scale(1)");var e=t.selectAll("div.title-icon"),i=e.node(),o=t.node().parentElement.getBoundingClientRect();if(i){var r=e.node().getBoundingClientRect(),l=o.height/2;e.style("position","absolute").style("left","calc(50% - ".concat(r.width/2,"px)")).style("top","".concat(l-r.height/2,"px")),t.selectAll("div.data-count").style("position","absolute").style("left","calc(50% + ".concat(r.width/2,"px)")).style("top","".concat(l-r.height/2,"px"))}},o.prototype.postUpdateSmall=function(t){t.selectAll("lhs").style("display","none"),t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden");var e=t.node().getBoundingClientRect(),i=t.node().parentElement.getBoundingClientRect();t.style("transform","translate(".concat(i.x-e.x,"px, ").concat(i.y-e.y,"px) scale(").concat(this._scale,")"))},o.prototype.postUpdateRegular=function(t){t.selectAll("div.title-icon").style("position","static"),t.selectAll("div.body,div.title-text,div.icon-bar").style("display",""),t.selectAll("div.data-count").style("visibility","hidden")},o.prototype.exit=function(e,i){this._progressBar.exit(e,i),this.right(null),this._legend.target(null),this.center(null),this._carousel.target(null),this.top(null),this._titleBar.target(null),this._modal.target(null),delete this._prevChart,delete this._prevButtons,delete this._prevChartDataFamily,delete this._prevPos,delete this._prevdataVisible,delete this._prevlegendVisible,t.prototype.exit.call(this,e,i)},o.prototype.click=function(t,e,i){},o.prototype.dblclick=function(t,e,i){},o.prototype.vertex_click=function(t,e,i,o){o&&o.vertex},o.prototype.vertex_dblclick=function(t,e,i,o){o&&o.vertex},o.prototype.edge_click=function(t,e,i,o){o&&o.edge},o.prototype.edge_dblclick=function(t,e,i,o){o&&o.edge},o}(_);tt.prototype._class+=" layout_ChartPanel",tt.prototype.publishReset(),tt.prototype.publishProxy("title","_titleBar"),tt.prototype.publish("titleVisible",!0,"boolean"),tt.prototype.publish("titleOverlay",!1,"boolean"),tt.prototype.publishProxy("titleIcon","_titleBar"),tt.prototype.publishProxy("titleIconFont","_titleBar"),tt.prototype.publishProxy("titleFont","_titleBar"),tt.prototype.publishProxy("titleIconFontSize","_titleBar"),tt.prototype.publishProxy("titleFontSize","_titleBar"),tt.prototype.publishProxy("description","_titleBar"),tt.prototype.publishProxy("descriptionFont","_titleBar"),tt.prototype.publishProxy("descriptionFontSize","_titleBar"),tt.prototype.publish("dataVisible",!1,"boolean","Show data table"),tt.prototype.publish("dataButtonVisible",!0,"boolean","Show data table button"),tt.prototype.publish("downloadButtonVisible",!0,"boolean","Show data download button"),tt.prototype.publish("downloadImageButtonVisible",!1,"boolean","Show image download button"),tt.prototype.publish("downloadTitle","","string","File name when downloaded"),tt.prototype.publish("downloadTimestampSuffix",!0,"boolean","Use timestamp as file name suffix"),tt.prototype.publish("legendVisible",!1,"boolean","Show legend"),tt.prototype.publish("legendButtonVisible",!0,"boolean","Show legend button"),tt.prototype.publish("legendPosition","right","set","Position of legend",["right","bottom"]),tt.prototype.publishProxy("legend_labelMaxWidth","_legend","labelMaxWidth"),tt.prototype.publishProxy("legend_showSeriesTotal","_legend","showSeriesTotal"),tt.prototype.publishProxy("legend_showLegendTotal","_legend","showLegendTotal"),tt.prototype.publishProxy("legend_itemPadding","_legend","itemPadding"),tt.prototype.publishProxy("legend_shapeRadius","_legend","shapeRadius"),tt.prototype.publishProxy("legend_symbolType","_legend","symbolType"),tt.prototype.publishProxy("legend_labelAlign","_legend","labelAlign"),tt.prototype.publish("widget",null,"widget","Widget",void 0,{render:!1}),tt.prototype.publish("enableAutoscaling",!1,"boolean"),tt.prototype.publish("highlightSize",4,"number"),tt.prototype.publish("highlightColor","#e67e22","html-color"),tt.prototype.publishProxy("progress_halfLife","_progressBar","halfLife"),tt.prototype.publishProxy("progress_decay","_progressBar","decay"),tt.prototype.publishProxy("progress_size","_progressBar","size"),tt.prototype.publishProxy("progress_color","_progressBar","color"),tt.prototype.publishProxy("progress_blurBar","_progressBar","blurBar"),tt.prototype.publishProxy("progress_blurSize","_progressBar","blurSize"),tt.prototype.publishProxy("progress_blurColor","_progressBar","blurColor"),tt.prototype.publishProxy("progress_blurOpacity","_progressBar","blurOpacity"),tt.prototype.widget=function(t){if(!arguments.length)return this._widget;this._carousel.widgets([t,this._table]),this._widget=t,this._widget.fields(this._legend.filteredFields()).data(this._legend.filteredData());var e=this,i=this._widget;return i.click=function(){e.click.apply(e,arguments)},i.dblclick=function(){e.dblclick.apply(e,arguments)},i.vertex_click=function(){e.vertex_click.apply(e,arguments)},i.vertex_dblclick=function(){e.vertex_dblclick.apply(e,arguments)},i.edge_click=function(){e.edge_click.apply(e,arguments)},i.edge_dblclick=function(){e.edge_dblclick.apply(e,arguments)},this};p(".layout_FlexGrid{display:flex}.FlexGrid-list-item{border-style:solid;flex-grow:1;overflow:hidden}");var et=function(t){function i(){return t.call(this)||this}return n(i,t),i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),e.select(i.parentNode).style("height","100%").style("width","100%")},i.prototype.update=function(e,i){var o=this;t.prototype.update.call(this,e,i);var r=this,l=[];this.updateFlexParent(i);var n=i.selectAll(".FlexGrid-list-item").data(this.widgets(),function(t){return t.id()});n.enter().append("div").classed("FlexGrid-list-item",!0).each(function(t){t.target(this)}).merge(n).style("min-height",this.itemMinHeight()+"px").style("min-width",this.itemMinWidth()+"px").style("flex-basis",function(t,e){var i=o.widgetsFlexBasis()[e];return void 0!==i?i:o.flexBasis()}).style("flex-grow",function(t,e){var i=o.widgetsFlexGrow()[e];return void 0!==i?i:o.flexGrow()}).style("border-width",this.borderWidth()+"px").style("border-color",this.itemBorderColor()).each(function(){this.firstChild.style.display="none"}).each(function(){var t=this.getBoundingClientRect();l.push([t.width,t.height])}).each(function(t,e){this.firstChild.style.display="block",t.resize({width:l[e][0]-2*r.borderWidth(),height:l[e][1]-2*r.borderWidth()})}),n.exit().remove()},i.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},i.prototype.updateFlexParent=function(t){var e=this;t.style("height","100%").style("flex-direction","horizontal"===this.orientation()?"row":"column").style("flex-wrap",this.flexWrap()).style("align-items",this.alignItems()).style("align-content",this.alignContent()).style("overflow-x",function(){return e.forceXScroll()||"horizontal"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"}).style("overflow-y",function(){return e.forceYScroll()||"vertical"===e.orientation()&&"nowrap"===e.flexWrap()&&!e.disableScroll()?"scroll":"hidden"})},i}(e.HTMLWidget);function it(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}et.prototype._class+=" layout_FlexGrid",et.prototype.publish("itemBorderColor","transparent","html-color","Color of list item borders"),et.prototype.publish("borderWidth",0,"number","Width of list item borders (pixels)"),et.prototype.publish("orientation","horizontal","set","Controls the flex-direction of the list items",["horizontal","vertical"]),et.prototype.publish("flexWrap","wrap","set","Controls the line wrap when overflow occurs",["nowrap","wrap","wrap-reverse"]),et.prototype.publish("disableScroll",!1,"boolean","If false, scrollbar will show (when flexWrap is set to 'nowrap')",null,{disable:function(t){return"nowrap"!==t.flexWrap()}}),et.prototype.publish("forceXScroll",!1,"boolean","If true, horzontal scrollbar will show"),et.prototype.publish("forceYScroll",!1,"boolean","If true, vertical scrollbar will show"),et.prototype.publish("itemMinHeight",64,"number","Minimum height of a list item (pixels)"),et.prototype.publish("itemMinWidth",64,"number","Minimum width of a list item (pixels)"),et.prototype.publish("alignItems","stretch","set","Controls normal alignment of items",["flex-start","center","flex-end","stretch"]),et.prototype.publish("alignContent","stretch","set","Controls normal alignment of item rows",["flex-start","center","flex-end","stretch","space-between","space-around"]),et.prototype.publish("flexGrow",1,"number","Default flex-grow style for all list items"),et.prototype.publish("flexBasis","10%","string","Default flex-basis style for all list items"),et.prototype.publish("widgetsFlexGrow",[],"array","Array of flex-grow values keyed on the widgets array"),et.prototype.publish("widgetsFlexBasis",[],"array","Array of flex-basis values keyed on the widgets array"),et.prototype.publish("widgets",[],"widgetArray","Array of widgets to be rendered as list items");var ot,rt={exports:{}};var lt=(ot||(ot=1,function(t){t.exports=function(){var t=function(t,e){for(var i in this._options=e,this.defaults)this._options.hasOwnProperty(i)||(this._options[i]=this.defaults[i]);this.items=t,this._adjustSizeOfItems(),this.generateGrid()};t.cloneItems=function(t,e){var i,o;for(void 0===e&&(e=[]),i=0;i<t.length;i++)for(o in e[i]||(e[i]={}),t[i])e[i][o]=t[i][o];return e},t.prototype={defaults:{lanes:5,direction:"horizontal"},toString:function(){var t,e,i,o=this.grid.length,r="\n #|",l="\n --";for(e=0;e<o;e++)r+=" "+this._padNumber(e," "),l+="---";for(r+=l,e=0;e<this._options.lanes;e++)for(r+="\n"+this._padNumber(e," ")+"|",i=0;i<o;i++)r+=" ",r+=(t=this.grid[i][e])?this._padNumber(this.items.indexOf(t),"0"):"--";return r+="\n"},generateGrid:function(){var t;for(this._resetGrid(),t=0;t<this.items.length;t++)this._markItemPositionToGrid(this.items[t])},resizeGrid:function(t){var e=0;this._options.lanes=t,this._adjustSizeOfItems(),this._sortItemsByPosition(),this._resetGrid();for(var i=0;i<this.items.length;i++){var o=this.items[i],r=this._getItemPosition(o);this._updateItemPosition(o,this.findPositionForItem(o,{x:e,y:0})),e=Math.max(e,r.x)}this._pullItemsToLeft()},findPositionForItem:function(t,e,i){var o,r,l;for(o=e.x;o<this.grid.length;o++)if(void 0!==i){if(l=[o,i],this._itemFitsAtPosition(t,l))return l}else for(r=e.y;r<this._options.lanes;r++)if(l=[o,r],this._itemFitsAtPosition(t,l))return l;var n=this.grid.length,s=0;return void 0!==i&&this._itemFitsAtPosition(t,[n,i])&&(s=i),[n,s]},moveItemToPosition:function(t,e){var i=this._getItemPosition({x:e[0],y:e[1],w:t.w,h:t.h});this._updateItemPosition(t,[i.x,i.y]),this._resolveCollisions(t)},resizeItem:function(t,e){var i=e.w||t.w,o=e.h||t.h;this._updateItemSize(t,i,o),this._resolveCollisions(t),this._pullItemsToLeft()},getChangedItems:function(t,e){for(var i=[],o=0;o<t.length;o++){var r=this._getItemByAttribute(e,t[o][e]);r.x===t[o].x&&r.y===t[o].y&&r.w===t[o].w&&r.h===t[o].h||i.push(r)}return i},_sortItemsByPosition:function(){this.items.sort(function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return i.x!=o.x?i.x-o.x:i.y!=o.y?i.y-o.y:0}.bind(this))},_adjustSizeOfItems:function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];void 0===e.autoSize&&(e.autoSize=0===e.w||0===e.h),e.autoSize&&("horizontal"===this._options.direction?e.h=this._options.lanes:e.w=this._options.lanes)}},_resetGrid:function(){this.grid=[]},_itemFitsAtPosition:function(t,e){var i,o,r=this._getItemPosition(t);if(e[0]<0||e[1]<0)return!1;if(e[1]+r.h>this._options.lanes)return!1;for(i=e[0];i<e[0]+r.w;i++){var l=this.grid[i];if(l)for(o=e[1];o<e[1]+r.h;o++)if(l[o]&&l[o]!==t)return!1}return!0},_updateItemPosition:function(t,e){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),this._setItemPosition(t,e),this._markItemPositionToGrid(t)},_updateItemSize:function(t,e,i){null!==t.x&&null!==t.y&&this._deleteItemPositionFromGrid(t),t.w=e,t.h=i,this._markItemPositionToGrid(t)},_markItemPositionToGrid:function(t){var e,i,o=this._getItemPosition(t);for(this._ensureColumns(o.x+o.w),e=o.x;e<o.x+o.w;e++)for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]=t},_deleteItemPositionFromGrid:function(t){var e,i,o=this._getItemPosition(t);for(e=o.x;e<o.x+o.w;e++)if(this.grid[e])for(i=o.y;i<o.y+o.h;i++)this.grid[e][i]==t&&(this.grid[e][i]=null)},_ensureColumns:function(t){var i;for(i=0;i<t;i++)this.grid[i]||this.grid.push(new e(this._options.lanes))},_getItemsCollidingWithItem:function(t){for(var e=[],i=0;i<this.items.length;i++)t!=this.items[i]&&this._itemsAreColliding(t,this.items[i])&&e.push(i);return e},_itemsAreColliding:function(t,e){var i=this._getItemPosition(t),o=this._getItemPosition(e);return!(o.x>=i.x+i.w||o.x+o.w<=i.x||o.y>=i.y+i.h||o.y+o.h<=i.y)},_resolveCollisions:function(t){this._tryToResolveCollisionsLocally(t)||this._pullItemsToLeft(t),this._pullItemsToLeft()},_tryToResolveCollisionsLocally:function(e){var i=this._getItemsCollidingWithItem(e);if(!i.length)return!0;var o,r,l,n,s=new t([],this._options);t.cloneItems(this.items,s.items),s.generateGrid();for(var a=0;a<i.length;a++){var h=s.items[i[a]],d=this._getItemPosition(h),p=this._getItemPosition(e);if(o=[p.x-d.w,d.y],r=[p.x+p.w,d.y],l=[d.x,p.y-d.h],n=[d.x,p.y+p.h],s._itemFitsAtPosition(h,o))s._updateItemPosition(h,o);else if(s._itemFitsAtPosition(h,l))s._updateItemPosition(h,l);else if(s._itemFitsAtPosition(h,n))s._updateItemPosition(h,n);else{if(!s._itemFitsAtPosition(h,r))return!1;s._updateItemPosition(h,r)}}return t.cloneItems(s.items,this.items),this.generateGrid(),!0},_pullItemsToLeft:function(t){if(this._sortItemsByPosition(),this._resetGrid(),t){var e=this._getItemPosition(t);this._updateItemPosition(t,[e.x,e.y])}for(var i=0;i<this.items.length;i++){var o=this.items[i],r=this._getItemPosition(o);if(!t||o!=t){var l=this._findLeftMostPositionForItem(o),n=this.findPositionForItem(o,{x:l,y:0},r.y);this._updateItemPosition(o,n)}}},_findLeftMostPositionForItem:function(t){for(var e=0,i=this._getItemPosition(t),o=0;o<this.grid.length;o++)for(var r=i.y;r<i.y+i.h;r++){var l=this.grid[o][r];if(l){var n=this._getItemPosition(l);this.items.indexOf(l)<this.items.indexOf(t)&&(e=n.x+n.w)}}return e},_getItemByAttribute:function(t,e){for(var i=0;i<this.items.length;i++)if(this.items[i][t]===e)return this.items[i];return null},_padNumber:function(t,e){return t>=10?t:e+t},_getItemPosition:function(t){return"horizontal"===this._options.direction?t:{x:t.y,y:t.x,w:t.h,h:t.w}},_setItemPosition:function(t,e){"horizontal"===this._options.direction?(t.x=e[0],t.y=e[1]):(t.x=e[1],t.y=e[0])}};var e=function(t){for(var e=0;e<t;e++)this.push(null)};return e.prototype=[],t}()}(rt)),rt.exports),nt=it(lt),st=r({__proto__:null,default:nt},[lt]);p('.layout_Grid>.ddCell{position:absolute}.layout_Grid>.laneBackground{background:#f5f5f5;border-style:solid;border-width:1px;position:absolute}.layout_Grid>.lane{border-radius:0;border-style:none;opacity:.25;pointer-events:none;position:absolute}.layout_Grid>.ddCell.draggable{background-color:#f8f8ff;border-radius:0;border-style:solid;border-width:1px;cursor:move}.layout_Grid>.ddCell.draggable>.resizeHandle{border-style:none;bottom:0;cursor:nwse-resize;height:8px;position:absolute;right:0;width:8px}.layout_Grid>.ddCell.draggable .resizeHandleDisplay{background-color:none;border-color:#a9a9a9;border-style:solid;border-width:0 2px 2px 0;bottom:2px;height:4px;position:absolute;right:2px;width:4px}.layout_Grid>.ddCell.draggable .resizeHandleDisplay:hover{border-color:orange}.layout_Grid>.dragging{background:repeating-linear-gradient(-45deg,transparent,transparent 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 8px)}.layout_Grid>.dragging,.layout_Grid>.resizing{border:1px solid gray;border-radius:0;position:absolute}.layout_Grid>.resizing{background-color:orange;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,orange 0,orange 8px);opacity:.3}.layout_Grid>.ddCell.draggable .common_Widget.selected{background-color:gray;background:repeating-linear-gradient(-45deg,transparent,transparent 4px,rgba(100,0,0,.1) 0,rgba(100,0,0,.1) 8px);border:1px solid red;border-radius:0;position:absolute}.layout_Grid #drag-me:before{content:"#" attr(id);font-weight:700}');var at=st&&nt||st,ht=function(t){function i(){var i=t.call(this)||this;return i._tag="div",i._selectionBag=new e.Utility.Selection(i),i.content([]),i}return n(i,t),i.prototype.getDimensions=function(){var t={width:0,height:0};return this.content().forEach(function(e){t.width<e.gridCol()+e.gridColSpan()&&(t.width=e.gridCol()+e.gridColSpan()),t.height<e.gridRow()+e.gridRowSpan()&&(t.height=e.gridRow()+e.gridRowSpan())},this),t},i.prototype.clearContent=function(t){this.content(this.content().filter(function(e){if(!t)return e.target(null),!1;for(var i=e;i;){if(t===i)return e.target(null),!1;i=i.widget?i.widget():null}return!0}))},i.prototype.setContent=function(t,e,i,o,r,l){if(r=r||1,l=l||1,o=o||"",this.content(this.content().filter(function(i){return i.gridRow()!==t||i.gridCol()!==e||(i.target(null),!1)})),i){var n=(new f).gridRow(t).gridCol(e).widget(i).title(o).gridRowSpan(r).gridColSpan(l);this.content().push(n)}return this},i.prototype.sortedContent=function(){return this.content().sort(function(t,e){return t.gridRow()===e.gridRow()?t.gridCol()-e.gridCol():t.gridRow()-e.gridRow()})},i.prototype.getCell=function(t,e){var i=null;return this.content().some(function(o){return t>=o.gridRow()&&t<o.gridRow()+o.gridRowSpan()&&e>=o.gridCol()&&e<o.gridCol()+o.gridColSpan()&&(i=o,!0)}),i},i.prototype.getWidgetCell=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i,!0)}),e},i.prototype.getContent=function(t){var e=null;return this.content().some(function(i){return i.widget().id()===t&&(e=i.widget(),!0)}),e},i.prototype.cellToGridItem=function(t){return{x:t.gridCol(),y:t.gridRow(),w:t.gridColSpan(),h:t.gridRowSpan(),id:t.id(),cell:t}},i.prototype.gridItemToCell=function(t){t.cell.gridCol(t.x).gridRow(t.y).gridColSpan(t.w).gridRowSpan(t.h)},i.prototype.resetItemsPos=function(){this.origItems.forEach(function(t){var e=this.itemsMap[t.id];e.x=t.x,e.y=t.y},this)},i.prototype.initGridList=function(){this.itemsMap={},this.items=this.content().map(function(t){var e=this.cellToGridItem(t);return this.itemsMap[e.id]=e,e},this),this.origItems=this.content().map(this.cellToGridItem),this.gridList=new at(this.items,{direction:this.snapping(),lanes:"horizontal"===this.snapping()?this.snappingRows():this.snappingColumns()})},i.prototype.killGridList=function(){this.gridList=null,delete this.items,delete this.itemsMap},i.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o),this._scrollBarWidth=e.Platform.getScrollbarWidth();var r=this;this._d3Drag=e.drag().subject(function(t){var e=r.cellToGridItem(t);return{x:e.x*r.cellWidth,y:e.y*r.cellHeight}}).on("start",function(t){if(r.designMode()){e.d3Event().sourceEvent.stopPropagation(),r.initGridList();var i=r.itemsMap[t.id()];r.dragItem=o.append("div").attr("class","dragging").style("transform",function(){return"translate("+i.x*r.cellWidth+"px, "+i.y*r.cellHeight+"px)"}).style("width",function(){return i.w*r.cellWidth-r.gutter()+"px"}).style("height",function(){return i.h*r.cellHeight-r.gutter()+"px"}),r.selectionBagClick(t)}}).on("drag",function(t){if(r.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=r.itemsMap[t.id()];i.x<0&&(i.x=0),i.x+o.w*r.cellWidth>r.snappingColumns()*r.cellWidth&&(i.x=r.snappingColumns()*r.cellWidth-o.w*r.cellWidth),i.y<0&&(i.y=0),i.y+o.h*r.cellWidth>r.snappingRows()*r.cellWidth&&(i.y=r.snappingRows()*r.cellWidth-o.h*r.cellWidth);var l=[Math.max(0,Math.floor((i.x+r.cellWidth/2)/r.cellWidth)),Math.max(0,Math.floor((i.y+r.cellHeight/2)/r.cellHeight))];o.x===l[0]&&o.y===l[1]||("none"!==r.snapping()?(r.resetItemsPos(),r.gridList.moveItemToPosition(o,l)):(o.x=l[0],o.y=l[1]),t.gridCol()===o.x&&t.gridRow()===o.y||(r.items.forEach(r.gridItemToCell),r.updateGrid(!1,100))),r.dragItem.style("transform",function(){return"translate("+i.x+"px, "+i.y+"px)"}).style("width",function(){return o.w*r.cellWidth+"px"}).style("height",function(){return o.h*r.cellHeight+"px"})}}).on("end",function(){r.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())}),this._d3DragResize=e.drag().subject(function(t){var e=r.cellToGridItem(t);return{x:(e.x+e.w-1)*r.cellWidth,y:(e.y+e.h-1)*r.cellHeight}}).on("start",function(t){if(r.designMode()){e.d3Event().sourceEvent.stopPropagation(),r.initGridList();var i=r.itemsMap[t.id()];r.dragItem=o.append("div").attr("class","resizing").style("transform",function(){return"translate("+i.x*r.cellWidth+"px, "+i.y*r.cellHeight+"px)"}).style("width",function(){return i.w*r.cellWidth-r.gutter()+"px"}).style("height",function(){return i.h*r.cellHeight-r.gutter()+"px"}),r.dragItemPos={x:i.x,y:i.y}}}).on("drag",function(t){if(r.designMode()){var i=e.d3Event();i.sourceEvent.stopPropagation();var o=r.itemsMap[t.id()],l=[Math.max(0,Math.round(i.x/r.cellWidth)),Math.max(0,Math.round(i.y/r.cellHeight))],n={w:Math.max(1,l[0]-o.x+1),h:Math.max(1,l[1]-o.y+1)};o.w===n.w&&o.h===n.h||("none"!==r.snapping()?(r.resetItemsPos(),r.gridList.resizeItem(o,n)):(o.w=n.w,o.h=n.h),t.gridColSpan()===o.w&&t.gridRowSpan()===o.h||(r.items.forEach(r.gridItemToCell),r.updateGrid(o.id,100))),r.dragItem.style("width",function(){return(1-o.x)*r.cellWidth+i.x-r.gutter()+"px"}).style("height",function(){return(1-o.y)*r.cellHeight+i.y-r.gutter()+"px"})}}).on("end",function(){r.designMode()&&(e.d3Event().sourceEvent.stopPropagation(),r.dragItem.remove(),r.dragItem=null,r.killGridList())})},i.prototype.updateGrid=function(t,e,i){void 0===e&&(e=0),e=e||0;var o=this;this.divItems.classed("draggable",this.designMode()).transition().duration(e).style("left",function(t){return t.gridCol()*o.cellWidth+o.gutter()/2+"px"}).style("top",function(t){return t.gridRow()*o.cellHeight+o.gutter()/2+"px"}).style("width",function(t){return t.gridColSpan()*o.cellWidth-o.gutter()+"px"}).style("height",function(t){return t.gridRowSpan()*o.cellHeight-o.gutter()+"px"}).on("end",function(e){e.surfaceShadow_default(o.surfaceShadow()).surfacePadding_default(o.surfacePadding()).surfaceBorderWidth_default(o.surfaceBorderWidth()).surfaceBackgroundColor_default(o.surfaceBackgroundColor()),!0!==t&&t!==e.id()||e.resize().lazyRender()})},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o),this._placeholderElement.style("overflow-x","width"===this.fitTo()?"hidden":null),this._placeholderElement.style("overflow-y","width"===this.fitTo()?"scroll":null);var r=this.getDimensions(),l=this.width()-("width"===this.fitTo()?this._scrollBarWidth:0);if(this.cellWidth=l/r.width,this.cellHeight="all"===this.fitTo()?this.height()/r.height:this.cellWidth,this.designMode()){var n=Math.min(this.width()/this.snappingColumns(),this.height()/this.snappingRows()),s=Math.floor(n);this.cellWidth=s,this.cellHeight=this.cellWidth}var a=this,h=o.selectAll("#"+this.id()+" > .ddCell").data(this.content(),function(t){return t.id()});this.divItems=h.enter().append("div").attr("class","ddCell").each(function(t){t.target(this),t.__grid_watch=t.monitor(function(e,i,o){!a._renderCount||"snapping"!==e&&0!==e.indexOf("grid")||i===o||a.gridList||(a.initGridList(),"none"!==a.snapping()&&a.gridList.resizeGrid("horizontal"===a.snapping()?a.snappingRows():a.snappingColumns()),a.items.forEach(a.gridItemToCell),a.updateGrid(t.id(),100),a.killGridList())}),e.select(this).append("div").attr("class","resizeHandle").call(a._d3DragResize).append("div").attr("class","resizeHandleDisplay")}).merge(h),this.divItems.each(function(t){var i=e.select(this);a.designMode()?i.call(a._d3Drag):i.on("mousedown.drag",null).on("touchstart.drag",null)}),this.divItems.select(".resizeHandle").style("display",this.designMode()?null:"none"),this.updateGrid(!0),h.exit().each(function(t){t.target(null),t.__grid_watch&&t.__grid_watch.remove()}).remove();var d=o.selectAll("#"+this.id()+" > .laneBackground").data(this.designMode()?[""]:[]);d.enter().insert("div",":first-child").attr("class","laneBackground").style("left","1px").style("top","1px").on("click",function(){a.selectionBagClear()}).merge(d).style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px"),d.exit().each(function(){a.selectionBagClear()}).remove();var p=o.selectAll("#"+this.id()+" > .lane").data(this.designMode()?[""]:[]);p.enter().append("div").attr("class","lane").style("left","1px").style("top","1px"),p.style("display",this.showLanes()?null:"none").style("width",this.snappingColumns()*this.cellWidth+"px").style("height",this.snappingRows()*this.cellHeight+"px").style("background-image","linear-gradient(to right, grey 1px, transparent 1px), linear-gradient(to bottom, grey 1px, transparent 1px)").style("background-size",this.cellWidth+"px "+this.cellHeight+"px"),p.exit().remove()},i.prototype.exit=function(e,i){this.content().forEach(function(t){return t.target(null)}),t.prototype.exit.call(this,e,i)},i.prototype._createSelectionObject=function(t){return{_id:t._id,element:function(){return t._element},widget:t}},i.prototype.selection=function(t){return arguments.length?(this._selectionBag.set(t.map(function(t){return this._createSelectionObject(t)},this)),this):this._selectionBag.get().map(function(t){return t._id})},i.prototype.selectionBagClear=function(){this._selectionBag.isEmpty()||(this._selectionBag.clear(),this.postSelectionChange())},i.prototype.selectionBagClick=function(t){if(null!==t){var i=this._createSelectionObject(t);if(e.d3Event().sourceEvent.ctrlKey)this._selectionBag.isSelected(i)?(this._selectionBag.remove(i),this.postSelectionChange()):(this._selectionBag.append(i),this.postSelectionChange());else{var o=this._selectionBag.get();1===o.length&&o[0]._id===i._id?this.selectionBagClear():this._selectionBag.set([i]),this.postSelectionChange()}}},i.prototype.postSelectionChange=function(){},i.prototype.applyLayout=function(t){this.divItems.each(function(e,i){if(t[i]){var o=t[i],r=o[0],l=o[1],n=o[2],s=o[3];e.gridCol(r).gridRow(l).gridColSpan(n).gridRowSpan(s)}}),this.updateGrid(!0)},i.prototype.vizActivation=function(t){},i}(e.HTMLWidget);ht.prototype._class+=" layout_Grid",ht.prototype.publish("designMode",!1,"boolean","Design Mode",null,{tags:["Basic"]}),ht.prototype.publish("showLanes",!0,"boolean","Show snapping lanes when in design mode",null,{tags:["Basic"],disable:function(t){return!t.designMode()}}),ht.prototype.publish("fitTo","all","set","Sizing Strategy",["all","width"],{tags:["Basic"]}),ht.prototype.publish("snapping","vertical","set","Snapping Strategy",["vertical","horizontal","none"]),ht.prototype.publish("snappingColumns",12,"number","Snapping Columns"),ht.prototype.publish("snappingRows",16,"number","Snapping Rows"),ht.prototype.publish("gutter",6,"number","Gap Between Widgets",null,{tags:["Basic"]}),ht.prototype.publish("surfaceShadow",!0,"boolean","3D Shadow"),ht.prototype.publish("surfacePadding",null,"string","Cell Padding (px)",null,{tags:["Intermediate"]}),ht.prototype.publish("surfaceBorderWidth",1,"number","Width (px) of Cell Border",null,{tags:["Intermediate"]}),ht.prototype.publish("surfaceBackgroundColor",null,"html-color","Surface Background Color",null,{tags:["Advanced"]}),ht.prototype.publish("content",[],"widgetArray","widgets",null,{tags:["Basic"],render:!1});var dt=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("horizontal"),e.flexWrap_default("nowrap"),e}return n(e,t),e}(et);dt.prototype._class+=" layout_HorizontalList";p(".layout_Layered{pointer-events:none}.layout_Layered>.container>.content{position:absolute}.layout_Layered>.container>.content>div>.common_Widget,.layout_Layered>.container>.content>div>svg>.common_Widget{pointer-events:all}");var pt=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e._widgetPlacements=[],e._widgetRatios=[],e}return n(i,t),i.prototype.addLayer=function(t,i,o,r){void 0===i&&(i="default"),void 0===o&&(o=1),void 0===r&&(r=1);var l=this.widgets();return l.push(t||(new e.Text).text("No widget defined for layer.")),this.widgets(l),this._widgetPlacements.push(i),this._widgetRatios.push([o,r]),this},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._contentContainer=i.append("div").attr("class","container")},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=this;i.style("padding",this.surfacePadding()+"px");var r=this._contentContainer.selectAll(".content.id"+this.id()).data(this.widgets(),function(t){return t.id()});r.enter().append("div").attr("class","content id"+this.id()).each(function(t,e){t.target(this)}).merge(r).each(function(t,e){var i={width:o.clientWidth(),height:o.clientHeight()},r=o.widgetSize(e,i),l=o.widgetPosition(e,i,r);this.style.top=l.y+"px",this.style.left=l.x+"px",t.resize(r).render()}),r.exit().each(function(t,e){t.target(null)}).remove(),r.order()},i.prototype.widgetSize=function(t,e){return this._widgetPlacements[t],{width:e.width*this._widgetRatios[t][0],height:e.height*this._widgetRatios[t][1]}},i.prototype.widgetPosition=function(t,e,i){switch(this._widgetPlacements[t]){default:return{x:0,y:0};case"top":return{x:e.width/2-i.width/2,y:0};case"bottom":return{x:e.width/2-i.width/2,y:e.height-i.height};case"left":return{x:0,y:e.height/2-i.height/2};case"right":return{x:e.width-i.width,y:e.height/2-i.height/2};case"center":return{x:e.width/2-i.width/2,y:e.height/2-i.height/2}}},i}(e.HTMLWidget);pt.prototype._class+=" layout_Layered",pt.prototype.publish("surfacePadding",0,"number","Padding"),pt.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});var ct=function(t){function e(){var e=t.call(this)||this;return e._tag="div",e._surfaceButtons=[],e}return n(e,t),e.prototype.updateState=function(t){t=t||!this.popupState(),this.popupState(t).render()},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this.widget().target(e),this._originalPosition=this.position()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.style("visibility",this.popupState()?null:"hidden").style("opacity",this.popupState()?null:0).style("width",this.shrinkWrap()?this.widget().width()+"px":this._size.width+"px").style("height",this.shrinkWrap()?this.widget().height()+"px":this._size.height+"px"),0===this.widget().size().height&&this.widget().resize(this.size())},e.prototype.postUpdate=function(e,i){var o,r;switch(this.centerPopup()){case"container":this._placeholderElement&&(o=parseInt(this._placeholderElement.style("width"))/2-this.widget().width()/2,r=parseInt(this._placeholderElement.style("height"))/2-this.widget().height()/2),this.position("absolute");break;case"window":o=window.innerWidth/2-this.widget().width()/2,r=window.innerHeight/2-this.widget().height()/2,this.position("fixed");break;default:o=0,r=0,this.position(this._originalPosition)}this.pos({x:o,y:r}),t.prototype.postUpdate.call(this,e,i),i.style("position",this.position()).style("left",this.left()+"px").style("right",this.right()+"px").style("top",this.top()+"px").style("bottom",this.bottom()+"px")},e.prototype.exit=function(e,i){this.widget()&&this.widget().target(null),t.prototype.exit.call(this,e,i)},e.prototype.click=function(t){},e}(e.HTMLWidget);ct.prototype._class+=" layout_Popup",ct.prototype.publish("popupState",!1,"boolean","State of the popup, visible (true) or hidden (false)",null,{}),ct.prototype.publish("shrinkWrap",!1,"boolean","The popup parent container either shrinks to the size of its contents (true) or expands to fit thge popup's parentDiv (false)",null,{}),ct.prototype.publish("centerPopup","none","set","Center the widget in its container element (target) or in the window",["none","container","window"],{}),ct.prototype.publish("top",null,"number","Top position property of popup",null,{}),ct.prototype.publish("bottom",null,"number","Bottom position property of popup",null,{}),ct.prototype.publish("left",null,"number","Left position property of popup",null,{}),ct.prototype.publish("right",null,"number","Right position property of popup",null,{}),ct.prototype.publish("position","relative","set","Value of the 'position' property",["absolute","relative","fixed","static","initial","inherit"],{tags:["Private"]}),ct.prototype.publish("widget",null,"widget","Widget",null,{tags:["Private"]});p(".layout_Tabbed .tab-button{background-color:transparent;background-color:#ccc;border-left:1px solid #ddd;border-right:1px solid #ddd;border-top:1px solid #ddd;display:inline-block;margin-right:4px;padding:2px 2px 4px;position:relative;top:1px}.layout_Tabbed .tab-button.active{background-color:#fff;z-index:999}.layout_Tabbed .on_bottom .tab-button{border-bottom:1px solid #ddd;border-top:none;top:-1px}");var ut=function(t){function i(){var e=t.call(this)||this;return e._tag="div",e}return n(i,t),i.prototype.clearTabs=function(){return this.labels([]),this.widgets([]),this},i.prototype.addTab=function(t,i,o,r){var l=t.size();0===l.width&&0===l.height&&t.size({width:"100%",height:"100%"});var n=this.labels(),s=this.widgets();o&&this.activeTabIdx(this.widgets().length),n.push(i);var a=(new g).widget(t||(new e.Text).text("No widget defined for tab"));return s.push(a),this.labels(n),this.widgets(s),r&&r(a),this},i.prototype.widgetSize=function(t){var e=this.clientWidth(),i=this.clientHeight(),o=this._tabContainer.node().getBoundingClientRect();return void 0!==o.height&&(i-=o.height),{width:e,height:i}},i.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this._tabContainer=i.append("div"),this._contentContainer=i.append("div")},i.prototype.update=function(i,o){t.prototype.update.call(this,i,o);var r=this;o.style("padding",this.surfacePadding_exists()?this.surfacePadding()+"px":null);var l=this._tabContainer.selectAll(".tab-button.id"+this.id()).data(this.showTabs()?this.labels():[],function(t){return t});l.enter().append("span").attr("class","tab-button id"+this.id()).style("cursor","pointer").on("click",function(t,e){r.click(r.widgets()[e].widget(),t,e),r.activeTabIdx(e).render()}).merge(l).classed("active",function(t,e){return r.activeTabIdx()===e}).text(function(t){return t}),l.exit().remove();var n=this._contentContainer.selectAll(".tab-content.id"+this.id()).data(this.widgets(),function(t){return t.id()});if(n.enter().append("div").attr("class","tab-content id"+this.id()).each(function(t,e){t.target(this)}).merge(n).classed("active",function(t,e){return r.activeTabIdx()===e}).style("display",function(t,e){return r.activeTabIdx()===e?"block":"none"}).each(function(t,i){if(t.visible(r.activeTabIdx()===i),r.activeTabIdx()===i){var o=r.widgetSize(e.select(this));t.surfaceBorderWidth(r.showTabs()?null:0).surfacePadding(r.showTabs()?null:0).resize(o)}}),n.exit().each(function(t,e){t.target(null)}).remove(),"bottom"===this.tabLocation())this._tabContainer.attr("class","on_bottom").style("top",this._contentContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute"),this._contentContainer.style("top",this.surfacePadding_exists()?this.surfacePadding()+"px":null).style("position","absolute");else this._tabContainer.attr("class","on_top").style("top",null).style("position","relative"),this._contentContainer.style("top",this._tabContainer.node().offsetHeight+this.surfacePadding()+"px").style("position","absolute")},i.prototype.click=function(t,e,i){},i}(e.HTMLWidget);ut.prototype._class+=" layout_Tabbed",ut.prototype.publish("showTabs",!0,"boolean","Show Tabs",null,{}),ut.prototype.publish("surfacePadding",4,"number","Padding"),ut.prototype.publish("activeTabIdx",0,"number","Index of active tab",null,{}),ut.prototype.publish("labels",[],"array","Array of tab labels sharing an index with ",null,{tags:["Private"]}),ut.prototype.publish("tabLocation","top","set","Position the tabs at the bottom of the widget",["top","bottom"],{tags:["Private"]}),ut.prototype.publish("widgets",[],"widgetArray","widgets",null,{tags:["Private"]});function gt(){e.HTMLWidget.call(this),this._tag="div"}p(".layout_Toolbar{background-color:#ddd;height:100%;overflow:hidden;white-space:nowrap}.layout_Toolbar .toolbar-title{display:inline-block;font-weight:700;margin-left:4px;overflow:hidden;position:relative;text-overflow:ellipsis;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%);white-space:nowrap}.layout_Toolbar .toolbar-child{float:right;line-height:16px;margin-left:4px;margin-right:4px;position:relative;top:50%;transform:translateY(-50%);-ms-transform:translateY(-50%)}"),gt.prototype=Object.create(e.HTMLWidget.prototype),gt.prototype.constructor=gt,gt.prototype._class+=" layout_Toolbar",gt.prototype.publish("title","","string","Title",null,{tags:["Intermediate"]}),gt.prototype.publish("fontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("fontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("fontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("fontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),gt.prototype.publish("backgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),gt.prototype.publish("responsive",!0,"boolean","Adapts to pixel width",null,{tags:["Basic"]}),gt.prototype.publish("widgets",[],"widgetArray","Child widgets of the toolbar",null,{tags:["Basic"]}),gt.prototype.publish("widgetClasses",[],"array","Array of Html Element classes to be assigned to the child widgets (shares index with widgets param)",null,{tags:["Basic"]}),gt.prototype.enter=function(t,i){e.HTMLWidget.prototype.enter.apply(this,arguments)},gt.prototype.update=function(t,i){e.HTMLWidget.prototype.update.apply(this,arguments);var o=this;i.attr("title",o.title()).style("background-color",this.backgroundColor());var r=i.selectAll("div.toolbar-title").data(this.title()?[this.title()]:[]);r.enter().append("div").classed("toolbar-title",!0).append("span"),r.selectAll("div.toolbar-title > span").style("font-size",this.fontSize_exists()?this.fontSize()+"px":null).style("color",this.fontColor_exists()?this.fontColor():null).style("font-family",this.fontFamily_exists()?this.fontFamily():null).style("font-weight",this.fontBold_exists()?this.fontBold()?"bold":"normal":null).style("background-color",this.backgroundColor_exists()?this.backgroundColor():null).text(o.title()),r.exit().remove();var l=i.selectAll("div.toolbar-child").data(null!==this.widgets()?this.widgets():[],function(t){return t.id()});l.enter().insert("div","div.toolbar-title").each(function(t,i){var r=o.widgetClasses()[i]?o.widgetClasses()[i]+" toolbar-child":"toolbar-child";e.select(this).classed(r,!0),t.target(this)}),l.exit().each(function(t){t.target(null)}).remove(),l.order()},gt.prototype.render=function(t){var i=this;e.HTMLWidget.prototype.render.call(this,function(e){var o=i.element().node().getBoundingClientRect(),r=o.left+o.width;i.element().selectAll("div.toolbar-child").each(function(t,e){var i=this.getBoundingClientRect();r>i.left&&(r=i.left)}),i.element().select(".toolbar-title").style("width",r-o.left-4+"px"),t&&t(e)})},gt.prototype.exit=function(t,i){e.HTMLWidget.prototype.exit.apply(this,arguments),this.widgets().forEach(function(t){t.target(null)})};var ft=function(t){function e(){var e=t.call(this)||this;return e.orientation_default("vertical"),e.flexWrap_default("nowrap"),e}return n(e,t),e}(et);ft.prototype._class+=" layout_VerticalList",t.AbsoluteSurface=c,t.Accordion=u,t.BUILD_VERSION="2.108.10",t.Border=y,t.Border2=_,t.Carousel=v,t.Cell=f,t.ChartPanel=tt,t.FlexGrid=et,t.Grid=ht,t.HorizontalList=dt,t.Layered=pt,t.Legend=Q,t.Modal=$,t.PKG_NAME="@hpcc-js/layout",t.PKG_VERSION="2.51.6",t.Popup=ct,t.Surface=g,t.Tabbed=ut,t.Toolbar=gt,t.VerticalList=ft,t.WidgetDiv=b});
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|