updating vendors

This commit is contained in:
Erik Amaru Ortiz
2013-11-22 16:20:49 -04:00
parent 53d8c51036
commit 52c0dff57d
28 changed files with 1701 additions and 1296 deletions

145
build-vendor.php Normal file
View File

@@ -0,0 +1,145 @@
<?php
define('DS', DIRECTORY_SEPARATOR);
// --no-ansi wins over --ansi
if (in_array('--no-ansi', $argv)) {
define('USE_ANSI', false);
} elseif (in_array('--ansi', $argv)) {
define('USE_ANSI', true);
} else {
// On Windows, default to no ANSI, except in ANSICON and ConEmu.
// Everywhere else, default to ANSI if stdout is a terminal.
define('USE_ANSI',
(DIRECTORY_SEPARATOR == '\\')
? (false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'))
: (function_exists('posix_isatty') && posix_isatty(1))
);
}
$vendorDir = dirname(__FILE__) . DS . 'vendor';
if (! is_dir($vendorDir )) {
echo "Vendor directory is missing!" . PHP_EOL;
exit();
}
$projects = array(
'colosa/michelangelofe',
'colosa/pmui',
'colosa/restclient'
);
echo PHP_EOL;
out(" *** Building js projects ***", 'info', true);
foreach ($projects as $project) {
echo PHP_EOL;
for($i=0; $i<40; $i++) echo '-';
echo PHP_EOL;
out(" Building: $project ", 'success', true);
for($i=0; $i<40; $i++) echo '-';
echo PHP_EOL.PHP_EOL;
chdir($vendorDir.DS.$project);
echo `rake`;
}
echo PHP_EOL;
out(" *** Compying project files to its destination ***", 'info', true);
$destinationDir = dirname(__FILE__) . DS . 'workflow/public_html/lib';
if (! is_dir($destinationDir)) {
mkdir($destinationDir, 0777);
}
if (! is_dir($destinationDir.'/js')) {
mkdir($destinationDir.'/js', 0777);
}
if (! is_dir($destinationDir.'/mafe')) {
mkdir($destinationDir.'/mafe', 0777);
}
if (! is_dir($destinationDir.'/pmUI')) {
mkdir($destinationDir.'/pmUI', 0777);
}
$filesCollection = array(
"jquery/jquery/jquery-1.10.2.min.js" => "js/jquery-1.10.2.min.js",
"underscore/underscore/underscore-min.js" => "js/underscore-min.js",
//libs
"colosa/michelangelo-fe-libs/jQueryLayout/jquery.layout.min.js" => "js/jquery.layout.min.js",
"colosa/michelangelo-fe-libs/jQueryUI/jquery-ui-1.10.3.custom.min.js" => "js/jquery-ui-1.10.3.custom.min.js",
"colosa/michelangelo-fe-libs/jQueryUI/jquery-ui-1.10.3.custom.min.css" => "js/jquery-ui-1.10.3.custom.min.css",
"colosa/michelangelo-fe-libs/wz_jsgraphics/wz_jsgraphics.js" => "js/wz_jsgraphics.js",
"colosa/restclient/restclient-min.js" => "js/restclient-min.js",
"colosa/michelangelofe/app.js" => "js/app.js",
// michelangelofe
"colosa/michelangelofe/build/js/mafe.min.js" => "mafe/mafe.min.js",
"colosa/michelangelofe/build/css/mafe.css" => "mafe/mafe.css",
"colosa/michelangelofe/build/img/*" => "img/",
// pmui
"colosa/pmui/build/js/min/pmui-1.0.0.min.js" => "pmUI/pmui-1.0.0.js",
"colosa/pmui/build/css/pmui-1.0.0.css" => "pmUI/pmui-1.0.0.css",
"colosa/pmui/build/img/*" => "img/",
);
echo "Destination dir: $destinationDir" . PHP_EOL.PHP_EOL;
foreach ($filesCollection as $source => $target) {
out("Copy: ", 'info', false);
echo "$source $target" . PHP_EOL;
echo `cp -Rf $vendorDir/$source $destinationDir/$target`;
}
echo PHP_EOL;
/////////////////////
/**
* colorize output
*/
function out($text, $color = null, $newLine = true)
{
$styles = array(
'success' => "\033[0;32m%s\033[0m",
'error' => "\033[31;31m%s\033[0m",
'info' => "\033[33;33m%s\033[0m"
);
$format = '%s';
if (isset($styles[$color]) && USE_ANSI) {
$format = $styles[$color];
}
if ($newLine) {
$format .= PHP_EOL;
}
printf($format, $text);
}

View File

@@ -5,8 +5,87 @@
"homepage": "http://processmaker.com", "homepage": "http://processmaker.com",
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.10.2",
"dist": {
"url": "http://code.jquery.com/jquery-1.10.2.min.js",
"type": "file"
}
}
},
{
"type": "package",
"package": {
"name": "underscore/underscore",
"version": "1.5.2",
"dist": {
"url": "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js",
"type": "file"
}
}
},
{
"type": "package",
"package": {
"name": "colosa/pmui",
"version": "dev-master",
"source": {
"url": "git@bitbucket.org:colosa/pmui.git",
"type": "git",
"reference": "origin/master"
}
}
},
{
"type": "package",
"package": {
"name": "colosa/michelangelofe",
"version": "dev-master",
"source": {
"url": "git@bitbucket.org:colosa/michelangelofe.git",
"type": "git",
"reference": "origin/master"
}
}
},
{
"type": "package",
"package": {
"name": "colosa/michelangelo-fe-libs",
"version": "dev-master",
"source": {
"url": "git@bitbucket.org:colosa/michelangelo-fe-libs.git",
"type": "git",
"reference": "origin/master"
}
}
},
{
"type": "package",
"package": {
"name": "colosa/restclient",
"version": "dev-master",
"source": {
"url": "git@github.com:colosa/restclient.git",
"type": "git",
"reference": "origin/master"
}
}
}
],
"require": { "require": {
"luracast/restler" : "dev-master", "luracast/restler" : "dev-master",
"bshaffer/oauth2-server-php": "v1.0" "bshaffer/oauth2-server-php": "v1.0",
"jquery/jquery": "1.10.2",
"colosa/pmui": "dev-master",
"colosa/michelangelofe": "dev-master",
"colosa/michelangelo-fe-libs": "dev-master",
"colosa/restclient": "dev-master",
"underscore/underscore": "1.5.2"
} }
} }

View File

@@ -1,19 +1,20 @@
<link type="text/css" href="/lib/jQueryUI/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
<link type="text/css" href="/lib/js/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="/lib/pmUI/pmui-1.0.0.css"> <link rel="stylesheet" type="text/css" href="/lib/pmUI/pmui-1.0.0.css">
<link rel="stylesheet" type="text/css" href="/lib/mafe/mafe.css"> <link rel="stylesheet" type="text/css" href="/lib/mafe/mafe.css">
<link rel="stylesheet" type="text/css" href="/lib/pmDraw/pmdraw.css">
<script type="text/javascript" src="/lib/translations.js"></script>
<script type="text/javascript" src="/lib/wz_jsgraphics/wz_jsgraphics.js"></script> <script type="text/javascript" src="/lib/js/wz_jsgraphics.js"></script>
<script type="text/javascript" src="/lib/jQuery/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="/lib/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib/underscore/underscore-min.js"></script> <script type="text/javascript" src="/lib/js/underscore-min.js"></script>
<script type="text/javascript" src="/lib/jQueryUI/jquery-ui-1.10.3.custom.min.js"></script> <script type="text/javascript" src="/lib/js/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="/lib/jQueryLayout/jquery.layout.min.js"></script> <script type="text/javascript" src="/lib/js/jquery.layout.min.js"></script>
<script type="text/javascript" src="/lib/restClient/restclient.js"></script> <script type="text/javascript" src="/lib/js/restclient-min.js"></script>
<script type="text/javascript" src="/lib/pmUI/pmui-1.0.0.js"></script> <script type="text/javascript" src="/lib/pmUI/pmui-1.0.0.js"></script>
<script type="text/javascript" src="/lib/mafe/mafe.js"></script> <script type="text/javascript" src="/lib/mafe/mafe.min.js"></script>
<script type="text/javascript" src="/lib/app.js"></script> <script type="text/javascript" src="/lib/js/app.js"></script>
<h3>Process Id: {$pro_uid}</h3> <h3>Process Id: {$pro_uid}</h3>

View File

@@ -1 +0,0 @@
/var/www/michelangelofe/app.js

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

File diff suppressed because one or more lines are too long

View File

@@ -1,142 +0,0 @@
/*
jquery.layout 1.3.0 - Release Candidate 30.79
$Date: 2013-01-01 08:00:00 (Tue, 1 Jan 2013) $
$Rev: 303007 $
Copyright (c) 2013 Kevin Dalman (http://allpro.net)
Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net)
Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
SEE: http://layout.jquery-dev.net/LICENSE.txt
Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.79
Docs: http://layout.jquery-dev.net/documentation.html
Tips: http://layout.jquery-dev.net/tips.html
Help: http://groups.google.com/group/jquery-ui-layout
*/
(function(b){var a=Math.min,d=Math.max,c=Math.floor,f=function(a){return"string"===b.type(a)},j=function(a,d){if(b.isArray(d))for(var c=0,j=d.length;c<j;c++){var h=d[c];try{f(h)&&(h=eval(h)),b.isFunction(h)&&h(a)}catch(k){}}};b.layout={version:"1.3.rc30.79",revision:0.033007,browser:{},effects:{slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},
west:{direction:"left"}},scale:{all:{duration:"fast"}},blind:{},clip:{},explode:{},fade:{},fold:{},puff:{},size:{all:{easing:"swing"}}},config:{optionRootKeys:"effects panes north south west east center".split(" "),allPanes:["north","south","west","east","center"],borderPanes:["north","south","west","east"],oppositeEdge:{north:"south",south:"north",east:"west",west:"east"},offscreenCSS:{left:"-99999px",right:"auto"},offscreenReset:"offscreenReset",hidden:{visibility:"hidden"},visible:{visibility:"visible"},
resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",
background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{side:"bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{side:"right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{side:"left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},
center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},callbacks:{},getParentPaneElem:function(a){a=b(a);if(a=a.data("layout")||a.data("parentLayout")){a=a.container;if(a.data("layoutPane"))return a;a=a.closest("."+b.layout.defaults.panes.paneClass);if(a.data("layoutPane"))return a}return null},getParentPaneInstance:function(a){return(a=b.layout.getParentPaneElem(a))?a.data("layoutPane"):null},getParentLayoutInstance:function(a){return(a=b.layout.getParentPaneElem(a))?
a.data("parentLayout"):null},getEventObject:function(b){return"object"===typeof b&&b.stopPropagation?b:null},parsePaneName:function(a){var d=b.layout.getEventObject(a);d&&(d.stopPropagation(),a=b(this).data("layoutEdge"));a&&!/^(west|east|north|south|center)$/.test(a)&&(b.layout.msg('LAYOUT ERROR - Invalid pane-name: "'+a+'"'),a="error");return a},plugins:{draggable:!!b.fn.draggable,effects:{core:!!b.effects,slide:b.effects&&(b.effects.slide||b.effects.effect&&b.effects.effect.slide)}},onCreate:[],
onLoad:[],onReady:[],onDestroy:[],onUnload:[],afterOpen:[],afterClose:[],scrollbarWidth:function(){return window.scrollbarWidth||b.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||b.layout.getScrollbarSize("height")},getScrollbarSize:function(a){var d=b('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"),c={width:d.css("width")-d[0].clientWidth,height:d.height()-d[0].clientHeight};
d.remove();window.scrollbarWidth=c.width;window.scrollbarHeight=c.height;return a.match(/^(width|height)$/)?c[a]:c},showInvisibly:function(b,a){if(b&&b.length&&(a||"none"===b.css("display"))){var d=b[0].style,d={display:d.display||"",visibility:d.visibility||""};b.css({display:"block",visibility:"hidden"});return d}return{}},getElementDimensions:function(a,c){var f={css:{},inset:{}},j=f.css,h={bottom:0},k=b.layout.cssNum,p=a.offset(),O,R,D;f.offsetLeft=p.left;f.offsetTop=p.top;c||(c={});b.each(["Left",
"Right","Top","Bottom"],function(d,k){O=j["border"+k]=b.layout.borderWidth(a,k);R=j["padding"+k]=b.layout.cssNum(a,"padding"+k);D=k.toLowerCase();f.inset[D]=0<=c[D]?c[D]:R;h[D]=f.inset[D]+O});j.width=a.width();j.height=a.height();j.top=k(a,"top",!0);j.bottom=k(a,"bottom",!0);j.left=k(a,"left",!0);j.right=k(a,"right",!0);f.outerWidth=a.outerWidth();f.outerHeight=a.outerHeight();f.innerWidth=d(0,f.outerWidth-h.left-h.right);f.innerHeight=d(0,f.outerHeight-h.top-h.bottom);f.layoutWidth=a.innerWidth();
f.layoutHeight=a.innerHeight();return f},getElementStyles:function(b,a){var d={},c=b[0].style,f=a.split(","),k=["Top","Bottom","Left","Right"],j=["Color","Style","Width"],h,p,D,x,A,r;for(x=0;x<f.length;x++)if(h=f[x],h.match(/(border|padding|margin)$/))for(A=0;4>A;A++)if(p=k[A],"border"===h)for(r=0;3>r;r++)D=j[r],d[h+p+D]=c[h+p+D];else d[h+p]=c[h+p];else d[h]=c[h];return d},cssWidth:function(a,c){if(0>=c)return 0;var f=!b.layout.browser.boxModel?"border-box":b.support.boxSizing?a.css("boxSizing"):
"content-box",j=b.layout.borderWidth,h=b.layout.cssNum,k=c;"border-box"!==f&&(k-=j(a,"Left")+j(a,"Right"));"content-box"===f&&(k-=h(a,"paddingLeft")+h(a,"paddingRight"));return d(0,k)},cssHeight:function(a,c){if(0>=c)return 0;var f=!b.layout.browser.boxModel?"border-box":b.support.boxSizing?a.css("boxSizing"):"content-box",j=b.layout.borderWidth,h=b.layout.cssNum,k=c;"border-box"!==f&&(k-=j(a,"Top")+j(a,"Bottom"));"content-box"===f&&(k-=h(a,"paddingTop")+h(a,"paddingBottom"));return d(0,k)},cssNum:function(a,
d,c){a.jquery||(a=b(a));var f=b.layout.showInvisibly(a);d=b.css(a[0],d,!0);c=c&&"auto"==d?d:Math.round(parseFloat(d)||0);a.css(f);return c},borderWidth:function(a,d){a.jquery&&(a=a[0]);var c="border"+d.substr(0,1).toUpperCase()+d.substr(1);return"none"===b.css(a,c+"Style",!0)?0:Math.round(parseFloat(b.css(a,c+"Width",!0))||0)},isMouseOverElem:function(a,d){var c=b(d||this),f=c.offset(),j=f.top,f=f.left,k=f+c.outerWidth(),c=j+c.outerHeight(),h=a.pageX,p=a.pageY;return b.layout.browser.msie&&0>h&&0>
p||h>=f&&h<=k&&p>=j&&p<=c},msg:function(a,d,c,f){b.isPlainObject(a)&&window.debugData?("string"===typeof d?(f=c,c=d):"object"===typeof c&&(f=c,c=null),c=c||"log( <object> )",f=b.extend({sort:!1,returnHTML:!1,display:!1},f),!0===d||f.display?debugData(a,c,f):window.console&&console.log(debugData(a,c,f))):d?alert(a):window.console?console.log(a):(d=b("#layoutLogger"),d.length||(d=b('<div id="layoutLogger" style="position: '+(b.support.fixedPosition?"fixed":"absolute")+'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);"><div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;"><span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div><ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul></div>').appendTo("body"),
d.css("left",b(window).width()-d.outerWidth()-5),b.ui.draggable&&d.draggable({handle:":first-child"})),d.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")+"</li>"))}};var h=navigator.userAgent.toLowerCase(),p=/(chrome)[ \/]([\w.]+)/.exec(h)||/(webkit)[ \/]([\w.]+)/.exec(h)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(h)||/(msie) ([\w.]+)/.exec(h)||0>h.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(h)||
[],h=p[1]||"",p=p[2]||0,x="msie"===h;b.layout.browser={version:p,safari:"webkit"===h,webkit:"chrome"===h,msie:x,isIE6:x&&6==p,boxModel:!x||!1!==b.support.boxModel};h&&(b.layout.browser[h]=!0);x&&b(function(){b.layout.browser.boxModel=b.support.boxModel});b.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,
onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",
noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",
buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",
slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:b.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},
fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",
size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}};b.layout.optionsMap={layout:"name instanceKey stateManagement effects inset zIndexes errors zIndex scrollToBookmarkOnLoad showErrorMessages maskPanesEarly outset resizeWithWindow resizeWithWindowDelay resizeWithWindowMaxDelay onresizeall onresizeall_start onresizeall_end onload onload_start onload_end onunload onunload_start onunload_end".split(" "),
center:"paneClass contentSelector contentIgnoreSelector findNestedContent applyDemoStyles triggerEventsOnLoad showOverflowOnHover maskContents maskObjects liveContentResizing containerSelector children initChildren resizeChildren destroyChildren onresize onresize_start onresize_end onsizecontent onsizecontent_start onsizecontent_end".split(" "),noDefault:["paneSelector","resizerCursor","customHotkey"]};b.layout.transformData=function(a,d){var c=d?{panes:{},center:{}}:{},f,j,k,h,p,x,D;if("object"!==
typeof a)return c;for(j in a){f=c;p=a[j];k=j.split("__");D=k.length-1;for(x=0;x<=D;x++)h=k[x],x===D?f[h]=b.isPlainObject(p)?b.layout.transformData(p):p:(f[h]||(f[h]={}),f=f[h])}return c};b.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",
triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",
noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(a){function d(b,c){for(var f=b.split("."),k=f.length-1,j={branch:a,key:f[k]},r=0,q;r<k;r++)q=f[r],j.branch=void 0==j.branch[q]?c?j.branch[q]={}:{}:j.branch[q];return j}var c=b.layout.backwardCompatibility.map,f,j,k,h;for(h in c)f=d(h),k=f.branch[f.key],void 0!==k&&(j=d(c[h],!0),j.branch[j.key]=k,delete f.branch[f.key])},renameAllOptions:function(a){var d=
b.layout.backwardCompatibility.renameOptions;d(a);a.defaults&&("object"!==typeof a.panes&&(a.panes={}),b.extend(!0,a.panes,a.defaults),delete a.defaults);a.panes&&d(a.panes);b.each(b.layout.config.allPanes,function(b,c){a[c]&&d(a[c])});return a}};b.fn.layout=function(h){function p(e){if(!e)return!0;var w=e.keyCode;if(33>w)return!0;var m={38:"north",40:"south",37:"west",39:"east"},a=e.shiftKey,g=e.ctrlKey,t,n,d,c;g&&(37<=w&&40>=w)&&r[m[w]].enableCursorHotkey?c=m[w]:(g||a)&&b.each(k.borderPanes,function(e,
b){t=r[b];n=t.customHotkey;d=t.customHotkeyModifier;if(a&&"SHIFT"==d||g&&"CTRL"==d||g&&a)if(n&&w===(isNaN(n)||9>=n?n.toUpperCase().charCodeAt(0):n))return c=b,!1});if(!c||!y[c]||!r[c].closable||q[c].isHidden)return!0;na(c);e.stopPropagation();return e.returnValue=!1}function x(e){if(H()){this&&this.tagName&&(e=this);var w;f(e)?w=y[e]:b(e).data("layoutRole")?w=b(e):b(e).parents().each(function(){if(b(this).data("layoutRole"))return w=b(this),!1});if(w&&w.length){var m=w.data("layoutEdge");e=q[m];e.cssSaved&&
X(m);if(e.isSliding||e.isResizing||e.isClosed)e.cssSaved=!1;else{var a={zIndex:r.zIndexes.resizer_normal+1},g={},t=w.css("overflow"),n=w.css("overflowX"),d=w.css("overflowY");"visible"!=t&&(g.overflow=t,a.overflow="visible");n&&!n.match(/(visible|auto)/)&&(g.overflowX=n,a.overflowX="visible");d&&!d.match(/(visible|auto)/)&&(g.overflowY=n,a.overflowY="visible");e.cssSaved=g;w.css(a);b.each(k.allPanes,function(e,b){b!=m&&X(b)})}}}}function X(e){if(H()){this&&this.tagName&&(e=this);var w;f(e)?w=y[e]:
b(e).data("layoutRole")?w=b(e):b(e).parents().each(function(){if(b(this).data("layoutRole"))return w=b(this),!1});if(w&&w.length){e=w.data("layoutEdge");e=q[e];var m=e.cssSaved||{};!e.isSliding&&!e.isResizing&&w.css("zIndex",r.zIndexes.pane_normal);w.css(m);e.cssSaved=!1}}}var G=b.layout.browser,k=b.layout.config,Q=b.layout.cssWidth,O=b.layout.cssHeight,R=b.layout.getElementDimensions,D=b.layout.getElementStyles,Ma=b.layout.getEventObject,A=b.layout.parsePaneName,r=b.extend(!0,{},b.layout.defaults);
r.effects=b.extend(!0,{},b.layout.effects);var q={id:"layout"+b.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},ba={north:null,south:null,east:null,west:null,center:null},M={data:{},set:function(e,b,m){M.clear(e);M.data[e]=setTimeout(b,m)},clear:function(e){var b=M.data;b[e]&&(clearTimeout(b[e]),delete b[e])}},
ca=function(e,w,m){var a=r;(a.showErrorMessages&&!m||m&&a.showDebugMessages)&&b.layout.msg(a.name+" / "+e,!1!==w);return!1},C=function(e,w,m){var a=w&&f(w),g=a?q[w]:q,t=a?r[w]:r,n=r.name,d=e+(e.match(/_/)?"":"_end"),c=d.match(/_end$/)?d.substr(0,d.length-4):"",l=t[d]||t[c],h="NC",k=[];!a&&"boolean"===b.type(w)&&(m=w,w="");if(l)try{f(l)&&(l.match(/,/)?(k=l.split(","),l=eval(k[0])):l=eval(l)),b.isFunction(l)&&(h=k.length?l(k[1]):a?l(w,y[w],g,t,n):l(z,g,t,n))}catch(j){ca(r.errors.callbackError.replace(/EVENT/,
b.trim((w||"")+" "+d)),!1),"string"===b.type(j)&&string.length&&ca("Exception: "+j,!1)}!m&&!1!==h&&(a?(m=y[w],t=r[w],g=q[w],m.triggerHandler("layoutpane"+d,[w,m,g,t,n]),c&&m.triggerHandler("layoutpane"+c,[w,m,g,t,n])):(u.triggerHandler("layout"+d,[z,g,t,n]),c&&u.triggerHandler("layout"+c,[z,g,t,n])));a&&"onresize_end"===e&&db(w+"",!0);return h},eb=function(e){if(!G.mozilla){var b=y[e];"IFRAME"===q[e].tagName?b.css(k.hidden).css(k.visible):b.find("IFRAME").css(k.hidden).css(k.visible)}},ya=function(e){var b=
y[e];e=k[e].dir;b={minWidth:1001-Q(b,1E3),minHeight:1001-O(b,1E3)};"horz"===e&&(b.minSize=b.minHeight);"vert"===e&&(b.minSize=b.minWidth);return b},fa=function(e,w,m){m||(m=k[e].dir);f(w)&&w.match(/%/)&&(w="100%"===w?-1:parseInt(w,10)/100);if(0===w)return 0;if(1<=w)return parseInt(w,10);var a=r,g=0;"horz"==m?g=v.innerHeight-(y.north?a.north.spacing_open:0)-(y.south?a.south.spacing_open:0):"vert"==m&&(g=v.innerWidth-(y.west?a.west.spacing_open:0)-(y.east?a.east.spacing_open:0));if(-1===w)return g;
if(0<w)return c(g*w);if("center"==e)return 0;m="horz"===m?"height":"width";a=y[e];e="height"===m?U[e]:!1;var g=b.layout.showInvisibly(a),t=a.css(m),n=e?e.css(m):0;a.css(m,"auto");e&&e.css(m,"auto");w="height"===m?a.outerHeight():a.outerWidth();a.css(m,t).css(g);e&&e.css(m,n);return w},ga=function(e,b){var a=y[e],E=r[e],g=q[e],t=b?E.spacing_open:0,E=b?E.spacing_closed:0;return!a||g.isHidden?0:g.isClosed||g.isSliding&&b?E:"horz"===k[e].dir?a.outerHeight()+t:a.outerWidth()+t},Y=function(e,b){if(H()){var m=
r[e],E=q[e],g=k[e],t=g.dir;g.sizeType.toLowerCase();var g=void 0!=b?b:E.isSliding,n=m.spacing_open,c=k.oppositeEdge[e],f=q[c],l=y[c],h=!l||!1===f.isVisible||f.isSliding?0:"horz"==t?l.outerHeight():l.outerWidth(),c=(!l||f.isHidden?0:r[c][!1!==f.isClosed?"spacing_closed":"spacing_open"])||0,f="horz"==t?v.innerHeight:v.innerWidth,l=ya("center"),l="horz"==t?d(r.center.minHeight,l.minHeight):d(r.center.minWidth,l.minWidth),g=f-n-(g?0:fa("center",l,t)+h+c),t=E.minSize=d(fa(e,m.minSize),ya(e).minSize),g=
E.maxSize=a(m.maxSize?fa(e,m.maxSize):1E5,g),E=E.resizerPosition={},n=v.inset.top,h=v.inset.left,c=v.innerWidth,f=v.innerHeight,m=m.spacing_open;switch(e){case "north":E.min=n+t;E.max=n+g;break;case "west":E.min=h+t;E.max=h+g;break;case "south":E.min=n+f-g-m;E.max=n+f-t-m;break;case "east":E.min=h+c-g-m,E.max=h+c-t-m}}},Na=function(e,a){var m=b(e),E=m.data("layoutRole"),g=m.data("layoutEdge"),t=r[g][E+"Class"],g="-"+g,n=m.hasClass(t+"-closed")?"-closed":"-open",d="-closed"===n?"-open":"-closed",n=
t+"-hover "+(t+g+"-hover ")+(t+n+"-hover ")+(t+g+n+"-hover ");a&&(n+=t+d+"-hover "+(t+g+d+"-hover "));"resizer"==E&&m.hasClass(t+"-sliding")&&(n+=t+"-sliding-hover "+(t+g+"-sliding-hover "));return b.trim(n)},Oa=function(e,a){var m=b(a||this);e&&"toggler"===m.data("layoutRole")&&e.stopPropagation();m.addClass(Na(m))},da=function(e,a){var m=b(a||this);m.removeClass(Na(m,!0))},fb=function(){var e=b(this).data("layoutEdge"),a=q[e];!a.isClosed&&(!a.isResizing&&!q.paneResizing)&&(b.fn.disableSelection&&
b("body").disableSelection(),r.maskPanesEarly&&va(e,{resizing:!0}))},gb=function(e,a){var m=a||this,E=b(m).data("layoutEdge"),g=E+"ResizerLeave";M.clear(E+"_openSlider");M.clear(g);a?q.paneResizing||(b.fn.enableSelection&&b("body").enableSelection(),r.maskPanesEarly&&za()):M.set(g,function(){gb(e,m)},200)},H=function(){return q.initialized||q.creatingLayout?!0:Aa()},Aa=function(e){var a=r;if(!u.is(":visible"))return!e&&(G.webkit&&"BODY"===u[0].tagName)&&setTimeout(function(){Aa(!0)},50),!1;if(!hb("center").length)return ca(a.errors.centerPaneMissing);
q.creatingLayout=!0;b.extend(v,R(u,a.inset));A(void 0);b.each(k.allPanes,function(e,b){ib(b,!0)});Pa();b.each(k.borderPanes,function(e,b){y[b]&&q[b].isVisible&&(Y(b),ha(b))});ia("center");b.each(k.allPanes,function(e,b){jb(b)});a.scrollToBookmarkOnLoad&&(e=self.location,e.hash&&e.replace(e.hash));z.hasParentLayout?a.resizeWithWindow=!1:a.resizeWithWindow&&b(window).bind("resize."+K,Ab);delete q.creatingLayout;q.initialized=!0;j(z,b.layout.onReady);C("onload_end");return!0},Qa=function(e,a){var m=
A.call(this,e),d=y[m];if(d){var g=U[m],t=q[m],n=r[m],c=r.stateManagement||{},n=a?n.children=a:n.children;if(b.isPlainObject(n))n=[n];else if(!n||!b.isArray(n))return;b.each(n,function(e,a){b.isPlainObject(a)&&(a.containerSelector?d.find(a.containerSelector):g||d).each(function(){var e=b(this),g=e.data("layout");if(!g){kb({container:e,options:a},t);if(c.includeChildren&&q.stateData[m]){var g=(q.stateData[m].children||{})[a.instanceKey],w=a.stateManagement||(a.stateManagement={autoLoad:!0});!0===w.autoLoad&&
g&&(w.autoSave=!1,w.includeChildren=!0,w.autoLoad=b.extend(!0,{},g))}(g=e.layout(a))&&Ba(m,g)}})})}},kb=function(e,b){var a=e.container,d=e.options,g=d.stateManagement,t=d.instanceKey||a.data("layoutInstanceKey");t||(t=(g&&g.cookie?g.cookie.name:"")||d.name);t=t?t.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):"layout"+ ++b.childIdx;d.instanceKey=t;a.data("layoutInstanceKey",t);return t},Ba=function(e,a){var m=y[e],d=ba[e],g=q[e];b.isPlainObject(d)&&(b.each(d,function(e,b){b.destroyed&&delete d[e]}),
b.isEmptyObject(d)&&(d=ba[e]=null));!a&&!d&&(a=m.data("layout"));a&&(a.hasParentLayout=!0,m=a.options,kb(a,g),d||(d=ba[e]={}),d[m.instanceKey]=a.container.data("layout"));z[e].children=ba[e];a||Qa(e)},Ab=function(){var e=r,b=Number(e.resizeWithWindowDelay);10>b&&(b=100);M.clear("winResize");M.set("winResize",function(){M.clear("winResize");M.clear("winResizeRepeater");var b=R(u,e.inset);(b.innerWidth!==v.innerWidth||b.innerHeight!==v.innerHeight)&&oa()},b);M.data.winResizeRepeater||lb()},lb=function(){var e=
Number(r.resizeWithWindowMaxDelay);0<e&&M.set("winResizeRepeater",function(){lb();oa()},e)},mb=function(){C("onunload_start");j(z,b.layout.onUnload);C("onunload_end")},nb=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,a){var d=r[a];if(d.enableCursorHotkey||d.customHotkey)return b(document).bind("keydown."+K,p),!1})},hb=function(e){e=r[e].paneSelector;if("#"===e.substr(0,1))return u.find(e).eq(0);var b=u.children(e).eq(0);return b.length?b:u.children("form:first").children(e).eq(0)},
ib=function(e,b){if(b||H()){var m=r[e],c=q[e],g=k[e],t=g.dir,n="center"===e,f={},h=y[e],l,j;h?Ra(e,!1,!0,!1):U[e]=!1;h=y[e]=hb(e);if(h.length){h.data("layoutCSS")||h.data("layoutCSS",D(h,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));z[e]={name:e,pane:y[e],content:U[e],options:r[e],state:q[e],children:ba[e]};h.data({parentLayout:z,layoutPane:z[e],layoutEdge:e,layoutRole:"pane"}).css(g.cssReq).css("zIndex",r.zIndexes.pane_normal).css(m.applyDemoStyles?
g.cssDemo:{}).addClass(m.paneClass+" "+m.paneClass+"-"+e).bind("mouseenter."+K,Oa).bind("mouseleave."+K,da);g={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",
resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(j in g)h.bind("layoutpane"+j.toLowerCase()+"."+K,z[g[j]||j]);Sa(e,!1);n||(l=c.size=fa(e,m.size),n=fa(e,m.minSize)||1,j=fa(e,m.maxSize)||1E5,0<l&&(l=d(a(l,j),n)),c.autoResize=m.autoResize,c.isClosed=!1,c.isSliding=!1,c.isResizing=!1,c.isHidden=!1,c.pins||(c.pins=[]));c.tagName=h[0].tagName;c.edge=e;c.noRoom=!1;c.isVisible=!0;ob(e);"horz"===t?f.height=O(h,l):"vert"===t&&(f.width=Q(h,l));h.css(f);"horz"!=t&&ia(e,!0);q.initialized&&(Pa(e),nb(e));m.initClosed&&
m.closable&&!m.initHidden?ja(e,!0,!0):m.initHidden||m.initClosed?Ta(e):c.noRoom||h.css("display","block");h.css("visibility","visible");m.showOverflowOnHover&&h.hover(x,X);q.initialized&&jb(e)}else y[e]=!1}},jb=function(e){var b=y[e],a=q[e],d=r[e];b&&(b.data("layout")&&Ba(e,b.data("layout")),a.isVisible&&(q.initialized?oa():pa(e),d.triggerEventsOnLoad?C("onresize_end",e):db(e,!0)),d.initChildren&&d.children&&Qa(e))},ob=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,b){var a=y[b],g=
F[b],d=q[b],c=k[b].side,f={};if(a){switch(b){case "north":f.top=v.inset.top;f.left=v.inset.left;f.right=v.inset.right;break;case "south":f.bottom=v.inset.bottom;f.left=v.inset.left;f.right=v.inset.right;break;case "west":f.left=v.inset.left;break;case "east":f.right=v.inset.right}a.css(f);g&&d.isClosed?g.css(c,v.inset[c]):g&&!d.isHidden&&g.css(c,v.inset[c]+ga(b))}})},Pa=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,a){var d=y[a];F[a]=!1;P[a]=!1;if(d){var g=r[a],d=q[a],c="#"===g.paneSelector.substr(0,
1)?g.paneSelector.substr(1):"",n=g.resizerClass,f=g.togglerClass,h="-"+a,l=z[a],j=l.resizer=F[a]=b("<div></div>"),l=l.toggler=g.closable?P[a]=b("<div></div>"):!1;!d.isVisible&&g.slidable&&j.attr("title",g.tips.Slide).css("cursor",g.sliderCursor);j.attr("id",c?c+"-resizer":"").data({parentLayout:z,layoutPane:z[a],layoutEdge:a,layoutRole:"resizer"}).css(k.resizers.cssReq).css("zIndex",r.zIndexes.resizer_normal).css(g.applyDemoStyles?k.resizers.cssDemo:{}).addClass(n+" "+n+h).hover(Oa,da).hover(fb,gb).appendTo(u);
g.resizerDblClickToggle&&j.bind("dblclick."+K,na);l&&(l.attr("id",c?c+"-toggler":"").data({parentLayout:z,layoutPane:z[a],layoutEdge:a,layoutRole:"toggler"}).css(k.togglers.cssReq).css(g.applyDemoStyles?k.togglers.cssDemo:{}).addClass(f+" "+f+h).hover(Oa,da).bind("mouseenter",fb).appendTo(j),g.togglerContent_open&&b("<span>"+g.togglerContent_open+"</span>").data({layoutEdge:a,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-open").css("display",
"none").appendTo(l),g.togglerContent_closed&&b("<span>"+g.togglerContent_closed+"</span>").data({layoutEdge:a,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(l),pb(a));var g=a,B=b.layout.plugins.draggable,g=g?g.split(","):k.borderPanes;b.each(g,function(e,a){var g=r[a];if(!B||!y[a]||!g.resizable)return g.resizable=!1,!0;var m=q[a],w=r.zIndexes,d=k[a],c="horz"==d.dir?"top":"left",t=F[a],n=g.resizerClass,f=0,l,h,E=n+"-drag",j=n+"-"+a+"-drag",J=n+"-dragging",
zb=n+"-"+a+"-dragging",cb=n+"-dragging-limit",v=n+"-"+a+"-dragging-limit",x=!1;m.isClosed||t.attr("title",g.tips.Resize).css("cursor",g.resizerCursor);t.draggable({containment:u[0],axis:"horz"==d.dir?"y":"x",delay:0,distance:1,grid:g.resizingGrid,helper:"clone",opacity:g.resizerDragOpacity,addClasses:!1,zIndex:w.resizer_drag,start:function(e,w){g=r[a];m=q[a];h=g.livePaneResizing;if(!1===C("ondrag_start",a))return!1;m.isResizing=!0;q.paneResizing=a;M.clear(a+"_closeSlider");Y(a);l=m.resizerPosition;
f=w.position[c];t.addClass(E+" "+j);x=!1;b("body").disableSelection();va(a,{resizing:!0})},drag:function(e,b){x||(b.helper.addClass(J+" "+zb).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),x=!0,m.isSliding&&y[a].css("zIndex",w.pane_sliding));var d=0;b.position[c]<l.min?(b.position[c]=l.min,d=-1):b.position[c]>l.max&&(b.position[c]=l.max,d=1);d?(b.helper.addClass(cb+" "+v),window.defaultStatus=0<d&&a.match(/(north|west)/)||0>d&&a.match(/(south|east)/)?g.tips.maxSizeWarning:
g.tips.minSizeWarning):(b.helper.removeClass(cb+" "+v),window.defaultStatus="");h&&Math.abs(b.position[c]-f)>=g.liveResizingTolerance&&(f=b.position[c],p(e,b,a))},stop:function(e,g){b("body").enableSelection();window.defaultStatus="";t.removeClass(E+" "+j);m.isResizing=!1;q.paneResizing=!1;p(e,g,a,!0)}})});var p=function(b,e,a,g){var m=e.position,w=k[a];b=r[a];e=q[a];var d;switch(a){case "north":d=m.top;break;case "west":d=m.left;break;case "south":d=v.layoutHeight-m.top-b.spacing_open;break;case "east":d=
v.layoutWidth-m.left-b.spacing_open}d-=v.inset[w.side];g?(!1!==C("ondrag_end",a)&&Ca(a,d,!1,!0),za(!0),e.isSliding&&va(a,{resizing:!0})):Math.abs(d-e.size)<b.liveResizingTolerance||(Ca(a,d,!1,!0),ea.each(qb))};d.isVisible?Ua(a):(Da(a),ma(a,!0))}});qa()},Sa=function(b,a){if(H()){var m=r[b],d=m.contentSelector,g=z[b],c=y[b],n;d&&(n=g.content=U[b]=m.findNestedContent?c.find(d).eq(0):c.children(d).eq(0));n&&n.length?(n.data("layoutRole","content"),n.data("layoutCSS")||n.data("layoutCSS",D(n,"height")),
n.css(k.content.cssReq),m.applyDemoStyles&&(n.css(k.content.cssDemo),c.css(k.content.cssDemoPane)),c.css("overflowX").match(/(scroll|auto)/)&&c.css("overflow","hidden"),q[b].content={},!1!==a&&pa(b)):g.content=U[b]=!1}},qb=function(){var e=b(this),a=e.data("layoutMask"),a=q[a];"IFRAME"==a.tagName&&a.isVisible&&e.css({top:a.offsetTop,left:a.offsetLeft,width:a.outerWidth,height:a.outerHeight})},va=function(e,a){var m=k[e],d=["center"],g=r.zIndexes,c=b.extend({objectsOnly:!1,animation:!1,resizing:!0,
sliding:q[e].isSliding},a),n,f;c.resizing&&d.push(e);c.sliding&&d.push(k.oppositeEdge[e]);"horz"===m.dir&&(d.push("west"),d.push("east"));b.each(d,function(e,a){f=q[a];n=r[a];if(f.isVisible&&(n.maskObjects||!c.objectsOnly&&n.maskContents)){for(var m=b([]),d,w=0,h=ea.length;w<h;w++)d=ea.eq(w),d.data("layoutMask")===a&&(m=m.add(d));if(!m.length){m=y[a];d=q[a];var w=r[a],h=r.zIndexes,j=b([]),E,k,v,p,x;if(w.maskContents||w.maskObjects)for(x=0;x<(w.maskObjects?2:1);x++)E=w.maskObjects&&0==x,k=document.createElement(E?
"iframe":"div"),v=b(k).data("layoutMask",a),k.className="ui-layout-mask ui-layout-mask-"+a,p=k.style,p.display="block",p.position="absolute",p.background="#FFF",E&&(k.frameborder=0,k.src="about:blank",p.opacity=0,p.filter="Alpha(Opacity='0')",p.border=0),"IFRAME"==d.tagName?(p.zIndex=h.pane_normal+1,u.append(k)):(v.addClass("ui-layout-mask-inside-pane"),p.zIndex=w.maskZindex||h.content_mask,p.top=0,p.left=0,p.width="100%",p.height="100%",m.append(k)),j=j.add(k),ea=ea.add(k);m=j}m.each(function(){qb.call(this);
this.style.zIndex=f.isSliding?g.pane_sliding+1:g.pane_normal+1;this.style.display="block"})}})},za=function(a){if(a||!q.paneResizing)ea.hide();else if(!a&&!b.isEmptyObject(q.panesSliding)){a=ea.length-1;for(var d,m;0<=a;a--)m=ea.eq(a),d=m.data("layoutMask"),r[d].maskObjects||m.hide()}},Ra=function(a,d,m,c){if(H()){a=A.call(this,a);var g=y[a],t=U[a],n=F[a],f=P[a];g&&b.isEmptyObject(g.data())&&(g=!1);t&&b.isEmptyObject(t.data())&&(t=!1);n&&b.isEmptyObject(n.data())&&(n=!1);f&&b.isEmptyObject(f.data())&&
(f=!1);g&&g.stop(!0,!0);var h=r[a],l=ba[a],j=b.isPlainObject(l)&&!b.isEmptyObject(l);c=void 0!==c?c:h.destroyChildren;j&&c&&(b.each(l,function(a,b){b.destroyed||b.destroy(!0);b.destroyed&&delete l[a]}),b.isEmptyObject(l)&&(l=ba[a]=null,j=!1));g&&d&&!j?g.remove():g&&g[0]&&(d=h.paneClass,c=d+"-"+a,d=[d,d+"-open",d+"-closed",d+"-sliding",c,c+"-open",c+"-closed",c+"-sliding"],b.merge(d,Na(g,!0)),g.removeClass(d.join(" ")).removeData("parentLayout").removeData("layoutPane").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+
K),j&&t?(t.width(t.width()),b.each(l,function(a,b){b.resizeAll()})):t&&t.css(t.data("layoutCSS")).removeData("layoutCSS").removeData("layoutRole"),g.data("layout")||g.css(g.data("layoutCSS")).removeData("layoutCSS"));f&&f.remove();n&&n.remove();z[a]=y[a]=U[a]=F[a]=P[a]=!1;m||oa()}},Ea=function(a){var b=y[a],d=b[0].style;r[a].useOffscreenClose?(b.data(k.offscreenReset)||b.data(k.offscreenReset,{left:d.left,right:d.right}),b.css(k.offscreenCSS)):b.hide().removeData(k.offscreenReset)},rb=function(a){var b=
y[a];a=r[a];var d=k.offscreenCSS,c=b.data(k.offscreenReset),g=b[0].style;b.show().removeData(k.offscreenReset);a.useOffscreenClose&&c&&(g.left==d.left&&(g.left=c.left),g.right==d.right&&(g.right=c.right))},Ta=function(a,b){if(H()){var d=A.call(this,a),c=r[d],g=q[d],t=F[d];y[d]&&!g.isHidden&&!(q.initialized&&!1===C("onhide_start",d))&&(g.isSliding=!1,delete q.panesSliding[d],t&&t.hide(),!q.initialized||g.isClosed?(g.isClosed=!0,g.isHidden=!0,g.isVisible=!1,q.initialized||Ea(d),ia("horz"===k[d].dir?
"":"center"),(q.initialized||c.triggerEventsOnLoad)&&C("onhide_end",d)):(g.isHiding=!0,ja(d,!1,b)))}},Fa=function(a,b,d,c){if(H()){a=A.call(this,a);var g=q[a];y[a]&&g.isHidden&&!1!==C("onshow_start",a)&&(g.isShowing=!0,g.isSliding=!1,delete q.panesSliding[a],!1===b?ja(a,!0):ra(a,!1,d,c))}},na=function(a,b){if(H()){var d=Ma(a),c=A.call(this,a),g=q[c];d&&d.stopImmediatePropagation();g.isHidden?Fa(c):g.isClosed?ra(c,!!b):ja(c)}},ja=function(a,b,d,c){function g(){l.isMoving=!1;ma(t,!0);var a=k.oppositeEdge[t];
q[a].noRoom&&(Y(a),ha(a));if(!c&&(q.initialized||h.triggerEventsOnLoad))p||C("onclose_end",t),p&&C("onshow_end",t),v&&C("onhide_end",t)}var t=A.call(this,a);if(!q.initialized&&y[t]){a=t;var n=q[a];Ea(a);n.isClosed=!0;n.isVisible=!1;Da(a)}else if(H()){var f=y[t],h=r[t],l=q[t],j,p,v;u.queue(function(a){if(!f||!h.closable&&!l.isShowing&&!l.isHiding||!b&&l.isClosed&&!l.isShowing)return a();var e=!l.isShowing&&!1===C("onclose_start",t);p=l.isShowing;v=l.isHiding;delete l.isShowing;delete l.isHiding;if(e)return a();
j=!d&&!l.isClosed&&"none"!=h.fxName_close;l.isMoving=!0;l.isClosed=!0;l.isVisible=!1;v?l.isHidden=!0:p&&(l.isHidden=!1);l.isSliding?wa(t,!1):ia("horz"===k[t].dir?"":"center",!1);Da(t);j?(Ga(t,!0),f.hide(h.fxName_close,h.fxSettings_close,h.fxSpeed_close,function(){Ga(t,!1);l.isClosed&&g();a()})):(Ea(t),g(),a())})}},Da=function(a){if(F[a]){var d=F[a],c=P[a],f=r[a],g=k[a].side,t=f.resizerClass,n=f.togglerClass,h="-"+a;d.css(g,v.inset[g]).removeClass(t+"-open "+t+h+"-open").removeClass(t+"-sliding "+
t+h+"-sliding").addClass(t+"-closed "+t+h+"-closed");f.resizable&&b.layout.plugins.draggable&&d.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");c&&(c.removeClass(n+"-open "+n+h+"-open").addClass(n+"-closed "+n+h+"-closed").attr("title",f.tips.Open),c.children(".content-open").hide(),c.children(".content-closed").css("display","block"));Va(a,!1);q.initialized&&qa()}},ra=function(a,b,d,c){function g(){j.isMoving=!1;eb(f);j.isSliding||ia("vert"==k[f].dir?
"center":"",!1);Ua(f)}if(H()){var f=A.call(this,a),n=y[f],h=r[f],j=q[f],l,p;u.queue(function(a){if(!n||!h.resizable&&!h.closable&&!j.isShowing||j.isVisible&&!j.isSliding)return a();if(j.isHidden&&!j.isShowing)a(),Fa(f,!0);else{j.autoResize&&j.size!=h.size?ka(f,h.size,!0,!0,!0):Y(f,b);var e=C("onopen_start",f);if("abort"===e)return a();"NC"!==e&&Y(f,b);if(j.minSize>j.maxSize)return Va(f,!1),!c&&h.tips.noRoomToOpen&&alert(h.tips.noRoomToOpen),a();b?wa(f,!0):j.isSliding?wa(f,!1):h.slidable&&ma(f,!1);
j.noRoom=!1;ha(f);p=j.isShowing;delete j.isShowing;l=!d&&j.isClosed&&"none"!=h.fxName_open;j.isMoving=!0;j.isVisible=!0;j.isClosed=!1;p&&(j.isHidden=!1);l?(Ga(f,!0),n.show(h.fxName_open,h.fxSettings_open,h.fxSpeed_open,function(){Ga(f,!1);j.isVisible&&g();a()})):(rb(f),g(),a())}})}},Ua=function(a,d){var c=y[a],f=F[a],g=P[a],h=r[a],n=q[a],j=k[a].side,p=h.resizerClass,l=h.togglerClass,u="-"+a;f.css(j,v.inset[j]+ga(a)).removeClass(p+"-closed "+p+u+"-closed").addClass(p+"-open "+p+u+"-open");n.isSliding?
f.addClass(p+"-sliding "+p+u+"-sliding"):f.removeClass(p+"-sliding "+p+u+"-sliding");da(0,f);h.resizable&&b.layout.plugins.draggable?f.draggable("enable").css("cursor",h.resizerCursor).attr("title",h.tips.Resize):n.isSliding||f.css("cursor","default");g&&(g.removeClass(l+"-closed "+l+u+"-closed").addClass(l+"-open "+l+u+"-open").attr("title",h.tips.Close),da(0,g),g.children(".content-closed").hide(),g.children(".content-open").css("display","block"));Va(a,!n.isSliding);b.extend(n,R(c));q.initialized&&
(qa(),pa(a,!0));if(!d&&(q.initialized||h.triggerEventsOnLoad)&&c.is(":visible"))C("onopen_end",a),n.isShowing&&C("onshow_end",a),q.initialized&&C("onresize_end",a)},sb=function(a){function b(){g.isClosed?g.isMoving||ra(c,!0):wa(c,!0)}if(H()){var d=Ma(a),c=A.call(this,a),g=q[c];a=r[c].slideDelay_open;d&&d.stopImmediatePropagation();g.isClosed&&d&&"mouseenter"===d.type&&0<a?M.set(c+"_openSlider",b,a):b()}},Wa=function(a){function c(){g.isClosed?wa(f,!1):g.isMoving||ja(f)}if(H()){var m=Ma(a),f=A.call(this,
a);a=r[f];var g=q[f],h=g.isMoving?1E3:300;!g.isClosed&&!g.isResizing&&("click"===a.slideTrigger_close?c():a.preventQuickSlideClose&&g.isMoving||a.preventPrematureSlideClose&&m&&b.layout.isMouseOverElem(m,y[f])||(m?M.set(f+"_closeSlider",c,d(a.slideDelay_close,h)):c()))}},Ga=function(a,b){var d=y[a],c=q[a],g=r[a],f=r.zIndexes;b?(va(a,{animation:!0,objectsOnly:!0}),d.css({zIndex:f.pane_animate}),"south"==a?d.css({top:v.inset.top+v.innerHeight-d.outerHeight()}):"east"==a&&d.css({left:v.inset.left+v.innerWidth-
d.outerWidth()})):(za(),d.css({zIndex:c.isSliding?f.pane_sliding:f.pane_normal}),"south"==a?d.css({top:"auto"}):"east"==a&&!d.css("left").match(/\-99999/)&&d.css({left:"auto"}),G.msie&&(g.fxOpacityFix&&"slide"!=g.fxName_open&&d.css("filter")&&1==d.css("opacity"))&&d[0].style.removeAttribute("filter"))},ma=function(a,b){var d=r[a],c=F[a],g=d.slideTrigger_open.toLowerCase();if(c&&(!b||d.slidable)){g.match(/mouseover/)?g=d.slideTrigger_open="mouseenter":g.match(/(click|dblclick|mouseenter)/)||(g=d.slideTrigger_open=
"click");if(d.resizerDblClickToggle&&g.match(/click/))c[b?"unbind":"bind"]("dblclick."+K,na);c[b?"bind":"unbind"](g+"."+K,sb).css("cursor",b?d.sliderCursor:"default").attr("title",b?d.tips.Slide:"")}},wa=function(a,b){function d(b){M.clear(a+"_closeSlider");b.stopPropagation()}var c=r[a],g=q[a],f=r.zIndexes,h=c.slideTrigger_close.toLowerCase(),j=b?"bind":"unbind",k=y[a],l=F[a];M.clear(a+"_closeSlider");b?(g.isSliding=!0,q.panesSliding[a]=!0,ma(a,!1)):(g.isSliding=!1,delete q.panesSliding[a]);k.css("zIndex",
b?f.pane_sliding:f.pane_normal);l.css("zIndex",b?f.pane_sliding+2:f.resizer_normal);h.match(/(click|mouseleave)/)||(h=c.slideTrigger_close="mouseleave");l[j](h,Wa);"mouseleave"===h&&(k[j]("mouseleave."+K,Wa),l[j]("mouseenter."+K,d),k[j]("mouseenter."+K,d));b?"click"===h&&!c.resizable&&(l.css("cursor",b?c.sliderCursor:"default"),l.attr("title",b?c.tips.Close:"")):M.clear(a+"_closeSlider")},ha=function(a,d,c,f){d=r[a];var g=q[a],h=k[a],n=y[a],j=F[a],p="vert"===h.dir,l=!1;if("center"===a||p&&g.noVerticalRoom)(l=
0<=g.maxHeight)&&g.noRoom?(rb(a),j&&j.show(),g.isVisible=!0,g.noRoom=!1,p&&(g.noVerticalRoom=!1),eb(a)):!l&&!g.noRoom&&(Ea(a),j&&j.hide(),g.isVisible=!1,g.noRoom=!0);"center"!==a&&(g.minSize<=g.maxSize?(g.size>g.maxSize?ka(a,g.maxSize,c,!0,f):g.size<g.minSize?ka(a,g.minSize,c,!0,f):j&&(g.isVisible&&n.is(":visible"))&&(c=g.size+v.inset[h.side],b.layout.cssNum(j,h.side)!=c&&j.css(h.side,c)),g.noRoom&&(g.wasOpen&&d.closable?d.autoReopen?ra(a,!1,!0,!0):g.noRoom=!1:Fa(a,g.wasOpen,!0,!0))):g.noRoom||(g.noRoom=
!0,g.wasOpen=!g.isClosed&&!g.isSliding,g.isClosed||(d.closable?ja(a,!0,!0):Ta(a,!0))))},Ca=function(a,b,d,c,g){if(H()){a=A.call(this,a);var f=r[a],h=q[a];g=g||f.livePaneResizing&&!h.isResizing;h.autoResize=!1;ka(a,b,d,c,g)}},ka=function(e,c,f,h,g){function j(){for(var a="width"===ua?l.outerWidth():l.outerHeight(),a=[{pane:n,count:1,target:c,actual:a,correct:c===a,attempt:c,cssSize:D}],e=a[0],h={},t="Inaccurate size after resizing the "+n+"-pane.";!e.correct;){h={pane:n,count:e.count+1,target:c};h.attempt=
e.actual>c?d(0,e.attempt-(e.actual-c)):d(0,e.attempt+(c-e.actual));h.cssSize=("horz"==k[n].dir?O:Q)(y[n],h.attempt);l.css(ua,h.cssSize);h.actual="width"==ua?l.outerWidth():l.outerHeight();h.correct=c===h.actual;1===a.length&&(ca(t,!1,!0),ca(e,!1,!0));ca(h,!1,!0);if(3<a.length)break;a.push(h);e=a[a.length-1]}J.size=c;b.extend(J,R(l));J.isVisible&&l.is(":visible")&&(x&&x.css(B,c+v.inset[B]),pa(n));!f&&(!Z&&q.initialized&&J.isVisible)&&C("onresize_end",n);f||(J.isSliding||ia("horz"==k[n].dir?"":"center",
Z,g),qa());e=k.oppositeEdge[n];c<G&&q[e].noRoom&&(Y(e),ha(e,!1,f));1<a.length&&ca(t+"\nSee the Error Console for details.",!0,!0)}if(H()){var n=A.call(this,e),p=r[n],J=q[n],l=y[n],x=F[n],B=k[n].side,ua=k[n].sizeType.toLowerCase(),Z=J.isResizing&&!p.triggerEventsDuringLiveResize,z=!0!==h&&p.animatePaneSizing,G,D;u.queue(function(e){Y(n);G=J.size;c=fa(n,c);c=d(c,fa(n,p.minSize));c=a(c,J.maxSize);if(c<J.minSize)e(),ha(n,!1,f);else{if(!g&&c===G)return e();J.newSize=c;!f&&(q.initialized&&J.isVisible)&&
C("onresize_start",n);D=("horz"==k[n].dir?O:Q)(y[n],c);if(z&&l.is(":visible")){var h=b.layout.effects.size[n]||b.layout.effects.size.all,h=p.fxSettings_size.easing||h.easing,v=r.zIndexes,u={};u[ua]=D+"px";J.isMoving=!0;l.css({zIndex:v.pane_animate}).show().animate(u,p.fxSpeed_size,h,function(){l.css({zIndex:J.isSliding?v.pane_sliding:v.pane_normal});J.isMoving=!1;delete J.newSize;j();e()})}else l.css(ua,D),delete J.newSize,l.is(":visible")?j():(J.size=c,b.extend(J,R(l))),e()}})}},ia=function(a,c,
f){a=(a?a:"east,west,center").split(",");b.each(a,function(a,e){if(y[e]){var h=r[e],j=q[e],k=y[e],p=!0,l={},u=b.layout.showInvisibly(k),B={top:ga("north",!0),bottom:ga("south",!0),left:ga("west",!0),right:ga("east",!0),width:0,height:0};B.width=v.innerWidth-B.left-B.right;B.height=v.innerHeight-B.bottom-B.top;B.top+=v.inset.top;B.bottom+=v.inset.bottom;B.left+=v.inset.left;B.right+=v.inset.right;b.extend(j,R(k));if("center"===e){if(!f&&j.isVisible&&B.width===j.outerWidth&&B.height===j.outerHeight)return k.css(u),
!0;b.extend(j,ya(e),{maxWidth:B.width,maxHeight:B.height});l=B;j.newWidth=l.width;j.newHeight=l.height;l.width=Q(k,l.width);l.height=O(k,l.height);p=0<=l.width&&0<=l.height;if(!q.initialized&&h.minWidth>B.width){var h=h.minWidth-j.outerWidth,B=r.east.minSize||0,x=r.west.minSize||0,Z=q.east.size,z=q.west.size,A=Z,D=z;0<h&&(q.east.isVisible&&Z>B)&&(A=d(Z-B,Z-h),h-=Z-A);0<h&&(q.west.isVisible&&z>x)&&(D=d(z-x,z-h),h-=z-D);if(0===h){Z&&Z!=B&&ka("east",A,!0,!0,f);z&&z!=x&&ka("west",D,!0,!0,f);ia("center",
c,f);k.css(u);return}}}else{j.isVisible&&!j.noVerticalRoom&&b.extend(j,R(k),ya(e));if(!f&&!j.noVerticalRoom&&B.height===j.outerHeight)return k.css(u),!0;l.top=B.top;l.bottom=B.bottom;j.newSize=B.height;l.height=O(k,B.height);j.maxHeight=l.height;p=0<=j.maxHeight;p||(j.noVerticalRoom=!0)}p?(!c&&q.initialized&&C("onresize_start",e),k.css(l),"center"!==e&&qa(e),j.noRoom&&(!j.isClosed&&!j.isHidden)&&ha(e),j.isVisible&&(b.extend(j,R(k)),q.initialized&&pa(e))):!j.noRoom&&j.isVisible&&ha(e);k.css(u);delete j.newSize;
delete j.newWidth;delete j.newHeight;if(!j.isVisible)return!0;"center"===e&&(j=G.isIE6||!G.boxModel,y.north&&(j||"IFRAME"==q.north.tagName)&&y.north.css("width",Q(y.north,v.innerWidth)),y.south&&(j||"IFRAME"==q.south.tagName)&&y.south.css("width",Q(y.south,v.innerWidth)));!c&&q.initialized&&C("onresize_end",e)}})},oa=function(a){A(a);if(u.is(":visible"))if(q.initialized){if(!0===a&&b.isPlainObject(r.outset)&&u.css(r.outset),b.extend(v,R(u,r.inset)),v.outerHeight){!0===a&&ob();if(!1===C("onresizeall_start"))return!1;
var d,c,f;b.each(["south","north","east","west"],function(a,b){y[b]&&(c=r[b],f=q[b],f.autoResize&&f.size!=c.size?ka(b,c.size,!0,!0,!0):(Y(b),ha(b,!1,!0,!0)))});ia("",!0,!0);qa();b.each(k.allPanes,function(a,b){(d=y[b])&&q[b].isVisible&&C("onresize_end",b)});C("onresizeall_end")}}else Aa()},db=function(a,d){var c=A.call(this,a);r[c].resizeChildren&&(d||Ba(c),c=ba[c],b.isPlainObject(c)&&b.each(c,function(a,b){b.destroyed||b.resizeAll()}))},pa=function(a,c){if(H()){var h=A.call(this,a),h=h?h.split(","):
k.allPanes;b.each(h,function(a,e){function h(a){return d(u.css.paddingBottom,parseInt(a.css("marginBottom"),10)||0)}function j(){var a=r[e].contentIgnoreSelector,a=p.nextAll().not(".ui-layout-mask").not(a||":lt(0)"),b=a.filter(":visible"),d=b.filter(":last");v={top:p[0].offsetTop,height:p.outerHeight(),numFooters:a.length,hiddenFooters:a.length-b.length,spaceBelow:0};v.spaceAbove=v.top;v.bottom=v.top+v.height;v.spaceBelow=d.length?d[0].offsetTop+d.outerHeight()-v.bottom+h(d):h(p)}var m=y[e],p=U[e],
l=r[e],u=q[e],v=u.content;if(!m||!p||!m.is(":visible"))return!0;if(!p.length&&(Sa(e,!1),!p))return;if(!1!==C("onsizecontent_start",e)){if(!u.isMoving&&!u.isResizing||l.liveContentResizing||c||void 0==v.top)j(),0<v.hiddenFooters&&"hidden"===m.css("overflow")&&(m.css("overflow","visible"),j(),m.css("overflow","hidden"));m=u.innerHeight-(v.spaceAbove-u.css.paddingTop)-(v.spaceBelow-u.css.paddingBottom);if(!p.is(":visible")||v.height!=m){var x=p,l=x;f(x)?l=y[x]:x.jquery||(l=b(x));x=O(l,m);l.css({height:x,
visibility:"visible"});0<x&&0<l.innerWidth()?l.data("autoHidden")&&(l.show().data("autoHidden",!1),G.mozilla||l.css(k.hidden).css(k.visible)):l.data("autoHidden")||l.hide().data("autoHidden",!0);v.height=m}q.initialized&&C("onsizecontent_end",e)}})}},qa=function(a){a=(a=A.call(this,a))?a.split(","):k.borderPanes;b.each(a,function(a,d){var e=r[d],g=q[d],h=y[d],j=F[d],p=P[d],u;if(h&&j){var l=k[d].dir,x=g.isClosed?"_closed":"_open",B=e["spacing"+x],z=e["togglerAlign"+x],x=e["togglerLength"+x],A;if(0===
B)j.hide();else{!g.noRoom&&!g.isHidden&&j.show();"horz"===l?(A=v.innerWidth,g.resizerLength=A,h=b.layout.cssNum(h,"left"),j.css({width:Q(j,A),height:O(j,B),left:-9999<h?h:v.inset.left})):(A=h.outerHeight(),g.resizerLength=A,j.css({height:O(j,A),width:Q(j,B),top:v.inset.top+ga("north",!0)}));da(e,j);if(p){if(0===x||g.isSliding&&e.hideTogglerOnSlide){p.hide();return}p.show();if(!(0<x)||"100%"===x||x>A)x=A,z=0;else if(f(z))switch(z){case "top":case "left":z=0;break;case "bottom":case "right":z=A-x;break;
default:z=c((A-x)/2)}else h=parseInt(z,10),z=0<=z?h:A-x+h;if("horz"===l){var D=Q(p,x);p.css({width:D,height:O(p,B),left:z,top:0});p.children(".content").each(function(){u=b(this);u.css("marginLeft",c((D-u.outerWidth())/2))})}else{var C=O(p,x);p.css({height:C,width:Q(p,B),top:z,left:0});p.children(".content").each(function(){u=b(this);u.css("marginTop",c((C-u.outerHeight())/2))})}da(0,p)}if(!q.initialized&&(e.initHidden||g.isHidden))j.hide(),p&&p.hide()}}})},pb=function(a){if(H()){var b=A.call(this,
a);a=P[b];var d=r[b];a&&(d.closable=!0,a.bind("click."+K,function(a){a.stopPropagation();na(b)}).css("visibility","visible").css("cursor","pointer").attr("title",q[b].isClosed?d.tips.Open:d.tips.Close).show())}},Va=function(a,d){b.layout.plugins.buttons&&b.each(q[a].pins,function(c,f){b.layout.buttons.setPinState(z,b(f),a,d)})},u=b(this).eq(0);if(!u.length)return ca(r.errors.containerMissing);if(u.data("layoutContainer")&&u.data("layout"))return u.data("layout");var y={},U={},F={},P={},ea=b([]),v=
q.container,K=q.id,z={options:r,state:q,container:u,panes:y,contents:U,resizers:F,togglers:P,hide:Ta,show:Fa,toggle:na,open:ra,close:ja,slideOpen:sb,slideClose:Wa,slideToggle:function(a){a=A.call(this,a);na(a,!0)},setSizeLimits:Y,_sizePane:ka,sizePane:Ca,sizeContent:pa,swapPanes:function(a,c){function f(a){var d=y[a],c=U[a];return!d?!1:{pane:a,P:d?d[0]:!1,C:c?c[0]:!1,state:b.extend(!0,{},q[a]),options:b.extend(!0,{},r[a])}}function h(a,c){if(a){var e=a.P,f=a.C,g=a.pane,j=k[c],m=b.extend(!0,{},q[c]),
n=r[c],w={resizerCursor:n.resizerCursor};b.each(["fxName","fxSpeed","fxSettings"],function(a,b){w[b+"_open"]=n[b+"_open"];w[b+"_close"]=n[b+"_close"];w[b+"_size"]=n[b+"_size"]});y[c]=b(e).data({layoutPane:z[c],layoutEdge:c}).css(k.hidden).css(j.cssReq);U[c]=f?b(f):!1;r[c]=b.extend(!0,{},a.options,w);q[c]=b.extend(!0,{},a.state);e.className=e.className.replace(RegExp(n.paneClass+"-"+g,"g"),n.paneClass+"-"+c);Pa(c);j.dir!=k[g].dir?(e=p[c]||0,Y(c),e=d(e,q[c].minSize),Ca(c,e,!0,!0)):F[c].css(j.side,v.inset[j.side]+
(q[c].isVisible?ga(c):0));a.state.isVisible&&!m.isVisible?Ua(c,!0):(Da(c),ma(c,!0));a=null}}if(H()){var g=A.call(this,a);q[g].edge=c;q[c].edge=g;if(!1===C("onswap_start",g)||!1===C("onswap_start",c))q[g].edge=g,q[c].edge=c;else{var j=f(g),n=f(c),p={};p[g]=j?j.state.size:0;p[c]=n?n.state.size:0;y[g]=!1;y[c]=!1;q[g]={};q[c]={};P[g]&&P[g].remove();P[c]&&P[c].remove();F[g]&&F[g].remove();F[c]&&F[c].remove();F[g]=F[c]=P[g]=P[c]=!1;h(j,c);h(n,g);j=n=p=null;y[g]&&y[g].css(k.visible);y[c]&&y[c].css(k.visible);
oa();C("onswap_end",g);C("onswap_end",c)}}},showMasks:va,hideMasks:za,initContent:Sa,addPane:ib,removePane:Ra,createChildren:Qa,refreshChildren:Ba,enableClosable:pb,disableClosable:function(a,b){if(H()){var c=A.call(this,a),d=P[c];d&&(r[c].closable=!1,q[c].isClosed&&ra(c,!1,!0),d.unbind("."+K).css("visibility",b?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&b.data("draggable")&&(r[a].slidable=!0,q[a].isClosed&&ma(a,
!0))}},disableSlidable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&(r[a].slidable=!1,q[a].isSliding?ja(a,!1,!0):(ma(a,!1),b.css("cursor","default").attr("title",""),da(null,b[0])))}},enableResizable:function(a){if(H()){a=A.call(this,a);var b=F[a],c=r[a];b&&b.data("draggable")&&(c.resizable=!0,b.draggable("enable"),q[a].isClosed||b.css("cursor",c.resizerCursor).attr("title",c.tips.Resize))}},disableResizable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&b.data("draggable")&&(r[a].resizable=
!1,b.draggable("disable").css("cursor","default").attr("title",""),da(null,b[0]))}},allowOverflow:x,resetOverflow:X,destroy:function(a,c){b(window).unbind("."+K);b(document).unbind("."+K);"object"===typeof a?A(a):c=a;u.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(r.containerClass).unbind("."+K);ea.remove();b.each(k.allPanes,function(a,b){Ra(b,!1,!0,c)});u.data("layoutCSS")&&!u.data("layoutRole")&&u.css(u.data("layoutCSS")).removeData("layoutCSS");"BODY"===v.tagName&&
(u=b("html")).data("layoutCSS")&&u.css(u.data("layoutCSS")).removeData("layoutCSS");j(z,b.layout.onDestroy);mb();for(var d in z)d.match(/^(container|options)$/)||delete z[d];z.destroyed=!0;return z},initPanes:H,resizeAll:oa,runCallbacks:C,hasParentLayout:!1,children:ba,north:!1,south:!1,west:!1,east:!1,center:!1},Xa;var V,Ya,N,Ha,la,sa,W;h=b.layout.transformData(h,!0);h=b.layout.backwardCompatibility.renameAllOptions(h);if(!b.isEmptyObject(h.panes)){V=b.layout.optionsMap.noDefault;la=0;for(sa=V.length;la<
sa;la++)N=V[la],delete h.panes[N];V=b.layout.optionsMap.layout;la=0;for(sa=V.length;la<sa;la++)N=V[la],delete h.panes[N]}V=b.layout.optionsMap.layout;var Bb=b.layout.config.optionRootKeys;for(N in h)Ha=h[N],0>b.inArray(N,Bb)&&0>b.inArray(N,V)&&(h.panes[N]||(h.panes[N]=b.isPlainObject(Ha)?b.extend(!0,{},Ha):Ha),delete h[N]);b.extend(!0,r,h);b.each(k.allPanes,function(a,c){k[c]=b.extend(!0,{},k.panes,k[c]);Ya=r.panes;W=r[c];if("center"===c){V=b.layout.optionsMap.center;a=0;for(sa=V.length;a<sa;a++)if(N=
V[a],!h.center[N]&&(h.panes[N]||!W[N]))W[N]=Ya[N]}else{W=r[c]=b.extend(!0,{},Ya,W);var d=r[c],f=r.panes;d.fxSettings||(d.fxSettings={});f.fxSettings||(f.fxSettings={});b.each(["_open","_close","_size"],function(a,e){var h="fxName"+e,j="fxSpeed"+e,k="fxSettings"+e,l=d[h]=d[h]||f[h]||d.fxName||f.fxName||"none",p=b.effects&&(b.effects[l]||b.effects.effect&&b.effects.effect[l]);if("none"===l||!r.effects[l]||!p)l=d[h]="none";l=r.effects[l]||{};h=l.all||null;l=l[c]||null;d[j]=d[j]||f[j]||d.fxSpeed||f.fxSpeed||
null;d[k]=b.extend(!0,{},h,l,f.fxSettings,d.fxSettings,f[k],d[k])});delete d.fxName;delete d.fxSpeed;delete d.fxSettings;W.resizerClass||(W.resizerClass="ui-layout-resizer");W.togglerClass||(W.togglerClass="ui-layout-toggler")}W.paneClass||(W.paneClass="ui-layout-pane")});var Ia=h.zIndex,xa=r.zIndexes;0<Ia&&(xa.pane_normal=Ia,xa.content_mask=d(Ia+1,xa.content_mask),xa.resizer_normal=d(Ia+2,xa.resizer_normal));delete r.panes;var Cb=r,tb=q;tb.creatingLayout=!0;j(z,b.layout.onCreate);if(!1===C("onload_start"))Xa=
"cancel";else{var Za=u[0],$=b("html"),ub=v.tagName=Za.tagName,vb=v.id=Za.id,wb=v.className=Za.className,L=r,Ja=L.name,$a={},Ka=u.data("parentLayout"),La=u.data("layoutEdge"),ab=Ka&&La,ta=b.layout.cssNum,bb,aa;v.selector=u.selector.split(".slice")[0];v.ref=(L.name?L.name+" layout / ":"")+ub+(vb?"#"+vb:wb?".["+wb+"]":"");v.isBody="BODY"===ub;!ab&&!v.isBody&&(bb=u.closest("."+b.layout.defaults.panes.paneClass),Ka=bb.data("parentLayout"),La=bb.data("layoutEdge"),ab=Ka&&La);u.data({layout:z,layoutContainer:K}).addClass(L.containerClass);
var xb={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(Ja in xb)u.bind("layout"+Ja.toLowerCase()+"."+K,z[xb[Ja]||Ja]);ab&&(z.hasParentLayout=!0,Ka.refreshChildren(La,z));u.data("layoutCSS")||(v.isBody?(u.data("layoutCSS",b.extend(D(u,"position,margin,padding,border"),{height:u.css("height"),overflow:u.css("overflow"),overflowX:u.css("overflowX"),overflowY:u.css("overflowY")})),$.data("layoutCSS",b.extend(D($,"padding"),{height:"auto",overflow:$.css("overflow"),overflowX:$.css("overflowX"),
overflowY:$.css("overflowY")}))):u.data("layoutCSS",D(u,"position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{$a={overflow:"hidden",overflowX:"hidden",overflowY:"hidden"};u.css($a);L.inset&&!b.isPlainObject(L.inset)&&(aa=parseInt(L.inset,10)||0,L.inset={top:aa,bottom:aa,left:aa,right:aa});if(v.isBody)L.outset?b.isPlainObject(L.outset)||(aa=parseInt(L.outset,10)||0,L.outset={top:aa,bottom:aa,left:aa,right:aa}):L.outset={top:ta($,"paddingTop"),bottom:ta($,
"paddingBottom"),left:ta($,"paddingLeft"),right:ta($,"paddingRight")},$.css($a).css({height:"100%",border:"none",padding:0,margin:0}),G.isIE6?(u.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),L.inset||(L.inset=R(u).inset)):(u.css({width:"auto",height:"auto",margin:0,position:"absolute"}),u.css(L.outset)),b.extend(v,R(u,L.inset));else{var yb=u.css("position");(!yb||!yb.match(/(fixed|absolute|relative)/))&&u.css("position","relative");u.is(":visible")&&(b.extend(v,
R(u,L.inset)),1>v.innerHeight&&ca(L.errors.noContainerHeight.replace(/CONTAINER/,v.ref)))}ta(u,"minWidth")&&u.parent().css("overflowX","auto");ta(u,"minHeight")&&u.parent().css("overflowY","auto")}catch(Db){}nb();b(window).bind("unload."+K,mb);j(z,b.layout.onLoad);Cb.initPanes&&Aa();delete tb.creatingLayout;Xa=q.initialized}return"cancel"===Xa?null:z}})(jQuery);
(function(b){b.ui||(b.ui={});b.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(a){for(var d=document.cookie,d=d?d.split(";"):[],c,f=0,j=d.length;f<j;f++)if(c=b.trim(d[f]).split("="),c[0]==a)return decodeURIComponent(c[1]);return null},write:function(a,d,c){var f="",j="",h=!1;c=c||{};var p=c.expires||null,x=b.type(p);"date"===x?j=p:"string"===x&&0<p&&(p=parseInt(p,10),x="number");"number"===x&&(j=new Date,0<p?j.setDate(j.getDate()+p):(j.setFullYear(1970),h=!0));j&&(f+=";expires="+
j.toUTCString());c.path&&(f+=";path="+c.path);c.domain&&(f+=";domain="+c.domain);c.secure&&(f+=";secure");document.cookie=a+"="+(h?"":encodeURIComponent(d))+f},clear:function(a){b.ui.cookie.write(a,"",{expires:-1})}};b.cookie||(b.cookie=function(a,d,c){var f=b.ui.cookie;if(null===d)f.clear(a);else{if(void 0===d)return f.read(a);f.write(a,d,c)}});b.layout.plugins.stateManagement=!0;b.layout.config.optionRootKeys.push("stateManagement");b.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,
animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}};b.layout.optionsMap.layout.push("stateManagement");b.layout.state={saveCookie:function(a,d,c){var f=a.options,j=f.stateManagement;c=b.extend(!0,{},j.cookie,c||null);a=a.state.stateData=a.readState(d||j.stateKeys);b.ui.cookie.write(c.name||f.name||
"Layout",b.layout.state.encodeJSON(a),c);return b.extend(!0,{},a)},deleteCookie:function(a){a=a.options;b.ui.cookie.clear(a.stateManagement.cookie.name||a.name||"Layout")},readCookie:function(a){a=a.options;return(a=b.ui.cookie.read(a.stateManagement.cookie.name||a.name||"Layout"))?b.layout.state.decodeJSON(a):{}},loadCookie:function(a){var d=b.layout.state.readCookie(a);d&&(a.state.stateData=b.extend(!0,{},d),a.loadState(d));return d},loadState:function(a,d,c){if(b.isPlainObject(d)&&!b.isEmptyObject(d))if(d=
a.state.stateData=b.layout.transformData(d),c=b.extend({animateLoad:!1,includeChildren:a.options.stateManagement.includeChildren},c),a.state.initialized){var f=!c.animateLoad,j,h,p,x;b.each(b.layout.config.borderPanes,function(c,G){S=d[G];b.isPlainObject(S)&&(s=S.size,j=S.initClosed,h=S.initHidden,ar=S.autoResize,p=a.state[G],x=p.isVisible,ar&&(p.autoResize=ar),x||a._sizePane(G,s,!1,!1,!1),!0===h?a.hide(G,f):!0===j?a.close(G,!1,f):!1===j?a.open(G,!1,f):!1===h&&a.show(G,!1,f),x&&a._sizePane(G,s,!1,
!1,f))});if(c.includeChildren){var I,T;b.each(a.children,function(a,c){(I=d[a]?d[a].children:0)&&c&&b.each(c,function(a,b){T=I[a];b&&T&&b.loadState(T)})})}}else{var S=b.extend(!0,{},d);b.each(b.layout.config.allPanes,function(a,b){S[b]&&delete S[b].children});b.extend(!0,a.options,S)}},readState:function(a,d){"string"===b.type(d)&&(d={keys:d});d||(d={});var c=a.options.stateManagement,f=d.includeChildren,f=void 0!==f?f:c.includeChildren,c=d.stateKeys||c.stateKeys,j={isClosed:"initClosed",isHidden:"initHidden"},
h=a.state,p=b.layout.config.allPanes,x={},I,T,S,X,G,k;b.isArray(c)&&(c=c.join(","));for(var c=c.replace(/__/g,".").split(","),Q=0,O=c.length;Q<O;Q++)I=c[Q].split("."),T=I[0],I=I[1],0>b.inArray(T,p)||(S=h[T][I],void 0!=S&&("isClosed"==I&&h[T].isSliding&&(S=!0),(x[T]||(x[T]={}))[j[I]?j[I]:I]=S));f&&b.each(p,function(c,d){G=a.children[d];X=h.stateData[d];b.isPlainObject(G)&&!b.isEmptyObject(G)&&(k=x[d]||(x[d]={}),k.children||(k.children={}),b.each(G,function(a,c){c.state.initialized?k.children[a]=b.layout.state.readState(c):
X&&(X.children&&X.children[a])&&(k.children[a]=b.extend(!0,{},X.children[a]))}))});return x},encodeJSON:function(a){function d(a){var f=[],j=0,h,p,x,I=b.isArray(a);for(h in a)p=a[h],x=typeof p,"string"==x?p='"'+p+'"':"object"==x&&(p=d(p)),f[j++]=(!I?'"'+h+'":':"")+p;return(I?"[":"{")+f.join(",")+(I?"]":"}")}return d(a)},decodeJSON:function(a){try{return b.parseJSON?b.parseJSON(a):window.eval("("+a+")")||{}}catch(d){return{}}},_create:function(a){var d=b.layout.state,c=a.options.stateManagement;b.extend(a,
{readCookie:function(){return d.readCookie(a)},deleteCookie:function(){d.deleteCookie(a)},saveCookie:function(b,c){return d.saveCookie(a,b,c)},loadCookie:function(){return d.loadCookie(a)},loadState:function(b,c){d.loadState(a,b,c)},readState:function(b){return d.readState(a,b)},encodeJSON:d.encodeJSON,decodeJSON:d.decodeJSON});a.state.stateData={};if(c.autoLoad)if(b.isPlainObject(c.autoLoad))b.isEmptyObject(c.autoLoad)||a.loadState(c.autoLoad);else if(c.enabled)if(b.isFunction(c.autoLoad)){var f=
{};try{f=c.autoLoad(a,a.state,a.options,a.options.name||"")}catch(j){}f&&(b.isPlainObject(f)&&!b.isEmptyObject(f))&&a.loadState(f)}else a.loadCookie()},_unload:function(a){var d=a.options.stateManagement;if(d.enabled&&d.autoSave)if(b.isFunction(d.autoSave))try{d.autoSave(a,a.state,a.options,a.options.name||"")}catch(c){}else a.saveCookie()}};b.layout.onCreate.push(b.layout.state._create);b.layout.onUnload.push(b.layout.state._unload);b.layout.plugins.buttons=!0;b.layout.defaults.autoBindCustomButtons=
!1;b.layout.optionsMap.layout.push("autoBindCustomButtons");b.layout.buttons={init:function(a){var d=a.options.name||"",c;b.each("toggle open close pin toggle-slide open-slide".split(" "),function(f,j){b.each(b.layout.config.borderPanes,function(f,p){b(".ui-layout-button-"+j+"-"+p).each(function(){c=b(this).data("layoutName")||b(this).attr("layoutName");(void 0==c||c===d)&&a.bindButton(this,j,p)})})})},get:function(a,d,c,f){var j=b(d);a=a.options;var h=a.errors.addButtonError;j.length?0>b.inArray(c,
b.layout.config.borderPanes)?(b.layout.msg(h+" "+a.errors.pane+": "+c,!0),j=b("")):(d=a[c].buttonClass+"-"+f,j.addClass(d+" "+d+"-"+c).data("layoutName",a.name)):b.layout.msg(h+" "+a.errors.selector+": "+d,!0);return j},bind:function(a,d,c,f){var j=b.layout.buttons;switch(c.toLowerCase()){case "toggle":j.addToggle(a,d,f);break;case "open":j.addOpen(a,d,f);break;case "close":j.addClose(a,d,f);break;case "pin":j.addPin(a,d,f);break;case "toggle-slide":j.addToggle(a,d,f,!0);break;case "open-slide":j.addOpen(a,
d,f,!0)}return a},addToggle:function(a,d,c,f){b.layout.buttons.get(a,d,c,"toggle").click(function(b){a.toggle(c,!!f);b.stopPropagation()});return a},addOpen:function(a,d,c,f){b.layout.buttons.get(a,d,c,"open").attr("title",a.options[c].tips.Open).click(function(b){a.open(c,!!f);b.stopPropagation()});return a},addClose:function(a,d,c){b.layout.buttons.get(a,d,c,"close").attr("title",a.options[c].tips.Close).click(function(b){a.close(c);b.stopPropagation()});return a},addPin:function(a,d,c){var f=b.layout.buttons,
j=f.get(a,d,c,"pin");if(j.length){var h=a.state[c];j.click(function(d){f.setPinState(a,b(this),c,h.isSliding||h.isClosed);h.isSliding||h.isClosed?a.open(c):a.close(c);d.stopPropagation()});f.setPinState(a,j,c,!h.isClosed&&!h.isSliding);h.pins.push(d)}return a},setPinState:function(a,b,c,f){var j=b.attr("pin");if(!(j&&f===("down"==j))){a=a.options[c];var j=a.buttonClass+"-pin",h=j+"-"+c;c=j+"-up "+h+"-up";j=j+"-down "+h+"-down";b.attr("pin",f?"down":"up").attr("title",f?a.tips.Unpin:a.tips.Pin).removeClass(f?
c:j).addClass(f?j:c)}},syncPinBtns:function(a,d,c){b.each(a.state[d].pins,function(f,j){b.layout.buttons.setPinState(a,b(j),d,c)})},_load:function(a){var d=b.layout.buttons;b.extend(a,{bindButton:function(b,c,h){return d.bind(a,b,c,h)},addToggleBtn:function(b,c,h){return d.addToggle(a,b,c,h)},addOpenBtn:function(b,c,h){return d.addOpen(a,b,c,h)},addCloseBtn:function(b,c){return d.addClose(a,b,c)},addPinBtn:function(b,c){return d.addPin(a,b,c)}});for(var c=0;4>c;c++)a.state[b.layout.config.borderPanes[c]].pins=
[];a.options.autoBindCustomButtons&&d.init(a)},_unload:function(){}};b.layout.onLoad.push(b.layout.buttons._load);b.layout.plugins.browserZoom=!0;b.layout.defaults.browserZoomCheckInterval=1E3;b.layout.optionsMap.layout.push("browserZoomCheckInterval");b.layout.browserZoom={_init:function(a){!1!==b.layout.browserZoom.ratio()&&b.layout.browserZoom._setTimer(a)},_setTimer:function(a){if(!a.destroyed){var d=a.options,c=a.state,f=a.hasParentLayout?5E3:Math.max(d.browserZoomCheckInterval,100);setTimeout(function(){if(!a.destroyed&&
d.resizeWithWindow){var f=b.layout.browserZoom.ratio();f!==c.browserZoom&&(c.browserZoom=f,a.resizeAll());b.layout.browserZoom._setTimer(a)}},f)}},ratio:function(){function a(a,b){return(100*(parseInt(a,10)/parseInt(b,10))).toFixed()}var d=window,c=screen,f=document,j=f.documentElement||f.body,h=b.layout.browser,p=h.version,x,I,T;return h.msie&&8<p||!h.msie?!1:c.deviceXDPI&&c.systemXDPI?a(c.deviceXDPI,c.systemXDPI):h.webkit&&(x=f.body.getBoundingClientRect)?a(x.left-x.right,f.body.offsetWidth):h.webkit&&
(I=d.outerWidth)?a(I,d.innerWidth):(I=c.width)&&(T=j.clientWidth)?a(I,T):!1}};b.layout.onReady.push(b.layout.browserZoom._init)})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
/var/www/michelangelofe/build/css/mafe.css

View File

@@ -0,0 +1,303 @@
.pm-toolbarpanel-btn {
text-decoration: none;
list-style: none;
text-align: center;
}
.pm-toolbarpanel-btn-span{
font-size: 10px;
}
.pm-toolbarpanel-btn-img{
width: 30px;
height: 30px;
}
.pm-toolbarpanel-tooltip {
font-size: 10px;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
background-color: #6D87B7;
color: white;
}
.pmui-pmcanvas {
background-image: url(../img/grid_10.png);
}
.pmui-bpmn-sprite {
background-image: url(../img/bpmn_sprite_with_zoom.png);
background-repeat: no-repeat;
display: inline-block;
}
.pm-event-start {
background-color: #DCF7B8;
border: 2px solid #A3CB26;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
-ms-border-radius: 100px;
-o-border-radius: 100px;
border-radius: 100px;
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
/*.pm_event {
background: url('../../img/event_shape.png') no-repeat;
}*/
.pmui-event-end {
background-color: #D74816;
border: 2px solid #e58d70;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
-ms-border-radius: 100px;
-o-border-radius: 100px;
border-radius: 100px;
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
/*.pm_event_end {
background: url('../../img/event_end.png') no-repeat;
}*/
.pm-gateway {
background: url(../img/gateway_shape.png) no-repeat;
}
.pm-email {
background: url(../img/email.png) no-repeat;
}
/*
* For buttons that are on the north from the Layout
*/
.ui-layout-north a{
margin-left: 2px;
}
.pm-activity-task {
background-color: #d9edf7;
border: 2px solid #0055cc;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
-ms-border-radius: 7px;
-o-border-radius: 7px;
border-radius: 7px;
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
.pm-activity-subprocess {
background-color: #dcceff;
border: 2px solid #756899;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
-ms-border-radius: 7px;
-o-border-radius: 7px;
border-radius: 7px;
-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}
/*
* Processmaker Toolbar
*/
.pmui-button {
border:1px solid #7d99ca;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
text-align:center;
margin-top: auto;
margin-bottom: auto;
font-size:10px;
font-family:arial, helvetica, sans-serif;
/*padding: 4px 4px 4px 4px; */
text-decoration:none;
display:inline-block;
font-weight:bold;
color: #FFFFFF;
background-color: #6681B0;
background-image: -webkit-gradient(linear, left top, left bottom, from(#A5B8DA), to(#7089B3));
background-image: -webkit-linear-gradient(top, #A5B8DA, #7089B3);
padding-left: 5px;
padding-right: 5px;
}
.pmui-toolbar-sprite {
background-image: url(../img/spriteOld.png) !important;
background-repeat: no-repeat;
display: inline;
overflow: hidden;
padding: 2px 5px 2px 22px;
/*padding-left: 22px;*/
}
.pmui-dynaform {
background-position: 0 -181px;
}
.pmui-input {
background-position: 0 -11757px;
}
.pmui-output {
background-position: 0 -12045px;
}
.pmui-trigger {
background-position: 0 -4233px;
}
.pmui-report {
background-position: 0 -15429px;
}
.pmui-database {
background-position: 0 -5619px;
}
.pmui-scheduler {
background-position: 0 -2991px;
}
.pm-toolbar-sprite {
background-image: url(../img/bpmn_sprite_with_zoom.png);
background-repeat: no-repeat;
width: 16px;
height: 16px;
display: inline-block;
}
.pm-toolbar-task {
background-position: -2px -852px;
}
.pm-toolbar-task:hover {
background-position: -2px -852px;
background-color: #8A8484;
}
.pm-toolbar-subprocess {
background-position: -55px -852px;
}
.pm-toolbar-subprocess:hover {
background-position: -55px -852px;
background-color: #8A8484;
}
.pm-toolbar-startcase {
background-position: -19px -852px;
}
.pm-toolbar-startcase:hover {
background-position: -19px -852px;
background-color: #8A8484;
}
.pm-toolbar-endprocess {
background-position: -73px -852px;
}
.pm-toolbar-endprocess:hover {
background-position: -73px -852px;
background-color: #8A8484;
}
.pm-toolbar-selection {
background-position: -92px -852px;
}
.pm-toolbar-selection:hover {
background-position: -92px -852px;
background-color: #8A8484;
}
.pm-toolbar-evaluation {
background-position: -92px -852px;
}
.pm-toolbar-evaluation:hover {
background-position: -92px -852px;
background-color: #8A8484;
}
.pm-toolbar-parallel {
background-position: -92px -852px;
}
.pm-toolbar-parallel:hover {
background-position: -92px -852px;
background-color: #8A8484;
}
.pm-toolbar-parallel-evaluation {
background-position: -92px -852px;
}
.pm-toolbar-parallel-evaluation:hover {
background-position: -92px -852px;
background-color: #8A8484;
}
.pm-toolbar-parallel-join {
background-position: -92px -852px;
}
.pm-toolbar-parallel-join:hover {
background-position: -92px -852px;
background-color: #8A8484;
}
/**
* Canvas Menu
*/
.pmui-menu-edit-process {
background: url(../img/edit.gif) no-repeat;
}
.pmui-menu-export-process {
background: url(../img/edit.gif) no-repeat;
}
.pmui-menu-add-task {
background: url(../img/add.png) no-repeat;
}
.pmui-menu-sub-process {
background: url(../img/subProcess.png) no-repeat;
}
.pmui-menu-add-text {
background: url(../img/addtext.png) no-repeat;
}
.pmui-menu-horiz-line {
background: url(../img/linhori.png) no-repeat;
}
.pmui-menu-vertical-line {
background: url(../img/linver.png) no-repeat;
}
.pmui-menu-all-lines {
background: url(../img/delete.png) no-repeat;
}
.pmui-menu-process-permissions {
background: url(../img/object_permission.gif) no-repeat;
}
.pmui-menu-process-supervisor {
background: url(../img/users.png) no-repeat;
}
.pmui-menu-web-entry {
background: url(../img/dynaforms.gif) no-repeat;
}
.pmui-menu-case-tracker {
background: url(../img/tracker.gif) no-repeat;
}
.pmui-menu-files-manager {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-events {
background: url(../img/events.gif) no-repeat;
}
/**
* PMTask Menu
*/
.pmui-menu-task-steps {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-task-users {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-task-users-adhoc {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-task-rules {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-task-delete-rules {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-task-delete {
background: url(../img/folder.gif) no-repeat;
}
.pmui-menu-task-properties {
background: url(../img/folder.gif) no-repeat;
}
/**
*Hard core
*/
fieldset {
display: inline;
color: black !important;
}

View File

@@ -1 +0,0 @@
/var/www/michelangelofe/build/js/mafe.js

View File

@@ -1 +0,0 @@
/var/www/pmdraw/example-beta/css/style.css

View File

@@ -1 +0,0 @@
/var/www/pmui/build/css/pmui-1.0.0.css

View File

@@ -0,0 +1,551 @@
/*PMUI Stylesheet
pmui 1.0.0
*/
.pmui-icon {
background-image: url(../img/sprite.png);
background-repeat: no-repeat;
display: inline-block;
}
.pmui-icon-help {
background-position: -16px 0;
}
.pmui-icon-info {
background-position: 0 0;
}
.pmui-icon-error {
background-position: -16px -16px;
}
.pmui-icon-warning {
background-position: 0 -16px;
}
.pmui-tooltip {
padding: 0.2em 0.3em;
border-radius: 1em;
}
.pmui-tooltip-message {
margin: 0 5px 0 3px;
}
.pmui-tooltip-mode-normal .pmui-tooltip-message {
font-size: 0.8em;
}
.pmui-field-message-container {
display: block;
}
.pmui-tooltip-category-error {
color: #F00;
}
.pmui-window-modal {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.4);
left: 0;
top: 0;
z-index: 100
}
.pmui-window,
.pmui-window-header {
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-top-left-radius: 5px;
-moz-border-top-right-radius: 5px;
-o-border-top-left-radius: 5px;
-o-border-top-right-radius: 5px;
-ms-box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
cursor: move;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.pmui-window {
padding: 6px;
position: absolute;
background: #D8D8D8;
border: 1px solid #BBB;
-webkit-box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
-o-box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
-ms-box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
}
.pmui-window-title {
font-weight: bold;
display: block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.pmui-window .pmui-window-close {
float: right;
background: #888;
border: 0;
width: 1.5em;
}
.pmui-window-body {
background: #F8F8F8;
border: 1px solid #aaa;
overflow: auto;
cursor: default;
}
.pmui-window-footer {
overflow: hidden;
}
.pmui-button {
margin-top: 1%;
}
.pmui-button {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
border:1px solid #7d99ca;
text-align:center;
margin-top: auto;
margin-bottom: auto;
font-size:12px;
font-family:arial, helvetica, sans-serif;
text-decoration:none;
display:inline-block;
font-weight:bold;
color: #FFFFFF;
background-color: #AAAAAA;
background-image: -webkit-gradient(linear, left top, left bottom, from(#A5B8DA), to(#7089B3));
background-image: -webkit-linear-gradient(top, #A5B8DA, #7089B3);
background-image: -o-linear-gradient(top, #A5B8DA, #7089B3);
background-image: -moz-linear-gradient(top, #A5B8DA, #7089B3);
padding-left: 5px;
padding-right: 5px;
}
.pmui-button:hover{
background-image: -webkit-gradient(linear, left top, left bottom, from(#819bcb), to(#536f9d));
background-image: -webkit-linear-gradient(top, #819bcb, #536f9d);
background-color: #819bcb;
}
/**
* TreePanel Class
*
* Styles for TreeItem class as a basic item from TreePanel class
*/
.pmui-tree {
font-size: 10px;
}
.pmui-tree div:hover{
background-color: #d0e2f4;
}
.pmui-item-treeitem span{
margin: 0 5px 0 5px;
}
.pmui-item-selected {
background-color: #b2adad;
}
.pmui-tree-icon {
background: url(../img/leaf.gif) no-repeat;
display: inline-block;
width: 16px;
height: 16px;
}
.pmui-tree-parent {
background: url(../img/folder.gif) no-repeat;
display: inline-block;
width: 16px;
height: 16px;
}
.pmui-tree-nodeclosed {
background: url(../img/elbow-plus.gif) no-repeat;
display: inline-block;
width: 16px;
height: 16px;
}
.pmui-tree-nodeexpanded {
background: url(../img/elbow-minus.gif) no-repeat;
display: inline-block;
width: 16px;
height: 16px;
}
.pmui-node-icon {
display: inline-block;
width: 16px;
height: 16px;
}
.pmui-field:hover {
background: #F0F0F0;
}
.pmui-field-label {
display: inline-block;
text-align: right;
padding: 4px 2px;
background: #F0F0F0;
}
.pmui-field-message {
display: block;
}
input.pmui-element,
select.pmui-element,
textarea.pmui-element {
border: 1px solid #888;
}
.pmui-field-container {
display: block;
}
.pmui-field-control-table {
display: inline-block;
vertical-align: top;
}
.pmui-formpanel {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
}
.pmui-formpanel-legend {
height: 1em;
}
.pmui-form-title,
.pmui-form-footer {
text-align: center;
}
.pmui-form-header {
padding: 0.4em;
}
.pmui-form-title {
font-size: 1.2em;
margin: 0;
line-height: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.pmui-form-footer {
padding: 6px;
}
.pmui-menu-container li{
list-style-type: none;
}
.pmui-menu-container a{
text-decoration: none;
}
.pmui-menu-container {
background-color: #eaeaea;
border: 1px solid;
border-color: rgb(163, 162, 162);
-moz-box-shadow: 8px 9px 10px -10px #000;
-webkit-box-shadow: 8px 9px 10px -10px #000;
box-shadow: 8px 9px 10px -10px #000;
}
.pmui-list {
padding: 0px 5px 0px 5px;
margin: 10px 0px 10px 0px;
}
.pmui-menu-item-element {
cursor: pointer;
}
.pmui-menu-item-element-disabled {
cursor: default;
opacity: .25;
-moz-opacity: .25;
filter:alpha(opacity=25);
}
.pmui-menu-item-element-disabled a {
cursor: default;
}
.pmui-item-link {
padding-left: 40px;
}
.pmui-menu-icon-empty {
width: 16px;
height: 16px;
}
.pmui-item-separator {
}
.pmui-separator {
border-bottom: 1px solid;
display: block;
font-size: 1px;
line-height: 1px;
overflow: hidden;
white-space: nowrap;
background-color: #999797;
border-bottom-color: #999797;
height: 1px;
}
.pmui-check-checked {
background: url(../img/checked.png) no-repeat;
background-size: 12px 12px;
}
.pmui-check-unchecked {
background: url(../img/unchecked.png) no-repeat;
background-size: 16px 16px;
}
.pmui-item-active {
background-color: #cfdef7;
border-style: solid;
border-width: 1px 0;
margin: 0 1px;
padding: 0;
border-color: #b0caf4;
}
.pmui-label {
color: black;
}
.pmui-item-icon {
border-right: 1px solid;
border-color: #cecece;
left: 5px;
padding-right: 10px;
margin-left: 5px;
position: absolute;
width: 16px;
height: 16px
}
.pmui-text{
font-size: 14px;
font: normal 8pt "Open Sans", Tahoma, sans-serif, MiscFixed;
color: black;
}
.pmui-tabpanel-tabs{
list-style: none;
margin: initial;
padding: initial;
display: block;
}
.pmui-tabItem{
display: inline-block;
border-radius: 0.4em 0.4em 0 0;
border-left: 1px solid #c0c0c0;
border-right: 1px solid #c0c0c0;
border-top: 1px solid #c0c0c0;
margin:0 2px 0 0;
padding:0.1em 0.4em 0.1em 0.4em;
}
.pmui-tabItem:hover{
background: #D1D1D1;
cursor:pointer;
}
.pmui-tabpanel-container{
width:365px;
height:400px;
background:#F3F2F2;
border: 1px solid #C0C0C0;
}
.pmui-tab-ref{
text-decoration: none;
color: #2F4F4F;
}
.pmui-datepicker {
font-size: 12px;
width: 200px;
position: absolute;
border: #888 1px solid;
background: #F8F8F8;
}
.pmui-datepicker input {
border: 1px #888 solid;
font-size: 0.8em;
}
.pmui-datepicker a {
text-decoration: none;
color: inherit;
}
.pmui-datepicker-header {
font-size: 1.2em;
}
.pmui-datepicker-head-table {
width: 100%;
}
.pmui-datepicker-month-selector select,
.pmui-datepicker-year-selector select {
background: none;
border: none;
}
.pmui-datepicker-month-selector {
text-align: left;
}
.pmui-datepicker-year-selector {
text-align: right;
}
.pmui-datepicker-table {
width: 100%;
}
.pmui-datepicker-table tr {
margin: 0;
padding: 0;
}
.pmui-datepicker-table td {
text-align: center;
background: #F0F0F0;
padding: 1px;
}
.pmui-datepicker-table td a {
display: block;
}
.pmui-datepicker-table td a:hover,
.pmui-datepicker-table td .selected {
background: #D0D0D0;
}
.pmui-datepicker-table thead th {
font-size: 0.8em;
}
.pmui-datepicker-disabled-date {
color: #888;
}
.pmui-datepicker-footer {
padding: 4px;
}
.pmui-datepicker-footer div {
display: inline-block;
}
.pmui-datepicker-button {
font-family: Arial;
background: #C0C0C0;
padding: 1px;
border: 1px solid #888;
margin: 1px;
}
.pmui-menu-container li{
list-style-type: none;
}
.pmui-menu-container a{
text-decoration: none;
}
.pmui-menu-container {
background-color: #eaeaea;
border: 1px solid;
border-color: rgb(163, 162, 162);
-moz-box-shadow: 8px 9px 10px -10px #000;
-webkit-box-shadow: 8px 9px 10px -10px #000;
box-shadow: 8px 9px 10px -10px #000;
}
.pmui-list {
padding: 0px 5px 0px 5px;
margin: 10px 0px 10px 0px;
}
.pmui-menu-item-element {
cursor: pointer;
}
.pmui-menu-item-element-disabled {
cursor: default;
opacity: .25;
-moz-opacity: .25;
filter:alpha(opacity=25);
}
.pmui-menu-item-element-disabled a {
cursor: default;
}
.pmui-item-link {
padding-left: 40px;
}
.pmui-menu-icon-empty {
width: 16px;
height: 16px;
}
.pmui-item-separator {
}
.pmui-separator {
border-bottom: 1px solid;
display: block;
font-size: 1px;
line-height: 1px;
overflow: hidden;
white-space: nowrap;
background-color: #999797;
border-bottom-color: #999797;
height: 1px;
}
.pmui-check-checked {
background: url(../img/checked.png) no-repeat;
background-size: 12px 12px;
}
.pmui-check-unchecked {
background: url(../img/unchecked.png) no-repeat;
background-size: 16px 16px;
}
.pmui-item-active {
background-color: #cfdef7;
border-style: solid;
border-width: 1px 0;
margin: 0 1px;
padding: 0;
border-color: #b0caf4;
}
.pmui-label {
color: black;
}
.pmui-item-icon {
border-right: 1px solid;
border-color: #cecece;
left: 5px;
padding-right: 10px;
margin-left: 5px;
position: absolute;
width: 16px;
height: 16px
}
.pmui-text{
font-size: 14px;
font: normal 8pt "Open Sans", Tahoma, sans-serif, MiscFixed;
color: black;
}

View File

@@ -1 +0,0 @@
/var/www/pmui/build/js/pmui-1.0.0.js

View File

@@ -0,0 +1,610 @@
var PMUI={version:"1.0.0",isCtrl:!1,isShift:!1,activeCanvas:null,currentContextMenu:null};
$(document).keydown(function(a){if(PMUI.activeCanvas)switch(a.which){case 16:PMUI.isShift=!0;break;case 17:PMUI.isCtrl=!0;break;case 116:a.preventDefault();window.location.reload(!0);break;case 37:PMUI.activeCanvas.currentLabel||(a.preventDefault(),PMUI.activeCanvas.moveElements(PMUI.activeCanvas,"LEFT"));break;case 38:PMUI.activeCanvas.currentLabel||(a.preventDefault(),PMUI.activeCanvas.moveElements(PMUI.activeCanvas,"TOP"));break;case 39:PMUI.activeCanvas.currentLabel||(a.preventDefault(),PMUI.activeCanvas.moveElements(PMUI.activeCanvas,
"RIGHT"));break;case 40:PMUI.activeCanvas.currentLabel||(a.preventDefault(),PMUI.activeCanvas.moveElements(PMUI.activeCanvas,"BOTTOM"));break;case 67:!PMUI.activeCanvas.currentLabel&&PMUI.isCtrl&&(a.preventDefault(),PMUI.activeCanvas.copy());break;case 86:!PMUI.activeCanvas.currentLabel&&PMUI.isCtrl&&(a.preventDefault(),PMUI.activeCanvas.paste());break;case 90:PMUI.isCtrl&&(PMUI.isShift?PMUI.activeCanvas.redo():PMUI.activeCanvas.undo(),a.preventDefault())}}).keypress(function(a){}).keyup(function(a){a.preventDefault();
switch(a.which){case 8:PMUI.isCtrl&&PMUI.activeCanvas&&!PMUI.activeCanvas.currentLabel&&PMUI.activeCanvas.removeElements();break;case 13:PMUI.activeCanvas&&PMUI.activeCanvas.currentLabel&&PMUI.activeCanvas.currentLabel.loseFocus();break;case 46:PMUI.activeCanvas&&!PMUI.activeCanvas.currentLabel&&PMUI.activeCanvas.removeElements();break;case 16:PMUI.isShift=!1;break;case 17:PMUI.isCtrl=!1;break;case 113:PMUI.activeCanvas&&null!==PMUI.activeCanvas.getCurrentSelection().getLast()&&(a=PMUI.activeCanvas.getCurrentSelection().getLast(),
void 0!==a&&null!==a.label.html&&($(a.label.html).dblclick(),$(a.label.text.html).focus()))}});PMUI.extendNamespace=function(a,b){var f,c,d,e;if(2!==arguments.length)throw Error("PMUI.extendNamespace(): method needs 2 arguments");c=a.split(".");"PMUI"===c[0]&&(c=c.slice(1));f=PMUI;for(e=0;e<c.length-1;e+=1)d=c[e],"undefined"===typeof f[d]&&(f[d]={}),f=f[d];d=c[c.length-1];f[d]&&console.log("PMUI.extendNamespace(): Warning! overriding the class '"+c.join(".")+"'");return f[d]=b};
PMUI.validPath=function(a,b){var f=a.split("."),c,d,e;b?c=b:("PMUI"===f[0]&&(f=f.slice(1)),c=PMUI);for(e=0;e<f.length;e+=1){d=f[e];if(!c[d])return null;c=c[d]}return c};
PMUI.inheritFrom=function(a,b){var f,c,d,e;if(2!==arguments.length)throw Error("PMUI.inheritFrom(): method needs 2 arguments");d=a.split(".");"PMUI"===d[0]&&(d=d.slice(1));f=PMUI;for(e=0;e<d.length;e+=1){c=d[e];if("undefined"===typeof f[c])throw Error("PMUI.inheritFrom(): object "+c+" not found, full path was "+a);f=f[c]}c=function(b){var f=function(){};f.prototype=b;return new f}(f.prototype);c.constructor=b;b.prototype=c;b.superclass=f};
PMUI.generateUniqueId=function(){var a=function(b,f){"undefined"===typeof b&&(b=0);"undefined"===typeof f&&(f=999999999);return Math.floor(Math.random()*(f-b+1))+b},b=function(b,f){"undefined"===typeof b&&(b="");var a,g=function(b,f){var a="",c;b=parseInt(b,10).toString(16);if(f<b.length)return b.slice(b.length-f);if(f>b.length){a="";for(c=0;c<1+(f-b.length);c+=1)a+="0";return a+b}return b};this.php_js||(this.php_js={});this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random()));
this.php_js.uniqidSeed+=1;a=b+g(parseInt((new Date).getTime()/1E3,10),8);a+=g(this.php_js.uniqidSeed,5);f&&(a+=(10*Math.random()).toFixed(8).toString());return a},f;do f=b(a(0,999999999),!0),f=f.replace(".","0");while(32!==f.length);return f};PMUI.createHTMLElement=function(a){return document.createElement(a)};
PMUI.calculateWidth=function(a,b){var f=b||"12px arial",c=$(this.createHTMLElement("div"));c.text(a).css({position:"absolute","float":"left","white-space":"nowrap",visibility:"hidden",font:f}).appendTo($("body"));f=c.width();c.remove();return f};PMUI.getVersion=function(){return this.version};
PMUI.triggerEvent=function(a,b,f){if(a instanceof PMUI.core.Element)if(a.events[b]instanceof PMUI.event.Event)a.events[b].handler.call(f||this);else throw Error("Event name is not registered int this element");else throw Error("Current Element is not able to trigger events");};PMUI.setActiveCanvas=function(a){PMUI.activeCanvas=a;return this};PMUI.getActiveCanvas=function(){return PMUI.activeCanvas};
PMUI.pageCoordinatesToShapeCoordinates=function(a,b,f,c){f=!f?b.pageX:f;b=!c?b.pageY:c;c=a.getCanvas();f+=c.getLeftScroll()-a.getAbsoluteX()-c.getX();b+=c.getTopScroll()-a.getAbsoluteY()-c.getY();return new PMUI.util.Point(f,b)};PMUI.getPointRelativeToPage=function(a){var b=a.getCanvas(),f=a.absoluteX+b.getX()-b.getLeftScroll()+a.zoomWidth/2;a=a.absoluteY+b.getY()-b.getTopScroll()+a.zoomHeight/2;return new PMUI.point.Point(f,a)};
PMUI.json2xml=function(a){var b,f,c,d;b=function(b){var f=0,a;for(a in b)b.hasOwnProperty(a)&&(f+=1);return f};f=function(a,d){var h,k,l="<"+a,m=!1;if("undefined"===typeof d||null===d)return l+"/>";if("object"!==typeof d)return l+=">"+c(d)+"</"+a+">";if(d.constructor===Object){for(h in d)if(d.hasOwnProperty(h)&&"@"===h.charAt(0))if("object"!==typeof d[h])l+=" "+h.substring(1)+'="'+d[h]+'"',delete d[h];else throw Error(typeof d[h]+" being attribute is not supported.");0===b(d)?(l+="/>",m=!0):l+=">";
if(m)return l;if("undefined"!==typeof d["#text"])if("object"!==typeof d["#text"])l+=d["#text"],delete d["#text"];else throw Error(typeof d["#text"]+" being #text is not supported.");for(k in d)if(d.hasOwnProperty(k))if(d[k].constructor===Array)for(h=0;h<d[k].length;h++)if("object"!==typeof d[k][h]||d[k][h].constructor===Object)l+=f(k,d[k][h]);else throw Error(typeof d[k][h]+" is not supported.");else if(d[k].constructor===Object||"object"!==typeof d[k])l+=f(k,d[k]);else throw Error(typeof d[k]+" is not supported.");
return l+="</"+a+">"}};c=function(b){b=b.toString();b=b.replace(/\&/g,"&amp;");b=b.replace(/\"/g,"&quot;");b=b.replace(/</g,"&lt;");return b=b.replace(/>/g,"&gt;")};if("object"===typeof a&&a.constructor===Object&&1===b(a))for(d in a)if(a.hasOwnProperty(d))return f(d,a[d])};PMUI.removeContextMenu=function(){PMUI.currentContextMenu&&(document.body.removeChild(PMUI.currentContextMenu.html),PMUI.currentContextMenu=null);return this};PMUI.getContextMenu=function(){return PMUI.currentContextMenu};
PMUI.setContextMenu=function(a,b){var f,c;b&&a.addEvent("contextmenu").listen(a.html,function(d){d.preventDefault();PMUI.removeContextMenu();PMUI.currentContextMenu=new PMUI.ui.Menu(b);f=PMUI.currentContextMenu;f.setParentWidget(a);c=f.listeners.clickParent;c(f.parent,d);d.stopPropagation()})};PMUI.showContextMenu=function(a){var b=PMUI.getContextMenu();b&&(document.body.appendChild(b.getHTML()),b.show(a.x,a.y),b.defineEvents())};"undefined"!==typeof exports&&(module.exports=PMUI);
(function(){var a=function(){var b=[],f=0,a,d;return{id:Math.random(),get:function(f){return b[f]},insert:function(a){b[f]=a;f+=1;return this},remove:function(d){a=this.indexOf(d);if(-1===a)return!1;f-=1;b.splice(a,1);return!0},getSize:function(){return f},isEmpty:function(){return 0===f},indexOf:function(a){for(d=0;d<f;d+=1)if(a===b[d])return d;return-1},find:function(f,a){var c,d;for(c=0;c<b.length;c+=1)if(d=b[c],d[f]===a)return d},contains:function(b){return-1!==this.indexOf(b)?!0:!1},sort:function(f){var a=
!1;f&&(b.sort(f),a=!0);return a},asArray:function(){return b},getFirst:function(){return b[0]},getLast:function(){return b[f-1]},popLast:function(){var a;f-=1;a=b[f];b.splice(f,1);return a},getDimensionLimit:function(){var a=[1E5,-1,-1,1E5];for(d=0;d<f;d+=1)a[0]>b[d].y&&(a[0]=b[d].y),a[1]<b[d].x+b[d].width&&(a[1]=b[d].x+b[d].width),a[2]<b[d].y+b[d].height&&(a[2]=b[d].y+b[d].height),a[3]>b[d].x&&(a[3]=b[d].x);return a},clear:function(){0!==f&&(b=[],f=0);return this}}};PMUI.extendNamespace("PMUI.util.ArrayList",
a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.belongsTo=this.cssClasses=this.cssProperties=null;a.prototype.initObject.call(this,b)};a.prototype.type="Style";a.MAX_ZINDEX=100;a.prototype.initObject=function(b){var f={cssClasses:[],cssProperties:{},belongsTo:null};jQuery.extend(!0,f,b);this.cssClasses=f.cssClasses;this.cssProperties=f.cssProperties;this.belongsTo=f.belongsTo};a.prototype.applyStyle=function(){if(!this.belongsTo.html)throw Error("applyStyle(): can't apply style to an object with no html");var b,
f;b=this.belongsTo.type.toLowerCase();jQuery(this.belongsTo.html).addClass("pmui-"+b);jQuery(this.belongsTo.html).css(this.cssProperties);for(b=0;b<this.cssClasses.length;b+=1)f=this.cssClasses[b],$(this.belongsTo.html).hasClass(f)||jQuery(this.belongsTo.html).addClass(f);return this};a.prototype.addProperties=function(b){jQuery.extend(!0,this.cssProperties,b);jQuery(this.belongsTo.html).css(b);return this};a.prototype.getProperty=function(b){return this.cssProperties[b]||jQuery(this.belongsTo.html).css(b)||
this.belongsTo.html&&window.getComputedStyle(this.belongsTo.html,null).getPropertyValue(b)||""};a.prototype.removeProperties=function(b){var f,a;for(a=0;a<b.length;a+=1)f=b[a],this.cssProperties.hasOwnProperty(f)&&(jQuery(this.belongsTo.html).css(f,""),delete this.cssProperties[f]);return this};a.prototype.addClasses=function(b){var f,a;if(b&&b instanceof Array)for(f=0;f<b.length;f+=1)if(a=b[f],"string"===typeof a)-1===this.cssClasses.indexOf(a)&&(this.cssClasses.push(a),jQuery(this.belongsTo.html).addClass(a));
else throw Error("addClasses(): array element is not of type string");else throw Error("addClasses(): parameter must be of type Array");return this};a.prototype.removeClasses=function(b){var f,a;if(b&&b instanceof Array)for(f=0;f<b.length;f+=1)if(a=b[f],"string"===typeof a)a=this.cssClasses.indexOf(a),-1!==a&&(jQuery(this.belongsTo.html).removeClass(this.cssClasses[a]),this.cssClasses.splice(a,1));else throw Error("removeClasses(): array element is not of type string");else throw Error("removeClasses(): parameter must be of type Array");
return this};a.prototype.removeAllClasses=function(){this.cssClasses=[];jQuery(this.belongsTo.html).removeClass();return this};a.prototype.containsClass=function(b){return-1!==this.cssClasses.indexOf(b)};a.prototype.getClasses=function(){return this.cssClasses};a.prototype.stringify=function(){return{cssClasses:this.cssClasses}};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.util.Style",a)})();
(function(){var a=function(b){this.defaultProduct=this.products=null;a.prototype.init.call(this,b)};a.prototype.type="Factory";a.prototype.family="Factory";a.prototype.init=function(b){var f;b||(b={});f=b.defaultProduct||"element";b=b.products||{element:PMUI.core.Element};this.setDefaultProduct(f).setProducts(b)};a.prototype.setDefaultProduct=function(b){this.defaultProduct=b;return this};a.prototype.setProducts=function(b){this.products=b;return this};a.prototype.register=function(b,f){var a=this.products||
{};a[b]=f;this.products=a;return this};a.prototype.build=function(b,f){var a;if(this.isValidName(b))a=this.products[b],a=new a(f);else throw Error('The type "'+b+'" has not valid constructor or is undefined.');return a};a.prototype.isValidName=function(b){return this.products[b]};a.prototype.isValidClass=function(b){var f=!1;jQuery.each(this.products,function(a,d){b instanceof d&&(f=!0)});return f};a.prototype.make=function(b){var f=b.pmType||"";return this.isValidClass(b)?b:this.isValidName(f)?this.build.call(this,
f,b):this.build.call(this,this.defaultProduct,b)};PMUI.extendNamespace("PMUI.util.Factory",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,f,a,d){this.red=!b?0:b;this.green=!f?0:f;this.blue=!a?0:a;this.opacity=!d?1:d};a.prototype.type="Color";a.GREY=new a(192,192,192,1);a.prototype.getRed=function(){return this.red};a.prototype.getGreen=function(){return this.green};a.prototype.getBlue=function(){return this.blue};a.prototype.getOpacity=function(){return this.opacity};a.prototype.setRed=function(b){"number"===typeof b&&(0<=b&&255>=b)&&(this.red=b);return this};a.prototype.setGreen=function(b){"number"===
typeof b&&(0<=b&&255>=b)&&(this.green=b);return this};a.prototype.setBlue=function(b){"number"===typeof b&&(0<=b&&255>=b)&&(this.blue=b);return this};a.prototype.setOpacity=function(b){"number"===typeof b&&(0<=b&&255>=b)&&(this.opacity=b);return this};a.prototype.getCSS=function(){return"rgba("+this.red+","+this.green+","+this.blue+","+this.opacity+")"};PMUI.extendNamespace("PMUI.util.Color",a)})();
(function(){var a=function(b,f){this.x=b;this.y=f};a.prototype.type="Point";a.prototype.getX=function(){return this.x};a.prototype.getY=function(){return this.y};a.prototype.add=function(b){return new a(this.x+b.x,this.y+b.y)};a.prototype.subtract=function(b){return new a(this.x-b.x,this.y-b.y)};a.prototype.multiply=function(b){return new a(this.x*b,this.y*b)};a.prototype.equals=function(b){return Math.abs(this.x-b.x)<PMUI.draw.Geometry.eps&&Math.abs(this.y-b.y)<PMUI.draw.Geometry.eps};a.prototype.getDistance=
function(b){return Math.sqrt((this.x-b.x)*(this.x-b.x)+(this.y-b.y)*(this.y-b.y))};a.prototype.getSquaredDistance=function(b){return(this.x-b.x)*(this.x-b.x)+(this.y-b.y)*(this.y-b.y)};a.prototype.getManhattanDistance=function(b){return Math.abs(this.x-b.x)+Math.abs(this.y-b.y)};a.prototype.clone=function(){return new a(this.x,this.y)};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.util.Point",a)})();
(function(){var a=function(b){if(!b)return null;this.graphics=new JSGraphics(b);this.color=new PMUI.util.Color(0,0,0)};a.prototype.drawLine=function(b,f,a,d,e,g,h,k,l){l||this.graphics.clear();e||(e="regular");switch(e){case "dotted":this.graphics.setStroke(-1);break;case "segmented":this.graphics.setStroke(1);this.graphics.drawLine=this.makeSegmentedLine;break;case "segmentdot":this.graphics.setStroke(1);this.graphics.drawLine=this.makeSegmentDotLine;break;default:this.graphics.setStroke(1)}this.graphics.setColor(g.getCSS());
this.graphics.drawLine(b,f,a,d,h,k);this.graphics.paint()};a.prototype.getColor=function(){return this.color};a.prototype.setColor=function(b){"Color"===b.type&&(this.color=b);return this};a.prototype.makeSegmentedLine=function(b,f,a,d,e,g){var h,k=4,l=3;h=0;if(!(a!==b&&d!==f)){if(a===b){if(d===f)return;a=0;d<f&&(h=d,d=f,f=h);d=h=d-f}else d=0,a<b&&(h=a,a=b,b=h),a=h=a-b;7>h&&(k=2,l=1);k=!e?k:e;l=!g?l:g;if(0===d)for(;0<a;)a>=k?(this._mkDiv(b,f,k,1),b+=k+l,a-=k+l):(this._mkDiv(b,f,a,1),a=0);else for(;0<
d;)d>=k?(this._mkDiv(b,f,1,k),f+=k+l,d-=k+l):(this._mkDiv(b,f,1,d),d=0)}};a.prototype.makeSegmentDotLine=function(b,f,a,d,e,g){var h;if(!(a!==b&&d!==f)){if(a===b){if(d===f)return;a=0;d<f&&(h=d,d=f,f=h);d-=f}else d=0,a<b&&(h=a,a=b,b=h),a-=b;e=!e?7:e;g=!g?4:g;if(0===d)for(;0<a;)a>=e?(this._mkDiv(b,f,e,1),a-=e+g,b+=e+g,0<a&&(this._mkDiv(b,f,1,1),a-=1+g,b+=1+g)):(this._mkDiv(b,f,a,1),a=0);else for(;0<d;)d>=e?(this._mkDiv(b,f,1,e),d-=e+g,f+=e+g,0<d&&(this._mkDiv(b,f,1,1),d-=1+g,f+=1+g)):(this._mkDiv(b,
f,1,d),d=0)}};a.prototype.drawArc=function(b,f,a,d,e,g){var h,k=d;for(g||(g=10);1E-5<Math.abs(k-e);)k=(k+g)%360,d=b+a*Math.cos(k*PMUI.draw.Geometry.pi/180),h=f+a*Math.sin(k*PMUI.draw.Geometry.pi/180),this.graphics.drawLine(d,h,d,h)};PMUI.extendNamespace("PMUI.draw.Graphics",a)})();
(function(){var a={pi:Math.acos(-1),eps:1E-8,cross:function(b,f){return b.x*f.y-b.y*f.x},area:function(b,f,a){f=f.clone();a=a.clone();return this.cross(f.subtract(b),a.subtract(b))},onSegment:function(b,f,a){return Math.abs(this.area(f,a,b))<this.eps&&b.x>=Math.min(f.x,a.x)&&b.x<=Math.max(f.x,a.x)&&b.y>=Math.min(f.y,a.y)&&b.y<=Math.max(f.y,a.y)},perpendicularSegmentIntersection:function(b,f,a,d){var e,g=null;if(b.x>f.x||b.y>f.y)e=b.clone(),b=f.clone(),f=e;if(a.x>d.x||a.y>d.y)e=a.clone(),a=d.clone(),
d=e;b.x===f.x?a.y===d.y&&(a.x<b.x&&b.x<d.x&&b.y<a.y&&a.y<f.y)&&(g=new PMUI.util.Point(b.x,a.y)):b.y===f.y&&a.x===d.x&&(b.x<a.x&&a.x<f.x&&a.y<b.y&&b.y<d.y)&&(g=new PMUI.util.Point(a.x,b.y));return g},segmentIntersection:function(b,f,a,d,e){var g=this.area(a,d,b),h=this.area(a,d,f),k=this.area(b,f,a),l=this.area(b,f,d),m;if((0<g&&0>h||0>g&&0<h)&&(0<k&&0>l||0>k&&0<l))return!0;m=!1;e&&(0===g&&this.onSegment(b,a,d)?m=!0:0===h&&this.onSegment(f,a,d)?m=!0:0===k&&this.onSegment(a,b,f)?m=!0:0===l&&this.onSegment(d,
b,f)&&(m=!0));return m},segmentIntersectionPoint:function(b,f,a,d){return b.add(f.subtract(b).multiply(this.cross(a.subtract(b),d.subtract(b))/this.cross(f.subtract(b),d.subtract(a))))},pointInRectangle:function(b,f,a){return b.x>=f.x&&b.x<=a.x&&b.y>=f.y&&b.y<=a.y},pointInCircle:function(b,f,a){return f.getDistance(b)<=a},pointInRhombus:function(b,f,a){var d,e=f.length-1;for(d=0;d<f.length;e=d,d+=1)if(this.segmentIntersection(a,b,f[e],f[d],!0)&&!1===this.onSegment(b,f[e],f[d]))return!1;return!0}};
"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.draw.Geometry",a)})();
(function(){var a=function(b){this.actionIcon=this.actionText=null;this.disabled=!1;this.handler=null;a.prototype.init.call(this,b)};a.prototype.type="Action";a.prototype.family="Action";a.prototype.isAction=!0;a.prototype.init=function(b){var f;f={icon:null,text:null,disabled:!1,handler:function(){}};jQuery.extend(!0,f,b);this.setActionIcon(f.icon).setActionText(f.text).setDisable(f.disabled).setHandler(f.handler)};a.prototype.setActionIcon=function(b){this.actionIcon=b;return this};a.prototype.setActionText=
function(b){this.actionText=b;return this};a.prototype.setDisable=function(b){"boolean"===typeof b&&(this.disabled=b);return this};a.prototype.getIcon=function(){return this.actionIcon};a.prototype.getText=function(){return this.actionText};a.prototype.setHandler=function(b){"function"===typeof b&&(this.handler=b);return this};a.prototype.enable=function(){this.setDisable(!1)};a.prototype.disabled=function(){this.setDisable(!0)};a.prototype.isEnabled=function(){return!this.disabled};a.prototype.execute=
function(){!this.disabled&&"function"===typeof this.handler&&this.handler()};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.event.Action",a)})();
(function(){var a=function(b){this.id=null;a.prototype.init.call(this,b)};a.prototype.type="Base";a.prototype.family="Core";a.prototype.init=function(b){var f={id:PMUI.generateUniqueId()};jQuery.extend(!0,f,b);this.setID(f.id)};a.prototype.setID=function(b){this.id=b;return this};a.prototype.getID=function(){return this.id};a.prototype.getType=function(){return this.type};a.prototype.getFamily=function(){return this.family};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.core.Base",
a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.enabledMenu=this.menu=this.display=this.proportion=this.positionMode=this.elementTag=this.zOrder=this.visible=this.height=this.width=this.y=this.x=this.style=this.html=null;this.events={};a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Base",a);a.prototype.type="Element";a.prototype.init=function(b){var f={elementTag:"div",positionMode:"relative",enabledMenu:!1,style:{cssProperties:{},cssClasses:[]},x:0,y:0,width:"auto",height:"auto",
zOrder:"auto",display:"",visible:!0,proportion:1};jQuery.extend(!0,f,b);this.setElementTag(f.elementTag).setStyle(f.style).setPositionMode(f.positionMode).setDisplay(f.display).setX(f.x).setY(f.y).setWidth(f.width).setHeight(f.height).setZOrder(f.zOrder).setVisible(f.visible).setProportion(f.proportion).setEnabledMenu(f.enabledMenu).setMenuBehavior()};a.prototype.setDisplay=function(b){if(""===b||"block"===b||"inline"===b||"inline-block"===b||"none"===b)this.display=b,this.applyStyle();else throw Error('The setDisplay() method only accepts one od the following options: "", "block", "inline", "inline-block", "none"');
return this};a.prototype.setPositionMode=function(b){if("static"===b||"absolute"===b||"fixed"===b||"relative"===b||"inherit"===b)this.positionMode=b,this.applyStyle();else throw Error('The setPosition() method only accepts one of the following options: "static", "absolute", "fixed", "relative", "inherit"');return this};a.prototype.setElementTag=function(b){!this.html&&"string"===typeof b&&(this.elementTag=b);return this};a.prototype.setStyle=function(b){b instanceof PMUI.util.Style?(this.style=b,
b.belongsTo=this):"object"===typeof b&&(b.belongsTo=this,this.style=new PMUI.util.Style(b));return this};a.prototype.setX=function(b){if("number"===typeof b)this.x=b;else if(/^\d+(\.\d+)?px$/.test(b))this.x=parseInt(b,10);else throw Error("setX: x param is not a number");this.style.addProperties({left:this.x});return this};a.prototype.getX=function(){return this.x};a.prototype.setY=function(b){if("number"===typeof b)this.y=b;else if(/^\d+(\.\d+)?px$/.test(b))this.y=parseInt(b,10);else throw Error("setY: y param is not a number");
this.style.addProperties({top:this.y});return this};a.prototype.getY=function(){return this.y};a.prototype.setWidth=function(b){if("number"===typeof b)this.width=b;else if(/^\d+(\.\d+)?px$/.test(b))this.width=parseInt(b,10);else if(/^\d+(\.\d+)?%$/.test(b))this.width=b;else if(/^\d+(\.\d+)?em$/.test(b))this.width=b;else if("auto"===b||"inherit"===b)this.width=b;else throw Error("setWidth: width param is not a number");this.style.addProperties({width:this.width});return this};a.prototype.getWidth=
function(){return this.width};a.prototype.setHeight=function(b){if("number"===typeof b)this.height=b;else if(/^\d+(\.\d+)?px$/.test(b))this.height=parseInt(b,10);else if(/^\d+(\.\d+)?%$/.test(b))this.height=b;else if(/^\d+(\.\d+)?em$/.test(b))this.height=b;else if("auto"===b||"inherit"===b)this.height=b;else throw Error("setHeight: height param is not a number");this.style.addProperties({height:this.height});return this};a.prototype.getHeight=function(){return this.height};a.prototype.setZOrder=function(b){if("number"===
typeof b)this.zOrder=parseInt(b,10);else if("auto"===b||"inherit"===b)this.zOrder=b;else throw Error("setZOrder: zOrder param is not a number");this.html&&this.style.addProperties({"z-index":this.zOrder});return this};a.prototype.getZOrder=function(){return this.zOrder};a.prototype.setVisible=function(b){this.visible=!!b;this.html&&this.style.addProperties({display:this.visible?this.display:"none"});return this};a.prototype.isVisible=function(){return this.visible};a.prototype.setPosition=function(b){this.setX(b.x);
this.setY(b.y);return this};a.prototype.getPosition=function(){return{x:this.getX(),y:this.getY()}};a.prototype.setDimension=function(b){this.setWidth(b.width);this.setHeight(b.height);return this};a.prototype.getDimension=function(){return{width:this.getWidth(),height:this.getHeight()}};a.prototype.applyStyle=function(){this.html&&(this.style.applyStyle(),this.style.addProperties({display:this.visible?this.display:"none",position:this.positionMode,left:this.x,top:this.y,width:this.width,height:this.height,
zIndex:this.zOrder}));return this};a.prototype.createHTML=function(){var b;if(this.html)return this.html;b=PMUI.createHTMLElement(this.elementTag||"div");b.id=this.id;this.html=b;this.applyStyle();return this.html};a.prototype.getHTML=function(){this.html||(this.html=this.createHTML());return this.html};a.prototype.setProportion=function(b){this.proportion=b;return this};a.prototype.addEvent=function(b,f){var a=(new PMUI.event.EventFactory).make(b),d=f||PMUI.generateUniqueId();return this.events[d]=
a};a.prototype.defineEvents=function(){};a.prototype.calculateWidth=function(b,f){var a=f||"12px arial",d=$(PMUI.createHTMLElement("div"));d.text(b).css({position:"absolute","float":"left","white-space":"nowrap",visibility:"hidden",font:a}).appendTo($("body"));a=d.width();d.remove();return a};a.prototype.setEnabledMenu=function(b){this.enabledMenu=b;this.menu instanceof PMUI.behavior.NoSupportMenuBehavior&&this.setMenuBehavior();return this};a.prototype.setMenuBehavior=function(){this.menu=(new PMUI.behavior.BehaviorFactory({products:{nosupportmenu:PMUI.behavior.NoSupportMenuBehavior,
supportmenu:PMUI.behavior.SupportMenuBehavior},defaultProduct:"supportmenu"})).make(this.enabledMenu?"supportmenu":"nosupportmenu");this.menu.parent=this;return this};a.prototype.showMenu=function(b){this.enabledMenu&&this.menu.showMenu(b)};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.core.Element",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.factory=this.items=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.type="Container";a.prototype.init=function(b){var f={items:[]};jQuery.extend(!0,f,b);this.items=new PMUI.util.ArrayList;this.setFactory(f.factory).setItems(f.items)};a.prototype.setFactory=function(b){this.factory=b instanceof PMUI.util.Factory?b:new PMUI.util.Factory(b);return this};a.prototype.removeItem=function(b){var f;b instanceof
PMUI.core.Element?f=b:"string"===typeof b?f=this.items.find("id",b.id):"number"===typeof b&&(f=this.items.get(b));f&&(jQuery(f.html).remove(),this.items.remove(f));return this};a.prototype.clearItems=function(){for(;0<this.items.getSize();)this.removeItem(0);return this};a.prototype.isDirectParentOf=function(b){return 0<=this.items.indexOf(b)};a.prototype.addItem=function(b){var f;this.factory&&(f=this.factory.make(b));f&&!this.isDirectParentOf(f)&&(f.parent=this,this.items.insert(f),this.html&&this.html.appendChild(f.getHTML()));
return this};a.prototype.setItems=function(b){var f;if(jQuery.isArray(b)){this.clearItems();for(f=0;f<b.length;f+=1)this.addItem(b[f])}return this};a.prototype.getItems=function(){return this.items.asArray()};a.prototype.getItem=function(b){return"number"===typeof b?this.items.get(b):this.items.find("id",b)};a.prototype.createHTML=function(){if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);this.setItems(this.items.asArray().slice(0));this.style.applyStyle();return this.html};
a.prototype.defineEvents=function(){var b,f;if(0<this.items.getSize()){f=this.getItems();for(b=0;b<f.length;b++)f[b].defineEvents()}return this};PMUI.extendNamespace("PMUI.core.Container",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.parent=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Container",a);a.prototype.type="Item";a.prototype.family="Item";a.prototype.init=function(b){var f={parent:null};jQuery.extend(!0,f,b);this.setParent(f.parent)};a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.getParent=function(){return this.parent};PMUI.extendNamespace("PMUI.core.Item",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.border=this.borderWidth=this.rightPadding=this.bottomPadding=this.leftPadding=this.topPadding=this.layout=this.parent=this.panel=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Container",a);a.prototype.type="Panel";a.prototype.init=function(b){var f={panel:null,parent:null,layout:"box",padding:"",borderWidth:"",border:!1};jQuery.extend(!0,f,b);this.setPanel(f.panel).setParent(f.parent).setLayout(f.layout).setPadding(f.padding).setBorderWidth(f.borderWidth)};
a.prototype.applyStyle=function(){this.html&&(this.style.applyStyle(),this.style.addProperties({display:this.visible?this.display:"none",position:this.positionMode,left:this.x,top:this.y,width:this.width,height:this.height,zIndex:this.zOrder,"padding-top":this.topPadding,"padding-right":this.rightPadding,"padding-bottom":this.bottomPadding,"padding-left":this.leftPadding,"border-width":this.borderWidth,"border-style":""!==this.borderWidth?"solid":"","box-sizing":"border-box"}));return this};a.prototype.setBorderWidth=
function(b){var f=!1;"number"===typeof b?this.borderWidth=b+"px":"string"===typeof b?(b=jQuery.trim(b),/^\d+(\.\d+)?px$/.test(b)||""===b?this.borderWidth=b:f=!0):f=!1;if(f)throw Error("setBorderWidth(): invalid parameter.");this.applyStyle();this.layout&&this.layout.applyLayout();return this};a.prototype.getBorderWidth=function(){return this.borderWidth||this.style.getProperty("border-width")};a.prototype.setPadding=function(b){var f=!1;if("string"===typeof b)if(b=jQuery.trim(b),b=b.split(/\s+/).join(" "),
/^(\d+(\.\d+)?(px|%)\s)+$/.test(b+" "))switch(b=b.match(/\d+(\.\d+)?(px|%)/g),b.length){case 4:this.topPadding=b[0];this.rightPadding=b[1];this.bottomPadding=b[2];this.leftPadding=b[3];break;case 3:this.topPadding=b[0];this.rightPadding=this.leftPadding=b[1];this.bottomPadding=b[2];break;case 2:this.topPadding=this.bottomPadding=b[0];this.rightPadding=this.leftPadding=b[1];break;case 1:this.topPadding=this.rightPadding=this.bottomPadding=this.leftPadding=b[0]}else""===b?this.topPadding=this.rightPadding=
this.bottomPadding=this.leftPadding="":f=!0;else"number"===typeof b?this.topPadding=this.rightPadding=this.bottomPadding=this.leftPadding=b+"px":f=!0;if(f)throw Error("setPadding(): Invalid parameter.");this.applyStyle();this.layout&&this.layout.applyLayout();return this};a.prototype.getPadding=function(){return[this.topPadding||this.style.getProperty("padding-top"),this.rightPadding||this.style.getProperty("padding-right"),this.bottomPadding||this.style.getProperty("padding-bottom"),this.leftPadding||
this.style.getProperty("padding-left")]};a.prototype.setPanel=function(b){b&&(b instanceof a?this.panel=b:"object"===typeof b&&(this.panel=new a(b)),this.html&&jQuery(this.html).empty().append(b.getHTML()));return this};a.prototype.getUsableWidth=function(){var b=this.getPadding(),f=2*parseInt(this.getBorderWidth(),10);return isNaN(this.getWidth())?this.getWidth():this.getWidth()-(parseInt(b[1],10)||0)-(parseInt(b[3],10)||0)-(f||0)};a.prototype.getUsableHeight=function(){var b=this.getPadding(),f=
2*parseInt(this.getBorderWidth(),10);return isNaN(this.getHeight())?this.getHeight():this.getHeight()-(parseInt(b[0],10)||0)-(parseInt(b[2],10)||0)-(f||0)};a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.setLayout=function(b){this.layout=(new PMUI.layout.LayoutFactory).make(b);this.layout.setContainer(this);this.html&&this.layout.applyLayout();return this};a.prototype.addItem=function(b){a.superclass.prototype.addItem.call(this,b);this.layout&&this.layout.applyLayout();return this};
a.prototype.setWidth=function(b){a.superclass.prototype.setWidth.call(this,b);this.layout&&this.layout.applyLayout();return this};a.prototype.setHeight=function(b){a.superclass.prototype.setHeight.call(this,b);this.layout&&this.layout.applyLayout();return this};a.prototype.getParent=function(){return this.parent};a.prototype.createHTML=function(){if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);this.applyStyle();this.layout&&this.layout.applyLayout();return this.html};"undefined"!==
typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.core.Panel",a)})();
(function(){var a=function(b,f){a.superclass.call(this,b);this.classNameDisabled=this.className=this.icon=this.focused=this.disabled=this.toolTip=this.menu=this.parentMenu=this.action=this.text=null;a.prototype.init.call(this,b,f)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.type="MenuItemElement";a.prototype.family="Item";a.prototype.init=function(b,f){var a={text:null,className:"pmui-menu-item-element",classNameDisabled:"pmui-menu-item-element-disabled",menu:null,toolTip:null,parentMenu:f||
null,disabled:!1,focused:!1,icon:"pmui-menu-icon-empty"};jQuery.extend(!0,a,b);this.setText(a.text).setClassName(a.className).setClassNameDisabled(a.classNameDisabled).setToolTip(a.toolTip).setParentMenu(a.parentMenu).setDisabled(a.disabled).setIcon(a.icon).setFocused(a.focused)};a.prototype.loadAction=function(b,f){this.action=b;this.setText(this.action.text);this.setIcon(this.action.cssStyle);this.setDisabled(this.action.disabled);this.setParentMenu(f);this.setFocused(!1);b.menu&&this.setChildMenu(b.menu)};
a.prototype.setText=function(b){this.text=b;this.action&&this.action.setText(b);return this};a.prototype.setClassName=function(b){this.className=b;return this};a.prototype.setClassNameDisabled=function(b){this.classNameDisabled=b;return this};a.prototype.setIcon=function(b){this.icon=b;this.action&&this.action.setCssClass(b);return this};a.prototype.setParentMenu=function(b){this.parentMenu=b;return this};a.prototype.setChildMenu=function(b){b instanceof PMUI.ui.Menu?(b.setCanvas(this.parentMenu.canvas),
b.setParent(this),this.menu=b):(b.canvas=this.parentMenu.canvas,b.parent=this);return this};a.prototype.setDisabled=function(b){this.disabled=b;return this};a.prototype.setFocused=function(b){this.focused=b;return this};a.prototype.setToolTip=function(b){this.toolTip=b;return this};a.prototype.createHTML=function(){var b;b=PMUI.createHTMLElement("li");b.className=this.className;this.disabled&&(b.className=b.className+" "+this.classNameDisabled);b.id=PMUI.generateUniqueId();return this.html=b};a.prototype.closeMenu=
function(){this.parentMenu&&(this.parentMenu.canvas&&this.parentMenu.canvas.currentMenu)&&this.parentMenu.canvas.currentMenu.hide()};PMUI.extendNamespace("PMUI.core.MenuItemElement",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.onChange=this.disabled=this.field=this.value=this.name=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.init=function(b){var f={name:this.id,value:"",field:null,disabled:!1,onChange:null};$.extend(!0,f,b);this.setName(f.name).setValue(f.value).setField(f.field).disable(f.disabled).setOnChangeHandler(f.onChange)};a.prototype.setName=function(b){if("string"===typeof b||"number"===typeof b)this.name=b.toString(),
this.html&&this.html.setAttribute("name",b);else throw Error("The setName() method only accepts string or number values");return this};a.prototype.getName=function(){return this.name};a.prototype.setValue=function(b){if("undefined"!==typeof b)this.value=b.toString();else throw Error("setValue(): a parameter is required.");return this};a.prototype.getValue=function(){return this.value};a.prototype.setField=function(b){b instanceof PMUI.form.Field&&(this.field=b);return this};a.prototype.getField=function(){return this.field};
a.prototype.disable=function(b){this.disabled=!!b;return this};a.prototype.isEnabled=function(){return!this.disabled};a.prototype.setOnChangeHandler=function(b){"function"===typeof b&&(this.onChange=b);return this};a.prototype.getValueFromRawElement=function(){throw Error("Calling getValueFromRawElement() from PMUI.control.Control: this is an abstract method!");};a.prototype.onChangeHandler=function(){var b=this.value;this.value=this.getValueFromRawElement();if("function"===typeof this.onChange)this.onChange(this.value,
b);return this};a.prototype.attachListeners=function(){throw Error("Calling attachListeners() from PMUI.control.Control: this is an abstract method!");};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);return this.html};a.prototype.getHTML=function(){this.html||(this.html=this.createHTML());return this.html};PMUI.extendNamespace("PMUI.control.Control",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.elementTag="input"};PMUI.inheritFrom("PMUI.control.Control",a);a.prototype.setValue=function(b){a.superclass.prototype.setValue.call(this,b);this.html&&(this.html.value=this.value);return this};a.prototype.disable=function(b){a.superclass.prototype.disable.call(this,b);this.html&&(this.html.disabled=this.disabled);return this};a.prototype.getValueFromRawElement=function(){return this.html.value};a.prototype.defineEvents=function(){var b=
this;this.html&&this.addEvent("change").listen(this.html,function(){b.onChangeHandler()});return this};a.prototype.createHTML=function(){if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);this.setName(this.name).setValue(this.value).disable(this.disabled);return this.html};PMUI.extendNamespace("PMUI.control.HTMLControl",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.maxLength=this.placeholder=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.control.HTMLControl",a);a.prototype.init=function(b){var f={placeholder:"",maxLength:524288};$.extend(!0,f,b);this.setPlaceholder(f.placeholder).setMaxLength(f.maxLength)};a.prototype.setPlaceholder=function(b){"string"===typeof b&&(this.placeholder=b,this.html&&(this.html.placeholder=b));return this};a.prototype.setMaxLength=function(b){if("number"===
typeof b&&0===b%1)this.maxLength=b,this.html&&(this.html.maxLength=0<b?b:524288);else throw Error("method setMaxLength() only accepts integer values.");return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.html.type="text";this.setPlaceholder(this.placeholder).setMaxLength(this.maxLength);return this.html};PMUI.extendNamespace("PMUI.control.TextControl",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.options=[];this.elementTag="select";a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.control.HTMLControl",a);a.prototype.init=function(b){var f={options:[]},a=this.value;jQuery.extend(!0,f,b);this.setOptions(f.options).setValue(a)};a.prototype.clearOptions=function(){this.options=[];this.html&&jQuery(this.html).empty();this.value="";return this};a.prototype.enableDisableOption=function(b,f,a){var d=this,e=jQuery(this.html),g,h;h={applyTo:"all"};
b=!!b;if(a){for(g=0;g<this.options.length;g+=1)if(this.options[g].isGroup&&this.options[g].label===a){d=this.options[g];break}if(d===this.options)throw Error('disableOption(): the group "'+a+'" wasnt found.');e=jQuery(this.html).find('>optgroup[label="'+a+'"]')}if("number"===typeof f)d.options[f].disabled=b,e.find(">*").eq(f).attr("disabled",b);else if("string"===typeof f){for(g=0;g<d.options.length;g+=1)if(!d.options[g].isGroup&&d.options[g].value===f)d.options[g].disabled=b;else if(d.options[g].isGroup&&
d.options[g].label===f){d.options[g].disabled=b;h=d.options[g].options;for(a=0;a<h.length;a+=1)h[a].value===f&&(h[a].disabled=!0)}jQuery(e).find('option[value="'+f+'"]').add('optgroup[label="'+f+'"]').attr("disabled",b)}else if("object"===typeof f)if(jQuery.extend(!0,h,f),"groups"===h.applyTo){for(g=0;g<d.options.length;g+=1)d.options[g].isGroup&&d.options[g].label===f.criteria&&(d.options[g].disabled=b);jQuery(e).find('optgroup[label="'+f.criteria+'"]').attr("disabled",b)}else if("options"===h.applyTo){for(g=
0;g<d.options.length;g+=1)!d.options[g].isGroup&&d.options[g].value===f.criteria&&(d.options[g].disabled=b);jQuery(e).find('option[value="'+f.criteria+'"]').attr("disabled",b.criteria)}else{f=f.criteria;for(g=0;g<d.options.length;g+=1)if(!d.options[g].isGroup&&d.options[g].value===f)d.options[g].disabled=b;else if(d.options[g].isGroup&&d.options[g].label===f){d.options[g].disabled=b;h=d.options[g].options;for(a=0;a<h.length;a+=1)h[a].value===f&&(h[a].disabled=!0)}jQuery(e).find('option[value="'+f+
'"]').add('optgroup[label="'+f+'"]').attr("disabled",b)}else throw Error("disableOption(): the first parameter must be a Number or a String.");return this};a.prototype.disableOption=function(b,f){return this.enableDisableOption(!0,b,f)};a.prototype.enableOption=function(b,f){return this.enableDisableOption(!1,b,f)};a.prototype.removeOption=function(b,f){var a=this,d=jQuery(this.html),e,g,h;g={applyTo:"all"};if(f){for(e=0;e<this.options.length;e+=1)if(this.options[e].isGroup&&this.options[e].label===
f){a=this.options[e];break}if(a===this.options)throw Error('disableOption(): the group "'+f+'" wasnt found.');d=jQuery(this.html).find('>optgroup[label="'+f+'"]')}if("number"===typeof b)a.options.splice(b,1),d.find(">*").eq(b).remove();else if("string"===typeof b){for(e=0;e<a.options.length;e+=1)if(!a.options[e].isGroup&&a.options[e].value===b)a.options.splice(e,1),e-=1;else if(a.options[e].isGroup&&a.options[e].label===b){h=a.options[e].options;for(g=0;g<h.length;g+=1)h[g].value===b&&(h.splice(g,
1),g-=1);a.options.splice(e,1);e-=1}jQuery(d).find('option[value="'+b+'"]').add('optgroup[label="'+b+'"]').remove()}else if("object"===typeof b)if(jQuery.extend(!0,g,b),"groups"===g.applyTo){for(e=0;e<a.options.length;e+=1)a.options[e].isGroup&&a.options[e].label===b.criteria&&(a.options.splice(e,1),e-=1);jQuery(d).find('optgroup[label="'+b.criteria+'"]').remove()}else if("options"===g.applyTo){for(e=0;e<a.options.length;e+=1)!a.options[e].isGroup&&a.options[e].value===b.criteria&&(a.options.splice(e,
1),e-=1);jQuery(d).find('option[value="'+b.criteria+'"]').remove()}else{b=b.criteria;for(e=0;e<a.options.length;e+=1)if(!a.options[e].isGroup&&a.options[e].value===b||a.options[e].isGroup&&a.options[e].label===b)a.options.splice(e,1),e-=1;jQuery(d).find('option[value="'+b+'"]').add('optgroup[label="'+b+'"]').remove()}else throw Error("disableOption(): the first parameter must be a Number or a String.");return this};a.prototype.addOptionGroup=function(b){var f={},a;if(!b.label)throw Error("addOptionGroup(): a label for the new option group is required!");
f.label=b.label;f.disabled=!!b.disabled;f.isGroup=!0;f.options=[];this.options.push(f);this.html&&(a=PMUI.createHTMLElement("optgroup"),a.label=f.label,a.disabled=f.disabled,this.html.appendChild(a));jQuery.isArray(b.options)||(b.options=[]);for(a=0;a<b.options.length;a+=1)this.addOption(b.options[a],f.label);return this};a.prototype.addOption=function(b,f){var a={},d,e;e=!1;a.value=b.value||b.label||"";a.value=a.value.toString();a.label=b.label||a.value;a.label=a.label.toString();a.disabled=!!b.disabled;
a.isGroup=!1;if(f){for(d=0;d<this.options.length;d+=1)if(this.options[d].isGroup&&this.options[d].label===f){this.options[d].options.push(a);e=!0;break}e||(this.addOptionGroup({label:f}),this.options[this.options.length-1].options.push(a))}else this.options.push(a);if(this.html)if(d=PMUI.createHTMLElement("option"),d.value=a.value,d.selected=!!b.selected,d.label=a.label,d.disabled=a.disabled,d.textContent=d.label,f)if(e=jQuery(this.html).find('optgroup[label="'+f+'"]'),e.length)e.get(0).appendChild(d);
else throw Error('addOption(): the optiongroup "'+f+"\" wasn't found");else jQuery(this.html).append(d);b.selected&&(this.value=a.value);return this};a.prototype.getSelectedLabel=function(){var b;if(this.html)return jQuery(this.html).find("option:selected").attr("label");for(b=0;b<this.options.length;b+=1)if(this.options[b].value===this.value)return this.options[b].label;return""};a.prototype.setOptions=function(b){var f;if(jQuery.isArray(b)){this.clearOptions();for(f=0;f<b.length;f+=1)jQuery.isArray(b[f].options)?
this.addOptionGroup(b[f]):this.addOption(b[f])}return this};a.prototype.getOptions=function(b){var f=[],a;if(b)return this.options.slice(0);for(b=0;b<this.options.length;b+=1)if(this.options[b].isGroup)for(a=0;a<this.options[b].options.length;a+=1)f.push(this.options[b].options[a]);else f.push(this.options[b]);return f};a.prototype.defineEvents=function(){var b=this;this.addEvent("change").listen(this.html,function(){b.onChangeHandler()});return this};a.prototype.createHTML=function(){var b;if(this.html)return this.html;
b=this.value;a.superclass.prototype.createHTML.call(this);this.setOptions(this.options.slice(0)).setValue(b);return this.html};PMUI.extendNamespace("PMUI.control.DropDownListControl",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.readonly=null;this.elementTag="textarea";a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.control.TextControl",a);a.prototype.init=function(b){var f={readonly:!1};jQuery.extend(!0,f,b);this.setReadOnly(f.readonly)};a.prototype.setReadOnly=function(b){"undefined"!==typeof b&&(this.readonly=!!b,this.html&&(this.html.readOnly=this.readonly));return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.setReadOnly(this.readonly);
return this.html};PMUI.extendNamespace("PMUI.control.TextAreaControl",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.textContainer=this.control=this.mode=this.onDeselect=this.onSelect=this.label=this.selected=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.control.HTMLControl",a);a.prototype.init=function(b){var f={selected:!1,mode:"checkbox",label:"",value:"",onSelect:null,onDeselect:null};jQuery.extend(!0,f,b);if("checkbox"===f.mode||"radio"===f.mode)this.mode=f.mode;else throw Error('SelectableControl: it only accepts "checkbox" and "radio" as value for the "mode" property');
this.onSelect=f.onSelect;this.onDeselect=f.onDeselect;this.setLabel(f.label);f.selected?this.select():this.deselect()};a.prototype.setName=function(b){a.superclass.prototype.setName.call(this,b);this.control&&(this.control.name=b);return this};a.prototype.setValue=function(b){a.superclass.superclass.prototype.setValue.call(this,b);this.control&&(this.control.value=b);return this};a.prototype.isSelected=function(){this.html&&(this.selected=jQuery(this.control).is(":checked"));return this.selected};
a.prototype.deselect=function(){this.selected=!1;this.control&&(this.control.checked=!1);return this};a.prototype.select=function(){this.selected=!0;this.control&&(this.control.checked=!0);return this};a.prototype.onChangeHandler=function(){this.selected=$(this.control).is(":checked");if("function"===typeof this.onChange)this.onChange(this.value,this.value);if(this.selected&&"function"===typeof this.onSelect)this.onSelect();else if(!this.selected&&"function"===typeof this.onDeselect)this.onDeselect();
return this};a.prototype.setLabel=function(b){if("string"!==typeof b)throw Error("setLabel(): it only accepts string type values.");this.label=b;this.html&&(this.textContainer.textContent=b);return this};a.prototype.disable=function(b){a.superclass.superclass.prototype.disable.call(this,b);this.html&&(this.control.disabled=this.disabled);return this};a.prototype.createHTML=function(){var b,f,a;if(this.html)return this.html;b=PMUI.createHTMLElement("label");a=PMUI.createHTMLElement("input");a.type=
this.mode;f=PMUI.createHTMLElement("span");f.contentText=this.label;b.appendChild(a);b.appendChild(f);this.control=a;this.textContainer=f;this.html=b;this.html.id=this.id;this.setName(this.name).setValue(this.value).disable(this.disabled).setLabel(this.label);this.selected?this.select():this.deselect();this.applyStyle();return this.html};PMUI.extendNamespace("PMUI.control.SelectableControl",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.control.HTMLControl",a);a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.html.type="hidden";return this.html};PMUI.extendNamespace("PMUI.control.HiddenControl",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.firstDay=this.maxDate=this.minDate=this.dateObject=this.dateFormat=this.datetime=this.dom=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.control.HTMLControl",a);a.prototype.daysOrder="sunday monday tuesday wednesday thursday friday saturday".split(" ");a.prototype.monthsOrder="january february march april may june july august september october november december".split(" ");a.prototype.days={sunday:{value:0},monday:{value:1},
tuesday:{value:2},wednesday:{value:3},thursday:{value:4},friday:{value:5},saturday:{value:6}};a.prototype.months={january:{value:0},february:{value:1},march:{value:2},april:{value:3},may:{value:4},june:{value:5},july:{value:6},august:{value:7},september:{value:8},october:{value:9},november:{value:10},december:{value:11}};a.prototype.init=function(b){var f={datetime:!1,dateFormat:b&&b.datetime?"yy-mm-dd HH:ii:ss":"yy-mm-dd",months:{january:"January",february:"February",march:"March",april:"April",
may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},days:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},minDate:-365,maxDate:365,firstDay:0};jQuery.extend(!0,f,b);this.setFirstDay(f.firstDay).setDateFormat(f.dateFormat).setMonths(f.months).setDays(f.days).setMinDate(f.minDate).setMaxDate(f.maxDate).visibleDateTime(f.datetime)};a.prototype.getFirstDay=
function(){return this.firstDay};a.prototype.getMinDate=function(b){return this.formatDate(this.minDate,b||"UTC")};a.prototype.getMaxDate=function(b){return this.formatDate(this.maxDate,b||"UTC")};a.prototype.visibleDateTime=function(b){this.datetime=!!b;this.html&&(this.dom.footer.style.display=this.datetime?"block":"none");return this};a.prototype.setValue=function(b,f){var a,d,e,g,h,k,l,m,n,p=!1,q=!1;if(b instanceof Date)a=b;else if("number"===typeof b)a=new Date(b);else if("string"===typeof b)if(""===
b)a=null;else if(/^\d+$/.test(b))a=new Date(parseInt(b,10));else if(/^\d{4}\-\d{2}\-\d{2}$/.test(b)||/^\d{4}\-\d{2}\-\d{2}T\d{2}\:\d{2}\:\d{2}[\+\-]\d{2}\:\d{2}$/.test(b)){a=new Date;d=b.split(/T|\+|\-(?=\d{2}\:\d{2})/);e=d[0].split("-");g=parseInt(e[0],10);h=parseInt(e[1],10);k=parseInt(e[2],10);d[1]?(p=!0,e=d[1].split(":"),l=parseInt(e[0],10),m=parseInt(e[1],10),n=parseInt(e[2],10),e=d[2].split(":"),d=("+"===b[19]?-1:1)*parseInt(e[0],10),e=(0>d?-1:1)*parseInt(e[1],10)):l=m=n=d=e=0;if(!this.isValidDateTime(g,
h,k,l,m,n))throw Error("setValue(): invalid date time.");a.setFullYear(g);a.setMonth(h-1);a.setDate(k);a.setHours(l);a.setMinutes(m);a.setSeconds(n);a.setMilliseconds(0);a.setHours(a.getHours()+d);a.setMinutes(a.getMinutes()+e);p||f?(this.dateObject.setUTCFullYear(a.getFullYear()),this.dateObject.setUTCMonth(a.getMonth()),this.dateObject.setUTCDate(a.getDate()),this.dateObject.setUTCHours(a.getHours()),this.dateObject.setUTCMinutes(a.getMinutes()),this.dateObject.setUTCSeconds(a.getSeconds())):(this.dateObject.setFullYear(g),
this.dateObject.setMonth(h-1),this.dateObject.setDate(k),this.dateObject.setHours(l),this.dateObject.setMinutes(m),this.dateObject.setSeconds(n),this.dateObject.setMilliseconds(0));a=null}else q=!0;else q=!0;if(q)throw Error("setValue(): Invalid parameter format/data type.");this.dateObject||(this.dateObject=new Date);a&&(this.dateObject.setFullYear(a.getFullYear()),this.dateObject.setMonth(a.getMonth()),this.dateObject.setDate(a.getDate()),this.dateObject.setHours(a.getHours()),this.dateObject.setMinutes(a.getMinutes()),
this.dateObject.setSeconds(a.getSeconds()));this.html&&(this.html.value=this.formatDate(this.dateObject,this.dateFormat));this.value=this.getValue("UTC");return this};a.prototype.setFirstDay=function(b){if("number"===typeof b&&0<=b&&7>b)return this.firstDay=Math.floor(b),this.html&&(this.setDays(this.days),this.buildDaysTable()),this;throw Error("setFirstDay(): The parameter must be a number between 0 and 6.");};a.prototype.setDateFormat=function(b){if("string"===typeof b)this.dateFormat=b,this.updateValue();
else throw Error("setDateFormat(): The parameter must be a string.");return this};a.prototype.getDateFormat=function(){return this.dateFormat};a.prototype.getFormatedDate=function(){return this.html.value};a.prototype.getValue=function(b){b=b||"UTC";if(this.dateObject)switch(b){case "timestamp":case "@":b=this.formatDate(this.dateObject,"@");break;default:b=this.formatDate(this.dateObject,b)}else b="";return b};a.prototype.isLeapYear=function(b){return 0===b%400?!0:0===b%100?!1:0===b%4?!0:!1};a.prototype.isValidDateTime=
function(b,f,a,d,e,g,h){if(!("number"===typeof b&&"number"===typeof f&&"number"===typeof a))return!1;d=d||0;e=e||0;g=g||0;h=h||0;if(!("number"===typeof d&&"number"===typeof e&&"number"===typeof g&&"number"===typeof h)||!(0<=d&&23>=d)||!(0<=e&&59>=e)||!(0<=g&&59>=g)||!(0<=h&&999>=h)||1>a||31<a||1>f||12<f)return!1;switch(f){case 4:case 6:case 9:case 11:if(30<a)return!1;break;case 2:return this.isLeapYear(b)?29>=a:28>=a}return!0};a.prototype.parseDate=function(b){var f,a,d,e;if("number"===typeof b)f=
new Date,f.setDate(f.getDate()+b);else if("string"===typeof b){if(f=new Date,b=" "+jQuery.trim(b),/^(\s[\+|\-]\d+[y|m|d|w])+$/.test(b)){b=b.match(/[\+|\-]\d+[y|m|d]/g);for(d=0;d<b.length;d+=1)switch(a=b[d].match(/[\-|\+]|\d+|[m|d|y]/g),e=parseInt(a[1],10),"-"===a[0]&&(e*=-1),a[2]){case "d":f.setDate(f.getDate()+e);break;case "m":f.setMonth(f.getMonth()+e);break;case "y":f.setFullYear(f.getFullYear()+e);break;case "w":f.setDate(f.getDate()+7*e)}}}else if(b instanceof Date)f=b;else if("object"===typeof b)f=
new Date(b.year,b.month-1,b.day,b.hours,b.minutes,b.seconds,b.milliseconds);else throw Error("parseDate(): invalid parameter.");return f};a.prototype.setMinDate=function(b){b=this.parseDate(b);var a;if(this.maxDate&&b>this.maxDate)throw Error("setMinDate(): The min date can't be major than the max date");this.minDate=b;this.fillYearSelector();this.fillMonthSelector();this.buildDaysTable();this.html&&(a=new Date,this.dom.todayButton.disabled=!(a>=b&&this.maxDate&&a<=this.maxDate));return this};a.prototype.setMaxDate=
function(b){b=this.parseDate(b);var a;if(this.minDate&&b<this.minDate)throw Error("setMaxDate(): The max date can't be minor than the min date");this.maxDate=b;this.fillYearSelector();this.fillMonthSelector();this.buildDaysTable();this.html&&(a=new Date,this.dom.todayButton.disabled=!(a<=b&&this.minDate&&a>=this.minDate));return this};a.prototype.setMonths=function(b){var a,c;for(a in this.months)this.months.hasOwnProperty(a)&&b.hasOwnProperty(a)&&("string"===typeof b[a]?(c=!0,this.months[a].name=
b[a],this.months[a].shortname=b[a].charAt(0).toUpperCase()+b[a].slice(1,3)):"object"===typeof b[a]&&(this.months[a].name=b[a].name,this.months[a].shortname=b[a].shortname,c=!0));c&&this.fillMonthSelector();return this};a.prototype.fillMonthSelector=function(){var b,a,c,d;if(this.html){a=this.dom.yearSelector.value;b=this.dom.monthSelector.value||(new Date).getMonth().toString();jQuery(this.dom.monthSelector).empty();c=0;d=this.monthsOrder.length-1;a===this.minDate.getFullYear().toString()&&(c=this.minDate.getMonth());
a===this.maxDate.getFullYear().toString()&&(d=this.maxDate.getMonth());for(c;c<=d;c+=1)a=PMUI.createHTMLElement("option"),a.label=this.months[this.monthsOrder[c]].name,a.textContent=a.label,a.value=this.months[this.monthsOrder[c]].value,a.selected=b===a.value.toString(),this.dom.monthSelector.appendChild(a)}return this};a.prototype.setDays=function(b){var a,c,d=this.daysOrder.length;for(a in this.days)if(this.days.hasOwnProperty(a)&&b.hasOwnProperty(a)){if("string"===typeof b[a])this.days[a].name=
b[a],this.days[a].shortname=b[a].substr(0,3);else if("object"===typeof b[a])this.days[a].name=b[a].name||this.days[a].name||"",this.days[a].shortname=b[a].shortname&&b[a].shortname.substr(0,3)||this.days[a].name&&this.days[a].name.substr(0,3)||"";else throw Error("setDays(): The argument supplied must be a string or an object.");c=!0}if(c&&this.html){jQuery(this.dom.daysHeader).empty();c=0;for(b=this.firstDay;c<d;)b===d&&(b=0),a=PMUI.createHTMLElement("th"),a.textContent=this.days[this.daysOrder[b]].shortname,
a.setAttribute("data-value",this.days[this.daysOrder[b]].value),this.dom.daysHeader.appendChild(a),b+=1,c+=1}return this};a.prototype.fillYearSelector=function(){var b,a,c,d;if(this.html){d=this.dom.yearSelector.value||this.dateObject&&this.dateObject.getFullYear()||(new Date).getFullYear();d=d.toString();jQuery(this.dom.yearSelector).empty();b=this.minDate.getFullYear();a=this.maxDate.getFullYear();for(b;b<=a;b+=1)c=PMUI.createHTMLElement("option"),c.textContent=c.label=c.value=b,c.value.toString()===
d&&(c.selected=!0),this.dom.yearSelector.appendChild(c)}return this};a.prototype.daysInMonth=function(b,a){if(1>a||12<a)return 0;switch(a){case 4:case 6:case 9:case 11:return 30;case 2:return this.isLeapYear(b)?29:28;default:return 31}};a.prototype.whichDay=function(b,a,c){var d,e=b%100,g=[6,4,2,0];if(!this.isValidDateTime(b,a,c))throw Error("whichDay(): invalid date.");switch(a){case 3:case 11:d=3;break;case 4:case 7:d=6;break;case 5:d=1;break;case 6:d=4;break;case 8:d=2;break;case 9:case 12:d=5;
break;case 10:d=0;break;case 1:d=this.isLeapYear(b)?-1:0;break;case 2:d=this.isLeapYear(b)?2:3}b=Math.floor(b/100);for(a=0;0!==b%4;)b+=1,a+=1;b=0===a?g[0]:g[g.length-a];return(c+d+e+Math.floor(e/4)+b)%7};a.prototype.buildDaysTable=function(){var b,a,c,d,e,g=1,h,k,l,m;if(this.html){jQuery(this.dom.tableBody).empty();c=parseInt(this.dom.yearSelector.value,10);d=parseInt(this.dom.monthSelector.value,10)+1;b=this.whichDay(c,d,1)-this.firstDay;0>b&&(b=7+b);a=this.daysInMonth(c,d);l=7*Math.ceil((b+a)/7);
h=PMUI.createHTMLElement("tr");for(e=0;e<l;e+=1)k=PMUI.createHTMLElement("td"),0<=e-b&&g<=a&&(m=!0,d-1===this.maxDate.getMonth()&&c===this.maxDate.getFullYear()?g>this.maxDate.getDate()&&(m=!1):d-1===this.minDate.getMonth()&&c===this.minDate.getFullYear()&&g<this.minDate.getDate()&&(m=!1),m?(m=PMUI.createHTMLElement("a"),m.href="#",m.setAttribute("data-date",g),m.textContent=g,k.appendChild(m)):(k.className="pmui-datepicker-disabled-date",k.textContent=g),g+=1),h.appendChild(k),0===(e+1)%7&&(this.dom.tableBody.appendChild(h),
h=PMUI.createHTMLElement("tr"));this.dom.tableBody.appendChild(h)}return this};a.prototype.showCalendar=function(){var b,a;this.html&&(b=jQuery(this.html).offset(),a=jQuery(this.html).outerHeight(),document.body.appendChild(this.dom.calendar),this.dom.calendar.style.left=b.left+"px",this.dom.calendar.style.top=b.top+a+"px",this.dom.calendar.style.display="");return this};a.prototype.hideCalendar=function(){this.html&&jQuery(this.dom.calendar).detach();return this.html};a.prototype.getDayOfYear=function(b,
a,c){var d=0,e=1;if(!("number"===typeof b&&"number"===typeof a&&"number"===typeof c))throw Error("getDayOfYear(): invalid parameters.");if(!this.isValidDateTime(b,a,c))throw Error("getDayOfYear(): invalid date.");for(;e<a;)d+=this.daysInMonth(b,a),e+=1;return d+c};a.prototype.formatDate=function(b,a){var c;c=b.getDate();var d=this.getDayOfYear(b.getFullYear(),b.getMonth()+1,b.getDate()),e=b.getMonth()+1,g=b.getHours(),h=12<g?g-12:g,k=b.getMinutes(),l=b.getSeconds(),m=b.getFullYear(),n,p,q;n=b.getTimezoneOffset();
p=0>n?"+":"-";n=Math.sqrt(n*n);q=Math.floor(n/60);n-=60*q;p+=(10>q?"0":"")+q+":"+(10>n?"0":"")+n;d=[{regExp:/dd/g,value:10>c?"0"+c:c},{regExp:/d/g,value:c},{regExp:/oo/g,value:10>d?"00"+d:100>d?"0"+d:d},{regExp:/o/g,value:d},{regExp:/mm/g,value:10>e?"0"+e:e},{regExp:/m/g,value:e},{regExp:/yy/g,value:m},{regExp:/y/g,value:m%100},{regExp:/\@/g,value:b.getTime()},{regExp:/\!/g,value:1E4*b.getTime()+621355968E9},{regExp:/MM/g,value:this.months[this.monthsOrder[b.getMonth()]].name},{regExp:/M/g,value:this.months[this.monthsOrder[b.getMonth()]].shortname},
{regExp:/HH/g,value:(10>g?"0":"")+g},{regExp:/H/g,value:g},{regExp:/hh/g,value:(10>h?"0":"")+h},{regExp:/h/g,value:h},{regExp:/ii/g,value:(10>k?"0":"")+k},{regExp:/i/g,value:k},{regExp:/ss/g,value:(10>l?"0":"")+l},{regExp:/s/g,value:l},{regExp:/UTC/g,value:m+"-"+(10>e?"0":"")+e+"-"+(10>c?"0":"")+c+"T"+(10>g?"0":"")+g+":"+(10>k?"0":"")+k+":"+(10>l?"0":"")+l+p},{regExp:/P/g,value:12<g?"PM":"AM"},{regExp:/DD/g,value:this.days[this.daysOrder[b.getDay()]].name},{regExp:/D/g,value:this.days[this.daysOrder[b.getDay()]].shortname}];
c=a||this.dateFormat;for(k=0;k<d.length;k+=1)c=c.replace(d[k].regExp,d[k].value);return c};a.prototype.updateValue=function(){var b;this.value=b=this.dateObject?this.formatDate(this.dateObject,this.dateFormat):"";this.html&&(this.html.value=b);return this};a.prototype.getValueFromRawElement=function(){return this.getValue("UTC")};a.prototype.onChangeHandler=function(){this.value=this.getValueFromRawElement();if("function"===typeof this.onChange)this.onChange(this.value,this.value);return this};a.prototype.defineEvents=
function(){var b=this,a;this.html&&(this.addEvent("change").listen(this.dom.yearSelector,function(){b.fillMonthSelector();b.buildDaysTable()}),this.addEvent("change").listen(this.dom.monthSelector,function(){b.buildDaysTable()}),this.addEvent("focus").listen(this.html,function(){b.showCalendar()}),this.addEvent("click").listen(this.dom.todayButton,function(){a=new Date;b.dom.doneButton.disabled=!1;b.dom.yearSelector.value=a.getFullYear();b.dom.monthSelector.value=a.getMonth();b.buildDaysTable();jQuery(b.dom.tableBody).find("a[data-date="+
a.getDate()+"]").addClass("selected")}),this.addEvent("click").listen(this.dom.doneButton,function(){a.setMilliseconds(0);a.setSeconds(parseInt(b.dom.secondsInput.value,10));a.setMinutes(parseInt(b.dom.minutesInput.value,10));a.setHours(parseInt(b.dom.hoursInput.value,10));b.dateObject=a;a=null;this.disabled=!0;jQuery(b.dom.tableBody).find(".selected").removeClass("selected");b.updateValue();b.hideCalendar();b.onChangeHandler()}),jQuery(this.dom.tableBody).on("click","a",function(c){var d,e;c.preventDefault();
c=parseInt(this.textContent,10);d=parseInt(b.dom.monthSelector.value,10);e=parseInt(b.dom.yearSelector.value,10);b.datetime?(a=new Date,a.setYear(e),a.setMonth(d),a.setDate(c),b.dom.doneButton.disabled=!1,jQuery(b.dom.tableBody).find("a").filter(".selected").removeClass("selected"),jQuery(this).addClass("selected")):(b.dateObject||(b.dateObject=new Date),b.dateObject.setYear(e),b.dateObject.setMonth(d),b.dateObject.setDate(c),b.dateObject.setMilliseconds(0),b.dateObject.setSeconds(0),b.dateObject.setMinutes(0),
b.dateObject.setHours(0),b.updateValue(),b.hideCalendar(),b.onChangeHandler())}))};a.prototype.createHTML=function(){var b,f,c,d,e,g,h;if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);this.html.type="text";this.html.readOnly=!0;h=PMUI.createHTMLElement("div");h.className="pmui-datepicker";b=PMUI.createHTMLElement("div");b.className="pmui-datepicker-header";f=PMUI.createHTMLElement("table");f.className="pmui-datepicker-head-table";d=PMUI.createHTMLElement("select");e=PMUI.createHTMLElement("select");
g=PMUI.createHTMLElement("tr");c=PMUI.createHTMLElement("td");c.className="pmui-datepicker-month-selector";c.appendChild(d);g.appendChild(c);c=PMUI.createHTMLElement("td");c.className="pmui-datepicker-year-selector";c.appendChild(e);g.appendChild(c);f.appendChild(g);b.appendChild(f);this.dom={};this.dom.yearSelector=e;this.dom.monthSelector=d;f=PMUI.createHTMLElement("table");f.className="pmui-datepicker-table";c=PMUI.createHTMLElement("thead");g=PMUI.createHTMLElement("tr");this.dom.daysHeader=g;
c.appendChild(g);f.appendChild(c);c=PMUI.createHTMLElement("tbody");this.dom.tableBody=c;f.appendChild(c);g=PMUI.createHTMLElement("div");g.className="pmui-datepicker-footer";c=PMUI.createHTMLElement("div");d=PMUI.createHTMLElement("button");d.textContent="Today";d.className="pmui-datepicker-button";this.dom.todayButton=d;c.appendChild(d);g.appendChild(c);c=PMUI.createHTMLElement("div");e=PMUI.createHTMLElement("input");e.type="number";e.size=2;e.min=0;e.max=23;e.value=0;e.placeholder="hrs.";this.dom.hoursInput=
e;c.appendChild(e);e=e.cloneNode(!1);e.max=59;e.placeholder="min.";this.dom.minutesInput=e;c.appendChild(e);e=e.cloneNode(!1);e.max=59;e.placeholder="sec.";this.dom.secondsInput=e;c.appendChild(e);g.appendChild(c);this.dom.timeCell=c;c=c.cloneNode(!1);g.appendChild(c);d=d.cloneNode(!0);d.textContent="Done";d.disabled=!0;this.dom.doneButton=d;c.appendChild(d);g.appendChild(c);h.appendChild(b);h.appendChild(f);h.appendChild(g);this.dom.calendar=h;this.dom.footer=g;this.setMinDate(this.minDate).setMaxDate(this.maxDate).setDays(this.days).visibleDateTime(this.datetime);
return this.html};PMUI.extendNamespace("PMUI.control.DateTimeControl",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,jQuery.extend(!0,{width:400},b));this.closeButton=this.footer=this.body=this.titleContainer=this.header=this.title=null;this.modal=!1;this.footerHeight=this.bodyHeight=this.headerHeight=this.modalObject=null;this.opened=!1;this.windowPadding=null;this.buttons=new PMUI.util.ArrayList;this.spaceButtons=this.buttonsPosition=null;this.showCloseButton=!1;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.type="Window";a.prototype.family=
"ui";a.prototype.init=function(b){var a={title:"[Untitled window]",modal:!0,height:"auto",width:400,headerHeight:"1em",bodyHeight:"auto",footerHeight:"auto",windowPadding:8,zOrder:100,buttons:[],buttonsPosition:"right",spaceButtons:15,showCloseButton:!0};jQuery.extend(!0,a,b);this.windowPadding=a.windowPadding;this.setTitle(a.title).setModal(a.modal).setWidth(a.width).setHeight(a.height).setHeaderHeight(a.headerHeight).setBodyHeight(a.bodyHeight).setFooterHeight(a.footerHeight).setZOrder(a.zOrder).setSpaceButtons(a.spaceButtons).setButtons(a.buttons).setButtonsPosition(a.buttonsPosition).setshowCloseButton(a.showCloseButton);
this.style.addProperties({padding:a.windowPadding})};a.prototype.setshowCloseButton=function(b){this.showCloseButton=b;return this};a.prototype.setButtonsPosition=function(b){this.buttonsPosition=b;return this};a.prototype.setSpaceButtons=function(b){this.spaceButtons=b;return this};a.prototype.getSpaceButtons=function(){return this.spaceButtons};a.prototype.centerWindow=function(){this.opened&&this.style.addProperties({left:"50%","margin-left":this.width/-2+"px",top:"50%","margin-top":jQuery(this.html).outerHeight()/
-2+"px"});return this};a.prototype.updateDimensions=function(){var b;this.opened&&(this.centerWindow(),"auto"!==this.height?(b=$(this.html).height()-$(this.header).outerHeight()-$(this.footer).outerHeight(),this.body.style.height=b-2+"px"):(this.body.style.height="auto"!==this.bodyHeight?this.bodyHeight+"px":this.bodyHeight,this.footer.style.height="auto"!==this.footerHeight?this.footerHeight+"px":this.footerHeight),this.modal&&(this.updateModalDimensions(),this.centerWindow()));return this};a.prototype.getFooterHeight=
function(){return this.FooterHeight};a.prototype.setWidth=function(b){if("number"===typeof b)this.width=b-2*(this.windowPadding||0)-2;else if(/^\d+(\.\d+)?px$/.test(b))this.width=parseInt(b,10)-2*(this.windowPadding||0)-2;else if("auto"===b)this.width=b;else throw Error("setWidth: width param is not valid.");a.superclass.prototype.setWidth.call(this,this.width);return this};a.prototype.getWidth=function(){return this.width};a.prototype.setHeight=function(b){if("number"===typeof b)this.height=b-2*
(this.windowPadding||0)-2;else if(/^\d+(\.\d+)?px$/.test(b))this.height=parseInt(b,10)-2*(this.windowPadding||0)-2;else if("auto"===b)this.height=b;else throw Error("setHeight: height param is not valid.");a.superclass.prototype.setHeight.call(this,this.height);this.updateDimensions();return this};a.prototype.getHeight=function(){return this.height};a.prototype.getTitle=function(){return this.title};a.prototype.setFooterHeight=function(b){if("number"===typeof b)this.footerHeight=b;else if(/^\d+(\.\d+)?px$/.test(b))this.footerHeight=
parseInt(b,10);else if("auto"===b)this.footerHeight=b;else throw Error("setFooterHeight: footerHeight param is not valid.");this.footer&&(this.footer.style.height=this.footerHeight+"px");this.updateDimensions();return this};a.prototype.setBodyHeight=function(b){if("number"===typeof b)this.bodyHeight=b;else if(/^\d+(\.\d+)?px$/.test(b))this.bodyHeight=parseInt(b,10);else if("auto"===b)this.bodyHeight=b;else throw Error("setBodyHeight: bodyHeight param is not valid.");this.updateDimensions();return this};
a.prototype.setHeaderHeight=function(b){if("number"===typeof b)this.headerHeight=b;else if(/^\d+(\.\d+)?px$/.test(b))this.headerHeight=parseInt(b,10);else if(/^\d+(\.\d+)?%$/.test(b))this.headerHeight=b;else if(/^\d+(\.\d+)?em$/.test(b))this.headerHeight=b;else throw Error("setHeaderHeight: headerHeight param is not valid");this.updateDimensions();return this};a.prototype.setModal=function(b){"undefined"!==typeof b&&(this.modal=!!b);return this};a.prototype.setTitle=function(b){if("string"===typeof b)this.title=
b,this.titleContainer&&(this.titleContainer.textContent=b,this.titleContainer.title=b);else throw Error("The setTitle() method accepts only string values.");return this};a.prototype.setButtons=function(b){var a,c,d=this.getSpaceButtons()/2,e=new PMUI.util.Factory({products:{button:PMUI.ui.Button},defaultProduct:"button"}),g=this;c=b.length;jQuery.each(b,function(b,k){switch(b){case 0:a=e.make(k);a.style.addProperties({"margin-right":d});break;case c-1:a=e.make(k);a.style.addProperties({"margin-left":d});
break;default:a=e.make(k),a.style.addProperties({"margin-left":d}),a.style.addProperties({"margin-right":d})}a.style.addProperties({"margin-top":"1%"});g.buttons.insert(a);g.html&&g.footer.appendChild(a.getHTML())});return this};a.prototype.addItem=function(b){var a;this.factory&&(a=this.factory.make(b));a&&!this.isDirectParentOf(a)&&(a.parent=this,this.items.insert(a),this.body&&this.body.appendChild(a.getHTML()));return this};a.prototype.defineEvents=function(){var b,a,c=this;b=this.html;a=this.modal;
var d=this.buttons,e=new PMUI.event.Action({handler:function(b){b.stopPropagation()}}),g=new PMUI.event.Action({handler:function(){c.updateModalDimensions()}});if(b){this.addEvent("mousedown").listen(this.body,e);this.addEvent("mousedown").listen(this.footer,e);c.addEvent("click").listen(a,e);c.addEvent("mouseover").listen(a,e);c.addEvent("mouseout").listen(a,e);c.addEvent("mousedown").listen(a,e);c.addEvent("resize").listen(window,g);if(0<c.items.getSize()){a=c.getItems();for(b=0;b<a.length;b++)a[b].defineEvents()}a=
d.asArray();for(b=0;b<d.getSize();b++)a[b].defineEvents()}};a.prototype.createHTML=function(){var b,f,c,d,e,g,h=this;if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);b=PMUI.createHTMLElement("div");b.className="pmui-window-header";f=PMUI.createHTMLElement("div");f.className="pmui-window-body";c=PMUI.createHTMLElement("div");c.className="pmui-window-footer";c.style.textAlign=this.buttonsPosition;g=PMUI.createHTMLElement("div");g.className="pmui-window-modal";g.id=this.id+
"-modal";d=PMUI.createHTMLElement("span");d.className="pmui-window-title";e=new PMUI.ui.Button({text:"X",style:{cssClasses:["pmui-window-close"]},handler:function(b){b.preventDefault();h.close();b.stopPropagation()}});this.modalObject=g;this.showCloseButton&&b.appendChild(e.getHTML());e.defineEvents();b.appendChild(d);this.html.appendChild(b);"auto"===this.width?this.setDisplay("inline-block"):this.setDisplay("");this.html.appendChild(f);this.html.appendChild(c);this.header=b;this.body=f;this.footer=
c;this.titleContainer=d;this.closeButton=e;this.setTitle(this.title).setFooterHeight(this.footerHeight).setItems(this.items.asArray().slice(0));b=this.buttons.asArray();jQuery.each(b,function(b,a){h.footer.appendChild(a.getHTML())});this.defineEvents();return this.html};a.prototype.isOpen=function(){return this.opened};a.prototype.updateModalDimensions=function(){var b,a;document&&this.modalObject&&(this.modalObject.style.height=this.modalObject.style.width="0px",b=jQuery(document).width(),a=jQuery(document).height(),
this.modalObject.style.width=b+"px",this.modalObject.style.height=a+"px");return this};a.prototype.open=function(){var b;if(this.opened)return this;b=this.getHTML();this.modal?(this.modalObject.appendChild(b),document.body.appendChild(this.modalObject),jQuery(b).draggable({containment:"#"+this.modalObject.id,scroll:!1})):(document.body.appendChild(b),jQuery(this.getHTML()).draggable());this.opened=!0;this.updateDimensions();this.setVisible(!0);return this};a.prototype.close=function(){jQuery(this.modalObject).remove();
jQuery(this.html).remove();jQuery(this.closeButton).remove();this.opened=!1;return this};PMUI.extendNamespace("PMUI.ui.Window",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,f){a.superclass.call(this,b);this.labelSpan=this.minWidth=this.aliasButton=this.text=this.parent=this.action=this.icon=null;a.prototype.init.call(this,b,f)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.type="Button";a.prototype.family="Button";a.prototype.init=function(b,a){var c;c={icon:null,aliasButton:null,parent:a||null,height:"auto",minWidth:"auto",handler:function(){},text:"undefined-button"};jQuery.extend(!0,c,b);this.setIcon(c.icon).setAliasButton(c.aliasButton).setParent(c.parent).setMinWidth(c.minWidth).setText(c.text);
this.action=new PMUI.event.Action({actionText:this.aliasButton,handler:c.handler})};a.prototype.setText=function(b){this.text=b;return this};a.prototype.setMinWidth=function(b){this.minWidth=b;this.style.addProperties({"min-width":b});return this};a.prototype.setIcon=function(b){this.icon=b;return this};a.prototype.setAliasButton=function(b){this.aliasButton=b;return this};a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.Click=function(b,a){this.action=b;this.setAliasButton(this.action.text);
this.setIcon(this.icon);this.setParent(a)};a.prototype.createHTML=function(){var b;if(this.html)return this.html;this.html=PMUI.createHTMLElement("a");this.html.href="#";this.html.id=this.id;b=PMUI.createHTMLElement("span");b.className="pmui-button-Label";b.style.lineHeight=this.getHeight();b.appendChild(document.createTextNode(this.text));this.labelSpan=b;this.html.appendChild(this.labelSpan);this.applyStyle();return this.html};a.prototype.defineEvents=function(){var b=this,a;this.addEvent("click").listen(this.html,
function(c){c.stopPropagation();a=b.action.handler;a(c)})};a.prototype.setHeight=function(b){if("number"===typeof b)this.height=b+"px";else if(/^\d+(\.\d+)?px$/.test(b))this.height=b;else if(/^\d+(\.\d+)?%$/.test(b))this.height=b;else if(/^\d+(\.\d+)?em$/.test(b))this.height=b;else if("auto"===b||"inherit"===b)this.height=b;else throw Error("setHeight: height param is not a number");this.style.addProperties({height:this.height});this.centerLabel();return this};a.prototype.centerLabel=function(){this.labelSpan&&
(this.labelSpan.style.lineHeight=this.getHeight());return this};PMUI.extendNamespace("PMUI.ui.Button",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.track=this.onClose=this.onOpen=this.hideEffect=this.showEffect=this.tooltipClass=this.tooltipPosition=this.mode=this.displayMode=this.category=this.message=this.messageArea=this.icon=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.type="PMUITooltipMessage";a.prototype.family="PMUITooltipMessage";a.prototype.init=function(b){var a={message:"",category:"help",displayMode:"inline",mode:"tooltip",tooltipClass:"pmui-tooltip-message",
tooltipPosition:{my:"left top+15",at:"left bottom",collision:"flipfit"},showEffect:null,hideEffect:null,onOpen:null,onClose:null,track:!1};$.extend(!0,a,b);this.onClose=a.onClose;this.onOpen=a.onOpen;this.setTooltipClass(a.tooltipClass).setTooltipPosition(a.tooltipPosition).setShowEffect(a.showEffect).setHideEffect(a.hideEffect).setTrack(a.track).setMessage(a.message).setCategory(a.category).setDisplayMode(a.displayMode).setMode(a.mode)};a.prototype.setTooltipClass=function(b){this.tooltipClass=b;
return this};a.prototype.setTrack=function(b){this.track=!!b;this.html&&this.setMode(this.mode);return this};a.prototype.setHideEffect=function(b){this.hideEffect=b;this.html&&this.setMode(this.mode);return this};a.prototype.setShowEffect=function(b){this.showEffect=b;this.html&&this.setMode(this.mode);return this};a.prototype.setTooltipPosition=function(b){this.tooltipPosition=b;this.html&&this.setMode(this.mode);return this};a.prototype.setMessage=function(b){if("string"===typeof b)this.message=
b,this.html&&(this.messageArea&&(this.messageArea.getHTML().textContent=b),this.icon.html.title="tooltip"===this.mode?b:"");else throw Error("setMessage() method only accepts string values.");return this};a.prototype.setCategory=function(b){var a=["help","info","error","warning"];if("string"===typeof b&&-1<a.indexOf(b))this.category=b,this.icon&&this.messageArea&&(this.icon.style.removeAllClasses(),this.icon.style.addClasses(["pmui-icon","pmui-icon-"+b]),this.messageArea.className="pmui-tooltip-message pmui-tooltip-"+
b+"-message"),this.html&&("error"===this.category?this.style.addClasses(["pmui-tooltip-category-error"]):this.style.removeClasses(["pmui-tooltip-category-error"]));else throw Error('setCategory() method only accepts one of the following values: "help", "info", "warning", "info".');return this};a.prototype.setDisplayMode=function(b){if("block"===b||"inline"===b)this.displayMode=b,this.html&&this.style.addProperties({display:b});else throw Error('setDisplayMode() method only accepts "inline" or "block" values');
return this};a.prototype.setMode=function(b){if("tooltip"===b||"normal"===b){if(this.mode=b,this.html)if($(this.html).addClass("pmui-tooltip-mode-"+b),"tooltip"===b)this.messageArea.setVisible(!1),this.icon.html.title=this.message,$(this.icon.html).tooltip({tooltipClass:this.tooltipClass,position:this.tooltipPosition,show:this.showEffect,hide:this.hideEffect,open:this.onOpen,track:this.track,close:this.onClose});else{try{$(this.icon.html).tooltip("destroy")}catch(a){}this.icon.html.title="";this.messageArea.setVisible(!0)}}else throw Error('setMode() method only accepts "tooltip" or "normal" values');
return this};a.prototype.createHTML=function(){var b,a,c;if(this.html)return this.html;b=PMUI.createHTMLElement("span");b.className="pmui-tooltip";c=new PMUI.core.Element({elementTag:"span",width:16,height:16,style:{cssClasses:["pmui-icon"],cssProperties:{display:"inline-block","vertical-align":"middle"}}});a=new PMUI.core.Element({elementTag:"span",style:{cssClasses:["pmui-tooltip-message"]}});b.appendChild(c.getHTML());b.appendChild(a.getHTML());this.icon=c;this.messageArea=a;this.html=b;this.applyStyle();
this.setCategory(this.category);this.setMessage(this.message);this.setMode(this.mode);return this.html};PMUI.extendNamespace("PMUI.ui.TooltipMessage",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.message=this.helper=this.value=this.label=this.name=null;this.controls=[];this.validators={};this.data=this.eventsDefined=this.form=this.controlsWidth=this.validAtChange=this.requiredMessage=this.required=this.validatorFactory=this.valueType=this.onChange=this.labelPosition=this.labelVisible=this.colonVisible=this.labelWidth=this.helperIsVisible=this.dom=this.controlPositioning=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Element",
a);a.prototype.type="Field";a.prototype.init=function(b){var a={name:this.id,label:"[field]",value:"",helper:"",showHelper:!(!b||!b.helper),validators:[],valueType:"string",controlPositioning:"[c*]",labelWidth:"30%",width:"100%",showColon:!0,validatorFactory:new PMUI.form.ValidatorFactory,onChange:null,required:!1,validAtChange:!0,requiredMessage:"This field is required.",labelVisible:!0,labelPosition:"left",form:null,controlsWidth:"auto"};$.extend(!0,a,b);this.helper=new PMUI.ui.TooltipMessage({category:"help"});
this.dom={};this.data=new PMUI.data.DataField;this.message=new PMUI.ui.TooltipMessage({category:"error",displayMode:"block",mode:"normal",visible:!1});this.setForm(a.form).setValidAtChange(a.validAtChange).setRequired(a.required).setRequiredMessage(a.requiredMessage).setValidatorFactory(a.validatorFactory).setValidators(a.validators).setName(a.name).setLabel(a.label).setValue(a.value).setHelper(a.helper).setValueType(a.valueType).setControlPositioning(a.controlPositioning).setOnChangeHandler(a.onChange).setLabelWidth(a.labelWidth).setWidth(a.width).setLabelPosition(a.labelPosition).setControlsWidth(a.controlsWidth).setControls();
a.showHelper?this.showHelper():this.hideHelper();a.showColon?this.showColon():this.hideColon();a.labelVisible?this.showLabel():this.hideLabel()};a.prototype.setControlsWidth=function(b){var a=0;jQuery.isArray(b)&&(b=[b]);for(a=0;a<b.length&&a<this.controls.length;a++)this.controlsWidth[a]=this.controls[a].setWidth(b[a]).getWidth();return this};a.prototype.setForm=function(b){b instanceof PMUI.form.Form&&(this.form=b);return this};a.prototype.setValidAtChange=function(b){this.validAtChange=!!b;return this};
a.prototype.setLabelPosition=function(b){if("top"===b||"right"===b||"bottom"===b||"left"===b)this.labelPosition=b,this.html&&("top"===b||"left"===b?(jQuery(this.dom.subcontainer).prepend(this.dom.labelTextContainer),this.dom.labelTextContainer.style.display="top"===b?"block":"inline-block",this.dom.labelTextContainer.style.textAlign="top"===b?"left":"right"):(jQuery(this.dom.subcontainer).append(this.dom.labelTextContainer).append(this.dom.messageContainer),this.dom.labelTextContainer.style.display=
"bottom"===b?"block":"inline-block",this.dom.labelTextContainer.style.textAlign="left"));else throw Error('setLabelPosition(): it only accepts "top", "rigth", "left" or "bottom" as value for the parameter');return this};a.prototype.setValidatorFactory=function(b){this.validatorFactory=b instanceof PMUI.util.Factory?b:new PMUI.form.ValidatorFactory(b);return this};a.prototype.setRequiredMessage=function(b){if("string"===typeof b)this.requiredMessage=b;else throw Error("the setRequiredMessage() method only accepts string values.");
return this};a.prototype.setRequired=function(b){this.required=!!b;return this};a.prototype.clearValidators=function(){for(var b in this.validators)this.validators.hasOwnProperty(b)&&(this.validators[b]=null,delete this.validators[b]);return this};a.prototype.addValidator=function(b){var a;if(this.validatorFactory)if(this.validatorFactory.isValidClass(b)||this.validatorFactory.isValidName(b.pmType))a=this.validatorFactory.make(b);else throw Error("Invalid validator to add.");a&&a instanceof PMUI.form.Validator&&
(a.setParent(this),this.validators[a.type]=a);return this};a.prototype.setValidators=function(b){var a=0;if(jQuery.isArray(b)){this.clearValidators();for(a=0;a<b.length;a++)this.addValidator(b[a])}return this};a.prototype.showColon=function(){this.colonVisible=!0;return this.setLabel(this.label)};a.prototype.hideColon=function(){this.colonVisible=!1;return this.setLabel(this.label)};a.prototype.setLabelWidth=function(b){if("number"===typeof b)this.labelWidth=b+"px";else if(/^\d+(\.\d+)?(px|em|%)$/.test(b)||
"auto"===b)this.labelWidth=b;else throw Error('setLabelWidth(): invalid "width" parameter');this.dom.labelTextContainer&&(this.dom.labelTextContainer.style.width=this.labelWidth,this.message.style.addProperties({"margin-left":this.labelWidth}));return this};a.prototype.setOnChangeHandler=function(b){"function"===typeof b&&(this.onChange=b);return this};a.prototype.showHelper=function(){this.helperIsVisible=!0;this.helper.setVisible(!0);return this};a.prototype.hideHelper=function(){this.helperIsVisible=
!1;this.helper.setVisible(!1);return this};a.prototype.getControls=function(){return this.controls};a.prototype.getControl=function(b){return this.controls[b||0]};a.prototype.setControlPositioning=function(b){var a,c,d,e,g,h,k=this;if("string"===typeof b){if(this.controlPositioning=b,this.html&&this.controls.length){for(c=0;c<this.controls.length;c++)jQuery(this.controls[c].getHTML()).detach();$(this.dom.controlContainer).empty();if(""!==b){e=this.controls.slice();a=b.split(/\[c[\d|\*]\]/);b=b.match(/\[c[\d|\*]\]/g);
h=function(b){if("[c*]"===b)for(b=0;b<e.length;b++)null!==e[b]&&(k.dom.controlContainer.appendChild(e[b].getHTML()),e[b]=null);else b=b.match(/\d+/),b=parseInt(b[0],10),null!==e[b]&&(k.dom.controlContainer.appendChild(e[b].getHTML()),e[b]=null)};for(c=d=0;c<a.length;c++)""===a[c]&&d<b.length?(h(b[d]),d++):(g=PMUI.createHTMLElement("span"),g.textContent=a[c],this.dom.controlContainer.appendChild(g)),d<b.length&&(h(b[d]),d++);this.dom.controlContainer.appendChild(this.helper.getHTML())}}}else throw Error("The setControlPositioning() method only accepts string values.");
return this};a.prototype.setControls=function(){};a.prototype.setName=function(b){if("string"===typeof b)this.name=b,this.data.setKey(b);else throw Error("The setName() method only accepts string values!");return this};a.prototype.getName=function(){return this.name};a.prototype.setLabel=function(b){if("string"===typeof b)this.label=b;else throw Error("The setLabel() method only accepts string values!");this.dom.labelTextContainer&&(this.dom.labelTextContainer.textContent=this.label+(this.colonVisible?
":":""));return this};a.prototype.getLabel=function(){return this.label};a.prototype.setValueToControls=function(b){var a;for(a=0;a<this.controls.length;a+=1)this.controls[a].setValue(b);return this};a.prototype.updateValueFromControls=function(){var b="",a;for(a=0;a<this.controls.length;a++)b+=" "+this.controls[a].getValue();this.value=b.substr(1);this.data.setValue(this.value);return this};a.prototype.setValue=function(b){if("string"===typeof b)this.value=b,this.data.setValue(b),this.setValueToControls(b);
else throw Error("The setValue() method only accepts string values!");return this};a.prototype.getValue=function(){return this.value};a.prototype.setHelper=function(b){this.helper.setMessage(b);return this};a.prototype.showMessage=function(b,a){this.message.setCategory(a||"info").setMessage(b).setVisible(!0);return this};a.prototype.hideMessage=function(){this.message.setVisible(!1);return this};a.prototype.setValueType=function(b){if("string"===typeof b)this.valueType=b;else throw Error("The setValueType() method onyl accepts string values!");
return this};a.prototype.getValueType=function(){return this.valueType};a.prototype.onChangeHandler=function(){var b=this;return function(){var a=b.value;b.updateValueFromControls();b.validAtChange&&b.isValid();if("function"===typeof b.onChange)b.onChange(b.getValue(),a)}};a.prototype.defineEvents=function(){var b;if(!this.eventsDefined){for(b=0;b<this.controls.length;b++)this.controls[b].setOnChangeHandler(this.onChangeHandler()).defineEvents();this.eventsDefined=!0}return this};a.prototype.isLabelVisible=
function(){return this.labelVisible};a.prototype.hideLabel=function(){jQuery(this.dom.labelTextContainer).hide();this.labelVisible=!1;return this};a.prototype.setControlWidth=function(){};a.prototype.showLabel=function(){jQuery(this.dom.labelTextContainer).show();this.labelVisible=!0;return this};a.prototype.evalRequired=function(){var b=!0;this.required&&""===this.getValue()?(this.showMessage(this.requiredMessage,"error"),b=!1):this.hideMessage();return b};a.prototype.isValid=function(){var b,a;
b=this.evalRequired();if(!b)return b;for(a in this.validators)if(this.validators.hasOwnProperty(a)&&(b=b&&this.validators[a].isValid(),!b))break;return b};a.prototype.createHTML=function(){var b,f,c,d;this.html||(a.superclass.prototype.createHTML.call(this),b=PMUI.createHTMLElement("label"),b.className="pmui-field-container",f=PMUI.createHTMLElement("span"),f.className="pmui-field-label",c=PMUI.createHTMLElement("span"),c.className="pmui-field-control",d=PMUI.createHTMLElement("span"),d.className=
"pmui-field-message",f.textContent=this.label,d.appendChild(this.message.getHTML()),b.appendChild(f),b.appendChild(c),b.appendChild(d),this.html.appendChild(b),this.dom.subcontainer=b,this.dom.labelTextContainer=f,this.dom.controlContainer=c,this.dom.messageContainer=d,this.setControlPositioning(this.controlPositioning),this.setLabelWidth(this.labelWidth),this.setLabel(this.label),this.setValue(this.value),this.setLabelPosition(this.labelPosition),this.labelVisible?this.showLabel():this.hideLabel());
return this.html};PMUI.extendNamespace("PMUI.form.Field",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.trimOnBlur=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Field",a);a.prototype.init=function(b){var a={placeholder:"",maxLength:0,trimOnBlur:!0};$.extend(!0,a,b);this.setPlaceholder(a.placeholder).setMaxLength(a.maxLength).setTrimOnBlur(a.trimOnBlur)};a.prototype.setValue=function(b){this.trimOnBlur&&(b=jQuery.trim(b));a.superclass.prototype.setValue.call(this,b);return this};a.prototype.setPlaceholder=function(b){this.controls[0].setPlaceholder(b);
return this};a.prototype.getPlaceholder=function(){return this.controls[0].getPlaceholder()};a.prototype.setMaxLength=function(b){this.controls[0].setMaxLength(b);return this};a.prototype.getMaxLength=function(){return this.controls[0].getMaxLength()};a.prototype.setTrimOnBlur=function(b){this.trimOnBlur=!!b;return this};a.prototype.getTrimOnBlur=function(){return this.trimOnBlur};a.prototype.setControls=function(){if(this.controls.length)return this;this.controls.push(new PMUI.control.TextControl);
return this};a.prototype.onChangeHandler=function(){var b=this;return function(){var a=b.value,c;b.trimOnBlur&&(c=b.controls[0].getValue(),c=jQuery.trim(c),b.controls[0].setValue(c));b.updateValueFromControls();b.validAtChange&&b.isValid();if("function"===typeof b.onChange)b.onChange(b.getValue(),a)}};PMUI.extendNamespace("PMUI.field.TextField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.rows=this.cols=this.tooltipPosition=this.labelVerticalPosition=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.field.TextField",a);a.prototype.init=function(b){var a={labelVerticalPosition:"top",tooltipPosition:"top",cols:"auto",rows:"auto"};jQuery.extend(!0,a,b);this.setLabelVerticalPosition(a.labelVerticalPosition);this.setTooltipPosition(a.tooltipPosition);this.setRows(a.rows);this.setCols(a.cols)};a.prototype.setLabelVerticalPosition=
function(b){if("top"===b||"bottom"===b||"center"===b){if(this.labelVerticalPosition=b,this.controls[0]&&this.html&&(this.dom.labelTextContainer.style.position="relative","left"===this.labelPosition||"right"===this.labelPosition))"top"===this.labelVerticalPosition&&(this.dom.labelTextContainer.style.top="0px",this.dom.labelTextContainer.style.verticalAlign="top"),"bottom"===this.labelVerticalPosition&&(this.dom.labelTextContainer.style.top="0px",this.dom.labelTextContainer.style.verticalAlign="bottom"),
"center"===this.labelVerticalPosition&&(this.dom.labelTextContainer.style.verticalAlign="top",b=$(this.controls[0].getHTML()).outerHeight()/2-$(this.dom.labelTextContainer).outerHeight()/2,this.dom.labelTextContainer.style.top=b+"px")}else throw Error("The value is not 'top' or 'bottom' please enter these values");return this};a.prototype.setLabelPosition=function(b){if(this.html&&("top"===b||"bottom"===b))this.dom.labelTextContainer.style.top="0px";a.superclass.prototype.setLabelPosition.call(this,
b);return this};a.prototype.setTooltipPosition=function(b){if("top"===b||"bottom"===b)this.tooltipPosition=b,this.controls[0]&&this.html&&("top"===this.tooltipPosition&&this.helper.icon.style.addProperties({"vertical-align":"top"}),"bottom"===this.tooltipPosition&&this.helper.icon.style.addProperties({"vertical-align":"bottom"}));else throw Error("The value is not 'top' or 'bottom' please enter these values");return this};a.prototype.setControlHeight=function(b){this.controls[0].setHeight(b);return this};
a.prototype.setControlWidth=function(b){this.controls[0].setWidth(b);return this};a.prototype.setLabel=function(b){if("string"===typeof b)this.label=b;else throw Error("The setLabel() method only accepts string values!");this.dom.labelTextContainer&&("[field]"===b||""===b?(this.label="",this.dom.labelTextContainer.textContent=this.label):this.dom.labelTextContainer.textContent=this.label+(this.colonVisible?":":""));return this};a.prototype.setControls=function(){if(this.controls.length)return this;
this.controls.push(new PMUI.control.TextAreaControl);return this};a.prototype.disableField=function(){this.controls[0].disable(!0);return this};a.prototype.enableField=function(){this.controls[0].disable(!1);return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.setLabelVerticalPosition(this.labelVerticalPosition);this.setTooltipPosition(this.tooltipPosition);return this.html};a.prototype.setRows=function(b){this.controls[0].setHeight(b);return this};a.prototype.setCols=
function(b){this.controls[0].setWidth(b);return this};PMUI.extendNamespace("PMUI.field.TextAreaField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.listWidth=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Field",a);a.prototype.init=function(b){var a={options:[],listWidth:"auto"};jQuery.extend(!0,a,b);this.setOptions(a.options);this.setListWidth(a.listWidth)};a.prototype.setOptions=function(b){jQuery.isArray(b)&&this.controls[0].setOptions(b);return this};a.prototype.getOptions=function(b){return this.controls[0].getOptions(b)};a.prototype.clearOptions=function(){this.controls[0].clearOptions();
return this};a.prototype.disableOption=function(b,a){this.controls[0].disableOption(b,a);return this};a.prototype.enableOption=function(b,a){this.controls[0].enableOption(b,a);return this};a.prototype.removeOption=function(b,a){this.controls[0].removeOption(b,a);return this};a.prototype.addOptionGroup=function(b){this.controls[0].addOptionGroup(b);return this};a.prototype.addOption=function(b,a){this.controls[0].addOption(b,a);return this};a.prototype.getSelectedLabel=function(){this.controls[0].getSelectedLabel();
return this};a.prototype.setControls=function(){if(this.controls.length)return this;this.controls.push(new PMUI.control.DropDownListControl);return this};a.prototype.disable=function(b){"boolean"===typeof b&&this.controls[0].disable(b);return this};a.prototype.setListWidth=function(b){this.listWidth=b;this.controls[0].setWidth(this.listWidth);return this};a.prototype.getListWidth=function(b){return this.listWidth};a.prototype.setLabel=function(b){if("string"===typeof b)this.label=b;else throw Error("The setLabel() method only accepts string values!");
this.dom.labelTextContainer&&("[field]"===b||""===b?(this.label="",this.dom.labelTextContainer.textContent=this.label):this.dom.labelTextContainer.textContent=this.label+(this.colonVisible?":":""));return this};PMUI.extendNamespace("PMUI.field.DropDownListField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.maxDirectionOptions=this.controlPositioning=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Field",a);a.prototype.init=function(b){var a={options:[],controlPositioning:"vertical",maxDirectionOptions:1};jQuery.extend(!0,a,b);this.setOptions(a.options).setMaxDirectionOptions(a.maxDirectionOptions).setControlPositioning(a.controlPositioning)};a.prototype.setMaxDirectionOptions=function(b){if("number"===typeof b)this.maxDirectionOptions=
Math.floor(b),this.html&&this.setControlPositioning(this.controlPositioning);else throw Error("setMaxDirectionOptions(): it only accepts number values.");return this};a.prototype.setControlPositioning=function(b){var a,c,d,e;if("string"===typeof b){if(!("horizontal"===b||"vertical"===b))return this;this.controlPositioning=b;if(this.html&&this.controls){for(e=0;e<this.controls.length;e++)jQuery(this.controls[e].getHTML()).detach();$(this.dom.controlContainer).empty();a=PMUI.createHTMLElement("table");
a.className="pmui-field-control-table";c=PMUI.createHTMLElement("tbody");if("horizontal"===b){d=PMUI.createHTMLElement("tr");for(e=0;e<this.controls.length;e++)b=PMUI.createHTMLElement("td"),this.controls[e].getHTML(),this.controls[e].control.tabIndex=e,b.appendChild(this.controls[e].getHTML()),d.appendChild(b),0<this.maxDirectionOptions&&0===(e+1)%this.maxDirectionOptions&&(c.appendChild(d),d=PMUI.createHTMLElement("tr"));c.appendChild(d)}else for(e=0;e<this.controls.length;e++)b=PMUI.createHTMLElement("td"),
this.controls[e].getHTML(),this.controls[e].control.tabIndex=e,b.appendChild(this.controls[e].getHTML()),d=0===this.maxDirectionOptions?e:e%this.maxDirectionOptions,d=jQuery(c).find("tr").eq(d).get(0),d||(d=PMUI.createHTMLElement("tr"),c.appendChild(d)),d.appendChild(b);a.appendChild(c);this.dom.controlContainer.appendChild(a);this.dom.controlContainer.appendChild(this.helper.getHTML())}}return this};a.prototype.setOptions=function(b){var a=0;this.value=[];this.value=JSON.stringify(this.value);if(jQuery.isArray(b))for(a=
0;a<b.length;a++)this.addOption(b[a]);else throw Error("setOptions(): the supplied argument must be an array.");return this};a.prototype.addOption=function(b){b=new PMUI.control.SelectableControl(jQuery.extend(!0,b,{mode:"checkbox",name:this.controls.length+1,selected:b.selected}));b.isSelected()&&(this.value=JSON.parse(this.value),this.value.push(b.getValue()),this.value=JSON.stringify(this.value));this.eventsDefined&&(b.setOnChangeHandler(this.onChangeHandler()).getHTML(),b.defineEvents());this.controls.push(b);
this.setControlPositioning(this.controlPositioning);return this};a.prototype.removeOption=function(b){var a=-1,c;if("string"===typeof b)for(c=0;c<this.controls.length;c++)this.controls[c].label===b&&(a=c);else a=b;if(-1===a)throw Error("the value send is not part from group CheckBox");this.html&&jQuery(this.controls[a].getHTML()).remove();this.controls.splice(a,1);this.setControlPositioning(this.controlPositioning);return this};a.prototype.clearOptions=function(){for(;this.controls.length;)this.removeOption(0);
return this};a.prototype.updateValueFromControls=function(){var b=[],a;for(a=0;a<this.controls.length;a++)this.controls[a].isSelected()&&b.push(this.controls[a].getValue());this.value=JSON.stringify(b);return this};a.prototype.setValueToControls=function(b){var a;for(a=0;a<this.controls.length;a++)this.controls[a].getValue()===b&&this.controls[a].select();return this};a.prototype.evalRequired=function(){var b=!0,a;a=JSON.parse(this.getValue());this.required&&0===a.length?(this.showMessage(this.requiredMessage,
"error"),b=!1):this.hideMessage();return b};a.prototype.disableOption=function(b){var a=-1,c;if(this.html){if("string"===typeof b)for(c=0;c<this.controls.length;c++)this.controls[c].label===b&&(a=c);else a=b;if(-1===a)throw Error("the value send is not part of group CheckBox");this.controls[a].disable(!0)}return this};a.prototype.enableOption=function(b){var a=-1,c;if(this.html){if("string"===typeof b)for(c=0;c<this.controls.length;c++)this.controls[c].label===b&&(a=c);else a=b;if(-1===a)throw Error("the value send is not part from group CheckBox");
this.controls[a].disable(!1)}return this};PMUI.extendNamespace("PMUI.field.CheckBoxGroupField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.maxDirectionOptions=this.controlPositioning=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Field",a);a.prototype.init=function(b){var a={options:[],controlPositioning:"vertical",maxDirectionOptions:1};jQuery.extend(!0,a,b);this.setOptions(a.options).setMaxDirectionOptions(a.maxDirectionOptions).setControlPositioning(a.controlPositioning)};a.prototype.setMaxDirectionOptions=function(b){if("number"===typeof b)this.maxDirectionOptions=
Math.floor(b),this.html&&this.setControlPositioning(this.controlPositioning);else throw Error("setMaxDirectionOptions(): it only accepts number values.");return this};a.prototype.removeOption=function(b){var a=0;if("number"===typeof b)this.controls[b]&&(jQuery(this.controls[b].getHTML()).remove(),this.controls.splice(b,1));else if("string"===typeof b)for(a=0;a<this.controls.length;a+=1)"option"===this.controls[a].getValue()&&(jQuery(this.controls[a].getHTML()).remove(),this.controls.splice(b,1),a-=
1);return this};a.prototype.clearOptions=function(){for(;this.controls.length;)this.removeOption(0);return this};a.prototype.setControlPositioning=function(b){var a,c,d,e;if("string"===typeof b){if(!("horizontal"===b||"vertical"===b))return this;this.controlPositioning=b;if(this.html&&this.controls){for(e=0;e<this.controls.length;e++)jQuery(this.controls[e].getHTML()).detach();$(this.dom.controlContainer).empty();a=PMUI.createHTMLElement("table");a.className="pmui-field-control-table";c=PMUI.createHTMLElement("tbody");
if("horizontal"===b){d=PMUI.createHTMLElement("tr");for(e=0;e<this.controls.length;e++)b=PMUI.createHTMLElement("td"),this.controls[e].getHTML(),this.controls[e].control.tabIndex=e,b.appendChild(this.controls[e].getHTML()),d.appendChild(b),0<this.maxDirectionOptions&&0===(e+1)%this.maxDirectionOptions&&(c.appendChild(d),d=PMUI.createHTMLElement("tr"));c.appendChild(d)}else for(e=0;e<this.controls.length;e++)b=PMUI.createHTMLElement("td"),this.controls[e].getHTML(),this.controls[e].control.tabIndex=
e,b.appendChild(this.controls[e].getHTML()),d=0===this.maxDirectionOptions?e:e%this.maxDirectionOptions,d=jQuery(c).find("tr").eq(d).get(0),d||(d=PMUI.createHTMLElement("tr"),c.appendChild(d)),d.appendChild(b);a.appendChild(c);this.dom.controlContainer.appendChild(a);this.dom.controlContainer.appendChild(this.helper.getHTML())}}return this};a.prototype.addOption=function(b){b=new PMUI.control.SelectableControl(jQuery.extend(!0,b,{mode:"radio",name:this.name,selected:b.selected}));this.eventsDefined&&
(b.setOnChangeHandler(this.onChangeHandler()).getHTML(),b.defineEvents());this.controls.push(b);this.setControlPositioning(this.controlPositioning);return this};a.prototype.setOptions=function(b){var a=0;if(jQuery.isArray(b))for(a=0;a<b.length;a+=1)this.addOption(b[a]);else throw Error("setOptions(): the supplied argument must be an array.");return this};a.prototype.updateValueFromControls=function(){var b="",a;for(a=0;a<this.controls.length;a+=1)if(this.controls[a].isSelected()){b=this.controls[a].getValue();
break}this.value=b;return this};a.prototype.setValueToControls=function(b){var a;for(a=0;a<this.controls.length;a+=1)this.controls[a].getValue()===b&&this.controls[a].select();return this};PMUI.extendNamespace("PMUI.field.RadioButtonGroupField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.returnFormat=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Field",a);a.prototype.init=function(b){var a={datetime:!1,dateFormat:b&&b.datetime?"yy-mm-dd H:i:s":"yy-mm-dd",months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},days:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",
wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},minDate:-365,maxDate:365,firstDay:0,returnFormat:"UTC"};jQuery.extend(!0,a,b);this.setDateFormat(a.dateFormat).setMonths(a.months).setDays(a.days).setMinDate(a.minDate).setMaxDate(a.maxDate).setFirstDay(a.firstDay).setReturnFormat(a.returnFormat).setValue(a.value).visibleDateTime(a.datetime)};a.prototype.visibleDateTime=function(b){this.controls[0].visibleDateTime(b);return this};a.prototype.getMaxDate=function(b){return this.controls[0].getMaxDate(b)};
a.prototype.setReturnFormat=function(b){if("string"===typeof b)this.returnFormat=b,this.setValue(this.value);else throw Error("setReturnFormat(): the parameter must be a string.");return this};a.prototype.getFirstDay=function(){return this.controls[0].getFirstDay()};a.prototype.setValueToControls=function(b,a){this.controls[0].setValue(b,a);return this};a.prototype.setValue=function(b,a){b=b||"";if(b instanceof Date||"string"===typeof b||"number"===typeof b)this.controls[0]&&(this.setValueToControls(b),
this.value=this.controls[0].getValue(this.returnFormat),this.data.setValue(this.value));else throw Error("The setValue() method only accepts string values!");return this};a.prototype.setFirstDay=function(b){this.controls[0].setFirstDay(b);return this};a.prototype.setDateFormat=function(b){this.controls[0].setDateFormat(b);return this};a.prototype.setMinDate=function(b){this.controls[0].setMinDate(b);return this};a.prototype.setMaxDate=function(b){this.controls[0].setMaxDate(b);return this};a.prototype.setMonths=
function(b){this.controls[0].setMonths(b);return this};a.prototype.setDays=function(b){this.controls[0].setDays(b);return this};a.prototype.getFormatedDate=function(){return this.controls[0].getFormatedDate()};a.prototype.getValue=function(){return this.controls[0].getValue(this.returnFormat)};a.prototype.setControls=function(){if(this.controls.length)return this;this.controls.push(new PMUI.control.DateTimeControl);return this};a.prototype.updateValueFromControls=function(){this.value=this.controls[0].getValue(this.returnFormat);
return this};PMUI.extendNamespace("PMUI.field.DateTimeField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){a.superclass.call(this);a.prototype.init.call(this)};PMUI.inheritFrom("PMUI.util.Factory",a);a.prototype.init=function(){this.setProducts({panel:PMUI.form.FormPanel,text:PMUI.field.TextField,dropdown:PMUI.field.DropDownListField,radio:PMUI.field.RadioButtonGroupField,checkbox:PMUI.field.CheckBoxGroupField,textarea:PMUI.field.TextAreaField}).setDefaultProduct("panel")};PMUI.extendNamespace("PMUI.form.FormItemFactory",a)})();
(function(){var a=function(b){this.fields=new PMUI.util.ArrayList;this.formPanels=new PMUI.util.ArrayList;this.tabPanels=new PMUI.util.ArrayList;a.superclass.call(this,b);this.onChange=this.legendSize=this.legendElement=this.legend=this.form=this.fieldset=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.type="FormPanel";a.prototype.init=function(b){var a={form:null,fieldset:!1,legend:"",padding:b&&b.fieldset?"5px 10px":"",borderWidth:b&&b.fieldset?1:"",legendSize:12,
onChange:null};jQuery.extend(!0,a,b);this.setPadding(a.padding).setBorderWidth(a.borderWidth).setForm(a.form);this.form=a.form;this.fieldset=a.fieldset;this.legend=a.legend;this.legendSize=a.legendSize;this.onChange=a.onChange;this.fieldset&&this.setElementTag("fieldset")};a.prototype.getItems=function(b,f){var c=[],d,e,g,h;switch(b){case "fields":h=PMUI.form.Field;d=this.fields;break;case "formPanels":h=PMUI.form.FormPanel;d=this.formPanels;break;case "tabPanels":h=PMUI.form.TabPanel;d=this.tabPanels;
break;default:return a.superclass.prototype.getItems.call(this)}if(f)if(h){d=this.items.asArray();e=d.length;for(g=0;g<e;g+=1)d[g]instanceof h?c.push(d[g]):c=c.concat(d[g].getItems(b,!0))}else throw Error('getItems(): The valid values for the "filter" parameter are: "fields","formPanels" or "tabPanels", received: '+b);else c=d.asArray().slice(0);return c};a.prototype.setForm=function(b){b instanceof PMUI.form.Form&&(this.form=b);return this};a.prototype.setFactory=function(b){this.factory=b instanceof
PMUI.util.Factory?b:new PMUI.form.FormItemFactory(b);return this};a.prototype.clearItems=function(){a.superclass.prototype.clearItems.call(this);this.fields&&(this.fields.clear(),this.formPanels.clear(),this.tabPanels.clear());return this};a.prototype.setLegend=function(b){if("string"===typeof b)this.legend=b,this.legendElement&&(this.legendElement.textContent=b);else throw Error("setLegend(): this method accepts string values as only parameter.");return this};a.prototype.createHTML=function(){var b;
if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);this.fieldset&&(b=PMUI.createHTMLElement("legend"),b.textContent=this.legend,b.className="pmui-formpanel-legend",b.style.fontSize=this.legendSize+"px",this.legendElement=b,jQuery(this.html).prepend(b));this.defineEvents();return this.html};a.prototype.getUsableHeight=function(){var b=a.superclass.prototype.getUsableHeight.call(this);if(isNaN(b))return b;this.fieldset&&(b-=this.legendSize);return b};a.prototype.onChangeHandler=
function(){var b=this;return function(a,c,d){var e;this instanceof PMUI.form.Field?e=this:(e=a,a=c,c=d);if("function"===typeof b.onChange)b.onChange(e,a,c)}};a.prototype.addItem=function(b){var f;if(this.factory)if("object"===typeof b&&!b.layout&&(b.layout=this.layout&&this.layout.type.toLowerCase()||"vbox"),this.factory.isValidClass(b)||this.factory.isValidName(b.pmType))f=this.factory.make(b);else throw Error("Invalid item to add.");f&&(f.onChange=this.onChangeHandler(),f.setForm(this.form),f.setDisplay("inline-block"),
f instanceof PMUI.form.FormPanel?this.formPanels.insert(f):f instanceof PMUI.form.Field&&(this.fields.insert(f),this.form&&this.form.data.addItem(f.data)),a.superclass.prototype.addItem.call(this,f));return this};a.prototype.removeItem=function(b){var f;b instanceof PMUI.core.Element?f=b:"string"===typeof b?f=this.items.find("id",b.id):"number"===typeof b&&(f=this.items.get(b));f&&(f instanceof PMUI.form.Field&&this.form&&this.form.data.removeItem(f.data),a.superclass.prototype.removeItem.call(this,
f));return this};a.prototype.isValid=function(){var b=this.items.asArray(),a,c=!0;for(a=0;a<b.length;a++)console.log(b[a].isValid()),c=c&&b[a].isValid();return c};PMUI.extendNamespace("PMUI.form.FormPanel",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.footerHeight=this.header=this.data=this.onSubmit=this.onChange=this.buttons=this.visibleHeader=this.fontSize=this.title=this.encType=this.action=this.name=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.type="PMForm";a.prototype.family="PMForm";a.prototype.init=function(b){var a={title:"Untitled form",name:this.id,action:"",encType:"application/x-www-form-urlencoded",items:[],fontSize:12,width:600,height:400,
visibleHeader:!0,layout:"vbox",buttons:[],onChange:null,onSubmit:null};$.extend(!0,a,b);this.panel=new PMUI.form.FormPanel({form:this,width:a.width,layout:a.layout,style:{cssProperties:{overflow:"auto"}},onChange:this.onChangeHandler()});this.data=new PMUI.data.DataSet;this.buttons=new PMUI.util.ArrayList;this.visibleHeader=a.visibleHeader;this.onChange=a.onChange;this.onSubmit=a.onSubmit;this.setLayout(a.layout).setFontSize(a.fontSize).setWidth(a.width).setTitle(a.title).setName(a.name).setAction(a.action).setEncType(a.encType).setItems(a.items).setButtons(a.buttons)};
a.prototype.onChangeHandler=function(){var b=this;return function(a,c,d){if("function"===typeof b.onChange)b.onChange(a,c,d)}};a.prototype.removeButton=function(b){var a;b instanceof PMUI.ui.Button?a=b:"string"===typeof b?a=this.buttons.find("id",b):"number"===typeof b&&(a=this.buttons.get(b));a&&(jQuery(a.html).remove(),this.buttons.remove(a));return this};a.prototype.clearButtons=function(){for(;this.buttons.getSize();)this.removeButton(this.buttons.get(0));return this};a.prototype.addButton=function(b){var a;
b&&(b instanceof PMUI.ui.Button?a=b:"object"===typeof b&&(a=new PMUI.ui.Button(b)),a&&(a.setHeight("22px"),this.buttons.insert(a),this.footer&&this.footer.appendChild(a.getHTML())));return this};a.prototype.setButtons=function(b){var a=0;if(jQuery.isArray(b)){this.clearButtons();for(a=0;a<b.length;a++)this.addButton(b[a])}return this};a.prototype.updateDimensions=function(){var b=0,a=0;if(!this.panel)return this;"auto"!==this.getHeight()&&(this.visibleHeader&&this.title&&(b=2*this.fontSize),this.buttons&&
this.buttons.getSize()&&(a=1.7*this.fontSize+12),b=this.getHeight()-b-a,this.panel.setHeight(b));this.panel.setWidth(this.getWidth());return this};a.prototype.setHeight=function(b){a.superclass.prototype.setHeight.call(this,b);this.updateDimensions();return this};a.prototype.setWidth=function(b){a.superclass.prototype.setWidth.call(this,b);this.updateDimensions();return this};a.prototype.setFontSize=function(b){if("number"===typeof b)this.fontSize=b,this.style.addProperties({"font-size":b+"px"}),
this.updateDimensions();else throw Error("setFontSize(): this method only accepts a number as parameter.");return this};a.prototype.getFields=function(){return this.panel.getItems("fields",!0)};a.prototype.getItems=function(){return this.panel.getItems()};a.prototype.setLayout=function(b){var a;this.panel&&(a=new PMUI.layout.LayoutFactory,this.panel.layout=a.make(b),this.panel.layout.setContainer(this.panel),this.html&&this.panel.layout.applyLayout());return this};a.prototype.addItem=function(b){this.panel&&
this.panel.addItem(b);return this};a.prototype.setItems=function(b){this.panel&&this.panel.setItems(b);return this};a.prototype.setTitle=function(b){"string"===typeof b&&(this.title=b,this.header&&($(this.header).empty(),b?$(this.header).append('<h2 class="pmui-form-title"></h2>').find("h2").text(b):$(this.header).append('<h2 class="pmui-form-title"></h2>').find("h2").html("&nbsp;"),this.updateDimensions()));return this};a.prototype.setName=function(b){this.name=b;this.html&&(this.html.name=b);return this};
a.prototype.setAction=function(b){this.action=b;this.html&&(this.html.action=b);return this};a.prototype.setEncType=function(b){this.encType=b;this.html&&(this.html.encType=b);return this};a.prototype.showHeader=function(){this.visibleHeader=!0;this.header.style.display="";this.updateDimensions();return this};a.prototype.hideHeader=function(){this.visibleHeader=!1;this.header.style.display="none";this.updateDimensions();return this};a.prototype.isValid=function(){return this.panel.isValid()};a.prototype.submit=
function(){if(this.isValid()&&"function"===typeof this.onSubmit)this.onSubmit(this.getData());return this};a.prototype.getData=function(){return this.data};a.prototype.defineEvents=function(){var b=this.buttons.asArray(),a;for(a=0;a<b.length;a++)b[a].defineEvents();return this};a.prototype.createHTML=function(){var b,a,c;if(this.html)return this.html;b=PMUI.createHTMLElement("form");b.className="pmui-form";a=PMUI.createHTMLElement("div");a.className="pmui-form-header";c=PMUI.createHTMLElement("div");
c.className="pmui-form-footer";this.header=a;this.footer=c;b.appendChild(a);b.appendChild(this.panel.getHTML());b.appendChild(c);this.html=b;this.setTitle(this.title).setName(this.name).setAction(this.action).setEncType(this.encType).setButtons(this.buttons.asArray().slice(0));this.visibleHeader?this.showHeader():this.hideHeader();this.style.applyStyle();this.layout&&this.layout.applyLayout();this.defineEvents();return this.html};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.form.Form",
a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.criteria=this.parent=null;this.validated=!1;this.errorMessage=this.valid=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Base",a);a.prototype.type="Validator";a.prototype.family="Validator";a.prototype.init=function(b){var a={criteria:null,errorMessage:"the validation has failed",parent:null};jQuery.extend(!0,a,b);this.setCriteria(a.criteria).setParent(a.parent).setErrorMessage(a.errorMessage)};a.prototype.setErrorMessage=function(b){this.errorMessage=
b;return this};a.prototype.getErrorMessage=function(){return this.errorMessage};a.prototype.setCriteria=function(b){this.criteria=b;return this};a.prototype.setParent=function(b){if(b)if(b instanceof PMUI.form.Field)this.parent=b;else throw Error("setParent() method only accepts a Field object as parameter.");return this};a.prototype.getParent=function(){return this.parent};a.prototype.validate=function(){this.valid=!0};a.prototype.isValid=function(){this.validate();this.updateTooltip();return this.valid};
a.prototype.updateTooltip=function(){this.parent&&this.parent.message&&(this.valid?this.parent.hideMessage():this.parent.showMessage(this.errorMessage,"error"))};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.form.Validator",a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Validator",a);a.prototype.type="TextLengthValidator";a.prototype.init=function(b){var a=b.criteria.maxLength?" at most "+b.criteria.maxLength+" characters":"",a={errorMessage:"The text length must have "+(b.criteria.minLength?"at least "+b.criteria.minLength+" characters":"")+(a?" and ":"")+a};jQuery.extend(!0,a,b);this.setErrorMessage(a.errorMessage)};a.prototype.validate=function(){var b=
this.criteria.trim?jQuery.trim(this.parent.value):this.parent.value;this.valid=!0;this.criteria.maxLength&&(this.valid=b.length<=parseInt(this.criteria.maxLength,10));this.criteria.minLength&&(this.valid=(null!==this.valid?this.valid:!0)&&b.length>=parseInt(this.criteria.minLength,10));return this};PMUI.extendNamespace("PMUI.form.TextLengthValidator",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.form.Validator",a);a.prototype.type="RegExpValidator";a.prototype.init=function(b){var a={errorMessage:"The text pattern doesn't match"};$.extend(!0,a,b);this.setErrorMessage(a.errorMessage)};a.prototype.validate=function(){var b;this.parent&&this.parent.value?this.criteria instanceof RegExp?this.valid=this.criteria.test(this.parent.value):"string"===typeof this.criteria&&(b=RegExp(this.criteria.pattern,
this.criteria.modifiers),this.valid=b.text(this.parent.value)):this.valid=!1;return this};PMUI.extendNamespace("PMUI.form.RegExpValidator",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){a.superclass.call(this);a.prototype.init.call(this)};PMUI.inheritFrom("PMUI.util.Factory",a);a.prototype.init=function(){this.setProducts({textLength:PMUI.form.TextLengthValidator,regexp:PMUI.form.RegExpValidator}).setDefaultProduct("textLength")};PMUI.extendNamespace("PMUI.form.ValidatorFactory",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);var f=["north","center","south","east","west"],c={size:"size",closed:"initClosed",resizable:"resizable",closable:"closable",togglerOpen:"togglerLength_open",togglerClosed:"togglerLength_closed",overflow:"allowOverflow",hidden:"initHidden",cssProperties:"cssProperties",cssClasses:"cssClasses"};this.panels={};this.instance=this.west=this.east=this.south=this.center=this.north=null;a.prototype.getConfig=function(){return{panels:this.panels,prefix:"ui-layout-",
positions:f,isSetting:function(b){return"undefined"!==typeof c[b]},transformSetting:function(b){return c[b]}}};a.prototype.setConfig=function(b,a){this.panels[b]=a;return this};a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.type="LayoutPanel";a.prototype.init=function(b){var a={center:{cssProperties:{},cssClasses:[]},factory:{products:{layout:PMUI.panel.LayoutPanel,treePanel:PMUI.panel.TreePanel,panel:PMUI.core.Panel},defaultProduct:"panel"}};jQuery.extend(!0,a,b);
this.setFactory(a.factory).setPluginSettings(a).setPanels(a)};a.prototype.setPluginSettings=function(b){var a=this.getConfig(),c=this;jQuery.each(a.positions,function(d,e){var g=b[e],h={};if(g){c.factory&&c.factory.isValidClass(g)?h=b[e+"Config"]||{}:jQuery.each(g,function(b,c){a.isSetting(b)&&(h[a.transformSetting(b)]=c)});if(!h.cssClasses||!jQuery.isArray(h.cssClasses))h.cssClasses=[];h.cssClasses.push(a.prefix+e);c.setConfig(e,h)}});return this};a.prototype.setPanels=function(b){var a=this.getConfig(),
c=this,d;jQuery.each(a.positions,function(e,g){b[g]&&(c[g]=c.factory.make(b[g]),c[g]instanceof PMUI.panel.LayoutPanel&&c.setConfig(g,jQuery.extend(!0,a.panels[g],{instance:c[g]})),c[g]instanceof PMUI.panel.TreePanel&&(d={cssProperties:c[g].style.cssProperties,cssClasses:c[g].style.cssClasses},c.setConfig(g,jQuery.extend(!0,a.panels[g],d))),c[g].style.cssProperties=a.panels[g].cssProperties||{},c[g].style.cssClasses=a.panels[g].cssClasses||[a.prefix+g],c.addItem(c[g]))});return this};a.prototype.createHTML=
function(){var b,f;f=this.items.asArray();a.superclass.prototype.createHTML.call(this);for(b=0;b<f.length;b+=1)$(this.html).append(f[b].getHTML());return this.html};a.prototype.render=function(b){var a=this,c,d=b||!1;c=a.getConfig().panels;0===jQuery(a.html).height()&&jQuery(a.html).height(jQuery(document).height()-20);this.instance=jQuery(a.html).layout(c);jQuery.each(c,function(b,g){c[b].instance&&d&&c[b].instance.render(d);!0===c[b].allowOverflow&&a.instance.allowOverflow(b)})};a.prototype.destroy=
function(){void 0!==this.instance.destroy&&this.instance.destroy();void 0!==this.html&&(jQuery(this.html).remove(),this.html=null);this.instance=null};PMUI.extendNamespace("PMUI.panel.LayoutPanel",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.belongsTo=null;a.prototype.init.call(this,b)};a.prototype.type="Layout";a.prototype.family="Layout";a.prototype.init=function(b){var a={belongsTo:null};jQuery.extend(!0,a,b);this.setContainer(a.belongsTo)};a.prototype.applyLayout=function(){return this};a.prototype.setContainer=function(b){this.belongsTo=b;return this};PMUI.extendNamespace("PMUI.layout.Layout",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.layout.Layout",a);a.prototype.type="HBox";a.prototype.init=function(b){jQuery.extend(!0,{},b)};a.prototype.applyLayout=function(){var b=this.belongsTo,a=b.items,c=0,d=b.getUsableWidth(),b=b.getUsableHeight(),e,g;for(e=0;e<a.getSize();e+=1)g=a.get(e),c+=g.proportion;for(e=0;e<a.getSize();e+=1)g=a.get(e),g.setWidth(d*(g.proportion/c)),g.setHeight(b);return this};PMUI.extendNamespace("PMUI.layout.HBox",
a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.layout.Layout",a);a.prototype.type="VBox";a.prototype.init=function(b){jQuery.extend(!0,{},b)};a.prototype.applyLayout=function(){var b=this.belongsTo,a=b.items,c=0,d=b.getUsableWidth(),b=b.getUsableHeight(),e,g;for(e=0;e<a.getSize();e+=1)g=a.get(e),c+=g.proportion;for(e=0;e<a.getSize();e+=1)g=a.get(e),g.setHeight(b*(g.proportion/c)),g.setWidth(d);return this};PMUI.extendNamespace("PMUI.layout.VBox",
a);"undefined"!==typeof exports&&(module.exports=a)})();(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.layout.Layout",a);a.prototype.type="Box";a.prototype.init=function(b){jQuery.extend(!0,{},b)};a.prototype.applyLayout=function(){};PMUI.extendNamespace("PMUI.layout.Box",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.util.Factory",a);a.prototype.type="LayoutFactory";a.prototype.init=function(b){var a={products:{hbox:PMUI.layout.HBox,vbox:PMUI.layout.VBox,box:PMUI.layout.Box},defaultProduct:"box"};jQuery.extend(!0,a,b);this.setProducts(a.products).setDefaultProduct(a.defaultProduct)};a.prototype.make=function(b){var a=b.pmType||"";return this.isValidClass(b)?b:this.isValidName(a)?this.build.call(this,a,
b):this.isValidName(b)?this.build.call(this,b,{}):this.build.call(this,this.defaultProduct,b)};PMUI.extendNamespace("PMUI.layout.LayoutFactory",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.listeners=this.pointer=this.collapsed=this.classContainer=this.root=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.type="Tree";a.prototype.family="Panel";a.prototype.init=function(b){var a={root:{text:"PMUI TreePanel",id:"TreePanel",visible:!1},factory:{products:{treeitem:PMUI.item.TreeItem},defaultProduct:"treeitem"},listeners:{click:function(){},contextmenu:function(){},select:function(){}},classContainer:"pmui-"+
this.family.toLowerCase()+"-"+this.type.toLowerCase()+"-ul"};jQuery.extend(!0,a,b);this.setFactory(a.factory).setListeners(a.listeners).setClassContainer(a.classContainer).setCollapsed(a.collapsed).setChildren(a.children)};a.prototype.addChild=function(b){var a=this,c,d,e,g;jQuery.each(b,function(b,k){g={idTreePanel:a.id,collapsed:a.collapsed,classContainer:a.classContainer,space:0,listeners:a.listeners};c=jQuery.extend(!0,k,g);d=a.factory.make(c);e=d.getItems().length;0<e&&d.setIcon(d.iconParent);
a.addItem(d)});return d};a.prototype.removeChildren=function(b){b=this.search(this,b);if(null!==b)this.pointer=null,jQuery(b.child.html).remove(),b.father.items.remove(b.child);else throw Error("removeChildren(): can not remove items with the current id");return this};a.prototype.changeTextChild=function(b,a){var c=this.search(this,b);null!==c&&c.child.changeText(a);return this};a.prototype.setListeners=function(b){this.listeners=b;return this};a.prototype.search=function(b,a){var c;c=0;var d;if(void 0===
b)return!1;if(b.id===a)return this.pointer={father:b,child:b};if(0<b.items.getSize()){c=b.items.find("id",a);void 0!==c&&(this.pointer={father:b,child:c});d=b.getItems();for(c=0;c<d.length;c++)this.search(d[c],a)}return this.pointer};a.prototype.setChildren=function(b){b&&this.addChild(b);return this};a.prototype.addChildren=function(b,a){var c,d,e=PMUI.createHTMLElement("ul");d=this.search(this,b);this.pointer=null;if(a&&null!==d)return d=d.child,c=jQuery(d.html).find("span"),jQuery(c[0]).removeClass(),
jQuery(c[0]).addClass(d.iconNodeExpanded),jQuery(c[1]).removeClass(d.icon),jQuery(c[1]).addClass(d.iconParent),jQuery.extend(!0,a[0],{idTreePanel:d.idTreePanel,listeners:this.listeners}),c=d.addChild(a),c.defineEvents(),e.setAttribute("class",this.classContainer),e.setAttribute("style","list-style-type:none; padding-left:0px;"),e.appendChild(c.getHTML()),d.html.appendChild(e),d.setCollapsed(!1),c;throw Error("addChildren(): can not add items with the current parameters");};a.prototype.setClassContainer=
function(b){this.classContainer=b;return this};a.prototype.setCollapsed=function(b){this.collapsed=b;return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);var b=PMUI.createHTMLElement("ul"),f=this.getItems();b.setAttribute("class",this.classContainer);b.setAttribute("style","list-style-type:none; padding-left:0px;");jQuery.each(f,function(a,f){b.appendChild(f.getHTML())});this.html.appendChild(b);this.applyStyle();return this.html};a.prototype.render=function(){jQuery("#"+
this.id+" .pmui-panel-tree-ul").sortable({connectWith:"#"+this.id+" .pmui-panel-tree-ul",axis:"y",remove:function(b,a){console.log("removed:"+a)},receive:function(b,a){console.log(a);console.log("received:"+a)},change:function(b,a){a.item.attr("id");console.log("changed:"+a)}});return this};a.prototype.defineEvents=function(){var b,a;if(0<this.items.getSize()){a=this.getItems();for(b=0;b<a.length;b++)a[b].defineEvents()}};PMUI.extendNamespace("PMUI.panel.TreePanel",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.tabs=[];this.EventDefine=this.selectedTab=this.tabsContainer=this.panelContainer=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.init=function(b){var a={height:500,width:600,tabItems:[]};jQuery.extend(!0,a,b);this.setWidth(a.width);this.setHeight(a.height);this.setTabs(a.tabItems)};a.prototype.addItem=function(b){b.onSelect=this.onTabSelectHandler();b=new PMUI.item.TabItem(b);this.tabs.push(b);this.html&&
(this.tabsContainer.appendChild(b.getHTML()),this.EventDefine&&this.defineEvents());return this};a.prototype.setTabs=function(b){var a;if(jQuery.isArray(b))for(a=0;a<b.length;a++)this.addItem(b[a]);else throw Error("setTabs(): the parameter is not a valid, should to be as Array");if(this.tabs.length)for(a=0;a<this.tabs.length;a++)0===a?this.tabs[0].select():this.tabs[a].deselect();return this};a.prototype.removeTab=function(b){var a=-1,c;if("string"===typeof b)for(c=0;c<this.tabs.length;c++)this.tabs[c].title===
b&&(a=c);else a=b;if(-1===a)throw Error("removeTab(): the value send is not part from tabs");this.html&&jQuery(this.tabs[a].getHTML()).remove();this.tabs.splice(a,1);return this};a.prototype.createHTML=function(){var b,f,c;if(this.html)return this.html;a.superclass.prototype.createHTML.call(this);this.html.className="pmui-tabpanel";b=PMUI.createHTMLElement("ul");b.className="pmui-tabpanel-tabs";b.id=this.id+1;for(c=0;c<this.tabs.length;c++)this.tabs[c].defineEvents(),b.appendChild(this.tabs[c].getHTML());
this.tabsContainer=b;f=PMUI.createHTMLElement("div");f.className="pmui-tabpanel-container";f.id=this.id+2;f.style.width="auto";f.style.boxSizing="border-box";f.style.height=this.height-23+"px";this.panelContainer=f;for(c=0;c<this.tabs.length;c++)this.tabs[c].isSelected()?(f.appendChild(this.tabs[c].panel.getHTML()),this.tabs[c].html.style.background="#F3F2F2"):this.tabs[c].html.style.background="#D1D1D1";this.html.appendChild(b);this.html.appendChild(f);return this.html};a.prototype.setHeight=function(b){this.height=
b;a.superclass.prototype.setHeight.call(this,this.height);this.html&&(this.panelContainer.style.height=$(this.html).outerHeight()-$(this.tabsContainer).outerHeight()+"px");return this};a.prototype.defineEvents=function(){this.EventDefine=!0;for(var b=0;b<this.tabs.length;b++)this.tabs[b].getHTML(),this.tabs[b].defineEvents();return this};a.prototype.onTabSelectHandler=function(){var b=this;return function(){var a;b.selectedTab=this;for(a=0;a<b.tabs.length;a++)b.tabs[a]!==b.selectedTab&&b.tabs[a].deselect();
jQuery(b.panelContainer).empty();jQuery(b.panelContainer).append(this.getPanel().getHTML())}};"undefined"!==typeof exports&&(module.exports=a);PMUI.extendNamespace("PMUI.panel.TabPanel",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.listeners=this.maxLenght=this.idTreePanel=this.space=this.iconNodeExpanded=this.iconNodeClosed=this.iconParent=this.icon=this.cursor=this.iconBoxOff=this.iconBoxOn=this.classContainer=this.collapsed=this.text=null;this.relationship={};a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Item",a);a.prototype.type="TreeItem";a.prototype.family="item";a.prototype.init=function(b){var a={idTreePanel:0,text:"",collapsed:!1,space:25,maxLenght:100,
cursor:"pointer",icon:"pmui-tree-icon",iconParent:"pmui-tree-parent",iconNodeClosed:"pmui-tree-nodeclosed",iconNodeExpanded:"pmui-tree-nodeexpanded",classContainer:"",factory:{products:{treeitem:PMUI.item.TreeItem},defaultProduct:"treeitem"},listeners:{click:function(){},contextmenu:function(){},select:function(){}}};jQuery.extend(!0,a,b);this.setIdTreePanel(a.idTreePanel).setText(a.text).setFactory(a.factory).setCursor(a.cursor).setSpace(a.space).setMaxLenght(a.maxLenght).setCollapsed(a.collapsed).setClassContainer(a.classContainer).setIcon(a.icon).setIconParent(a.iconParent).setIconNodeClosed(a.iconNodeClosed).setIconNodeExpanded(a.iconNodeExpanded).setListeners(a.listeners).setChildren(a.children)};
a.prototype.setIdTreePanel=function(b){this.idTreePanel=b;return this};a.prototype.setText=function(b){this.text=b;return this};a.prototype.changeText=function(b){var a;if(a=jQuery(this.html).children())a=jQuery(a).children()[2],jQuery(a).text(b);return this};a.prototype.setCursor=function(b){this.cursor=b;return this};a.prototype.setSpace=function(b){this.space=b;return this};a.prototype.setMaxLenght=function(b){this.maxLenght=b;return this};a.prototype.setCollapsed=function(b){this.collapsed=b;
return this};a.prototype.setIcon=function(b){this.icon=b;return this};a.prototype.setIconParent=function(b){this.iconParent=b;return this};a.prototype.setIconNodeClosed=function(b){this.iconNodeClosed=b;return this};a.prototype.setIconNodeExpanded=function(b){this.iconNodeExpanded=b;return this};a.prototype.setListeners=function(b){this.listeners=b;return this};a.prototype.isCollapsed=function(){return this.collapsed};a.prototype.setClassContainer=function(b){this.classContainer=b;return this};a.prototype.initStatus=
function(){var b,a;a=this.getItems();if(0<this.items.getSize()){for(b=0;b<a.length;b++)a[b].setVisible(!this.isCollapsed());b=jQuery(this.html).children();this.isCollapsed()?(jQuery(b).children()[0].className=this.iconNodeClosed,this.collapsed=!0):(jQuery(b).children()[0].className=this.iconNodeExpanded,this.collapsed=!1)}return this};a.prototype.collapse=function(){var b=0,a;a=this.getItems();if(0<this.items.getSize()){for(b=0;b<a.length;b++)jQuery(a[b].html).slideUp(300);b=jQuery(this.html).children();
jQuery(b).children()[0].className=this.iconNodeClosed;this.collapsed=!0}return this};a.prototype.expand=function(){var b=0,a;a=this.getItems();if(0<this.items.getSize()){for(b=0;b<a.length;b++)jQuery(a[b].html).slideDown(300);b=jQuery(this.html).children();jQuery(b).children()[0].className=this.iconNodeExpanded;this.collapsed=!1}return this};a.prototype.toggleCollapse=function(){this.collapsed?this.expand():this.collapse();return this};a.prototype.addChild=function(b){var a=this,c,d,e;jQuery.each(b,
function(b,h){c=h;initObj={collapsed:a.collapsed,listeners:a.listeners};c=jQuery.extend(!0,h,initObj);d=a.factory.make(c);e=d.getItems().length;0<e&&d.setIcon(d.iconParent);a.addItem(d)});return d};a.prototype.setItemSelected=function(){var b;b=jQuery("#"+this.idTreePanel+" li").children();jQuery(b).removeClass("pmui-item-selected");b=jQuery("#"+this.id).children()[0];jQuery(b).addClass("pmui-item-selected");return this};a.prototype.createHTML=function(){var b=PMUI.createHTMLElement("li"),a=PMUI.createHTMLElement("span");
PMUI.createHTMLElement("span");var c=PMUI.createHTMLElement("span"),d=PMUI.createHTMLElement("span"),e=this,g,h,k,l;c.setAttribute("class",this.icon);0<this.items.getSize()&&a.setAttribute("class",this.iconNodeExpanded);a.className="pmui-node-icon";k=this.text.length>this.maxLenght?this.text.substr(0,this.maxLenght-3)+"...":this.text;d.appendChild(document.createTextNode(k));h=document.createElement("div");h.className="pmui-"+this.family.toLowerCase()+"-"+this.type.toLowerCase();h.appendChild(a);
h.appendChild(c);h.appendChild(d);parseInt(this.maxLenght,10);h.setAttribute("style","padding-left:"+this.space+"px;");b.id=this.id;this.addEvent("click").listen(d,function(b){g=jQuery("#"+e.idTreePanel+" li").children();jQuery(g).removeClass("pmui-item-selected");jQuery(h).addClass("pmui-item-selected");l=e.listeners.select;l(e,e.relationship.shape,b);b.stopPropagation()});b.appendChild(h);0<e.items.getSize()&&(g=PMUI.createHTMLElement("ul"),g.setAttribute("class",this.classContainer),g.setAttribute("style",
"list-style-type:none;padding-left:0px;"),a=e.getItems(),jQuery.each(a,function(b,a){g.appendChild(a.getHTML())}),b.appendChild(g));this.html=b;this.applyStyle();this.defineCursor();this.initStatus();return this.html};a.prototype.setChildren=function(b){var a=this,c,d,e;b&&jQuery.each(b,function(b,h){e={idTreePanel:a.idTreePanel,collapsed:a.collapsed,classContainer:a.classContainer,space:a.space+25,listeners:a.listeners};d=jQuery.extend(!0,h,e);c=a.factory.make(d);h.children&&c.setIcon(a.iconParent);
a.addItem(c)});return this};a.prototype.defineCursor=function(){this.html.setAttribute("style","cursor:"+this.cursor);return this};a.prototype.addRelationship=function(b){"object"===typeof b&&jQuery.extend(!0,this.relationship,b);return this};a.prototype.defineEvents=function(){var b,a,c,d,e=this;e.addEvent("click").listen(e.html,function(b){e.toggleCollapse();a=e.listeners.click;a(e,e.relationship.shape,b);b.stopPropagation()});e.addEvent("contextmenu").listen(e.html,function(b){b.preventDefault();
c=e.listeners.contextmenu;c(e,e.relationship.shape,b);b.stopPropagation()});if(0<e.items.getSize()){d=e.getItems();for(b=0;b<d.length;b++)d[b].defineEvents()}};PMUI.extendNamespace("PMUI.item.TreeItem",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.factory=this.link=this.onClose=this.selected=this.onSelect=this.panel=this.title=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.family="TabItem";a.prototype.type="TabItem";a.prototype.init=function(b){var a={title:"[untitled]",panel:null,onSelect:function(){}};jQuery.extend(!0,a,b);this.factory=new PMUI.util.Factory({products:{treepanel:PMUI.panel.TreePanel,panel:PMUI.core.Panel},defaultProduct:"panel"});
this.setTitle(a.title).setPanel(a.panel).setOnSelectCallback(a.onSelect)};a.prototype.setOnSelectCallback=function(b){if("function"===typeof b)this.onSelect=b;else throw Error("setOnSelectCallback(): The parameter is not a function.");return this};a.prototype.defineEvents=function(){var b=this;this.html&&this.addEvent("click").listen(this.link,function(a){"function"===typeof b.onSelect&&(a.preventDefault(),b.select())});return this};a.prototype.setTitle=function(b){this.title=b;return this};a.prototype.getTitle=
function(){return this.title};a.prototype.setPanel=function(b){var a;if(!b)throw Error("setPanel(): you must specified a valid panel.");if(b instanceof PMUI.ui.Window)throw Error("setPanel(): the object supplied as a parameter is not a valid type.");if(this.factory)if(this.factory.isValidClass(b)||this.factory.isValidName(b.pmType))a=this.factory.make(b);else throw Error("setPanel(): the object supplied as a parameter is not a valid type.");a&&(this.panel=a);return this};a.prototype.getPanel=function(){return this.panel};
a.prototype.isSelected=function(){return this.selected};a.prototype.select=function(){this.selected=!0;this.html&&($(this.html).addClass("active"),"function"===typeof this.onSelect&&(this.onSelect(),this.html.style.background="#F3F2F2"));return this};a.prototype.deselect=function(){this.selected=!1;this.html&&($(this.html).removeClass("active"),this.html.style.background="#D1D1D1");return this};a.prototype.createHTML=function(){var b,a,c;if(this.html)return this.html;b=PMUI.createHTMLElement("li");
b.id=this.id;b.className="pmui-tabItem";a=PMUI.createHTMLElement("a");a.className="pmui-tab-ref";a.href="#";c=document.createTextNode(this.title);a.appendChild(c);b.appendChild(a);this.link=a;return this.html=b};PMUI.extendNamespace("PMUI.item.TabItem",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.data=null;a.prototype.init.call(this,b)};a.prototype.type="Proxy";a.prototype.family="Proxy";a.prototype.init=function(b){var a={data:null};jQuery.extend(!0,a,b);this.setData(a.data)};a.prototype.setData=function(b){this.data=b;return this};a.prototype.getData=function(){return this.data};a.prototype.send=function(){};a.prototype.receive=function(){};PMUI.extendNamespace("PMUI.proxy.Proxy",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.rc=this.method=this.url=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.proxy.Proxy",a);a.prototype.type="RestProxy";a.prototype.init=function(b){var a={url:null,method:"POST"};jQuery.extend(!0,a,b);this.setUrl(a.url).setMethod(a.method);this.rc=new RestClient};a.prototype.setUrl=function(b){this.url=b;return this};a.prototype.setMethod=function(b){this.method=b;return this};a.prototype.send=function(){var b=this;this.rc&&(this.rc.setAuthorizationType("none"),
this.rc.setDataType("json"),this.rc.putCall({url:this.url,id:this.uid,data:this.data,success:function(a,c){b.success.call(this,a,c)},failure:function(a,c){b.failure.call(this,a,c)}}))};a.prototype.success=function(b,a){};a.prototype.failure=function(b,a){};PMUI.extendNamespace("PMUI.proxy.RestProxy",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.eventName=this.handler=this.element=null;a.prototype.init.call(this,b)};a.prototype.type="Event";a.prototype.family="Event";a.prototype.init=function(b){var a={handler:function(b){}};jQuery.extend(!0,a,b);a.action&&a.action instanceof PMUI.event.Action?this.setHandler(a.action.handler):this.setHandler(a.handler);this.setElement(a.element).setEventName(a.name);return this};a.prototype.setElement=function(b){this.element=b;return this};a.prototype.setHandler=function(b){"function"===
typeof b&&(this.handler=b);return this};a.prototype.setEventName=function(b){this.eventName=b;return this};a.prototype.listenWithDelegation=function(b,a,c){$(b).on(a,this.eventName,c);return this};a.prototype.listen=function(b,a){};PMUI.extendNamespace("PMUI.event.Event",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){a.superclass.call(this);a.prototype.init.call(this)};PMUI.inheritFrom("PMUI.util.Factory",a);a.prototype.type="EventFactory";a.prototype.eventTypes={click:"mouse",mousedown:"mouse",mouseup:"mouse",mousemove:"mouse",mouseover:"mouse",mouseout:"mouse",mouseenter:"mouse",mouseleave:"mouse",dblclick:"mouse",drag:"mouse",drop:"mouse",resize:"mouse",rightclick:"mouse",contextmenu:"mouse",blur:"form",change:"form",focus:"form",select:"form",submit:"form",keyup:"keyboard",keydown:"keyboard",
keypress:"keyboard"};a.prototype.init=function(){this.setProducts({mouse:PMUI.event.MouseEvent,form:PMUI.event.FormEvent,keyboard:PMUI.event.KeyboardEvent,event:PMUI.event.Event}).setDefaultProduct("event")};a.prototype.make=function(b){var a;this.isValidClass(b)||(a=this.eventTypes[b]||"event",b=this.build(a,{name:b}));return b};PMUI.extendNamespace("PMUI.event.EventFactory",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.event.Event",a);a.prototype.type="MouseEvent";a.prototype.listen=function(b,a){var c;c=a instanceof PMUI.event.Action?a.handler:a;jQuery(b).on(this.eventName,c);this.setHandler(c).setElement(b);return this};PMUI.extendNamespace("PMUI.event.MouseEvent",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.event.Event",a);a.prototype.type="KeyboardEvent";a.prototype.listen=function(b,a){var c;c=a instanceof PMUI.event.Action?a.handler:a;$(b).on(this.eventName,c);return this};PMUI.extendNamespace("PMUI.event.KeyboardEvent",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.event.Event",a);a.prototype.type="FormEvent";a.prototype.listen=function(b,a){var c;c=a instanceof PMUI.event.Action?a.handler:a;$(b).on(this.eventName,c);return this};PMUI.extendNamespace("PMUI.event.FormEvent",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.canvas=null;this.zoomHeight=this.zoomWidth=this.zoomY=this.zoomX=this.oldAbsoluteY=this.oldAbsoluteX=this.absoluteY=this.absoluteX=this.oldY=this.oldX=this.oldHeight=this.oldWidth=0;this.savedOptions={};this.enabledMenu=this.menu=this.drag=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Element",a);a.prototype.type="Core";a.prototype.paint=function(){};a.prototype.init=function(b){var a={zOrder:1,visible:!0,drag:"nodrag",
enabledMenu:!1};$.extend(!0,a,b);this.setZOrder(a.zOrder).setVisible(a.visible).setDragBehavior(a.drag).setEnabledMenu(a.enabledMenu).setMenuBehavior().setCanvas(a.canvas)};a.prototype.createHTML=function(){this.html||(this.html=PMUI.createHTMLElement("div"),this.html.id=this.id,this.style.applyStyle(),this.style.addProperties({position:"absolute",left:this.zoomX,top:this.zoomY,width:this.zoomWidth,height:this.zoomHeight,zIndex:this.zOrder}));return this.html};a.prototype.setEnabledMenu=function(b){this.enabledMenu=
b;this.menu instanceof PMUI.behavior.NoSupportMenuBehavior&&this.setMenuBehavior();return this};a.prototype.setPosition=function(b,a){this.setX(b);this.setY(a);return this};a.prototype.setDimension=function(b,a){this.setWidth(b);this.setHeight(a);return this};a.prototype.setX=function(b){if("number"===typeof b)this.x=b=Math.round(b),this.zoomX=this.canvas?this.x*this.canvas.zoomFactor:this.x,this.setAbsoluteX(),this.html&&this.style.addProperties({left:this.zoomX});else throw Error("setX : parameter newX is not a number");
return this};a.prototype.setY=function(b){"number"===typeof b&&(this.y=b=Math.round(b),this.zoomY=this.canvas?this.y*this.canvas.zoomFactor:this.y,this.setAbsoluteY(),this.html&&this.style.addProperties({top:this.zoomY}));return this};a.prototype.setAbsoluteX=function(){this.absoluteX=this.parent?this.zoomX+this.parent.absoluteX:this.zoomX;return this};a.prototype.setOldX=function(b){"number"===typeof b&&(this.oldX=b);return this};a.prototype.setOldY=function(b){"number"===typeof b&&(this.oldY=b);
return this};a.prototype.setAbsoluteY=function(){this.absoluteY=this.parent?this.zoomY+this.parent.absoluteY:this.zoomY;return this};a.prototype.setWidth=function(b){"number"===typeof b&&0<=b&&(this.width=b,this.canvas?(this.zoomWidth=this.width*this.canvas.zoomFactor,b=Math.floor(this.zoomWidth),this.zoomWidth=0===this.zoomWidth%2?b+1:b):this.zoomWidth=this.width,this.html&&this.style.addProperties({width:this.zoomWidth}));return this};a.prototype.setHeight=function(b){"number"===typeof b&&0<=b&&
(this.height=b,this.canvas?(this.zoomHeight=this.height*this.canvas.zoomFactor,b=Math.floor(this.zoomHeight),this.zoomHeight=0===this.zoomHeight%2?b+1:b):this.zoomHeight=this.height,this.html&&this.style.addProperties({height:this.zoomHeight}));return this};a.prototype.setZOrder=function(b){"number"===typeof b&&0<b&&(this.zOrder=b,this.html&&this.style.addProperties({zIndex:this.zOrder}));return this};a.prototype.setCanvas=function(b){b&&"Canvas"===b.family&&(this.canvas=b);return this};a.prototype.setVisible=
function(b){"boolean"===typeof b&&(this.visible=b,this.html&&(b?this.style.addProperties({display:"inline"}):this.style.addProperties({display:"none"})));return this};a.prototype.setID=function(b){this.id=b;this.html&&(this.html.id=this.id);return this};a.prototype.getCanvas=function(){return this.canvas};a.prototype.getAbsoluteX=function(){return this.absoluteX};a.prototype.getAbsoluteY=function(){return this.absoluteY};a.prototype.getStyle=function(){return this.style};a.prototype.getZoomX=function(){return this.zoomX};
a.prototype.getZoomY=function(){return this.zoomY};a.prototype.getZoomWidth=function(){return this.zoomWidth};a.prototype.getZoomHeight=function(){return this.zoomHeight};a.prototype.getOldX=function(){return this.oldX};a.prototype.getOldY=function(){return this.oldY};a.prototype.getOldWidth=function(){return this.oldWidth};a.prototype.getOldHeight=function(){return this.oldHeight};a.prototype.stringify=function(){return{id:this.getID(),x:this.getX(),y:this.getY(),width:this.getWidth(),height:this.getHeight(),
type:this.type,style:this.getStyle().stringify(),drag:this.savedOptions.drag}};a.prototype.setDragBehavior=function(b){this.drag=(new PMUI.behavior.BehaviorFactory({products:{customshapedrag:PMUI.behavior.CustomShapeDragBehavior,regulardrag:PMUI.behavior.RegularDragBehavior,connectiondrag:PMUI.behavior.ConnectionDragBehavior,connection:PMUI.behavior.ConnectionDragBehavior,nodrag:PMUI.behavior.NoDragBehavior},defaultProduct:"nodrag"})).make(b);this.html&&this.drag&&this.drag.attachDragBehavior(this);
return this};a.prototype.setMenuBehavior=function(){this.menu=(new PMUI.behavior.BehaviorFactory({products:{nosupportmenu:PMUI.behavior.NoSupportMenuBehavior,supportmenu:PMUI.behavior.SupportMenuBehavior},defaultProduct:"supportmenu"})).make(this.enabledMenu?"supportmenu":"nosupportmenu");this.menu.parent=this;return this};a.prototype.showMenu=function(b){this.enabledMenu&&this.menu.showMenu(b)};a.prototype.relativePoint=function(b){var a;a=b.pageX-this.absoluteX;b=b.pageY-this.absoluteY;this.canvas&&
(a+=this.canvas.getLeftScroll(),b+=this.canvas.getTopScroll(),a=Math.floor(a/this.canvas.zoomFactor),b=Math.floor(b/this.canvas.zoomFactor));return{x:a,y:b}};a.prototype.parseJSON=function(b){this.initObject(b)};a.prototype.TOP=0;a.prototype.RIGHT=1;a.prototype.BOTTOM=2;a.prototype.LEFT=3;a.prototype.HORIZONTAL=0;a.prototype.VERTICAL=1;a.prototype.ZOOMSCALES=5;PMUI.extendNamespace("PMUI.draw.Core",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.children=this.drop=this.container=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="BehavioralElement";a.prototype.init=function(b){var a={drop:"nodrop",container:"nocontainer"};$.extend(!0,a,b);this.setDropBehavior(a.drop);this.setContainerBehavior(a.container);this.children=new PMUI.util.ArrayList};a.prototype.setDropBehavior=function(b){this.drop=(new PMUI.behavior.BehaviorFactory({products:{connectioncontainer:PMUI.behavior.ConnectionContainerDropBehavior,
connection:PMUI.behavior.ConnectionDropBehavior,container:PMUI.behavior.ContainerDropBehavior,nodrop:PMUI.behavior.NoDropBehavior},defaultProduct:"nodrop"})).make(b);return this};a.prototype.setContainerBehavior=function(b){this.container=(new PMUI.behavior.BehaviorFactory({products:{regularcontainer:PMUI.behavior.RegularContainerBehavior,nocontainer:PMUI.behavior.NoContainerBehavior},defaultProduct:"nocontainer"})).make(b);return this};a.prototype.updateChildrenPosition=function(b,a){var c=this.getChildren(),
d,e,g=[],h=[],k=[];for(e=0;e<c.getSize();e+=1){d=c.get(e);if((0!==b||0!==a)&&!this.canvas.currentSelection.contains(d))g.push(d),h.push({x:d.x,y:d.y}),k.push({x:d.x+b,y:d.y+a});d.setPosition(d.x+b,d.y+a)}0<g.length&&this.canvas.triggerPositionChangeEvent(g,h,k);return this};a.prototype.isContainer=function(){return this.container&&"NoContainerBehavior"!==this.container.type};a.prototype.addElement=function(b,a,c,d){this.container.addToContainer(this,b,a,c,d);return this};a.prototype.removeElement=
function(b){this.container.removeFromContainer(b);return this};a.prototype.swapElementContainer=function(b,a,c,d,e){c=!c?b.getX():c;d=!d?b.getY():d;b.changedContainer=!0;this.removeElement(b);a.addElement(b,c,d,e);return this};a.prototype.getChildren=function(){return this.children};a.prototype.updateDimensions=function(b){"Canvas"!==this.family&&(this.updateSize(b),this.refreshConnections(),PMUI.draw.ResizeBehavior.prototype.updateResizeMinimums(this),a.prototype.updateDimensions.call(this.parent,
b));return this};a.prototype.setDropAcceptedSelectors=function(b,a){b&&b.hasOwnProperty("length")&&this.drop.updateSelectors(this,b,a);return this};a.prototype.updateBehaviors=function(){this.drop&&(this.drop.attachDropBehavior(this),this.drop.updateSelectors(this));return this};a.prototype.stringify=function(){var b=a.superclass.prototype.stringify.call(this);$.extend(!0,b,{container:this.savedOptions.container,drop:this.savedOptions.drop});return b};PMUI.extendNamespace("PMUI.draw.BehavioralElement",
a);"undefined"!==typeof exports&&(module.exports=a)})();(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.util.Factory",a);a.prototype.type="BehaviorFactory";a.prototype.make=function(b){var a=b.pmType;return this.isValidClass(b)?b:this.isValidName(a)?this.build(a,b):this.isValidName(b)?this.build(b,{}):this.build(this.defaultProduct,b)};PMUI.extendNamespace("PMUI.behavior.BehaviorFactory",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};a.prototype.type="DragBehavior";a.prototype.family="DragBehavior";a.prototype.attachDragBehavior=function(b){var a=$(b.getHTML());b={revert:!1,helper:"none",cursorAt:!1,revertDuration:0,grid:[1,1],start:this.onDragStart(b),drag:this.onDrag(b),stop:this.onDragEnd(b)};a.draggable(b)};a.prototype.onDragStart=function(b){return function(b,a){}};a.prototype.onDrag=function(b){return function(b,a){}};a.prototype.onDragEnd=function(b){return function(b,a){}};a.prototype.dragStartHook=
function(b){};a.prototype.dragHook=function(b){};a.prototype.dragEndHook=function(){};PMUI.extendNamespace("PMUI.behavior.DragBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.DragBehavior",a);a.prototype.type="CustomShapeDragBehavior";a.prototype.attachDragBehavior=function(b){var a=$(b.getHTML());b={revert:!1,helper:"none",cursorAt:!1,revertDuration:0,disable:!1,grid:[1,1],start:this.onDragStart(b),drag:this.onDrag(b,!0),stop:this.onDragEnd(b,!0)};a.draggable(b)};a.prototype.onDragStart=function(b){return function(a,c){PMUI.behavior.RegularDragBehavior.prototype.onDragStart.call(this,b)(a,c);b.previousXDragPosition=
b.getX();b.previousYDragPosition=b.getY()}};a.prototype.onDragProcedure=function(b,a,c,d,e,g){var h,k,l,m,n,p,q=b.canvas;if(a){b.setPosition(g.helper.position().left/q.zoomFactor,g.helper.position().top/q.zoomFactor);m=b.x-b.previousXDragPosition;n=b.y-b.previousYDragPosition;b.previousXDragPosition=b.x;b.previousYDragPosition=b.y;for(h=0;h<b.canvas.currentSelection.getSize();h+=1)l=b.canvas.currentSelection.get(h),l.id!==b.id&&l.setPosition(l.x+m,l.y+n)}else b.setPosition(b.x,b.y);if(a)for(h=0;h<
b.canvas.currentSelection.getSize();h+=1){l=b.canvas.currentSelection.get(h);for(k=0;k<l.children.getSize();k+=1)p=l.children.get(k),PMUI.behavior.CustomShapeDragBehavior.prototype.onDragProcedure.call(this,p,!1,m,n,e,g)}else for(h=0;h<b.children.getSize();h+=1)p=b.children.get(h),PMUI.behavior.CustomShapeDragBehavior.prototype.onDragProcedure.call(this,p,!1,c,d,e,g);if(a)for(h=0;h<b.canvas.currentSelection.getSize();h+=1){l=b.canvas.currentSelection.get(h);for(k=0;k<l.ports.getSize();k+=1)a=l.ports.get(k),
e=a.connection,a.setPosition(a.x,a.y),b.canvas.sharedConnections.find("id",e.getID())?e.srcPort.parent.getID()===l.getID()&&e.move(m*q.zoomFactor,n*q.zoomFactor):e.setSegmentColor(PMUI.util.Color.GREY,!1).setSegmentStyle("regular",!1).disconnect().connect()}else for(h=0;h<b.ports.getSize();h+=1)a=b.ports.get(h),e=a.connection,a.setPosition(a.x,a.y),b.canvas.sharedConnections.find("id",e.getID())?e.srcPort.parent.getID()===b.getID()&&e.move(c*q.zoomFactor,d*q.zoomFactor):e.setSegmentColor(PMUI.util.Color.GREY,
!1).setSegmentStyle("regular",!1).disconnect().connect()};a.prototype.onDrag=function(b,a,c,d){var e=this;return function(g,h){e.onDragProcedure(b,a,c,d,g,h);b.canvas.showOrHideSnappers(b)}};a.prototype.dragEndProcedure=function(b,a,c,d){var e,g,h,k;e=b.canvas;if(a){b.setPosition(d.helper.position().left/e.zoomFactor,d.helper.position().top/e.zoomFactor);b.wasDragged=!0;for(e=0;e<b.canvas.currentSelection.getSize();e+=1)h=b.canvas.currentSelection.get(e),h.setPosition(h.x,h.y)}else b.setPosition(b.x,
b.y);if(a)for(e=0;e<b.canvas.currentSelection.getSize();e+=1){h=b.canvas.currentSelection.get(e);for(g=0;g<h.children.getSize();g+=1)k=h.children.get(g),k.changedContainer=!0,PMUI.behavior.CustomShapeDragBehavior.prototype.dragEndProcedure.call(this,k,!1,c,d)}else for(e=0;e<b.children.getSize();e+=1)k=b.children.get(e),PMUI.behavior.CustomShapeDragBehavior.prototype.dragEndProcedure.call(this,k,!1,c,d);if(a)for(e=0;e<b.canvas.currentSelection.getSize();e+=1){h=b.canvas.currentSelection.get(e);for(g=
0;g<h.ports.getSize();g+=1)a=h.ports.get(g),c=a.connection,a.setPosition(a.x,a.y),b.canvas.sharedConnections.find("id",c.getID())?c.srcPort.parent.getID()===h.getID()&&(c.disconnect(!0).connect({algorithm:"user",points:c.points,dx:parseFloat($(c.html).css("left")),dy:parseFloat($(c.html).css("top"))}),c.checkAndCreateIntersectionsWithAll()):(c.setSegmentColor(c.originalSegmentColor,!1).setSegmentStyle(c.originalSegmentStyle,!1).disconnect().connect(),c.setSegmentMoveHandlers(),c.checkAndCreateIntersectionsWithAll())}else for(e=
0;e<b.ports.getSize();e+=1)a=b.ports.get(e),c=a.connection,a.setPosition(a.x,a.y),b.canvas.sharedConnections.find("id",c.getID())?c.srcPort.parent.getID()===b.getID()&&c.checkAndCreateIntersectionsWithAll():(c.setSegmentColor(c.originalSegmentColor,!1).setSegmentStyle(c.originalSegmentStyle,!1).disconnect().connect(),c.setSegmentMoveHandlers(),c.checkAndCreateIntersectionsWithAll())};a.prototype.onDragEnd=function(b){var a,c=this;return function(d,e){c.dragEndProcedure(b,!0,d,e);b.dragging=!1;b.canvas.verticalSnapper.hide();
b.canvas.horizontalSnapper.hide();b.changedContainer||(a=new PMUI.command.CommandMove(b.canvas.currentSelection),a.execute(),b.canvas.commandStack.add(a));b.changedContainer=!1;b.decreaseParentZIndex(b.oldParent)}};PMUI.extendNamespace("PMUI.behavior.CustomShapeDragBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.DragBehavior",a);a.prototype.type="RegularDragBehavior";a.prototype.attachDragBehavior=function(b){var f=$(b.getHTML());a.superclass.prototype.attachDragBehavior.call(this,b);f.draggable({cursor:"move"})};a.prototype.onDragStart=function(b){return function(a,c){var d=b.canvas,e=d.currentLabel,g;d.hideCurrentConnection();e&&(e.loseFocus(),$(e.textField).focusout());d.fixSnapData();d.currentSelection.contains(b)||(d.emptyCurrentSelection(),
d.addToSelection(b));for(g=0;g<d.currentSelection.getSize();g+=1)e=d.currentSelection.get(g),e.setOldX(e.getX()),e.setOldY(e.getY()),e.setOldParent(e.getParent());b.increaseParentZIndex(b.getParent());return!0}};a.prototype.onDrag=function(b){return function(a,c){b.setPosition(c.helper.position().left,c.helper.position().top);b.canvas.showOrHideSnappers(b)}};a.prototype.onDragEnd=function(b){return function(a,c){var d;b.setPosition(c.helper.position().left,c.helper.position().top);b.decreaseParentZIndex(b.oldParent);
b.dragging=!1;b.canvas.verticalSnapper.hide();b.canvas.horizontalSnapper.hide();b.changedContainer||(d=new PMUI.command.CommandMove(b),d.execute(),b.canvas.commandStack.add(d));b.changedContainer=!1}};PMUI.extendNamespace("PMUI.behavior.RegularDragBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.DragBehavior",a);a.prototype.type="ConnectionDragBehavior";a.prototype.attachDragBehavior=function(b){var f=$(b.getHTML()),c;c={helper:b.createDragHelper,cursorAt:{top:0,left:0},revert:!0};a.superclass.prototype.attachDragBehavior.call(this,b);f.draggable(c);f.draggable("enable")};a.prototype.onDragStart=function(b){return function(a,c){var d=b.canvas,e=d.currentLabel;d.relativePoint(a);var d=a.pageX-b.getAbsoluteX(),g=a.pageY-b.getAbsoluteY();
b.startConnectionPoint.portX=d;b.startConnectionPoint.portY=g;b.canvas.emptyCurrentSelection();e&&(e.loseFocus(),$(e.textField).focusout());if("CustomShape"!==b.family)return!1;b.setOldX(b.getX());b.setOldY(b.getY());b.startConnectionPoint.x+=b.getAbsoluteX();b.startConnectionPoint.y+=b.getAbsoluteY();return!0}};a.prototype.onDrag=function(b){return function(a,c){var d=b.getCanvas(),e=new PMUI.util.Point,g=d.relativePoint(a);d.connectionSegment&&$(d.connectionSegment.getHTML()).remove();e.x=g.x;e.y=
g.y;d.connectionSegment=new PMUI.draw.Segment({startPoint:b.startConnectionPoint,endPoint:e,parent:d,zOrder:2*PMUI.util.Style.MAX_ZINDEX});d.connectionSegment.pointsTo=b;d.connectionSegment.paint()}};a.prototype.onDragEnd=function(b){return function(a,c){b.canvas.connectionSegment&&$(b.canvas.connectionSegment.getHTML()).remove();b.setPosition(b.getOldX(),b.getOldY());b.dragging=!1}};PMUI.extendNamespace("PMUI.behavior.ConnectionDragBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.DragBehavior",a);a.prototype.type="NoDragBehavior";a.prototype.onDragStart=function(b){return function(a,c){b.canvas.hideCurrentConnection();return!1}};PMUI.extendNamespace("PMUI.behavior.NoDragBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.selectors=[];a.prototype.init.call(this,b)};a.prototype.type="DropBehavior";a.prototype.family="DropBehavior";a.prototype.defaultSelector="";a.prototype.init=function(b){var a={selectors:[]};jQuery.extend(!0,a,b);this.setSelectors(a.selectors)};a.prototype.attachDropBehavior=function(b){var a=$(b.getHTML());b={accept:this.defaultSelector,drop:this.onDrop(b),over:this.onDragEnter(b),out:this.onDragLeave(b),greedy:!0};a.droppable(b)};a.prototype.onDragEnter=function(b){return function(b,
a){}};a.prototype.onDragLeave=function(b){return function(b,a){}};a.prototype.onDrop=function(b){return function(b,a){}};a.prototype.setSelectors=function(b,a){var c;b&&(this.selectors=b);for(a?0<b.length&&(c=1):c=0;c<b.length;c+=1);return this};a.prototype.updateSelectors=function(b,a){var c=$(b.getHTML()),d,e;a&&(this.selectors=a);0<this.selectors.length&&(d=this.selectors[0]);for(e=1;e<this.selectors.length;e+=1)d+=","+this.selectors[e];c.droppable({accept:d});return this};a.prototype.dragEnterHook=
function(){return!0};a.prototype.dragLeaveHook=function(){return!0};a.prototype.dropStartHook=function(b,a,c){return!0};a.prototype.dropHook=function(b,a,c){return!0};a.prototype.dropEndHook=function(b,a,c){return!0};PMUI.extendNamespace("PMUI.behavior.DropBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.behavior.DropBehavior",a);a.prototype.type="ConnectionDropBehavior";a.prototype.defaultSelector=".custom_shape,.port";a.prototype.setSelectors=function(b,f){a.superclass.prototype.setSelectors.call(this,b,f);this.selectors.push(".port");this.selectors.push(".custom_shape");return this};a.prototype.onDragEnter=function(b){return function(a,c){b.entered=!0}};a.prototype.onDragLeave=function(b){return function(a,c){b.entered=
!1}};a.prototype.onDrop=function(b){return function(a,c){var d=b.getCanvas(),e=c.draggable.attr("id"),g,h,k,l,m;g=d.currentConnection;b.entered=!1;if(!b.drop.dropStartHook(b,a,c))return!1;if("none"===b.getConnectionType())return!0;g&&(k=g.srcPort,g=g.destPort,k=k.id===e?k:g.id===e?g:null);if(c.helper&&"drag-helper"===c.helper.attr("id")){g=b.canvas.connectionSegment.startPoint;h=b.canvas.connectionSegment.pointsTo;if(h.parent&&h.parent.id===b.id)return!0;h.setPosition(h.oldX,h.oldY);k=new PMUI.draw.Port({width:8,
height:8});e=new PMUI.draw.Port({width:8,height:8});b.canvas.relativePoint(a);l=c.offset.left-b.canvas.getX()-b.getAbsoluteX()+b.canvas.getLeftScroll();m=c.offset.top-b.canvas.getY()-b.getAbsoluteY()+b.canvas.getTopScroll();h.addPort(k,g.x,g.y);b.addPort(e,l,m,!1,k);g=new PMUI.draw.Connection({srcPort:k,destPort:e,canvas:b.canvas,segmentStyle:b.connectionType});g.setSrcDecorator(new PMUI.draw.ConnectionDecorator({width:11,height:11,canvas:d,decoratorPrefix:"con_normal",decoratorType:"source",parent:g}));
g.setDestDecorator(new PMUI.draw.ConnectionDecorator({width:11,height:11,canvas:d,decoratorPrefix:"con_normal",decoratorType:"target",parent:g}));g.canvas.commandStack.add(new PMUI.command.CommandConnect(g));g.connect();g.setSegmentMoveHandlers();d.addConnection(g);g.checkAndCreateIntersectionsWithAll();k.attachListeners(k);e.attachListeners(e);d.triggerCreateEvent(g,[])}else k&&(k.setOldParent(k.getParent()),k.setOldX(k.getX()),k.setOldY(k.getY()),e=c.position.left,g=c.position.top,k.setPosition(e,
g),b.dragging=!1,b.getID()!==k.parent.getID()?(k.parent.removePort(k),e=c.offset.left-d.getX()-b.absoluteX+b.canvas.getLeftScroll(),g=c.offset.top-d.getY()-b.absoluteY+b.canvas.getTopScroll(),b.addPort(k,e,g,!0),d.regularShapes.insert(k)):b.definePortPosition(k,k.getPoint(!0)),k.connection.connect(),d.triggerPortChangeEvent(k),k.connection.disconnect(),d=new PMUI.command.CommandReconnect(k),k.canvas.commandStack.add(d));return!1}};PMUI.extendNamespace("PMUI.behavior.ConnectionDropBehavior",a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.behavior.DropBehavior",a);a.prototype.type="ContainerDropBehavior";a.prototype.defaultSelector=".custom_shape";a.prototype.onDrop=function(b){return function(a,c){var d=null,e=b.getCanvas(),g,h,k,l;k=[];if(e.readOnly)return!1;b.entered=!1;if(c.helper&&"drag-helper"===c.helper.attr("id"))return!1;l=c.draggable.attr("id");d=e.shapeFactory(l);if(null===d){d=e.customShapes.find("id",l);if(!d||!b.dropBehavior.dropHook(b,a,
c))return!1;if(!(d.parent&&d.parent.id===b.id)){d=e.currentSelection;for(h=0;h<d.getSize();h+=1)g=d.get(h),l=PMUI.getPointRelativeToPage(g),l=PMUI.pageCoordinatesToShapeCoordinates(b,null,l.x,l.y),k.push({shape:g,container:b,x:l.x,y:l.y,topLeft:!1});k=new PMUI.command.CommandSwitchContainer(k);k.execute();e.commandStack.add(k);e.multipleDrop=!0}b.updateDimensions(10);e.updatedElement=null}else l=PMUI.pageCoordinatesToShapeCoordinates(b,a),b.addElement(d,l.x,l.y,d.topLeftOnCreation),e.updatedElement=
d,k=new PMUI.command.CommandCreate(d),e.commandStack.add(k),k.execute()}};PMUI.extendNamespace("PMUI.behavior.ContainerDropBehavior",a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.behavior.DropBehavior",a);a.prototype.type="ConnectionContainerDropBehavior";a.prototype.defaultSelector=".custom_shape,.port";a.prototype.setSelectors=function(b,f){a.superclass.prototype.setSelectors.call(this,b,f);this.selectors.push(".port");this.selectors.push(".custom_shape");return this};a.prototype.onDrop=function(b){return function(a,c){PMUI.behavior.ConnectionDropBehavior.prototype.onDrop.call(this,b)(a,c)||
PMUI.behavior.ContainerDropBehavior.prototype.onDrop.call(this,b)(a,c)}};PMUI.extendNamespace("PMUI.behavior.ConnectionContainerDropBehavior",a)})();(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.behavior.DropBehavior",a);a.prototype.type="NoDropBehavior";a.prototype.attachDropBehavior=function(b){};PMUI.extendNamespace("PMUI.behavior.NoDropBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};a.prototype.type="ContainerBehavior";a.prototype.family="ContainerBehavior";a.prototype.addToContainer=function(b,a,c,d,e){};a.prototype.removeFromContainer=function(b){};a.prototype.addShape=function(b,a,c,d){};a.prototype.isContainer=function(){return!1};PMUI.extendNamespace("PMUI.behavior.ContainerBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.ContainerBehavior",a);a.prototype.type="RegularContainerBehavior";a.prototype.addToContainer=function(b,a,c,d,e){var g=0,h=0,k,l,m=!0===e?0:1;l="Canvas"===b.family?b:b.canvas;e=a.getZoomWidth();k=a.getZoomHeight();g=(g+(c-e/2*m))/l.zoomFactor;h=(h+(d-k/2*m))/l.zoomFactor;a.setParent(b);b.getChildren().insert(a);this.addShape(b,a,g,h);a.fixZIndex(a,0);b.updateDimensions(10);l.addToList(a)};a.prototype.removeFromContainer=function(b){var a=
b.parent;a.getChildren().remove(b);a.isResizable()&&a.resizeBehavior.updateResizeMinimums(b.parent);b.parent=null};a.prototype.addShape=function(b,a,c,d){a.setPosition(c,d);b.getHTML().appendChild(a.getHTML());a.paint();a.updateHTML();a.applyBehaviors();a.attachListeners();return this};PMUI.extendNamespace("PMUI.behavior.RegularContainerBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.ContainerBehavior",a);a.prototype.type="NoContainerBehavior";PMUI.extendNamespace("PMUI.behavior.NoContainerBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};a.prototype.type="ResizeBehavior";a.prototype.family="ResizeBehavior";a.prototype.init=function(b){var a=$(b.getHTML());b={handles:b.getHandlesIDs(),disable:!1,start:this.onResizeStart(b),resize:this.onResize(b),stop:this.onResizeEnd(b)};a.resizable(b)};a.prototype.onResizeStart=function(b){};a.prototype.onResize=function(b){};a.prototype.onResizeEnd=function(b){};a.prototype.updateResizeMinimums=function(b){var a;a=b.getChildren().getDimensionLimit();var c=$(b.getHTML());
b=a[1]+15;a=a[2]+15;c.resizable();c.resizable("option","minWidth",b);c.resizable("option","minHeight",a);return this};PMUI.extendNamespace("PMUI.behavior.ResizeBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.ResizeBehavior",a);a.prototype.type="NoResizeBehavior";a.prototype.init=function(b){var f=$(b.getHTML());a.superclass.prototype.init.call(this,b);f.resizable("disable");f.removeClass("ui-state-disabled");b.applyStyleToHandlers("nonResizableStyle");b.showOrHideResizeHandlers(!1)};a.prototype.updateResizeMinimums=function(b){};PMUI.extendNamespace("PMUI.behavior.NoResizeBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.ResizeBehavior",a);a.prototype.type="RegularResizeBehavior";a.prototype.init=function(b){var f=$(b.getHTML());a.superclass.prototype.init.call(this,b);f.resizable("enable");b.applyStyleToHandlers("resizableStyle");b.showOrHideResizeHandlers(!1)};a.prototype.onResizeStart=function(b){return function(a,c){b.resizing=!0;b.dragging=!1;b.oldWidth=b.width;b.oldHeight=b.height;b.oldX=b.x;b.oldY=b.y;b.oldAbsoluteX=b.absoluteX;b.oldAbsoluteY=b.absoluteY;
b.ports&&b.initPortsChange();1<b.canvas.currentSelection.getSize()&&(b.canvas.emptyCurrentSelection(),b.canvas.addToSelection(b));b.showOrHideResizeHandlers(!1);b.calculateLabelsPercentage();return!0}};a.prototype.onResize=function(b){return function(a,c){var d=b.canvas;b.setPosition(c.position.left/d.zoomFactor,c.position.top/d.zoomFactor);b.setDimension(c.size.width/d.zoomFactor,c.size.height/d.zoomFactor);b.fixConnectionsOnResize(b.resizing,!0);b.updateLabelsPosition()}};a.prototype.onResizeEnd=
function(b){return function(f,c){var d,e;b.resizing=!1;a.prototype.onResize.call(this,b)(f,c);b.showOrHideResizeHandlers(!0);b.parent.updateDimensions(10);b.ports&&b.firePortsChange();d=new PMUI.command.CommandResize(b);b.canvas.commandStack.add(d);d.execute();for(d=0;d<b.labels.getSize();d+=1)e=b.labels.get(d),e.setLabelPosition(e.location,e.diffX,e.diffY);return!0}};PMUI.extendNamespace("PMUI.behavior.RegularResizeBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){this.parent=this.menu=null};a.prototype.type="MenuBehavior";a.prototype.family="behavior";a.prototype.menuFactory=function(){};a.prototype.showMenu=function(){};a.prototype.setContextMenu=function(){};a.prototype.defineEventsParent=function(){};a.prototype.showContextMenu=function(){};a.prototype.eventSelf=function(){};a.prototype.removeContextMenu=function(){};PMUI.extendNamespace("PMUI.behavior.MenuBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){a.superclass.call(this);a.prototype.init.call()};PMUI.inheritFrom("PMUI.behavior.MenuBehavior",a);a.prototype.init=function(){};a.prototype.type="SupportMenuBehavior";a.prototype.menuFactory=function(b){this.menu=(new PMUI.behavior.BehaviorFactory({products:{contextmenu:PMUI.ui.Menu},defaultProduct:"contextmenu"})).make(b);return this};a.prototype.showMenu=function(b){this.defineEventsParent(this.parent,b)};a.prototype.defineEventsParent=function(b,a){var c=this,d;this.parent.addEvent("contextmenu").listen(this.parent.html,
function(e){e.preventDefault();c.removeContextMenu();c.menuFactory(a);PMUI.currentContextMenu=c.menu;d=PMUI.currentContextMenu;d.setParentWidget(b);c.showContextMenu(e);fnClick=d.listeners.clickParent;fnClick(d.parent,e);e.stopPropagation()})};a.prototype.showContextMenu=function(b){var a=PMUI.getContextMenu();a&&(this.eventSelf(),document.body.appendChild(a.getHTML()),a.show(b.pageX,b.pageY),a.defineEvents())};a.prototype.eventSelf=function(){var b=this,a;jQuery(window).click(function(c){null!==
PMUI.currentContextMenu&&(c.preventDefault(),b.removeContextMenu(),a=b.menu.listeners.destroy,a(b.parent,c),c.stopPropagation())})};a.prototype.removeContextMenu=function(){PMUI.currentContextMenu&&(document.body.removeChild(PMUI.currentContextMenu.html),PMUI.currentContextMenu=null);return this};PMUI.extendNamespace("PMUI.behavior.SupportMenuBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){};PMUI.inheritFrom("PMUI.behavior.MenuBehavior",a);a.prototype.type="NoSupportMenuBehavior";a.prototype.showMenu=function(){throw Error("The current widget has not enabled the menu.");};PMUI.extendNamespace("PMUI.behavior.NoSupportMenuBehavior",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.receiver=b;this.canvas=this.getCanvas(b)};a.prototype.family="Command";a.prototype.execute=function(b){};a.prototype.undo=function(b){};a.prototype.redo=function(b){};a.prototype.getCanvas=function(b){b.getSize?(b=b.get(0),b=b.getCanvas()):b=b.getCanvas?b.getCanvas():null;return b};PMUI.extendNamespace("PMUI.command.Command",a)})();
(function(){var a=function(b){a.superclass.call(this,b)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandConnect";a.prototype.execute=function(){var b=this.receiver,a=b.canvas,c=b.getSrcPort(),d=b.getDestPort();c.parent.ports.insert(c);d.parent.ports.insert(d);c.parent.html.appendChild(c.getHTML());d.parent.html.appendChild(d.getHTML());a.addConnection(b);a.updatedElement=b;a.triggerCreateEvent(b,[]);return this};a.prototype.undo=function(){this.receiver.saveAndDestroy();this.receiver.canvas.triggerRemoveEvent(this.receiver,
[]);return this};a.prototype.redo=function(){this.execute();return this};PMUI.extendNamespace("PMUI.command.CommandConnect",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.after=this.before=null;a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandCreate";a.prototype.initObject=function(b){this.before={};this.after={x:b.getX(),y:b.getY(),parent:b.getParent()}};a.prototype.execute=function(){var b=this.receiver,a=b.parent;a.getChildren().contains(b)||a.getChildren().insert(b);this.after.parent.html.appendChild(b.getHTML());b.canvas.addToList(b);b.showOrHideResizeHandlers(!1);
b.canvas.triggerCreateEvent(b,[]);return this};a.prototype.undo=function(){this.receiver.parent.getChildren().remove(this.receiver);this.receiver.saveAndDestroy();this.receiver.canvas.triggerRemoveEvent(this.receiver,[]);return this};a.prototype.redo=function(){this.execute();return this};PMUI.extendNamespace("PMUI.command.CommandCreate",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.stackCommandConnect=[];this.currentSelection=new PMUI.util.ArrayList;this.currentConnection=null;this.relatedElements=[];a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandDelete";a.prototype.initObject=function(b){var a,c;for(a=0;0<(a<b.getCurrentSelection().getSize());a+=1)c=b.getCurrentSelection().get(a),this.currentSelection.insert(c);b.currentConnection&&(this.currentConnection=
b.currentConnection)};a.prototype.saveAndDestroy=function(b,a,c){var d,e,g=null,h=b.canvas;b.hasOwnProperty("children")&&(g=b.children);b.destroy&&b.destroy();for(d=0;d<g.getSize();d+=1)e=g.get(d),this.saveAndDestroy(e,!1,c);for(;b.ports&&0<b.ports.getSize();)d=b.ports.getFirst().connection,c&&this.relatedElements.push(d),this.stackCommandConnect.push(new PMUI.command.CommandConnect(d)),d.saveAndDestroy();a&&(a=b.parent,a.getChildren().remove(b),a.isResizable()&&a.resizeBehavior.updateResizeMinimums(b.parent),
h.removeFromList(b),b.html=$(b.html).detach()[0]);c&&this.relatedElements.push(b);return!0};a.prototype.execute=function(){var b,a,c=this.receiver,d=!1,e=null;0===this.relatedElements.length&&(d=!0);c.emptyCurrentSelection();for(a=0;a<this.currentSelection.getSize();a+=1)b=this.currentSelection.get(a),c.addToSelection(b);1===c.currentSelection.getSize()&&(e=b);for(a=[];0<c.getCurrentSelection().getSize();)b=c.getCurrentSelection().getFirst(),this.saveAndDestroy(b,!0,d),a.push(b.stringify());c.currentConnection=
this.currentConnection;if(b=c.currentConnection)this.relatedElements.push(b),this.stackCommandConnect.push(new PMUI.command.CommandConnect(b)),b.saveAndDestroy();c.triggerRemoveEvent(e,this.relatedElements);return this};a.prototype.undo=function(){var b,a,c=this.receiver.currentSelection.getFirst();for(b=0;b<this.currentSelection.getSize();b+=1)a=this.currentSelection.get(b),a.canvas.addToList(a),a.parent.getChildren().insert(a),a.parent.html.appendChild(a.getHTML()),PMUI.behavior.ResizeBehavior.prototype.updateResizeMinimums(a.parent),
a.showOrHideResizeHandlers(!1);for(b=this.stackCommandConnect.length-1;0<=b;b-=1)this.stackCommandConnect[b].redo();this.receiver.triggerCreateEvent(c,this.relatedElements);return this};a.prototype.redo=function(){this.execute();return this};PMUI.extendNamespace("PMUI.command.CommandDelete",a)})();
(function(){var a=function(b,f){a.superclass.call(this,b);this.after=this.before=null;a.prototype.initObject.call(this,b,f)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandEditLabel";a.prototype.initObject=function(b,a){var c=0,d=0;b.parent&&(c=b.parent.height,d=b.parent.width);this.before={message:b.message,width:b.width,height:b.height,parentHeight:c,parentWidth:d};this.after={message:a,width:0,height:0,parentHeight:d,parentWidth:c}};a.prototype.execute=function(b){this.receiver.setMessage(this.after.message);
this.receiver.updateDimension();0===this.after.width&&(this.after.width=this.receiver.width,this.after.height=this.receiver.height,0!==this.after.parentWidth&&(this.after.parentWidth=this.receiver.parent.width,this.after.parentHeight=this.receiver.parent.height));this.receiver.paint();b||(this.receiver.canvas.triggerTextChangeEvent(this.receiver,this.before.message,this.after.message),this.after.parentWidth!==this.before.parentWidth&&this.before.parentHeight!==this.after.parentHeight&&this.receiver.canvas.triggerDimensionChangeEvent(this.receiver.parent,
this.before.parentWidth,this.before.parentHeight,this.after.parentWidth,this.after.parentHeight))};a.prototype.undo=function(b){this.receiver.setMessage(this.before.message);this.receiver.parent&&this.receiver.parent.setDimension(this.before.parentWidth,this.before.parentHeight);this.receiver.setDimension(this.before.width,this.before.height);this.receiver.updateDimension();this.receiver.paint();this.receiver.canvas.triggerTextChangeEvent(this.receiver,this.after.message,this.before.message);this.after.parentWidth!==
this.before.parentWidth&&this.before.parentHeight!==this.after.parentHeight&&this.receiver.canvas.triggerDimensionChangeEvent(this.receiver.parent,this.after.parentWidth,this.after.parentHeight,this.before.parentWidth,this.before.parentHeight)};a.prototype.redo=function(){this.execute()};PMUI.extendNamespace("PMUI.command.CommandEditLabel",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.after=this.before=null;this.relatedShapes=[];a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandMove";a.prototype.initObject=function(b){var a,c=[],d=[];for(a=0;a<b.getSize();a+=1)this.relatedShapes.push(b.get(a)),c.push({x:b.get(a).getOldX(),y:b.get(a).getOldY()}),d.push({x:b.get(a).getX(),y:b.get(a).getY()});this.before={shapes:c};this.after={shapes:d}};a.prototype.execute=function(){var b,
a;for(b=0;b<this.relatedShapes.length;b+=1)a=this.relatedShapes[b],a.setPosition(this.after.shapes[b].x,this.after.shapes[b].y).refreshChildrenPositions(!0),a.refreshConnections(!1);this.canvas.triggerPositionChangeEvent(this.relatedShapes,this.before.shapes,this.after.shapes)};a.prototype.undo=function(){var b,a;for(b=0;b<this.relatedShapes.length;b+=1)a=this.relatedShapes[b],a.setPosition(this.before.shapes[b].x,this.before.shapes[b].y).refreshChildrenPositions(!0),a.refreshConnections(!1);this.canvas.triggerPositionChangeEvent(this.relatedShapes,
this.after.shapes,this.before.shapes)};a.prototype.redo=function(){this.execute()};PMUI.extendNamespace("PMUI.command.CommandMove",a)})();
(function(){var a=function(b,f){a.superclass.call(this,b);this.stackCommandConnect=[];this.stackCommandCreate=[];a.prototype.initObject.call(this,b,f)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandPaste";a.prototype.initObject=function(b,a){var c={stackCommandConnect:[],stackCommandCreate:[]};$.extend(!0,c,a);this.stackCommandConnect=c.stackCommandConnect;this.stackCommandCreate=c.stackCommandCreate};a.prototype.execute=function(){var b,a;for(b=0;b<this.stackCommandCreate.length;b+=
1)a=this.stackCommandCreate[b],a.redo();for(b=0;b<this.stackCommandConnect.length;b+=1)a=this.stackCommandConnect[b],a.redo();return this};a.prototype.undo=function(){var b,a;for(b=0;b<this.stackCommandCreate.length;b+=1)a=this.stackCommandCreate[b],a.undo();for(b=0;b<this.stackCommandConnect.length;b+=1)a=this.stackCommandConnect[b],a.undo();return this};a.prototype.redo=function(){this.execute();return this};PMUI.extendNamespace("PMUI.command.CommandPaste",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.before={x:this.receiver.getOldX(),y:this.receiver.getOldY(),parent:this.receiver.getOldParent()};this.after={x:this.receiver.getX(),y:this.receiver.getY(),parent:this.receiver.getParent()}};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandReconnect";a.prototype.execute=function(){var b=this.receiver,a=this.after.parent,c=this.before.parent;a.canvas.currentConnection&&(a.canvas.currentConnection.hidePortsAndHandlers(),
a.canvas.currentConnection=null);a.getID()!==c.getID()?(c.removePort(b),a.addPort(b,this.after.x,this.after.y,!0)):a.definePortPosition(b,new PMUI.util.Point(this.after.x,this.after.y));b.connection.disconnect().connect().setSegmentMoveHandlers().checkAndCreateIntersectionsWithAll();this.receiver.canvas.triggerPortChangeEvent(b);return this};a.prototype.undo=function(){var b=this.receiver,a=this.after.parent,c=this.before.parent;a.canvas.currentConnection&&(a.canvas.currentConnection.hidePortsAndHandlers(),
a.canvas.currentConnection=null);a.getID()!==c.getID()?(a.removePort(b),c.addPort(b,this.before.x,this.before.y,!0),b.canvas.regularShapes.insert(b)):a.definePortPosition(b,new PMUI.util.Point(this.before.x,this.before.y));b.connection.disconnect().connect().setSegmentMoveHandlers().checkAndCreateIntersectionsWithAll();this.receiver.canvas.triggerPortChangeEvent(b);return this};a.prototype.redo=function(){this.execute();return this};PMUI.extendNamespace("PMUI.command.CommandReconnect",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.before={x:this.receiver.getOldX(),y:this.receiver.getOldY(),width:this.receiver.getOldWidth(),height:this.receiver.getOldHeight()};this.after={x:this.receiver.getX(),y:this.receiver.getY(),width:this.receiver.getWidth(),height:this.receiver.getHeight()}};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandResize";a.prototype.execute=function(){var b=this.receiver,a=b.getCanvas();b.setPosition(this.after.x,this.after.y).setDimension(this.after.width,
this.after.height);b.fixConnectionsOnResize(b.resizing,!0);a.triggerDimensionChangeEvent(b,this.before.width,this.before.height,this.after.width,this.after.height);(this.after.x!==this.before.x||this.after.y!==this.before.y)&&a.triggerPositionChangeEvent([b],[{x:this.before.x,y:this.before.y}],[{x:this.after.x,y:this.after.y}]);return this};a.prototype.undo=function(){var b=this.receiver,a=b.getCanvas();b.setPosition(this.before.x,this.before.y).setDimension(this.before.width,this.before.height);
b.fixConnectionsOnResize(b.resizing,!0);a.triggerDimensionChangeEvent(b,this.after.width,this.after.height,this.before.width,this.before.height);(this.after.x!==this.before.x||this.after.y!==this.before.y)&&a.triggerPositionChangeEvent([b],[{x:this.after.x,y:this.after.y}],[{x:this.before.x,y:this.before.y}]);return this};a.prototype.redo=function(){this.execute();return this};PMUI.extendNamespace("PMUI.command.CommandResize",a)})();
(function(){var a=function(b,f){a.superclass.call(this,b);this.oldPoints=[];this.newPoints=[];a.prototype.initObject.call(this,f)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandResize";a.prototype.initObject=function(b){var a={oldPoints:[],newPoints:[]},c;$.extend(!0,a,b);this.oldPoints=[];for(b=0;b<a.oldPoints.length;b+=1)c=a.oldPoints[b],this.oldPoints.push(new PMUI.util.Point(c.x,c.y));this.newPoints=[];for(b=0;b<a.newPoints.length;b+=1)c=a.newPoints[b],this.newPoints.push(new PMUI.util.Point(c.x,
c.y))};a.prototype.common=function(b){var a=this.receiver;$(a.destDecorator.getHTML()).trigger("click");a.hidePortsAndHandlers();a.disconnect(!0).connect({algorithm:"user",points:this[b]});a.setSegmentMoveHandlers();a.checkAndCreateIntersectionsWithAll();a.showPortsAndHandlers();a.canvas.triggerConnectionStateChangeEvent(a);return this};a.prototype.execute=function(){this.common("newPoints");return this};a.prototype.undo=function(){this.common("oldPoints");return this};a.prototype.redo=function(){this.execute();
return this};PMUI.extendNamespace("PMUI.command.CommandSegmentMove",a)})();
(function(){PMUI.extendNamespace("PMUI.command.CommandStack",function(a,b){function f(){}var c,d,e;c=[];d=[];e=a||20;b&&"[object Function]"==={}.toString.call(b)&&(f=b);return{add:function(b){d=[];c.push(b);c.length>e&&c.shift();f()},addToRedo:function(b){d.push(b)},undo:function(){var b;if(0===c.length)return console.log("undo(): can't undo because there are no actions to undo"),!1;b=c.pop();b.undo();d.unshift(b);f();return!0},redo:function(){var b;if(0===d.length)return console.log("redo(): can't redo because there are no actions to redo"),
!1;b=d.shift();b.redo();c.push(b);f();return!0},clearStack:function(){console.log("CommandStack.clearStack(): WARNING - clearing the stacks");d=[];c=[]},debug:function(b){var a;console.log("Debugging command stack:");console.log("Undo stack size: "+c.length);if(b)for(a=0;a<c.length;a+=1)console.log(a+1+") "+c[a].type);console.log("Redo stack size: "+d.length);if(b)for(a=0;a<d.length;a+=1)console.log(a+1+") "+d[a].type)},getRedoSize:function(){return d.length},getUndoSize:function(){return c.length},
setHandler:function(b){b&&"[object Function]"==={}.toString.call(b)&&(f=b);return this}}})})();
(function(){var a=function(b){a.superclass.call(this,b[0].shape);this.after=this.before=null;this.relatedShapes=[];a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.command.Command",a);a.prototype.type="CommandSwitchContainer";a.prototype.initObject=function(b){var a,c,d=[],e=[];for(a=0;a<b.length;a+=1)c=b[a],this.relatedShapes.push(c.shape),d.push({parent:c.shape.parent,x:c.shape.getOldX(),y:c.shape.getOldY(),topLeft:!0}),e.push({parent:c.container,x:c.x,y:c.y,topLeft:c.topLeft});this.before=
{shapes:d};this.after={shapes:e}};a.prototype.execute=function(){var b,a;for(b=0;b<this.relatedShapes.length;b+=1)a=this.relatedShapes[b],this.before.shapes[b].parent.swapElementContainer(a,this.after.shapes[b].parent,this.after.shapes[b].x,this.after.shapes[b].y,this.after.shapes[b].topLeft),a.refreshChildrenPositions().refreshConnections();this.canvas.triggerParentChangeEvent(this.relatedShapes,this.before.shapes,this.after.shapes)};a.prototype.undo=function(){var b,a;for(b=0;b<this.relatedShapes.length;b+=
1)a=this.relatedShapes[b],this.before.shapes[b].parent.swapElementContainer(a,this.before.shapes[b].parent,this.before.shapes[b].x,this.before.shapes[b].y,this.before.shapes[b].topLeft),a.refreshChildrenPositions().refreshConnections();this.canvas.triggerParentChangeEvent(this.relatedShapes,this.after.shapes,this.before.shapes)};a.prototype.redo=function(){this.execute()};PMUI.extendNamespace("PMUI.command.CommandSwitchContainer",a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.sharedConnections=this.currentSelection=this.connections=this.regularShapes=this.customShapes=this.html=null;this.topScroll=this.leftScroll=0;this.verticalSnapper=this.horizontalSnapper=this.multipleSelectionHelper=this.connectionSegment=this.oldCurrentConnection=this.currentConnection=null;this.zoomFactor=1;this.zoomPropertiesIndex=2;this.zOrder=0;this.isMouseDown=!1;this.currentShape=null;this.draggingASegmentHandler=this.multipleDrop=
this.isMouseDownAndMove=!1;this.updatedElement=null;this.rightClick=!1;this.commandStack=this.currentLabel=this.intersectionTimeout=null;this.shapesToCopy=[];this.connectionsToCopy=[];this.readOnly=!1;this.readOnlyLayer=null;this.copyAndPasteReferences={};this.prevZoom=1;this.dummyLabelInitializer=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.BehavioralElement",a);a.prototype.type="Canvas";a.prototype.family="Canvas";a.prototype.init=function(b){var a;a={x:0,y:0,width:4E3,height:4E3,
copyAndPasteReferences:b&&b.copyAndPasteReferences||{},readOnly:!1};jQuery.extend(!0,a,b);b&&(this.children=new PMUI.util.ArrayList,this.customShapes=new PMUI.util.ArrayList,this.regularShapes=new PMUI.util.ArrayList,this.connections=new PMUI.util.ArrayList,this.currentSelection=new PMUI.util.ArrayList,this.sharedConnections=new PMUI.util.ArrayList,this.commandStack=new PMUI.command.CommandStack(20),this.multipleSelectionHelper=new PMUI.draw.MultipleSelectionContainer({canvas:this,x:a.absoluteX,y:a.absoluteY}),
this.copyAndPasteReferences=a.copyAndPasteReferences,this.setShapeFactory(a.shapeFactory),this.setPosition(a.x,a.y).setDimension(a.width,a.height).setCanvas(this),this.horizontalSnapper=new PMUI.draw.Snapper({orientation:"horizontal",canvas:this}),this.verticalSnapper=new PMUI.draw.Snapper({orientation:"vertical",canvas:this}),a.absoluteX&&(this.absoluteX=a.absoluteX),a.absoluteY&&(this.absoluteY=a.absoluteY),a.readOnly&&this.setToReadOnly())};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);
this.addElement(this.multipleSelectionHelper,0,0,!0);return this.html};a.prototype.setReadOnly=function(b){b?this.setToReadOnly():this.unsetReadOnly();return this};a.prototype.setToReadOnly=function(){var b=this.readOnlyLayer;if(!b||!b.html)this.readOnlyLayer=new PMUI.draw.ReadOnlyLayer({width:this.width,height:this.height});this.html.appendChild(this.readOnlyLayer.html);this.readOnly=!0;return this};a.prototype.unsetReadOnly=function(){this.html.removeChild(this.readOnlyLayer.getHTML());this.readOnly=
!1;return this};a.prototype.setPosition=function(b,a){this.setX(b);this.setY(a);return this};a.prototype.setX=function(b){this.x=this.zoomX=b;this.absoluteX=0;return this};a.prototype.setY=function(b){this.y=this.zoomY=b;this.absoluteY=0;return this};a.prototype.createHTMLDiv=function(){return document.getElementById(this.id)};a.prototype.shapeFactory=function(b){return null};a.prototype.addToList=function(b){switch(b.family){case "CustomShape":this.customShapes.contains(b)||this.customShapes.insert(b);
break;case "RegularShape":this.regularShapes.contains(b)||this.regularShapes.insert(b)}return this};a.prototype.hideCurrentConnection=function(){this.currentConnection&&(this.currentConnection.hidePortsAndHandlers(),this.currentConnection=null);return this};a.prototype.applyZoom=function(b){var a;0<b&&(b-=1,this.prevZoom=this.zoomPropertiesIndex,this.zoomPropertiesIndex=b,this.zoomFactor=(25*b+50)/100);for(b=0;b<this.customShapes.getSize();b+=1)a=this.customShapes.get(b),a.applyZoom(),a.paint();for(b=
0;b<this.regularShapes.getSize();b+=1)a=this.regularShapes.get(b),a.applyZoom(),a.paint();return this};a.prototype.addConnection=function(b){this.html.appendChild(b.getHTML());this.connections.insert(b);this.updatedElement=b;return this};a.prototype.removeElements=function(){var b;b=new PMUI.command.CommandDelete(this);this.commandStack.add(b);b.execute();return this};a.prototype.moveAllChildConnections=function(b){var a,c,d,e;if(null!==b.child)for(a=0;a<b.children.getSize();a+=1){c=b.children.get(a);
c.setPosition(c.x,c.y);for(d=0;d<c.getPorts().getSize();d+=1)e=c.getPorts().get(d),e.setPosition(e.x,e.y),e.connection.disconnect(),e.connection.connect();this.moveAllChildConnections(c)}return this};a.prototype.moveElements=function(b,a,c){var d,e,g,h=0,k=0,l,m=[];switch(a){case "LEFT":h=-1;break;case "RIGHT":h=1;break;case "TOP":k=-1;break;case "BOTTOM":k=1}for(d=0;d<b.getCurrentSelection().getSize();d+=1)if(a=!0,g=b.getCurrentSelection().get(d),m.push(g),c&&("function"===typeof c&&!c(g))&&(a=!1),
a){g.oldX=g.x;g.oldY=g.y;g.oldAbsoluteX=g.absoluteX;g.oldAbsoluteY=g.absoluteY;g.setPosition(g.getX()+h,g.getY()+k);g.changePosition(g.oldX,g.oldY,g.oldAbsoluteX,g.oldAbsoluteY);for(e=0;e<g.ports.getSize();e+=1)l=g.ports.get(e),l.setPosition(l.x,l.y),l.connection.disconnect().connect();this.moveAllChildConnections(g)}clearTimeout(this.intersectionTimeout);this.intersectionTimeout=window.setTimeout(function(b){var a=[];b=b||[];for(d=0;d<b.length;d+=1)g=b[d],a.push(g);for(;0<a.length;){g=a.pop();for(d=
0;d<g.getChildren().getSize();d+=1)a.push(g.getChildren().get(d));for(e=0;e<g.ports.getSize();e+=1)l=g.ports.get(e),l.connection.disconnect().connect(),l.connection.setSegmentMoveHandlers(),l.connection.checkAndCreateIntersectionsWithAll()}},1E3,m);return this};a.prototype.removeFromList=function(b){this.currentSelection.remove(b);"CustomShape"===b.family?this.customShapes.remove(b):"RegularShape"===b.family&&this.regularShapes.remove(b);return this};a.prototype.fixSnapData=function(){this.horizontalSnapper.createSnapData();
this.verticalSnapper.createSnapData();this.horizontalSnapper.sortData();this.verticalSnapper.sortData();return this};a.prototype.showOrHideSnappers=function(b){var a=this.horizontalSnapper,c=this.verticalSnapper,d=b.getAbsoluteX(),e=b.getAbsoluteY(),g=b.getZoomHeight();b=b.getZoomHeight();a.binarySearch(e)?(a.setPosition(this.getLeftScroll()/this.zoomFactor,e/this.zoomFactor),a.show()):a.binarySearch(e+b)?(a.setPosition(this.getLeftScroll()/this.zoomFactor,(e+b)/this.zoomFactor),a.show()):a.hide();
c.binarySearch(d)?(c.setPosition(d/this.zoomFactor,this.getTopScroll()/this.zoomFactor),c.show()):c.binarySearch(d+g)?(c.setPosition((d+g)/this.zoomFactor,this.getTopScroll()/this.zoomFactor),c.show()):c.hide();return this};a.prototype.emptyCurrentSelection=function(){for(var b;0<this.currentSelection.getSize();)b=this.currentSelection.get(0),this.removeFromSelection(b);this.sharedConnections.clear();return this};a.prototype.isValidSelection=function(b,a){return null===b.parent?null===a.parent:null===
a.parent?!1:a.parent.id===b.parent.id};a.prototype.addToSelection=function(b){var a=this.currentSelection,c;a.isEmpty()?c=!0:(c=a.get(0),c=this.isValidSelection(c,b));!a.contains(b)&&c&&(b.increaseZIndex(),a.insert(b),"CustomShape"===b.family&&this.addToSharedConnections(b),b.selected=!0,b.showOrHideResizeHandlers(!0));return this};a.prototype.removeFromSelection=function(b){b.decreaseZIndex();this.removeFromSharedConnections(b);this.currentSelection.remove(b);b.selected=!1;b.showOrHideResizeHandlers(!1);
return this};a.prototype.removeFromSharedConnections=function(b){var a,c,d=this.sharedConnections;for(a=0;a<b.getChildren().getSize();a+=1)c=b.getChildren().get(a),this.removeFromSharedConnections(c);if(b.ports)for(a=0;a<b.ports.getSize();a+=1)c=b.ports.get(a).connection,d.find("id",c.getID())&&this.sharedConnections.remove(c);return this};a.prototype.findAncestorInCurrentSelection=function(b){return this.currentSelection.find("id",b.getID())?!0:!b.parent?!1:this.findAncestorInCurrentSelection(b.parent)};
a.prototype.addToSharedConnections=function(b){var a,c,d,e,g=this.sharedConnections;for(a=0;a<b.getChildren().getSize();a+=1)c=b.getChildren().get(a),this.addToSharedConnections(c);if(b.ports)for(a=0;a<b.ports.getSize();a+=1)c=b.ports.get(a).connection,d=c.srcPort.parent,e=c.destPort.parent,this.findAncestorInCurrentSelection(d)&&(this.findAncestorInCurrentSelection(e)&&!g.find("id",c.getID()))&&g.insert(c);return this};a.prototype.removeConnection=function(b){this.connections.remove(b);return this};
a.prototype.attachListeners=function(){var b=$(this.html).click(this.onClick(this)),a=b.parent();b.mousedown(this.onMouseDown(this));a.scroll(this.onScroll(this,a));b.mousemove(this.onMouseMove(this));b.mouseup(this.onMouseUp(this));b.on("createelement",this.onCreateElement(this));b.on("removeelement",this.onRemoveElement(this));b.on("changeelement",this.onChangeElement(this));b.on("selectelement",this.onSelectElement(this));b.on("rightclick",this.onRightClick(this));b.on("contextmenu",function(b){b.preventDefault()});
this.updateBehaviors();return this};a.prototype.onCreateElementHandler=function(b){};a.prototype.onCreateElement=function(b){return function(a,c){b.onCreateElementHandler(b.updatedElement)}};a.prototype.onRemoveElementHandler=function(b){return!0};a.prototype.onRemoveElement=function(b){return function(a,c){b.onRemoveElementHandler(b.updatedElement.relatedElements)}};a.prototype.onChangeElementHandler=function(b){};a.prototype.onChangeElement=function(b){return function(a,c){b.onChangeElementHandler(b.updatedElement)}};
a.prototype.onSelectElementHandler=function(b){};a.prototype.onSelectElement=function(b){return function(a,c){b.onSelectElementHandler(b.updatedElement)}};a.prototype.onRightClickHandler=function(b,a){};a.prototype.onRightClick=function(b){return function(a,c,d){a=b.relativePoint(c);b.updatedElement=d;b.onRightClickHandler(b.updatedElement,{canvas:a,page:{x:c.pageX,y:c.pageY}})}};a.prototype.onClick=function(b){return function(a,c){var d=b.currentLabel;d&&(d.loseFocus(),$(d.textField).focusout())}};
a.prototype.onMouseDown=function(b){return function(a,c){var d=a.pageX-b.getX()+b.getLeftScroll()-b.getAbsoluteX(),e=a.pageY-b.getY()+b.getTopScroll()-b.getAbsoluteY();a.preventDefault();3===a.which&&(b.rightClick=!0,$(b.html).trigger("rightclick",[a,b]));b.isMouseDown=!0;b.isMouseDownAndMove=!1;b.draggingASegmentHandler||(b.emptyCurrentSelection(),b.hideCurrentConnection(),b.multipleSelectionHelper.reset(),b.multipleSelectionHelper.setPosition(d/b.zoomFactor,e/b.zoomFactor),b.multipleSelectionHelper.oldX=
d,b.multipleSelectionHelper.oldY=e,b.multipleSelectionHelper.setVisible(!0),b.multipleSelectionHelper.changeOpacity(0.2))}};a.prototype.onMouseMove=function(b){return function(a,c){if(b.isMouseDown&&!b.rightClick){b.isMouseDownAndMove=!0;var d=a.pageX-b.getX()+b.getLeftScroll()-b.getAbsoluteX(),e=a.pageY-b.getY()+b.getTopScroll()-b.getAbsoluteY(),g,h;g=Math.min(d,b.multipleSelectionHelper.oldX);h=Math.min(e,b.multipleSelectionHelper.oldY);d=Math.max(d,b.multipleSelectionHelper.oldX);e=Math.max(e,
b.multipleSelectionHelper.oldY);b.multipleSelectionHelper.setPosition(g/b.zoomFactor,h/b.zoomFactor);b.multipleSelectionHelper.setDimension((d-g)/b.zoomFactor,(e-h)/b.zoomFactor)}}};a.prototype.onMouseUp=function(b){return function(a,c){if(b.isMouseDownAndMove){var d=b.relativePoint(a),e=d.x,d=d.y;b.multipleSelectionHelper.setPosition(Math.min(e,b.multipleSelectionHelper.zoomX)/b.zoomFactor,Math.min(d,b.multipleSelectionHelper.zoomY)/b.zoomFactor);b.multipleSelectionHelper&&b.multipleSelectionHelper.wrapElements()}else if(b.multipleSelectionHelper.wasDragged||
b.multipleSelectionHelper.reset().setVisible(!1),b.isMouseDown)b.onClickHandler(b,e,d);b.isMouseDown=!1;b.isMouseDownAndMove=!1;b.rightClick=!1}};a.prototype.onClickHandler=function(){};a.prototype.onScroll=function(b,a){return function(c,d){b.setLeftScroll(a.scrollLeft()).setTopScroll(a.scrollTop())}};a.prototype.triggerSelectEvent=function(b){var a,c=[],d;for(a=0;a<b.length;a+=1)d=b[a],c.push({id:d.id,type:d.type,relatedObject:d});this.updatedElement=c;$(this.html).trigger("selectelement");return this};
a.prototype.triggerRightClickEvent=function(b){this.updatedElement={id:b.id,type:b.type,relatedObject:b};$(this.html).trigger("rightclick");return this};a.prototype.triggerCreateEvent=function(b,a){this.updatedElement={id:b&&b.id||null,type:b&&b.type||null,relatedObject:b,relatedElements:a};$(this.html).trigger("createelement");return this};a.prototype.triggerRemoveEvent=function(b,a){this.updatedElement={id:b&&b.id||null,type:b&&b.type||null,relatedObject:b,relatedElements:a};$(this.html).trigger("removeelement");
return this};a.prototype.triggerDimensionChangeEvent=function(b,a,c,d,e){this.updatedElement=[{id:b.id,type:b.type,fields:[{field:"width",oldVal:a,newVal:d},{field:"height",oldVal:c,newVal:e}],relatedObject:b}];$(this.html).trigger("changeelement");return this};a.prototype.triggerPortChangeEvent=function(b){this.updatedElement=[{id:b.getID(),type:b.type,fields:[{field:"x",oldVal:b.getOldX(),newVal:b.getX()},{field:"y",oldVal:b.getOldY(),newVal:b.getY()},{field:"parent",oldVal:b.getOldParent().getID(),
newVal:b.getParent().getID()},{field:"state",oldVal:b.connection.getOldPoints(),newVal:b.connection.savePoints()&&b.connection.getPoints()}],relatedObject:b}];console.log("port change!");$(this.html).trigger("changeelement");return this};a.prototype.triggerConnectionStateChangeEvent=function(b){var a=[],c=PMUI.util.Point,d,e;b.savePoints();for(e=0;e<b.points.length;e+=1)d=b.points[e],a.push(new c(d.x/this.zoomFactor,d.y/this.zoomFactor));this.updatedElement=[{id:b.getID(),type:b.type,fields:[{field:"state",
oldVal:b.getOldPoints(),newVal:a}],relatedObject:b}];$(this.html).trigger("changeelement");return this};a.prototype.triggerPositionChangeEvent=function(b,a,c){var d,e=[];for(d=0;d<b.length;d+=1)e.push({id:b[d].getID(),type:b[d].type,fields:[{field:"x",oldVal:a[d].x,newVal:c[d].x},{field:"y",oldVal:a[d].y,newVal:c[d].y}],relatedObject:b[d]});this.updatedElement=e;$(this.html).trigger("changeelement");return this};a.prototype.triggerTextChangeEvent=function(b,a,c){this.updatedElement=[{id:b.id,type:b.type,
parent:b.parent,fields:[{field:"message",oldVal:a,newVal:c}],relatedObject:b}];$(this.html).trigger("changeelement");return this};a.prototype.triggerParentChangeEvent=function(b,a,c){var d,e=[];for(d=0;d<b.length;d+=1)e.push({id:b[d].getID(),type:b[d].type,fields:[{field:"parent",oldParent:a[d].parent,newVal:c[d].parent},{field:"x",oldVal:a[d].x,newVal:c[d].x},{field:"y",oldVal:a[d].y,newVal:c[d].y}],relatedObject:b[d]});this.updatedElement=e;$(this.html).trigger("changeelement");return this};a.prototype.setTopScroll=
function(b){this.topScroll=b;return this};a.prototype.setLeftScroll=function(b){this.leftScroll=b;return this};a.prototype.setZoomFactor=function(b){"number"===typeof b&&(0===b%25&&0<b)&&(this.zoomFactor=b);return this};a.prototype.setCurrentConnection=function(b){"Connection"===b.type&&(this.currentConnection=b);return this};a.prototype.setShapeFactory=function(b){a.prototype.shapeFactory=b;return this};a.prototype.getZoomFactor=function(){return this.zoomFactor};a.prototype.getZoomPropertiesIndex=
function(){return this.zoomPropertiesIndex};a.prototype.getConnectionSegment=function(){return this.connectionSegment};a.prototype.getLeftScroll=function(){return this.leftScroll};a.prototype.getTopScroll=function(){return this.topScroll};a.prototype.getCurrentConnection=function(){return this.currentConnection};a.prototype.getCurrentSelection=function(){return this.currentSelection};a.prototype.getConnections=function(){return this.connections};a.prototype.getSharedConnections=function(){return this.sharedConnections};
a.prototype.getCustomShapes=function(){return this.customShapes};a.prototype.getRegularShapes=function(){return this.regularShapes};a.prototype.getMultipleSelectionHelper=function(){return this.multipleSelectionHelper};a.prototype.getHorizontalSnapper=function(){return this.horizontalSnapper};a.prototype.getVerticalSnapper=function(){return this.verticalSnapper};a.prototype.getUpdatedElement=function(){return this.updatedElement};a.prototype.isResizable=function(){return!1};a.prototype.getCanvas=
function(){return this};a.prototype.undo=function(){this.commandStack.undo();return this};a.prototype.redo=function(){this.commandStack.redo();return this};a.prototype.stringify=function(){var b,a=[],c=[],d=[];for(b=0;b<this.customShapes.getSize();b+=1)a.push(this.customShapes.get(b).stringify());for(b=0;b<this.regularShapes.getSize();b+=1)c.push(this.regularShapes.get(b).stringify());for(b=0;b<this.connections.getSize();b+=1)d.push(this.connections.get(b).stringify());b=(void 0).prototype.stringify.call(this);
$.extend(!0,b,{customShapes:a,regularShapes:c,connections:d});return b};a.prototype.addToShapesToCopy=function(b){var a,c;a=b.stringify();a.extendedType=b.extendedType;this.shapesToCopy.push(a);for(a=0;a<b.getChildren().getSize();a+=1)c=b.getChildren().get(a),this.addToShapesToCopy(c);return this};a.prototype.copy=function(){var b,a;this.shapesToCopy=[];for(b=0;b<this.getCurrentSelection().getSize();b+=1)a=this.getCurrentSelection().get(b),this.addToShapesToCopy(a);this.connectionsToCopy=[];for(b=
0;b<this.getSharedConnections().getSize();b+=1)a=this.getSharedConnections().get(b),this.connectionsToCopy.push(a.stringify());return this};a.prototype.paste=function(){this.parse({shapes:this.shapesToCopy,connections:this.connectionsToCopy,createCommand:!0,uniqueID:!0,selectAfterFinish:!0,prependMessage:"Copy of ",diffX:100,diffY:100});return this};a.prototype.shapeFactory=function(b,a){return this.copyAndPasteReferences[b]?new this.copyAndPasteReferences[b](a):new PMUI.draw.CustomShape(a)};a.prototype.connectionFactory=
function(b,a){return b&&this.copyAndPasteReferences[b]?new this.copyAndPasteReferences[b](a):new PMUI.draw.Connection(a)};a.prototype.transformToTree=function(b){var a={},c,d;for(d=0;d<b.length;d+=1)c=b[d],a[c.id]||(a[c.id]=[]),c.parent&&(a[c.parent]||(a[c.parent]=[]),a[c.parent][c.order]=c.id);return a};a.prototype.levelOrderTraversal=function(b,a){var c=[],d=[],e;e=a||this.getID();var g;for(c.push(e);0<c.length;){e=c.shift();d.push(e);for(g=0;g<b[e].length;g+=1)c.push(b[e][g])}return d};a.prototype.parse=
function(b){var a={shapes:[],connections:[],uniqueID:!1,selectAfterFinish:!1,prependMessage:"",createCommand:!0,diffX:0,diffY:0},c,d,e,g,h,k,l,m,n,p,q,t=[],u=[];e=this.getID();var s={},r={};$.extend(!0,a,b);p=a.diffX;q=a.diffY;r[e]=this;s[e]=e;a.selectAfterFinish&&this.emptyCurrentSelection();for(b=0;b<a.shapes.length;b+=1){g={};$.extend(!0,g,a.shapes[b]);g.canvas=this;c=g.id;a.uniqueID&&(g.id=PMUI.generateUniqueId());s[c]=g.id;if(g.labels)for(c=0;c<g.labels.length;c+=1)g.labels[c].message=a.prependMessage+
g.labels[c].message;c=this.shapeFactory(g.extendedType,g);r[g.id]=c;s[g.parent]?g.parent!==e?r[s[g.parent]].addElement(c,g.x,g.y,!0):r[s[g.parent]].addElement(c,g.x+p,g.y+q,!0):this.addElement(c,g.x+p,g.y+q,!0);c.parseHook();c.attachListeners();k=new PMUI.command.CommandCreate(c);k.execute();t.push(k)}for(b=0;b<a.connections.length;b+=1)g={},$.extend(!0,g,a.connections[b]),e=g.state||[],c=g.srcPort,k=r[s[c.parent]],h=k.getBorderConsideringLayers(),l=g.destPort,m=r[s[l.parent]],n=m.getBorderConsideringLayers(),
0===e.length&&(e.push({x:c.x+k.getAbsoluteX(),y:c.y+k.getAbsoluteY()}),e.push({x:l.x+m.getAbsoluteX(),y:l.y+m.getAbsoluteY()})),c=new PMUI.draw.Port({width:8,height:8}),l=new PMUI.draw.Port({width:8,height:8}),k.addPort(c,e[0].x+p+h-k.getAbsoluteX(),e[0].y+p+h-k.getAbsoluteY()),m.addPort(l,e[e.length-1].x+p+n-m.getAbsoluteX(),e[e.length-1].y+q+n-m.getAbsoluteY(),!1,c),h=this.connectionFactory(g.type,{srcPort:c,destPort:l,canvas:this,segmentStyle:g.segmentStyle}),h.id=g.id||PMUI.generateUniqueId(),
a.uniqueID&&(h.id=PMUI.generateUniqueId()),h.setSrcDecorator(new PMUI.draw.ConnectionDecorator({width:11,height:11,canvas:this,decoratorPrefix:g.srcDecoratorPrefix,decoratorType:"source",parent:h})),h.setDestDecorator(new PMUI.draw.ConnectionDecorator({width:11,height:11,canvas:this,decoratorPrefix:g.destDecoratorPrefix,decoratorType:"target",parent:h})),k=new PMUI.command.CommandConnect(h),u.push(k),3<=e.length?h.connect({algorithm:"user",points:g.state,dx:a.diffX,dy:a.diffY}):h.connect(),h.setSegmentMoveHandlers(),
this.addConnection(h),h.checkAndCreateIntersectionsWithAll(),c.attachListeners(c),l.attachListeners(l),this.triggerCreateEvent(h,[]);if(a.selectAfterFinish)for(d in r)r.hasOwnProperty(d)&&"Canvas"!==r[d].family&&this.addToSelection(r[d]);a.createCommand&&this.commandStack.add(new PMUI.command.CommandPaste(this,{stackCommandCreate:t,stackCommandConnect:u}));return this};a.prototype.getRelativeX=function(){return this.x+this.absoluteX};a.prototype.getRelativeY=function(){return this.y+this.absoluteY};
PMUI.extendNamespace("PMUI.draw.Canvas",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.xCorners=[0,0,0,0];this.yCorners=[0,0,0,0];this.xMidPoints=[0,0,0,0];this.yMidPoints=[0,0,0,0];this.cornerResizeHandlers=new PMUI.util.ArrayList;this.midResizeHandlers=new PMUI.util.ArrayList;this.oldParent=this.parent=this.center=null;this.defaultZOrder=1;this.entered=this.wasDragged=this.dragging=!1;this.resize=null;this.repainted=this.resizing=!1;this.fixed=!0;this.topLeftOnCreation=this.changedContainer=!1;a.prototype.init.call(this,
b)};PMUI.inheritFrom("PMUI.draw.BehavioralElement",a);a.prototype.type="Shape";a.prototype.family="Shape";a.prototype.noDragBehavior=null;a.prototype.regularDragBehavior=null;a.prototype.connectionDragBehavior=null;a.prototype.customShapeDragBehavior=null;a.prototype.cornersIdentifiers=["nw","ne","se","sw"];a.prototype.midPointIdentifiers=["n","e","s","w"];a.prototype.MAX_ZINDEX=100;a.prototype.DEFAULT_RADIUS=6;a.prototype.init=function(b){var a={topLeft:!1,resizeBehavior:"no",resizeHandlers:{type:"None",
total:4,resizableStyle:{cssProperties:{"background-color":"rgb(0, 255, 0)",border:"1px solid black"}},nonResizableStyle:{cssProperties:{"background-color":"white",border:"1px solid black"}}},drag:"disabled"};$.extend(!0,a,b);"disabled"!==a.drag?this.setDragBehavior(a.drag):this.setDragBehavior("nodrag");this.setResizeBehavior(a.resizeBehavior);this.createHandlers(a.resizeHandlers.type,a.resizeHandlers.total,a.resizeHandlers.resizableStyle,a.resizeHandlers.nonResizableStyle);this.topLeftOnCreation=
a.topLeft};a.prototype.createHandlers=function(b,a,c,d){if("Rectangle"===b){if(!a||8!==a&&4!==a&&0!==a)a=4;for(b=0;b<a&&4>b;b+=1)this.cornerResizeHandlers.insert(new PMUI.draw.ResizeHandler({parent:this,zOrder:PMUI.util.Style.MAX_ZINDEX+3,representation:new PMUI.draw.Rectangle,orientation:this.cornersIdentifiers[b],resizableStyle:c,nonResizableStyle:d}));a-=4;for(b=0;b<a;b+=1)this.midResizeHandlers.insert(new PMUI.draw.ResizeHandler({parent:this,zOrder:PMUI.util.Style.MAX_ZINDEX+3,representation:new PMUI.draw.Rectangle,
orientation:this.midPointIdentifiers[b],resizableStyle:c,nonResizableStyle:d}))}return this};a.prototype.updateHandlers=function(){var b,a;for(a=0;a<this.cornerResizeHandlers.getSize();a+=1)b=this.cornerResizeHandlers.get(a),b.setPosition(this.xCorners[a]-Math.round(b.width/2)-1,this.yCorners[a]-Math.round(b.height/2)-1);for(a=0;a<this.midResizeHandlers.getSize();a+=1)b=this.midResizeHandlers.get(a),b.setPosition(this.xMidPoints[a]-Math.round(b.width/2)-1,this.yMidPoints[a]-Math.round(b.height/2)-
1);return this};a.prototype.showOrHideResizeHandlers=function(b){var a;b||(b=!1);for(a=0;a<this.cornerResizeHandlers.getSize();a+=1)this.cornerResizeHandlers.get(a).setVisible(b);for(a=0;a<this.midResizeHandlers.getSize();a+=1)this.midResizeHandlers.get(a).setVisible(b);return this};a.prototype.applyStyleToHandlers=function(b){var a;for(a=0;a<this.cornerResizeHandlers.getSize();a+=1)this.cornerResizeHandlers.get(a)[b].applyStyle();for(a=0;a<this.midResizeHandlers.getSize();a+=1)this.midResizeHandlers.get(a)[b].applyStyle();
return this};a.prototype.attachListeners=function(){var b=$(this.html);b.on("mousedown",this.onMouseDown(this));b.on("mouseup",this.onMouseUp(this));b.on("click",this.onClick(this));this.updateBehaviors();return this};a.prototype.onMouseDown=function(b){return function(b,a){}};a.prototype.onMouseUp=function(b){return function(b,a){}};a.prototype.onClick=function(b){return function(b,a){}};a.prototype.createHTML=function(){var b;a.superclass.prototype.createHTML.call(this);for(b=0;b<this.cornerResizeHandlers.getSize();b+=
1)this.addResizeHandler(this.cornerResizeHandlers.get(b),this.xCorners[b],this.yCorners[b]);for(b=0;b<this.midResizeHandlers.getSize();b+=1)this.addResizeHandler(this.midResizeHandlers.get(b),this.xMidPoints[b],this.yMidPoints[b]);return this.html};a.prototype.isDraggable=function(){return this.drag&&"NoDragBehavior"!==this.drag.type};a.prototype.updateBehaviors=function(){a.superclass.prototype.updateBehaviors.call(this);this.drag&&this.drag.attachDragBehavior(this);this.resize&&this.resize.init(this);
return this};a.prototype.addResizeHandler=function(b,a,c){if(this.html)return this.html.appendChild(b.getHTML()),b.setPosition(a-Math.round(b.width/2)-1,c-Math.round(b.height/2)-1),b.setCategory("resizable"),this};a.prototype.paint=function(){var b;for(b=0;b<this.cornerResizeHandlers.getSize();b+=1)this.cornerResizeHandlers.get(b).paint();for(b=0;b<this.midResizeHandlers.getSize();b+=1)this.midResizeHandlers.get(b).paint();this.resizeBehavior&&(b="NoResizeBehavior"===this.resizeBehavior.type?"nonResizableStyle":
"resizableStyle",this.applyStyleToHandlers(b));return this};a.prototype.updateHTML=function(){return this};a.prototype.saveAndDestroy=function(){this.html=$(this.html).detach()[0];this.canvas.removeFromList(this);return this};a.prototype.updateSize=function(b){var a=this.children.getDimensionLimit(),c=a[3],d=a[0],e=a[1],a=a[2],g=this.getX(),h=this.getY(),k=this.getWidth(),l=this.getHeight(),m=0,n=0,p=!1,q=!1;b="undefined"!==b?b:15;0>c&&(m=b-c,p=!0,this.oldAbsoluteX=this.oldX=this.x,this.oldY=this.y,
this.oldAbsoluteY=this.absoluteY);0>d&&(n=b-d,p=!0,this.oldAbsoluteX=this.oldX=this.x,this.oldY=this.y,this.oldAbsoluteY=this.absoluteY);k+=m;l+=n;e>this.width&&(k+=e-this.width+b,q=!0,this.oldWidth=this.width);a>this.height&&(l+=a-this.height+b,q=!0,this.oldHeight=this.height);this.setPosition(g-m,h-n);this.setDimension(k,l);p&&this.changePosition(this.oldX,this.oldY,this.absoluteX,this.absoluteY);q&&this.changeSize(this.oldWidth,this.oldHeight);this.updateChildrenPosition(m,n);return this};a.prototype.applyZoom=
function(){this.refreshShape();return this};a.prototype.setDimension=function(b,f){a.superclass.prototype.setDimension.call(this,b,f);this.xCorners&&(this.xCorners=[0,Math.round(this.zoomWidth),Math.round(this.zoomWidth),0],this.yCorners=[0,0,Math.round(this.zoomHeight),Math.round(this.zoomHeight)],this.xMidPoints=[Math.round(this.zoomWidth/2),Math.round(this.zoomWidth),Math.round(this.zoomWidth/2),0],this.yMidPoints=[0,Math.round(this.zoomHeight/2),Math.round(this.zoomHeight),Math.round(this.zoomHeight/
2)],this.updateHandlers());return this};a.prototype.changeParent=function(b,a,c,d,e,g){g.updatedElement={id:this.id,type:this.type,fields:[{field:"x",oldVal:b,newVal:this.x},{field:"y",oldVal:a,newVal:this.y},{field:"absoluteX",oldVal:c,newVal:this.absoluteX},{field:"absoluteY",oldVal:d,newVal:this.absoluteY},{field:"parent",oldVal:e,newVal:this.parent}],relatedObject:this};$(g.html).trigger("changeelement");return this};a.prototype.changeSize=function(b,a){var c=this.canvas;c.updatedElement={id:this.id,
type:this.type,fields:[{field:"width",oldVal:b,newVal:this.width},{field:"height",oldVal:a,newVal:this.height}],relatedObject:this};$(c.html).trigger("changeelement");return this};a.prototype.changePosition=function(b,a,c,d){var e=this.canvas;e.updatedElement={id:this.id,type:this.type,fields:[{field:"x",oldVal:b,newVal:this.x},{field:"y",oldVal:a,newVal:this.y},{field:"absoluteX",oldVal:c,newVal:this.absoluteX},{field:"absoluteY",oldVal:d,newVal:this.absoluteY}],relatedObject:this};$(e.html).trigger("changeelement");
return this};a.prototype.setFixed=function(b){"boolean"===typeof b&&(this.fixed=b);return this};a.prototype.fixZIndex=function(b,a){var c,d,e,g;b.setZOrder(parseInt(b.parent.html.style.zIndex,10)+a+parseInt(b.defaultZOrder,10));for(c=0;c<b.children.getSize();c+=1)d=b.children.get(c),d.fixZIndex(d,0);if(b.ports)for(c=0;c<b.ports.getSize();c+=1)d=b.ports.get(c),e=d.connection.srcPort.parent,g=d.connection.destPort.parent,e=parseInt(e.html.style.zIndex,10),g=parseInt(g.html.style.zIndex,10),d.connection.style.addProperties({zIndex:Math.max(e+
1,g+1)});return this};a.prototype.increaseZIndex=function(){this.fixZIndex(this,PMUI.util.Style.MAX_ZINDEX);return this};a.prototype.decreaseZIndex=function(){this.fixZIndex(this,0);return this};a.prototype.increaseParentZIndex=function(b){"Canvas"!==b.family&&(b.style.addProperties({zIndex:parseInt(b.html.style.zIndex,10)+1}),b.increaseParentZIndex(b.parent));return this};a.prototype.decreaseParentZIndex=function(b){b&&"Canvas"!==b.family&&(b.style.addProperties({zIndex:parseInt(b.html.style.zIndex,
10)-1}),b.decreaseParentZIndex(b.parent));return this};a.prototype.setResizeBehavior=function(b){this.resize=(new PMUI.behavior.BehaviorFactory({products:{regularresize:PMUI.behavior.RegularResizeBehavior,Resize:PMUI.behavior.RegularResizeBehavior,yes:PMUI.behavior.RegularResizeBehavior,resize:PMUI.behavior.RegularResizeBehavior,noresize:PMUI.behavior.NoResizeBehavior,NoResize:PMUI.behavior.NoResizeBehavior,no:PMUI.behavior.NoResizeBehavior},defaultProduct:"noresize"})).make(b);this.html&&this.resize.init(this);
return this};a.prototype.isResizable=function(){return this.resize&&"NoResizeBehavior"!==this.resize.type};a.prototype.refreshShape=function(){this.setPosition(this.x,this.y).setDimension(this.width,this.height);return this};a.prototype.refreshConnections=function(){return this};a.prototype.refreshChildrenPositions=function(b){var a,c=this.children,d,e=[],g=[];for(a=0;a<c.getSize();a+=1)d=c.get(a),d.setPosition(d.getX(),d.getY()),b&&d.refreshConnections(!1),e.push(d),g.push({x:d.getX(),y:d.getY()}),
d.refreshChildrenPositions(b);this.canvas.triggerPositionChangeEvent(e,g,g);return this};a.prototype.fixConnectionsOnResize=function(b,a){var c,d,e;if(a){if(this.ports)for(c=0;c<this.ports.getSize();c+=1)d=this.ports.get(c),e=d.connection,this.recalculatePortPosition(d),e.disconnect().connect(),this.resizing||(e.setSegmentMoveHandlers(),e.checkAndCreateIntersectionsWithAll())}else if(this.ports)for(c=0;c<this.ports.getSize();c+=1)d=this.ports.get(c),e=d.connection,d.setPosition(d.x,d.y),e.disconnect().connect(),
this.resizing||(e.setSegmentMoveHandlers(),e.checkAndCreateIntersectionsWithAll());for(c=0;c<this.children.getSize();c+=1)d=this.children.get(c),d.setPosition(d.x,d.y),d.fixConnectionsOnResize(d.resizing,!1);return this};a.prototype.stringify=function(){var b=a.superclass.prototype.stringify.call(this);$.extend(!0,b,{resizeBehavior:this.savedOptions.resizeBehavior,resizeHandlers:{type:this.savedOptions.resizeHandlers&&this.savedOptions.resizeHandlers.type||"Rectangle",total:this.savedOptions.resizeHandlers&&
this.savedOptions.resizeHandlers.total||4}});return b};a.prototype.setCenter=function(b){if(b instanceof PMUI.util.Point)this.center=b;else throw Error("setCenter(): argument is not an instance of Point");return this};a.prototype.setParent=function(b,a){b&&(this.canvas&&a&&(this.canvas.updatedElement={id:this.id,type:this.type,fields:[{field:"parent",oldVal:this.parent,newVal:b}]},$(this.canvas.html).trigger("changeelement")),this.parent=b);return this};a.prototype.setOldParent=function(b){this.oldParent=
b;return this};a.prototype.getCenter=function(){return this.center};a.prototype.getParent=function(){return this.parent};a.prototype.getOldParent=function(){return this.oldParent};a.prototype.getHandlesIDs=function(){var b={},a;for(a=0;a<this.midPointIdentifiers.length;a+=1)b[this.midPointIdentifiers[a]]="#"+this.midPointIdentifiers[a]+this.id+"resizehandler";for(a=0;a<this.cornersIdentifiers.length;a+=1)b[this.cornersIdentifiers[a]]="#"+this.cornersIdentifiers[a]+this.id+"resizehandler";return b};
a.prototype.applyBehaviors=function(){this.html&&(this.drag&&this.drag.attachDragBehavior(this),this.drop&&this.drop.attachDropBehavior(this),this.resize&&this.resize.init(this));return this};PMUI.extendNamespace("PMUI.draw.Shape",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.yPercentage=this.xPercentage=0;this.orientation=this.message="";this.text=null;this.onFocus=this.overflow=this.updateParent=!1;this.location="";this.diffY=this.diffX=0;this.fontSizeOnZoom=[];this.fontSize=0;this.textField=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Shape",a);a.prototype.type="Label";a.prototype.lineHeight=20;a.prototype.init=function(b){var a={message:"New Label",orientation:"horizontal",fontFamily:"arial",
size:0,position:{location:"none",diffX:0,diffY:0},overflow:!1,updateParent:!1,parent:null};this.fontSizeOnZoom=[6,8,10,13,15];$.extend(!0,a,b);this.setMessage(a.message).setOverflow(a.overflow).setUpdateParent(a.updateParent).setOrientation(a.orientation).setFontFamily(a.fontFamily).setFontSize(a.size).setParent(a.parent).updateDimension().setLabelPosition(a.position.location,a.position.diffX,a.position.diffY)};a.prototype.attachListeners=function(){var b=$(this.html);if(!this.html)return this;a.superclass.prototype.attachListeners.call(this);
b.on("dblclick",this.onDblClick(this));return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.html.style.textAlign="center";this.html.style.align="center";this.html.style.fontFamily=this.fontFamily;this.html.style.fontSize=this.fontSize+"pt";this.textField=document.createElement("input");this.textField.style.width="200px";this.textField.style.position="absolute";this.textField.style.display="none";this.text=document.createElement("span");this.text.style.width=
"auto";this.text.style.height="auto";this.text.style.lineHeight=this.lineHeight*this.canvas.zoomFactor+"px";this.text.innerHTML=this.message;this.html.appendChild(this.text);this.html.appendChild(this.textField);this.html.style.zIndex=2;return this.html};a.prototype.paint=function(){var b=$(this.text);this.text.style.lineHeight=this.lineHeight*this.canvas.zoomFactor+"px";this.textField.value=this.message;this.text.innerHTML=this.message;this.html.style.verticalAlign="middle";this.html.style.overflow=
this.overflow?"hidden":"none";this.displayText(!0);"vertical"===this.orientation?b.addClass("rotateText"):b.removeClass("rotateText");return this};a.prototype.displayText=function(b){b?(this.text.style.display="block",this.textField.style.display="none","vertical"===this.orientation&&(this.textField.style.left="0px")):(this.textField.style.display="block","vertical"===this.orientation&&(this.textField.style.left=this.width/2-100+"px"),this.text.style.display="none");return this};a.prototype.setMessage=
function(b){this.message=b;this.text&&(this.text.innerHTML=this.message);return this};a.prototype.getMessage=function(){return this.message};a.prototype.setOrientation=function(b){var a;this.orientation=b;if(!this.html)return this;a=$(this.text);"vertical"===b?a.addClass("rotateText"):a.removeClass("rotateText");return this};a.prototype.getOrientation=function(){return this.orientation};a.prototype.setFontFamily=function(b){this.fontFamily=b;this.html&&(this.html.style.fontFamily=this.fontFamily);
return this};a.prototype.setFontSize=function(b){this.fontSize=0===b?this.getZoomFontSize():b;this.html&&(this.html.style.fontSize=this.fontSize+"pt");return this};a.prototype.setUpdateParent=function(b){this.updateParent=b;return this};a.prototype.setOverflow=function(b){this.overflow=b;return this};a.prototype.setLabelPosition=function(b,a,c){var d;d=this.zoomWidth;var e=this.zoomHeight,g=this.parent,h,k=this.canvas.zoomFactor,l=4*k,m="top-left top top-right center-left center center-right bottom-left bottom bottom-right".split(" ");
if(!b||""===b)b="top-left";if(void 0===a||null===a)a=0;if(void 0===c||null===c)c=0;if(g&&"Canvas"!==g.family){h=g.getZoomWidth();g=g.getZoomHeight();e=[{x:-d/2,y:0},{x:h/2-d/2,y:0},{x:h-d/2,y:0},{x:-d/2,y:g/2-e/2},{x:h/2-d/2,y:g/2-e/2},{x:h-d,y:g/2-e/2},{x:-d/2,y:g-l},{x:h/2-d/2,y:g-l},{x:h-d/2,y:g-l}];for(d=0;9>d;d+=1)if(b===m[d]){this.setPosition(e[d].x/k+a,e[d].y/k+c);break}}this.location=b;this.diffX=a;this.diffY=c;return this};a.prototype.getFocus=function(){var b=$(this.textField.html);this.displayText(!1);
this.canvas.currentLabel=this;$(b).select();this.onFocus=!0;return this};a.prototype.loseFocus=function(){var b;this.canvas.currentLabel=null;this.textField.value!==this.message&&(b=new PMUI.command.CommandEditLabel(this,this.textField.value),b.execute(),this.canvas.commandStack.add(b),this.setLabelPosition(this.location,this.diffX,this.diffY));this.paint();this.onFocus=!1;return this};a.prototype.onMouseDown=function(b){return function(a,c){"Canvas"===b.parent.family&&a.stopPropagation()}};a.prototype.onClick=
function(b){return function(a,c){"Canvas"===b.parent.family&&a.stopPropagation();b.onFocus&&a.stopPropagation()}};a.prototype.onDblClick=function(b){return function(a,c){var d=b.getCanvas();$(b.html);d.currentLabel&&d.currentLabel.loseFocus();b.getFocus()}};a.prototype.getZoomFontSize=function(){return this.fontSize=this.fontSizeOnZoom[this.canvas.zoomPropertiesIndex]};a.prototype.parseMessage=function(){var b;b=0;for(var a=[],c;" "===this.message.charAt(b);)b+=1;for(c=0;b<this.message.length;b+=
1)" "===this.message.charAt(b)?(a.push(c),c=0):c+=1;a.push(c);return a};a.prototype.updateDimension=function(b){b=$(this.text).width();var a;b=Math.max(b,this.zoomWidth);a=$(this.text).height();this.setDimension(b/this.canvas.zoomFactor,a/this.canvas.zoomFactor);this.updateParent&&this.updateParentDimension();return this};a.prototype.applyZoom=function(){this.setFontSize(0);this.updateDimension();this.paint();return this};a.prototype.updateParentDimension=function(){"vertical"===this.orientation?
this.updateVertically():this.updateHorizontally();this.parent.html&&this.parent.paint();return this};a.prototype.updateVertically=function(){var b=this.parent,a=this.zoomWidth;b.setDimension(b.width,(a>b.zoomHeight-10?a+10:b.zoomHeight)/this.canvas.zoomFactor);b.updateChildrenPosition(0,0);b.refreshConnections();this.setLabelPosition(this.location,this.diffX,this.diffY);return this};a.prototype.updateHorizontally=function(){var b=this.parent,a=this.zoomWidth,c=this.zoomHeight,d=this.canvas.zoomFactor;
b.setDimension((a>b.zoomWidth-10?a+10:b.zoomWidth)/d,(c>b.zoomHeight-10?c+10:b.zoomHeight)/d);b.refreshConnections();this.setLabelPosition(this.location,this.diffX,this.diffY);return this};a.prototype.stringify=function(){var b={},a={id:this.getID(),message:this.getMessage(),orientation:this.getOrientation(),position:{location:this.location,diffX:this.diffX,diffY:this.diffY}};$.extend(!0,b,a);return b};PMUI.extendNamespace("PMUI.draw.Label",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.layers=new PMUI.util.ArrayList;a.superclass.call(this,b);this.ports=new PMUI.util.ArrayList;this.labels=new PMUI.util.ArrayList;this.zoomProperties=new PMUI.util.ArrayList;this.limits=[0,0,0,0];this.border=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}];this.dragType=this.CANCEL;this.connectAtMiddlePoints=this.startConnectionPoint=null;this.previousYDragPosition=this.previousXDragPosition=0;this.connectionType=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Shape",
a);a.prototype.type="CustomShape";a.prototype.family="CustomShape";a.prototype.containerDropBehavior=null;a.prototype.connectionDropBehavior=null;a.prototype.noDropBehavior=null;a.prototype.CONNECT=1;a.prototype.DRAG=2;a.prototype.CANCEL=0;a.prototype.init=function(b){var a={connectAtMiddlePoints:!0,layers:[],labels:[],connectionType:"regular",drag:"customshapedrag"};this.limits=[5,5,5,5,5];this.setStartConnectionPoint(new PMUI.util.Point(0,0));$.extend(!0,a,b);for(b=0;b<a.layers.length;b+=1)this.createLayer(a.layers[b]);
for(b=0;b<a.labels.length;b+=1)this.createLabel(a.labels[b]);this.setConnectAtMiddlePoints(a.connectAtMiddlePoints).setConnectionType(a.connectionType).setDragBehavior(a.drag)};a.prototype.createLayer=function(b){b.parent=this;b=new PMUI.draw.Layer(b);this.addLayer(b);return b};a.prototype.createLabel=function(b){b.canvas=this.canvas;b.parent=this;0===b.width&&(b.width=0.9*this.width);b=new PMUI.draw.Label(b);this.addLabel(b);return b};a.prototype.addLabel=function(b){this.html&&(b.parent=this,this.html.appendChild(b.getHTML()));
this.labels.contains(b)||this.labels.insert(b)};a.prototype.createHTML=function(){var b,f;a.superclass.prototype.createHTML.call(this);this.style.addClasses(["custom_shape"]);this.layers.sort(PMUI.draw.Layer.prototype.comparisonFunction);for(b=0;b<this.layers.getSize();b+=1)this.html.appendChild(this.layers.get(b).getHTML());for(b=0;b<this.labels.getSize();b+=1)f=this.labels.get(b),this.addLabel(f),f.attachListeners();return this.html};a.prototype.attachListeners=function(){if(null===this.html)return this;
var b=$(this.html).click(this.onClick(this));b.on("mousedown",this.onMouseDown(this));b.mousemove(this.onMouseMove(this));b.mouseup(this.onMouseUp(this));b.on("contextmenu",function(b){b.preventDefault()});this.updateBehaviors();return this};a.prototype.paint=function(){var b,f;a.superclass.prototype.paint.call(this);for(b=0;b<this.layers.getSize();b+=1)this.layers.get(b).paint();for(b=0;b<this.ports.getSize();b+=1)this.ports.get(b).paint();for(b=0;b<this.labels.getSize();b+=1)f=this.labels.get(b),
f.paint();return this};a.prototype.updateHTML=function(){var b,a;this.setDimension(this.width,this.height);for(b=0;b<this.labels.getSize();b+=1)a=this.labels.get(b),a.paint(),a.updateDimension();return this};a.prototype.refreshConnections=function(b){var a,c,d=this.ports;for(a=0;a<d.getSize();a+=1)c=d.get(a),c.setPosition(c.getX(),c.getY()),c=c.connection,c.disconnect(b).connect(b).setSegmentMoveHandlers().checkAndCreateIntersectionsWithAll(),this.canvas.triggerConnectionStateChangeEvent(c);return this};
a.prototype.updateLayers=function(){var b,a;for(b=0;b<this.getLayers().getSize();b+=1)a=this.getLayers().get(b),a.setProperties();return this};a.prototype.findLayerPosition=function(b){var a=null,c=1E7,d,e,g;for(d=0;d<this.layers.getSize();d+=1)e=this.layers.get(d),g=e.getPriority(),g>b.getPriority()&&c>g&&(c=g,a=e);return a};a.prototype.addLayer=function(b){var a=this.findLayerPosition(b);this.html&&(a?this.html.insertBefore(b.getHTML(),a.getHTML()):this.html.appendChild(b.getHTML()),b.paint());
this.layers.insert(b);return this};a.prototype.findLayer=function(b){return this.layers.find("id",b)};a.prototype.setDimension=function(b,f){a.superclass.prototype.setDimension.call(this,b,f);this.updateLabels();this.updateLayers();return this};a.prototype.updateLabels=function(){};a.prototype.hideLayer=function(b){if(!b||"string"!==typeof b)return this;b=this.findLayer(b);if(!b)return this;b.setVisible(!1);return this};a.prototype.showLayer=function(b){if(!b||"string"!==typeof b)return this;b=this.findLayer(b);
if(!b)return this;b.setVisible(!0);return this};a.prototype.addPort=function(b,a,c,d,e){a=new PMUI.util.Point(a,c);b.setParent(this);b.setCanvas(this.canvas);this.definePortPosition(b,a,e);this.html.appendChild(b.getHTML());b.paint();this.ports.insert(b);return this};a.prototype.removePort=function(b){this.ports.remove(b);return this};a.prototype.definePortPosition=function(b,a,c){var d=[this.TOP,this.RIGHT,this.BOTTOM,this.LEFT],e=[new PMUI.util.Point(Math.round(this.zoomWidth/2),0),new PMUI.util.Point(this.zoomWidth,
Math.round(this.zoomHeight/2)),new PMUI.util.Point(Math.round(this.zoomWidth/2),this.zoomHeight),new PMUI.util.Point(0,Math.round(this.zoomHeight/2))],g=[new PMUI.util.Point(a.x,0),new PMUI.util.Point(this.getZoomWidth(),a.y),new PMUI.util.Point(a.x,this.getZoomHeight()),new PMUI.util.Point(0,a.y)],h,k,l,m=[-1,1,1,-1],n=[0,0,-2,0],p=[0,-2,0,0],e=this.connectAtMiddlePoints?e:g;l="getSquaredDistance";c&&this.connectAtMiddlePoints&&(l="getManhattanDistance");c=void 0;k=Infinity;for(g=0;g<e.length;g+=
1)h=a[l](e[g]),k>h&&(k=h,c=d[g]);a=this.getBorderConsideringLayers();for(g=0;4>g;g+=1)this.border[g].x=a*m[g]+a*n[g],this.border[g].y=a*m[g]+a*p[g];b.setDirection(c);b.setPosition(e[c].x-b.getWidth()/2,e[c].y-b.getHeight()/2);b.applyBorderMargin(!0);b.determinePercentage();return this};a.prototype.getBorderConsideringLayers=function(){var b=parseInt(this.style.getProperty("borderTopWidth")||0,10),a,c;for(c=0;c<this.getLayers().getSize();c+=1)a=this.getLayers().get(c),b=Math.max(b,parseInt(a.style.getProperty("borderTopWidth")||
0,10));return b};a.prototype.showPorts=function(){var b;for(b=0;b<this.ports.getSize();b+=1)this.ports.get(b).show();return this};a.prototype.hidePorts=function(){var b;for(b=0;b<this.ports.getSize();b+=1)this.ports.get(b).hide();return this};a.prototype.updatePortsPosition=function(b,a){var c,d,e=this.ports;for(c=0;c<e.getSize();c+=1)d=e.get(c),d.direction===this.RIGHT||d.direction===this.BOTTOM?(d.oldX=d.x,d.oldY=d.y,d.oldAbsoluteX=d.absoluteX,d.oldAbsoluteY=d.absoluteY,d.setPosition(d.x+b,d.y+
a,!0),d.changePosition(d.oldX,d.oldY,d.oldAbsoluteX,d.oldAbsoluteY)):d.setPosition(d.x,d.y,!0),d.connection.disconnect().connect(),d.connection.setSegmentMoveHandlers();return this};a.prototype.recalculatePortPosition=function(b){var a=Math.round(b.percentage*b.parent.getZoomWidth()/100),c=Math.round(b.percentage*b.parent.getZoomHeight()/100),a=[a,b.parent.getZoomWidth(),a,0],c=[0,c,b.parent.getZoomHeight(),c];b.setPosition(this.border[b.direction].x+a[b.direction]-Math.round(b.width/2),this.border[b.direction].y+
c[b.direction]-Math.round(b.height/2));return this};a.prototype.initPortsChange=function(){var b,a=this.ports,c;for(b=0;b<a.getSize();b+=1)c=a.get(b),c.oldX=c.x,c.oldY=c.y,c.oldAbsoluteX=c.absoluteX,c.oldAbsoluteY=c.absoluteY;return this};a.prototype.firePortsChange=function(){var b,f=this.ports,c;for(b=0;b<f.getSize();b+=1)c=f.get(b),a.superclass.prototype.changePosition.call(this,c.oldX,c.oldY,c.oldAbsoluteX,c.oldAbsoluteY);return this};a.prototype.refreshShape=function(){a.superclass.prototype.refreshShape.call(this);
this.updatePortsOnZoom().refreshConnections(!1);this.paint();return this};a.prototype.updatePortsOnZoom=function(){var b,a=this.ports,c,d=this.canvas.zoomFactor,e=(25*this.canvas.prevZoom+50)/100;b=0<a.getSize()?a.get(0).width/2:0;var g,h=[this.zoomWidth/2-b,this.zoomWidth-b,this.zoomWidth/2-b,-b],k=[-b,this.zoomHeight/2-b,this.zoomHeight-b,this.zoomHeight/2-b];for(b=0;b<a.getSize();b+=1)c=a.get(b),c.applyBorderMargin(!1),this.connectAtMiddlePoints?c.setPosition(h[c.direction],k[c.direction]):c.setPosition(c.x/
e*d,c.y/e*d),c.applyBorderMargin(!0),g=c.connection.srcDecorator,c=c.connection.destDecorator,g&&g.applyZoom(),c&&c.applyZoom();return this};a.prototype.calculateLabelsPercentage=function(){var b,a;for(b=0;b<this.labels.getSize();b+=1)a=this.labels.get(b),a.xPercentage=a.getX()/this.getWidth(),a.yPercentage=a.getY()/this.getHeight()};a.prototype.updateLabelsPosition=function(){var b,a;for(b=0;b<this.labels.getSize();b+=1)a=this.labels.get(b),a.setLabelPosition(a.location,a.diffX,a.diffY);return this};
a.prototype.determineDragBehavior=function(b){var a=PMUI.util.Point,c=PMUI.draw.Geometry,d=this.limits[this.canvas.zoomPropertiesIndex],e=parseInt(this.style.getProperty("border")||0,10);return c.pointInRectangle(b,new a(0,0),new a(this.zoomWidth+2*e,this.zoomHeight+2*e))?c.pointInRectangle(b,new a(e+d,e+d),new a(this.zoomWidth+e-d,this.zoomHeight+e-d))?this.DRAG:this.CONNECT:this.CANCEL};a.prototype.createDragHelper=function(){var b=document.createElement("div");b.style.width="8px";b.style.height=
"8px";b.style.backgroundColor="black";b.style.zIndex=2*PMUI.draw.Shape.prototype.MAX_ZINDEX;b.id="drag-helper";b.className="drag-helper";return b};a.prototype.onMouseDown=function(b){return function(a,c){var d=b.canvas;3===a.which?$(d.html).trigger("rightclick",[a,b]):(b.dragType===b.DRAG?b.setDragBehavior("customshapedrag"):b.dragType===b.CONNECT?b.setDragBehavior("connection"):b.setDragBehavior("nodrag"),b.dragging=!0);a.stopPropagation()}};a.prototype.onMouseUp=function(b){return function(a,c){b.dragging=
!1}};a.prototype.onMouseMove=function(b){return function(a,c){var d,e,g;!b.dragging&&!b.entered&&(d=$(b.html),e=b.getCanvas(),g=e.relativePoint(a),b.startConnectionPoint.x=g.x-b.absoluteX,b.startConnectionPoint.y=g.y-b.absoluteY,e=new PMUI.util.Point(a.pageX-e.getX()-b.absoluteX+e.getLeftScroll(),a.pageY-e.getY()-b.absoluteY+e.getTopScroll()),b.dragType=b.determineDragBehavior(e),b.dragType===b.DRAG?d.css("cursor","move"):b.dragType===b.CONNECT?d.css("cursor","crosshair"):d.css("cursor","default"))}};
a.prototype.onClick=function(b){return function(a,c){var d=!1,e=b.canvas,g=e.currentSelection,h=e.currentLabel;a.ctrlKey&&(d=!0);b.canvas.hideCurrentConnection();3===a.which?(a.preventDefault(),b.canvas.triggerRightClickEvent(b)):(b.wasDragged||(d?g.contains(b)?e.removeFromSelection(b):e.addToSelection(b):(e.emptyCurrentSelection(),e.addToSelection(b))),g.isEmpty()||e.triggerSelectEvent(g.asArray()));this.helper&&$(this.helper.html).remove();h&&(h.loseFocus(),$(h.textField).focusout());b.wasDragged=
!1;a.stopPropagation()}};a.prototype.parseHook=function(){};a.prototype.getPorts=function(){return this.ports};a.prototype.getLayers=function(){return this.layers};a.prototype.getLabels=function(){return this.labels};a.prototype.applyZoom=function(){var b,f;a.superclass.prototype.applyZoom.call(this);for(b=0;b<this.layers.getSize();b+=1)this.layers.get(b).applyZoom();for(b=0;b<this.labels.getSize();b+=1)f=this.labels.get(b),f.applyZoom(),f.setLabelPosition(f.location,f.diffX,f.diffY);return this};
a.prototype.setStartConnectionPoint=function(b){this.startConnectionPoint=b;return this};a.prototype.setConnectAtMiddlePoints=function(b){this.connectAtMiddlePoints=b;return this};a.prototype.getConnectAtMiddlePoints=function(){return this.connectAtMiddlePoints};a.prototype.setConnectionType=function(b){this.connectionType=b;return this};a.prototype.getConnectionType=function(){return this.connectionType};a.prototype.stringify=function(){var b=[],f=[],c;for(c=0;c<this.layers.getSize();c+=1)b.push(this.layers.get(c).stringify());
for(c=0;c<this.labels.getSize();c+=1)f.push(this.labels.get(c).stringify());c=a.superclass.prototype.stringify.call(this);b={canvas:this.canvas.getID(),layers:b,labels:f,connectAtMiddlePoints:this.getConnectAtMiddlePoints(),connectionType:this.getConnectionType(),parent:this.parent.getID()};$.extend(!0,c,b);return c};a.prototype.parseJSON=function(b){this.initObject(b);return this};PMUI.extendNamespace("PMUI.draw.CustomShape",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.color=new PMUI.util.Color;this.graphics=null};PMUI.inheritFrom("PMUI.draw.Shape",a);a.prototype.type="RegularShape";a.prototype.getColor=function(){return this.color};a.prototype.setColor=function(b){b.type&&"Color"===b.type&&(this.color=b);return this};PMUI.extendNamespace("PMUI.draw.RegularShape",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this);this.step=this.radius=this.endAngle=this.startAngle=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.RegularShape",a);a.prototype.type="Arc";a.prototype.init=function(b){var a={center:new PMUI.util.Point(0,0),radius:PMUI.draw.Shape.prototype.DEFAULT_RADIUS,startAngle:270,endAngle:90,step:10};$.extend(!0,a,b);this.setCenter(a.center).setStartAngle(a.startAngle).setEndAngle(a.endAngle).setRadius(a.radius).setStep(a.step);this.id+=
"-ARC"};a.prototype.paint=function(){this.setVisible(this.visible);this.html&&(this.style.applyStyle(),this.graphics=new PMUI.draw.Graphics(this.id),this.graphics.setColor("black"),this.graphics.drawArc(this.center.x,this.center.y,this.radius,this.startAngle,this.endAngle,this.step),this.graphics.graphics.paint());return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);return this.html};a.prototype.getStartAngle=function(){return this.startAngle};a.prototype.setStartAngle=
function(b){this.startAngle=b;return this};a.prototype.getEndAngle=function(){return this.endAngle};a.prototype.setEndAngle=function(b){this.endAngle=b;return this};a.prototype.getRadius=function(){return this.radius};a.prototype.setRadius=function(b){this.radius=b;return this};a.prototype.getStep=function(){return this.step};a.prototype.setStep=function(b){this.step=b;return this};PMUI.extendNamespace("PMUI.draw.Arc",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.RegularShape",a);a.prototype.type="Oval";a.prototype.init=function(b){var a={center:new PMUI.util.Point(0,0),width:4,height:4};$.extend(!0,a,b);this.setCenter(a.center).setWidth(a.width).setHeight(a.height)};a.prototype.paint=function(){this.setVisible(this.visible);this.html&&(this.style.applyStyle(),this.graphic=new JSGraphics(this.id),this.graphic.setColor("red"),this.graphic.fillOval(0,
0,this.getWidth(),this.getHeight()),this.graphic.paint());return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);return this.html};PMUI.extendNamespace("PMUI.draw.Oval",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.points=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.RegularShape",a);a.prototype.type="Polygon";a.prototype.init=function(b){var a={points:[]};$.extend(!0,a,b);this.setPoints(a.points)};a.prototype.setPoints=function(b){var a,c;this.points=[];for(a=0;a<b.length;a+=1)c=b[a],this.points.push(new PMUI.util.Point(c.getX(),c.getY()))};a.prototype.getPoints=function(){return this.points};PMUI.extendNamespace("PMUI.draw.Polygon",
a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,f,c){a.superclass.call(this);this.center=!b?null:b;this.visible=!0;this.parent=c;this.idOtherConnection=f};PMUI.inheritFrom("PMUI.draw.Arc",a);a.prototype.type="Intersection";a.prototype.paint=function(){this.parent.orientation===this.VERTICAL?(this.startAngle=270,this.endAngle=90):(this.startAngle=180,this.endAngle=0);a.superclass.prototype.paint.call(this);this.style.applyStyle();return this};a.prototype.destroy=function(){$(this.html).remove();return this};a.prototype.createHTML=
function(){PMUI.draw.Shape.prototype.createHTML.call(this);return this.html};PMUI.extendNamespace("PMUI.draw.Intersection",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Polygon",a);a.prototype.type="Rectangle";a.prototype.init=function(b){};a.prototype.paint=function(){this.html&&(this.style.applyStyle(),this.color&&this.style.addProperties({backgroundColor:this.color.getCSS()}));return this};a.prototype.createHTML=function(){PMUI.draw.Shape.prototype.createHTML.call(this);return this.html};PMUI.extendNamespace("PMUI.draw.Rectangle",a);"undefined"!==
typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this);this.canvas=this.backgroundColor=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Rectangle",a);a.prototype.type="MultipleSelectionContainer";a.prototype.init=function(b){var a={canvas:null,x:0,y:0,color:new PMUI.util.Color(0,128,255,0.1)};jQuery.extend(!0,a,b);this.backgroundColor=a.color;this.canvas=a.canvas;this.absoluteX=a.x;this.absoluteY=a.y};a.prototype.paint=function(){this.style.addProperties({backgroundColor:this.backgroundColor.getCSS()});return this};
a.prototype.changeOpacity=function(b){this.backgroundColor.setOpacity(b);this.paint();return this};a.prototype.wrapElements=function(){var b=this.canvas.currentSelection,a=[];this.intersectElements();b.isEmpty()||(a=b.asArray(),this.canvas.triggerSelectEvent(a));this.reset();this.setVisible(!1);return this};a.prototype.intersectElements=function(){var b,a,c;this.canvas.emptyCurrentSelection();c=this.canvas.customShapes;for(b=0;b<c.getSize();b+=1)a=c.get(b),"Canvas"===a.parent.family&&this.checkIntersection(a)&&
this.canvas.addToSelection(a);return this};a.prototype.reset=function(){this.setPosition(0,0);this.setDimension(0,0);return this};a.prototype.getLeft=PMUI.draw.Shape.prototype.getAbsoluteX;a.prototype.getTop=PMUI.draw.Shape.prototype.getAbsoluteY;a.prototype.checkIntersection=function(b){var a=PMUI.draw.Geometry,c=new PMUI.util.Point(this.zoomX,this.zoomY),d=new PMUI.util.Point(this.zoomX+this.zoomWidth,this.zoomY+this.zoomHeight);return a.pointInRectangle(new PMUI.util.Point(b.getZoomX(),b.getZoomY()),
c,d)||a.pointInRectangle(new PMUI.util.Point(b.zoomX+b.zoomWidth,b.zoomY),c,d)||a.pointInRectangle(new PMUI.util.Point(b.zoomX,b.zoomY+b.zoomHeight),c,d)||a.pointInRectangle(new PMUI.util.Point(b.zoomX+b.zoomWidth,b.zoomY+b.zoomHeight),c,d)};PMUI.extendNamespace("PMUI.draw.MultipleSelectionContainer",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.orientation=null;this.data=[];this.visible=!1;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="Snapper";a.prototype.init=function(b){var a={orientation:"horizontal"};$.extend(!0,a,b);this.setOrientation(a.orientation)};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);return this.html};a.prototype.enable=function(){this.html&&(this.graphic=new JSGraphics(this.id),this.graphic.setColor("#81DAF5"),
"horizontal"===this.orientation?this.graphic.drawLine(0,0,4E3,0):this.graphic.drawLine(0,0,0,4E3),this.graphic.paint());return this};a.prototype.hide=function(){this.visible=!1;this.setVisible(this.visible);return this};a.prototype.show=function(){this.visible=!0;this.setVisible(this.visible);return this};a.prototype.createSnapData=function(){var b,a=0,c,d=0;this.data=[];for(b=0;b<this.canvas.customShapes.getSize();b+=1)c=this.canvas.customShapes.get(b),d=parseInt($(c.getHTML()).css("borderTopWidth"),
10),"horizontal"===this.orientation?(this.data[2*a]=c.getAbsoluteY()-d,this.data[2*a+1]=c.getAbsoluteY()+c.getZoomHeight()):(this.data[2*a]=c.getAbsoluteX()-d,this.data[2*a+1]=c.getAbsoluteX()+c.getZoomWidth()),a+=1;for(b=0;b<this.canvas.regularShapes.getSize();b+=1)c=this.canvas.regularShapes.get(b),d=parseInt($(c.getHTML()).css("borderTopWidth"),10),"horizontal"===this.orientation?(this.data[2*a]=c.getAbsoluteY()-d,this.data[2*a+1]=c.getAbsoluteY()+c.getZoomHeight()):(this.data[2*a]=c.getAbsoluteX()-
d,this.data[2*a+1]=c.getAbsoluteX()+c.getZoomWidth()),a+=1;return this};a.prototype.sortData=function(){this.data.sort(function(b,a){return b>a});return this};a.prototype.binarySearch=function(b){for(var a=0,c=this.data.length-1,d;a<=c;){d=parseInt((a+c)/2,10);if(this.data[d]===b)return b;this.data[d]>b?c=d-1:a=d+1}return!1};a.prototype.attachListeners=function(b){$(b.html).mousemove(function(){b.hide()});return this};a.prototype.setOrientation=function(b){if("horizontal"===b||"vertical"===b)this.orientation=
b;else throw Error("setOrientation(): parameter is not valid");return this};a.prototype.getOrientation=function(){return this.orientation};PMUI.extendNamespace("PMUI.draw.Snapper",a);"undefined"!==typeof exports&&(module.exports=a)})();(function(){var a=function(){a.superclass.call(this)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="Router";a.prototype.createRoute=function(){return!0};PMUI.extendNamespace("PMUI.draw.Router",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(){a.superclass.call(this);this.mindist=20};PMUI.inheritFrom("PMUI.draw.Router",a);a.prototype.type="ManhattanConnectionRouter";a.prototype.createRoute=function(b){var a,c,d,e=[];a=b.srcPort.getPoint(!1);c=b.srcPort.direction;d=b.destPort.getPoint(!1);this.route(b,d,b.destPort.direction,a,c,e);return e};a.prototype.route=function(b,a,c,d,e,g){var h,k,l,m;h=a.x-d.x;k=a.y-d.y;0.01>h*h&&0.01>k*k?g.push(d):(3===c?0<h&&0.1>k*k&&1===e?(l=d,m=e):(0>h?l=new PMUI.util.Point(a.x-this.mindist,
a.y):0<k&&2===e||0>k&&0===e?l=new PMUI.util.Point(d.x,a.y):c===e?(c=Math.min(a.x,d.x)-this.mindist,l=new PMUI.util.Point(c,a.y)):l=new PMUI.util.Point(a.x-h/2,a.y),m=0<k?0:2):1===c?0>h&&0.1>k*k&&3===e?(l=d,m=e):(0<h?l=new PMUI.util.Point(a.x+this.mindist,a.y):0<k&&2===e||0>k&&0===e?l=new PMUI.util.Point(d.x,a.y):c===e?(c=Math.max(a.x,d.x)+this.mindist,l=new PMUI.util.Point(c,a.y)):l=new PMUI.util.Point(a.x-h/2,a.y),m=0<k?0:2):2===c?0.1>h*h&&0>k&&0===e?(l=d,m=e):(0<k?l=new PMUI.util.Point(a.x,a.y+
this.mindist):0<h&&1===e||0>h&&3===e?l=new PMUI.util.Point(a.x,d.y):c===e?(c=Math.max(a.y,d.y)+this.mindist,l=new PMUI.util.Point(a.x,c)):l=new PMUI.util.Point(a.x,a.y-k/2),m=0<h?3:1):0===c&&(0.1>h*h&&0<k&&2===e?(l=d,m=e):(0>k?l=new PMUI.util.Point(a.x,a.y-this.mindist):0<h&&1===e||0>h&&3===e?l=new PMUI.util.Point(a.x,d.y):c===e?(c=Math.min(a.y,d.y)-this.mindist,l=new PMUI.util.Point(a.x,c)):l=new PMUI.util.Point(a.x,a.y-k/2),m=0<h?3:1)),this.route(b,l,m,d,e,g),g.push(a))};PMUI.extendNamespace("PMUI.draw.ManhattanConnectionRouter",
a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.destDecorator=this.srcDecorator=this.destPort=this.srcPort=null;this.lineSegments=new PMUI.util.ArrayList;this.points=[];this.oldPoints=[];this.originalSegmentColor=this.segmentColor=this.originalSegmentStyle=this.segmentStyle=null;this.zOrder=this.defaultZOrder=2;this.intersectionWith=new PMUI.util.ArrayList;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="Connection";a.prototype.family="Connection";
a.prototype.router=new PMUI.draw.ManhattanConnectionRouter;a.prototype.init=function(b){var a={srcPort:new PMUI.draw.Port,destPort:new PMUI.draw.Port,segmentColor:new PMUI.util.Color(0,0,0),segmentStyle:"regular"};$.extend(!0,a,b);this.setSrcPort(a.srcPort).setDestPort(a.destPort).setSegmentStyle(a.segmentStyle,!1).setSegmentColor(a.segmentColor,!1);this.originalSegmentStyle=a.segmentStyle;this.originalSegmentColor=a.segmentColor;this.getSrcPort().setConnection(this);this.getDestPort().setConnection(this)};
a.prototype.createHTML=function(){this.html=document.createElement("div");this.html.id=this.id;this.style.addProperties({position:"absolute",left:0,top:0,height:0,width:0,zIndex:this.zOrder});return this.html};a.prototype.setSegmentMoveHandlers=function(){var b,a,c=[this.HORIZONTAL,this.VERTICAL],d=this.destPort.direction===this.TOP||this.destPort.direction===this.BOTTOM?1:0;for(b=this.lineSegments.getSize()-1;0<=b;b-=1)a=this.lineSegments.get(b),a.orientation=c[d],a.hasMoveHandler=!1,b<this.lineSegments.getSize()-
1&&0<b&&(a.nextNeighbor=this.lineSegments.get(b+1),a.previousNeighbor=this.lineSegments.get(b-1),a.hasMoveHandler=!0,a.addSegmentMoveHandler()),d=1-d;return this};a.prototype.removeAllSegmentHandlers=function(){var b,a;for(a=0;a<this.lineSegments.getSize();a+=1)b=this.lineSegments.get(a),b.hasMoveHandler&&$(b.moveHandler.html).remove();return this};a.prototype.showMoveHandlers=function(){var b,a;for(b=0;b<this.lineSegments.getSize();b+=1)(a=this.lineSegments.get(b).moveHandler)&&a.setVisible(!0);
return this};a.prototype.hideMoveHandlers=function(){var b,a;for(b=0;b<this.lineSegments.getSize();b+=1)(a=this.lineSegments.get(b).moveHandler)&&a.setVisible(!1);return this};a.prototype.hidePortsAndHandlers=function(){this.hidePorts();this.hideMoveHandlers();return this};a.prototype.showPortsAndHandlers=function(){this.showPorts();this.showMoveHandlers();return this};a.prototype.paint=function(b){var a={algorithm:"manhattan",points:[],dx:0,dy:0};$.extend(!0,a,b);try{null===this.html&&this.createHTML();
$(this.html).empty();this.oldPoint=null;switch(a.algorithm){case "manhattan":this.createManhattanRoute();break;case "user":this.createUserDefinedRoute(a.points,a.dx,a.dy);break;default:throw Error("Connection.paint(): the algorithm provided is not correct");}this.style.applyStyle();this.style.addProperties({top:0,left:0});null!==this.destDecorator&&(this.destDecorator.paint(),this.destDecorator.attachListeners());null!==this.srcDecorator&&this.srcDecorator.paint();this.oldPoint=null}catch(c){console.log(c.message)}return this};
a.prototype.disconnect=function(b){this.clearAllIntersections();this.hideMoveHandlers();b&&this.savePoints();this.lineSegments.clear();$(this.html).empty();return this};a.prototype.connect=function(b){this.paint(b);return this};a.prototype.hidePorts=function(){this.srcPort.hide();this.destPort.hide();return this};a.prototype.showPorts=function(){this.srcPort.show();this.destPort.show();return this};a.prototype.savePoints=function(b){var a,c="points";a={saveToOldPoints:!1};$.extend(!0,a,b);a.saveToOldPoints&&
(c="oldPoints");this[c]=[];for(b=0;b<this.lineSegments.getSize();b+=1)a=this.lineSegments.get(b),0===b&&this[c].push(new PMUI.util.Point(a.startPoint.x,a.startPoint.y)),this[c].push(new PMUI.util.Point(a.endPoint.x,a.endPoint.y));return this};a.prototype.createUserDefinedRoute=function(b,a,c){var d=new PMUI.util.Point(a,c);for(a=1;a<b.length;a+=1)c=new PMUI.draw.Segment({startPoint:(new PMUI.util.Point(parseInt(b[a-1].x,10),parseInt(b[a-1].y,10))).add(d),endPoint:(new PMUI.util.Point(parseInt(b[a].x,
10),parseInt(b[a].y,10))).add(d),parent:this,canvas:this.canvas,color:this.segmentColor}),this.addSegment(c);return this};a.prototype.createManhattanRoute=function(){var b=this.router.createRoute(this),a,c;for(a=1;a<b.length;a+=1)c=new PMUI.draw.Segment({startPoint:new PMUI.util.Point(parseInt(b[a-1].x-this.canvas.absoluteX,10),parseInt(b[a-1].y-this.canvas.absoluteY,10)),endPoint:new PMUI.util.Point(parseInt(b[a].x-this.canvas.absoluteX,10),parseInt(b[a].y-this.canvas.absoluteY,10)),parent:this,
canvas:this.canvas,color:this.segmentColor}),this.addSegment(c);return this};a.prototype.addSegment=function(b){b.setStyle(this.segmentStyle);b.paint();this.lineSegments.insert(b);return this};a.prototype.saveAndDestroy=function(){this.canvas.currentConnection&&(this.hidePortsAndHandlers(),this.canvas.currentConnection=null);this.canvas.removeConnection(this);this.srcPort.saveAndDestroy();this.destPort.saveAndDestroy();this.html=$(this.html).detach()[0];return this};a.prototype.fixZIndex=function(){var b=
this.srcPort.parent,a=this.destPort.parent,b=Math.min((b.parent?b.parent:b.canvas).getZOrder(),b.getZOrder()-1),a=Math.min((a.parent?a.parent:a.canvas).getZOrder(),a.getZOrder()-1);this.setZOrder(Math.max(b,a)+2);return this};a.prototype.checkAndCreateIntersections=function(b){var a,c,d,e,g=!1,h;for(a=0;a<this.lineSegments.getSize();a+=1){d=this.lineSegments.get(a);for(c=0;c<b.lineSegments.getSize();c+=1)if(e=b.lineSegments.get(c),h=PMUI.draw.Geometry.perpendicularSegmentIntersection(d.startPoint,
d.endPoint,e.startPoint,e.endPoint))g=!0,d.createIntersectionWith(e,h)}g&&(this.intersectionWith.find("id",b.getID())||this.intersectionWith.insert(b),b.intersectionWith.find("id",this.getID())||b.intersectionWith.insert(this));return g};a.prototype.checkAndCreateIntersectionsWithAll=function(){var b,a;for(b=0;b<this.canvas.connections.getSize();b+=1)a=this.canvas.connections.get(b),a.getID()!==this.getID()&&this.checkAndCreateIntersections(a);for(b=0;b<this.lineSegments.getSize();b+=1)a=this.lineSegments.get(b),
a.intersections.getSize()&&a.paintWithIntersections();return this};a.prototype.clearIntersectionsWith=function(b){var a,c,d,e;for(a=0;a<this.lineSegments.getSize();a+=1){e=!1;for(c=this.lineSegments.get(a);;){if(d=c.intersections.find("idOtherConnection",b.getID()))c.intersections.remove(d),d.destroy();else break;e=!0}e&&c.paintWithIntersections()}this.intersectionWith.remove(b);b.intersectionWith.remove(this);return this};a.prototype.clearAllIntersections=function(){for(var b;0<this.intersectionWith.getSize();)b=
this.intersectionWith.get(0),b.clearIntersectionsWith(this);return this};a.prototype.move=function(b,a){var c,d;c=parseFloat(this.html.style.top);d=parseFloat(this.html.style.left);$(this.html).css({top:c+a,left:d+b});return this};a.prototype.stringify=function(){return{segmentStyle:this.getSegmentStyle(),srcPort:this.getSrcPort().stringify(),destPort:this.getDestPort().stringify(),state:this.savePoints()&&this.points,srcDecoratorPrefix:this.getSrcDecorator().getDecoratorPrefix(),destDecoratorPrefix:this.getDestDecorator().getDecoratorPrefix()}};
a.prototype.setSegmentColor=function(b,a){var c,d;this.segmentColor=b;if(this.html&&a)for(c=0;c<this.lineSegments.getSize();c+=1)d=this.lineSegments.get(c),d.setColor(this.segmentColor),d.paint();return this};a.prototype.getSegmentColor=function(){return this.segmentColor};a.prototype.setSegmentStyle=function(b,a){var c,d;this.segmentStyle=b;if(this.html&&a)for(c=0;c<this.lineSegments.getSize();c+=1)d=this.lineSegments.get(c),d.setStyle(this.segmentStyle),d.paint();return this};a.prototype.getSegmentStyle=
function(){return this.segmentStyle};a.prototype.setSrcPort=function(b){this.srcPort=b;return this};a.prototype.getSrcPort=function(){return this.srcPort};a.prototype.setDestPort=function(b){this.destPort=b;return this};a.prototype.getDestPort=function(){return this.destPort};a.prototype.getSrcDecorator=function(){return this.srcDecorator};a.prototype.getDestDecorator=function(){return this.destDecorator};a.prototype.getLineSegments=function(){return this.lineSegments};a.prototype.setSrcDecorator=
function(b){"ConnectionDecorator"===b.type&&(this.srcDecorator=b);return this};a.prototype.setDestDecorator=function(b){"ConnectionDecorator"===b.type&&(this.destDecorator=b);return this};a.prototype.getZOrder=function(){return PMUI.draw.Shape.prototype.getZOrder.call(this)};a.prototype.getOldPoints=function(){return this.oldPoints};a.prototype.getPoints=function(){return this.points};PMUI.extendNamespace("PMUI.draw.Connection",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.decoratorPrefix=this.decoratorType=this.parent=null;this.spriteDirection={0:"top",1:"right",2:"bottom",3:"left"};this.width=this.height=11;this.cssClass=this.sprite=this.separator=null;a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="ConnectionDecorator";a.prototype.initObject=function(b){var a={width:11,height:11,sprite:"bpmn_zoom",decoratorPrefix:"",separator:"_",decoratorType:"target",parent:null};
$.extend(!0,a,b);this.setDecoratorType(a.decoratorType).setDecoratorPrefix(a.decoratorPrefix).setSeparator(a.separator).setSprite(a.sprite).setParent(a.parent).setDimension(a.width,a.height).setCssClass("")};a.prototype.paint=function(){var b,a,c,d;a="source"===this.decoratorType?this.parent.getSrcPort():this.parent.getDestPort();b=a.getPoint(!1);c=a.getDirection();a=a.canvas;d=[b.y-this.zoomHeight,b.y-Math.round(this.zoomHeight/2),b.y,b.y-Math.round(this.zoomHeight/2)];b=[b.x-Math.round(this.zoomWidth/
2)+1,b.x,b.x-Math.round(this.zoomWidth/2)+1,b.x-this.zoomWidth];null===this.getHTML()&&this.createHTML();if(null===this.decoratorType)return this.html=null,this;this.style.removeClasses([this.cssClass]);this.setCssClass([this.prefix,parseInt(100*a.zoomFactor,10),this.decoratorType,this.spriteDirection[c]].join(this.separator));this.style.addClasses([this.sprite,this.getCssClass()]);this.style.addProperties({top:d[c]-a.absoluteX,left:b[c]-a.absoluteY});this.parent.html.appendChild(this.html);return this};
a.prototype.createHTML=function(){this.html=document.createElement("div");this.html.id=this.id;this.style.applyStyle();this.style.addProperties({position:"absolute",left:0,top:0,height:this.zoomHeight,width:this.zoomWidth,zIndex:PMUI.util.Style.MAX_ZINDEX});return this.html};a.prototype.attachListeners=function(){$(this.getHTML()).click(this.onClick(this)).on("mousedown",this.onMouseDown(this));return this};a.prototype.applyZoom=function(){this.setDimension(this.width,this.height);return this};a.prototype.onMouseDown=
function(b){return function(a,c){a.preventDefault();3===a.which&&(b.parent.canvas.updatedElement=b.parent,$(b.parent.canvas.html).trigger("rightclick"));a.stopPropagation()}};a.prototype.onClick=function(b){return function(a,c){var d=b.parent,e=b.parent.canvas.currentConnection,g=d.canvas;g.emptyCurrentSelection();e&&e.hidePortsAndHandlers();d.showPortsAndHandlers();g.currentConnection=d;a.stopPropagation()}};a.prototype.stringify=function(){var b={},a={decoratorType:this.getDecoratorType(),decoratorPrefix:this.getDecoratorPrefix()};
$.extend(!0,b,a);return b};a.prototype.getDecoratorType=function(){return this.decoratorType};a.prototype.setDecoratorType=function(b){this.decoratorType=b;return this};a.prototype.getDecoratorPrefix=function(){return this.prefix};a.prototype.setDecoratorPrefix=function(b){this.prefix=b;return this};a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.getParent=function(){return this.parent};a.prototype.setSeparator=function(b){this.separator=b;return this};a.prototype.setSprite=
function(b){this.sprite=b;return this};a.prototype.setCssClass=function(b){this.cssClass=b;return this};a.prototype.getCssClass=function(){return this.cssClass};PMUI.extendNamespace("PMUI.draw.ConnectionDecorator",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.visible=this.parent=this.priority=this.layerName=null;this.currentZoomClass="";this.zoomSprites=[];a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="Layer";a.prototype.initObject=function(b){var a={x:0,y:0,parent:null,layerName:"defaultLayerName",priority:0,visible:!0,zoomSprites:["","","","",""]};$.extend(!0,a,b);this.setParent(a.parent).setPosition(a.x,a.y).setLayerName(a.layerName).setPriority(a.priority).setVisible(a.visible).setZoomSprites(a.zoomSprites).setProperties()};
a.prototype.applyZoom=function(){this.setProperties()};a.prototype.comparisonFunction=function(b,a){return b.priority>a.priority};a.prototype.createHTML=function(b){this.setProperties();a.superclass.prototype.createHTML.call(this,b);return this.html};a.prototype.paint=function(){$(this.html);var b;this.style.removeClasses([this.currentZoomClass]);b=this.zoomSprites[this.canvas.zoomPropertiesIndex];this.style.addClasses([b]);this.currentZoomClass=b;this.style.applyStyle();return this};a.prototype.setProperties=
function(){if(!this.parent)return this;this.id=this.parent.getID()+"Layer-"+this.layerName;this.setDimension(this.parent.getWidth(),this.parent.getHeight());this.canvas=this.parent.canvas;return this};a.prototype.getLayerName=function(){return this.layerName};a.prototype.getPriority=function(){return this.priority};a.prototype.setLayerName=function(b){"string"===typeof b&&""!==b&&(this.layerName=b);return this};a.prototype.setPriority=function(b){"number"===typeof b&&(this.priority=b);return this};
a.prototype.setParent=function(b){b&&(this.parent=b);return this};a.prototype.getParent=function(){return this.parent};a.prototype.setZoomSprites=function(b){var a;this.zoomSprites=["","","","",""];for(a=0;a<b.length;a+=1)this.zoomSprites[a]=b[a];return this};a.prototype.stringify=function(){var b={},a={id:this.getID(),x:this.getX(),y:this.getY(),layerName:this.getLayerName(),priority:this.getPriority(),style:{cssClasses:this.style.getClasses()},zoomSprites:this.zoomSprites};$.extend(!0,b,a);return b};
PMUI.extendNamespace("PMUI.draw.Layer",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.orientation=this.color=this.parent=this.representation=null};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.getParent=function(){return this.parent};a.prototype.setRepresentation=function(b){this.representation=b;return this};a.prototype.getRepresentation=function(){return this.representation};a.prototype.setOrientation=function(b){this.orientation=b;return this};a.prototype.getOrientation=
function(){return this.orientation};a.prototype.paint=function(){this.representation.paint.call(this);this.style.applyStyle();return this};a.prototype.setColor=function(b){this.color=b;return this};a.prototype.getColor=function(){return this.color};PMUI.extendNamespace("PMUI.draw.Handler",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.category=null;this.visible=!1;this.nonResizableStyle=this.resizableStyle=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Handler",a);a.prototype.type="ResizeHandler";a.prototype.init=function(b){var a={width:4,height:4,parent:null,orientation:null,representation:null,resizableStyle:{},nonResizableStyle:{},zOrder:2};$.extend(!0,a,b);a.resizableStyle.cssProperties&&(a.resizableStyle.cssProperties.zIndex=a.zOrder);a.nonResizableStyle.cssProperties&&
(a.nonResizableStyle.cssProperties.zIndex=a.zOrder);this.setParent(a.parent).setWidth(a.width).setHeight(a.height).setOrientation(a.orientation).setRepresentation(a.representation).setResizableStyle(a.resizableStyle).setNonResizableStyle(a.nonResizableStyle);this.id=a.orientation+a.parent.id+"resizehandler"};a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.getParent=function(){return this.parent};a.prototype.paint=function(){if(!this.html)throw Error("paint(): This handler has no html");
a.superclass.prototype.paint.call(this);this.setVisible(this.visible);return this};a.prototype.setCategory=function(b){"string"===typeof b&&(this.category=b);"resizable"===this.category?(this.color=new PMUI.util.Color(0,255,0),this.style.addClasses(["ui-resizable-handle","ui-resizable-"+this.orientation])):(this.color=new PMUI.util.Color(255,255,255),this.style.removeClasses(["ui-resizable-handle","ui-resizable-"+this.orientation]));return this};a.prototype.setResizableStyle=function(b){this.resizableStyle=
new PMUI.util.Style({belongsTo:this,cssProperties:b.cssProperties,cssClasses:b.cssClasses});return this};a.prototype.setNonResizableStyle=function(b){this.nonResizableStyle=new PMUI.util.Style({belongsTo:this,cssProperties:b.cssProperties,cssClasses:b.cssClasses});return this};PMUI.extendNamespace("PMUI.draw.ResizeHandler",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.orientation=null;this.visible=!1;this.zOrder=2;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Handler",a);a.prototype.type="SegmentMoveHandler";a.prototype.init=function(b){var a={width:4,height:4,parent:null,orientation:null,representation:new PMUI.draw.Rectangle,color:new PMUI.util.Color(0,255,0)};$.extend(!0,a,b);this.setWidth(a.width).setHeight(a.height).setParent(a.parent).setColor(a.color).setOrientation(a.orientation).setRepresentation(a.representation)};
a.prototype.paint=function(){a.superclass.prototype.paint.call(this);this.setVisible(this.visible);return this};a.prototype.attachListeners=function(b){var a=$(b.html);a.on("click",b.onClick(b));a.on("mousedown",b.onMouseDown(b));a.draggable({start:b.onDragStart(b),drag:b.onDrag(b),stop:b.onDragEnd(b),axis:b.orientation===b.HORIZONTAL?"y":"x"});return this};a.prototype.onMouseDown=function(b){return function(a,c){b.parent.parent.canvas.draggingASegmentHandler=!0}};a.prototype.onClick=function(b){return function(b,
a){b.stopPropagation()}};a.prototype.onDragStart=function(b){return function(a,c){var d=b.parent,e,g;d.getParent().savePoints({saveToOldPoints:!0});for(g=0;g<d.parent.lineSegments.getSize();g+=1)e=d.parent.lineSegments.get(g),e.clearIntersections();d.parent.clearAllIntersections();a.stopPropagation()}};a.prototype.onDrag=function(b){return function(a,c){b.parent.moveSegment(c.position.left,c.position.top)}};a.prototype.onDragEnd=function(b){return function(a,c){var d=b.parent.getParent(),e=d.canvas;
e.draggingASegmentHandler=!1;b.onDrag(b)(a,c);d.savePoints();d=new PMUI.command.CommandSegmentMove(d,{oldPoints:d.getOldPoints(),newPoints:d.getPoints()});d.execute();e.commandStack.add(d)}};PMUI.extendNamespace("PMUI.draw.SegmentMoveHandler",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this);this.percentage=this.direction=this.oldParent=this.parent=this.representation=this.connection=null;this.defaultZOrder=this.zOrder=1;this.realY=this.realX=0;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.TOWARDS_CENTER=5;a.prototype.type="Port";a.prototype.init=function(b){var a={width:4,height:4,visible:!1,parent:null};$.extend(!0,a,b);$.extend(!0,a,{representation:new PMUI.draw.Oval({width:a.width,height:a.height,
center:new PMUI.util.Point(0,0),visible:!0})});this.setVisible(a.visible).setParent(a.parent).setDimension(a.width,a.height).setRepresentation(a.representation)};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.style.addClasses(["port"]);return this.html};a.prototype.applyBorderMargin=function(b){b=b?1:-1;this.x+=b*this.parent.border[this.direction].x;this.y+=b*this.parent.border[this.direction].y;this.zoomX=this.x;this.zoomY=this.y;this.setAbsoluteX();this.setAbsoluteY();
this.html&&this.style.addProperties({left:this.zoomX,top:this.zoomY});return this};a.prototype.setX=function(b){this.zoomX=this.x=b;this.realX=this.canvas?this.x/this.canvas.zoomFactor:this.x;this.setAbsoluteX();this.html&&this.style.addProperties({left:this.zoomX});return this};a.prototype.setY=function(b){this.zoomY=this.y=b;this.setAbsoluteY();this.realY=this.canvas?this.y/this.canvas.zoomFactor:this.y;this.html&&this.style.addProperties({top:this.zoomY});return this};a.prototype.setWidth=function(b){this.zoomWidth=
this.width=b;this.html&&this.style.addProperties({width:this.zoomWidth});return this};a.prototype.setHeight=function(b){this.zoomHeight=this.height=b;this.html&&this.style.addProperties({height:this.zoomHeight});return this};a.prototype.paint=function(){this.html.appendChild(this.representation.getHTML());this.representation.paint();this.setVisible(this.visible);this.style.applyStyle();return this};a.prototype.repaint=function(b){b.style.addProperties({left:b.x,top:b.y});b.connection.connect();b.connection.setSegmentMoveHandlers();
b.connection.checkAndCreateIntersectionsWithAll();return this};a.prototype.onDragStart=function(b,a){return function(c,d){a.moveTowardsTheCenter(!0);b.moveTowardsTheCenter(!0);b.connection.disconnect();return!0}};a.prototype.onDrag=function(b,a,c,d){return function(e,g){var h;d.connectionSegment&&$(d.connectionSegment.getHTML()).remove();a.x=e.pageX-d.getX()+d.getLeftScroll()-d.getAbsoluteX();a.y=e.pageY-d.getY()+d.getTopScroll()-d.getAbsoluteY();h=c.getPoint(!1);h.x-=d.getAbsoluteX();h.y-=d.getAbsoluteY();
d.connectionSegment=new PMUI.draw.Segment({startPoint:h,endPoint:a,parent:d});d.connectionSegment.pointsTo=b;d.connectionSegment.createHTML();d.connectionSegment.paint()}};a.prototype.onDragEnd=function(b,a,c){return function(d,e){c.connectionSegment&&$(c.connectionSegment.getHTML()).remove();b.repaint(b);a.moveTowardsTheCenter();b.moveTowardsTheCenter();b.connection.showMoveHandlers()}};a.prototype.determinePercentage=function(){var b,a;if(!this.parent)return!1;this.direction===this.TOP||this.direction===
this.BOTTOM?(b=this.parent.getZoomWidth(),a=this.x):(b=this.parent.getZoomHeight(),a=this.y);this.percentage=Math.round(100*(a/b));return!0};a.prototype.show=function(){this.visible=!0;this.paint();this.moveTowardsTheCenter();return this};a.prototype.hide=function(){this.visible=!1;this.paint();this.moveTowardsTheCenter(!0);return this};a.prototype.saveAndDestroy=function(){this.parent.removePort(this);this.html=$(this.html).detach()[0];return this};a.prototype.attachListeners=function(b){var a;a=
b.connection.srcPort.getPoint(!1).equals(b.getPoint(!1))?b.connection.destPort:b.connection.srcPort;a={start:b.onDragStart(b,a),drag:b.onDrag(b,b.getPoint(!1),a,b.parent.canvas),stop:b.onDragEnd(b,a,b.parent.canvas)};$(b.html).draggable(a);$(b.html).mouseover(function(){$(b.html).css("cursor","Move")});return b};a.prototype.moveTowardsTheCenter=function(b){var f=a.prototype.TOWARDS_CENTER,c=[0,-f,0,f],f=[f,0,-f,0],d=1;b&&(d=-1);this.setPosition(this.x+c[this.direction]*d,this.y+f[this.direction]*
d);return this};a.prototype.setDirection=function(b){if(0<=b&&4>b)this.direction=b;else throw Error("setDirection(): parameter '"+b+"'is not valid");return this};a.prototype.getDirection=function(){return this.direction};a.prototype.setParent=function(b,a){this.canvas&&a&&(this.canvas.updatedElement={id:this.id,type:this.type,fields:[{field:"parent",oldVal:this.parent,newVal:b}]},$(this.canvas.html).trigger("changeelement"));this.parent=b;return this};a.prototype.getParent=function(){return this.parent};
a.prototype.setOldParent=function(b){this.oldParent=b;return this};a.prototype.getOldParent=function(){return this.oldParent};a.prototype.setConnection=function(b){if(b&&"Connection"===b.family)this.connection=b;else throw Error("setConnection(): parameter is not valid");return this};a.prototype.getConnection=function(){return this.connection};a.prototype.getRepresentation=function(){return this.representation};a.prototype.setRepresentation=function(b){if(b instanceof PMUI.draw.RegularShape)this.representation=
b;else throw Error("setRepresentation(): parameter must be an instance of any regularShape");return this};a.prototype.getPoint=function(b){parseInt(this.parent.style.getProperty("border"),10);return b?new PMUI.util.Point(this.getX()+Math.round(this.getWidth()/2),this.getY()+Math.round(this.getHeight()/2)):new PMUI.util.Point(this.getAbsoluteX()+Math.round(this.getWidth()/2),this.getAbsoluteY()+Math.round(this.getHeight()/2))};a.prototype.getPercentage=function(){return this.percentage};a.prototype.stringify=
function(){var b={},a={x:this.getX(),y:this.getY(),realX:this.realX,realY:this.realY,parent:this.getParent().getID()};$.extend(!0,b,a);return b};PMUI.extendNamespace("PMUI.draw.Port",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.endPoint=this.startPoint=this.parent=null;this.zOrder=PMUI.draw.Shape.prototype.MAX_ZINDEX;this.nextNeighbor=this.previousNeighbor=null;this.orientation="";this.width=1;this.moveHandler=this.segmentColor=this.segmentStyle=this.graphics=null;this.intersections=new PMUI.util.ArrayList;this.hasMoveHandler=!1;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.type="Segment";a.prototype.init=function(b){var a={startPoint:new PMUI.util.Point(0,
0),endPoint:new PMUI.util.Point(0,0),parent:null,color:new PMUI.util.Color(0,0,0)};$.extend(!0,a,b);this.setStartPoint(a.startPoint).setEndPoint(a.endPoint).setColor(a.color).setParent(a.parent)};a.prototype.createHTML=function(){this.html=document.createElement("div");this.html.id=this.id;this.html.style.position="absolute";this.html.style.left="0px";this.html.style.top="0px";this.html.style.height="0px";this.html.style.width="0px";this.html.style.zIndex=this.zOrder;return this.html};a.prototype.paint=
function(){if(null===this.getHTML())return this;null===this.graphics&&(this.graphics=new PMUI.draw.Graphics(this.html));this.graphics.drawLine(this.startPoint.x,this.startPoint.y,this.endPoint.x,this.endPoint.y,this.segmentStyle,this.segmentColor);this.parent.html.appendChild(this.html);return this};a.prototype.destroy=function(){$(this.html).remove();return this};a.prototype.paintWithIntersections=function(){this.destroy();var b,a,c,d,e=!1;if(null===this.getHTML())return this;null===this.graphics&&
(this.graphics=new PMUI.draw.Graphics(this.html));this.hasMoveHandler&&($(this.moveHandler.html).remove(),this.addSegmentMoveHandler());this.orientation===this.HORIZONTAL?(c=new PMUI.util.Point(PMUI.draw.Shape.prototype.DEFAULT_RADIUS,0),this.startPoint.x>this.endPoint.x&&(e=!0),this.intersections.sort(function(b,a){return b.center.x>=a.center.x})):(c=new PMUI.util.Point(0,PMUI.draw.Shape.prototype.DEFAULT_RADIUS),this.startPoint.y>this.endPoint.y&&(e=!0),this.intersections.sort(function(b,a){return b.center.y>=
a.center.y}));this.graphics.graphics.clear();b=this.startPoint.clone();for(d=0;d<this.intersections.getSize();d+=1)a=e?this.intersections.get(this.intersections.getSize()-d-1).center:this.intersections.get(d).center,a=e?a.add(c):a.subtract(c),this.graphics.drawLine(b.x,b.y,a.x,a.y,this.segmentStyle,this.segmentColor,0,0,!0),b=e?a.subtract(c.multiply(2)):a.add(c.multiply(2));a=this.endPoint.clone();this.graphics.drawLine(b.x,b.y,a.x,a.y,this.segmentStyle,this.segmentColor,0,0,!0);this.parent.html.appendChild(this.html);
return this};a.prototype.addSegmentMoveHandler=function(){var b=(this.startPoint.x+this.endPoint.x)/2,a=(this.startPoint.y+this.endPoint.y)/2;this.moveHandler=new PMUI.draw.SegmentMoveHandler({parent:this,orientation:this.orientation,style:{cssProperties:{border:"1px solid black"}}});b-=this.moveHandler.width/2;a-=this.moveHandler.height/2;this.moveHandler.setPosition(b,a);this.html.appendChild(this.moveHandler.getHTML());this.moveHandler.paint();this.moveHandler.attachListeners(this.moveHandler);
return this};a.prototype.getParent=function(){return this.parent};a.prototype.getStartPoint=function(){return this.startPoint};a.prototype.getEndPoint=function(){return this.endPoint};a.prototype.setParent=function(b){this.parent=b;return this};a.prototype.setStartPoint=function(b){this.startPoint=b;return this};a.prototype.setEndPoint=function(b){this.endPoint=b;return this};a.prototype.setStyle=function(b){this.segmentStyle=b;return this};a.prototype.setColor=function(b){this.segmentColor=b;return this};
a.prototype.createIntersectionWith=function(b,a){var c,d,e=!0;c=a?a:PMUI.draw.Geometry.segmentIntersectionPoint(this.startPoint,this.endPoint,b.startPoint,b.endPoint);for(d=0;d<this.intersections.getSize();d+=1)a.equals(this.intersections.get(d).center)&&(e=!1);e&&(c=new PMUI.draw.Intersection(c,b.parent.getID(),this),this.html.appendChild(c.getHTML()),c.paint(),this.intersections.insert(c));return this};a.prototype.clearIntersections=function(){for(var b,a=this.intersections.getSize();0<a;)b=this.intersections.get(a-
1),$(b.html).remove(),this.intersections.popLast(),a-=1;return this};a.prototype.moveSegment=function(b,a){var c=this.moveHandler,d=this.previousNeighbor,e=this.nextNeighbor,g;c.orientation===c.VERTICAL?(this.startPoint.x=b+c.width/2,this.endPoint.x=b+c.width/2,d.endPoint.x=this.startPoint.x,e.startPoint.x=this.endPoint.x):(this.startPoint.y=a+c.height/2,this.endPoint.y=a+c.height/2,d.endPoint.y=this.startPoint.y,e.startPoint.y=this.endPoint.y);this.moveHandler&&(c=(this.startPoint.x+this.endPoint.x)/
2-this.moveHandler.width/2,g=(this.startPoint.y+this.endPoint.y)/2-this.moveHandler.height/2,this.moveHandler.setPosition(c,g));d.paint();d.moveHandler&&(c=(d.startPoint.x+d.endPoint.x)/2-d.moveHandler.width/2,g=(d.startPoint.y+d.endPoint.y)/2-d.moveHandler.height/2,d.moveHandler.setPosition(c,g));e.paint();e.moveHandler&&(c=(e.startPoint.x+e.endPoint.x)/2-e.moveHandler.width/2,g=(e.startPoint.y+e.endPoint.y)/2-e.moveHandler.height/2,e.moveHandler.setPosition(c,g));this.paint();return this};PMUI.extendNamespace("PMUI.draw.Segment",
a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);a.prototype.initObject.call(this,b)};PMUI.inheritFrom("PMUI.draw.Core",a);a.prototype.initObject=function(b){this.createHTML();this.attachListeners()};a.prototype.attachListeners=function(){$(this.html).on("mousedown",this.onMouseDown(this)).on("mouseup",this.onMouseUp(this)).on("mousemove",this.onMouseMove(this)).on("click",this.onClick(this)).droppable({accept:"*",greedy:!0,onDrop:function(){return!1}})};a.prototype.onMouseDown=function(b){return function(b,
a){b.stopPropagation()}};a.prototype.onMouseUp=function(b){return function(b,a){b.stopPropagation()}};a.prototype.onClick=function(b){return function(b,a){b.stopPropagation()}};a.prototype.onMouseMove=function(b){return function(b,a){b.stopPropagation()}};PMUI.extendNamespace("PMUI.draw.ReadOnlyLayer",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,a){this.id=PMUI.generateUniqueId();this.val=a;this.key=b};a.prototype.type="DataItem";a.prototype.family="DataItem";a.prototype.getKey=function(){return this.key};a.prototype.getValue=function(){return this.val};a.prototype.setKey=function(b){this.key=b;return this};a.prototype.setValue=function(b){this.val=b;return this};a.prototype.set=function(b,a){this.key=b;this.val=a;return this};a.prototype.get=function(){var b={};b[this.key]=this.val;return b};a.prototype.getRecord=
function(){return{key:this.key,value:this.val}};PMUI.extendNamespace("PMUI.data.DataItem",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){b=b||{};a.superclass.call(this,b.key,b.value);this.custom=this.typeField=null;this.customKeys={};a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.data.DataItem",a);a.prototype.type="DataField";a.prototype.dataTypes={string:"native",number:"native",date:"native","boolean":"native",object:"native"};a.prototype.basicKeys={key:"native",value:"native",type:"class",val:"private",custom:"native",customKeys:"native",typeField:"native",family:"class"};a.prototype.defaultType=
"string";a.prototype.init=function(b){var a=this;b&&(this.setKey(b.key||null),this.setValue(b.value||null),this.setType(b.type||null));jQuery.each(b,function(b,d){!a.basicKeys[b]&&("object"!==typeof d&&"function"!==typeof d)&&(a[b]=d,a.customKeys[b]="custom")})};a.prototype.setType=function(b){b?this.dataTypes[b]?(this.typeField=b,this.custom=!1):(this.typeField=b,this.custom=!0):(this.custom=!1,this.typeField=this.defaultType);return this};a.prototype.getRecord=function(){var b={key:this.key,value:this.val,
type:this.typeField},a=this;jQuery.each(this.customKeys,function(c,d){b[c]=a[c]});return b};PMUI.extendNamespace("PMUI.data.DataField",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){this.factory=this.items=null;a.prototype.init.call(this,b)};a.prototype.type="DataSet";a.prototype.family="DataSet";a.prototype.init=function(b){var a={factory:{products:{datafield:PMUI.data.DataField,dataitem:PMUI.data.DataItem},defaultProduct:"dataitem"},items:[]};jQuery.extend(!0,a,b);this.items=new PMUI.util.ArrayList;this.factory=new PMUI.util.Factory(a.factory);this.setItems(a.items)};a.prototype.setItems=function(b){var a=this;jQuery.each(b,function(b,d){a.items.insert(a.factory.make(d))});
return this};a.prototype.addItem=function(b){b&&this.items.insert(this.factory.make(b));return this};a.prototype.getData=function(){var b,a=[];b=this.items.asArray();jQuery.each(b,function(b,d){a.push(d.getRecord())});return a};a.prototype.getJSON=function(){return JSON.stringify(this.getData())};a.prototype.getXML=function(){return PMUI.json2xml(this.getJSON())};a.prototype.removeItem=function(b){this.items.remove(b)};a.prototype.getValue=function(b){return this.items.find("key",b).getValue()};a.prototype.setValue=
function(b,a){this.items.find("key",b).setValue(a);return this};a.prototype.keys=function(){var b,a=[];b=this.items.asArray();jQuery.each(b,function(b,d){a.push(d.getKey())});return a};a.prototype.values=function(){var b,a=[];b=this.items.asArray();jQuery.each(b,function(b,d){a.push(d.getValue())});return a};PMUI.extendNamespace("PMUI.data.DataSet",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,f){a.superclass.call(this,b,f);this.listeners=this.hasMenuActive=this.itemAnchor=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.MenuItemElement",a);a.prototype.type="MenuItem";a.prototype.init=function(b){var a={hasMenuActive:!1,listeners:{click:function(){}}};$.extend(!0,a,b);this.setHasMenuActive(a.hasMenuActive);this.setListeners(a.listeners)};a.prototype.setHasMenuActive=function(b){this.hasMenuActive=b;return this};a.prototype.setListeners=function(b){this.listeners=
b;return this};a.prototype.createHTML=function(){var b,f;a.superclass.prototype.createHTML.call(this);this.itemAnchor=PMUI.createHTMLElement("a");this.itemAnchor.href="#";this.itemAnchor.className="pmui-item-link";f=PMUI.createHTMLElement("span");f.className="pmui-item-icon "+this.icon;b=PMUI.createHTMLElement("span");b.innerHTML=this.text;b.className="pmui-text";this.itemAnchor.appendChild(f);this.itemAnchor.appendChild(b);this.html.appendChild(this.itemAnchor);return this.html};a.prototype.defineEvents=
function(){var b,a=this;a.addEvent("click").listen(a.html,function(c){c.preventDefault();b=a.listeners.click;b(a,c);c.stopPropagation()});this.html&&(a.addEvent("mouseover").listen(a.html,function(b){b.preventDefault();a.setActiveItem(!0);b.stopPropagation()}),a.addEvent("mouseout").listen(a.html,function(b){b.preventDefault();a.setActiveItem(!1);b.stopPropagation()}),a.addEvent("mouseup").listen(a.html,function(a){a.stopPropagation()}),a.addEvent("mousedown").listen(a.html,function(a){a.stopPropagation()}))};
a.prototype.setActiveItem=function(a){this.disabled||(a?this.focused||(this.style.addClasses(["pmui-item-active"]),this.style.applyStyle()):this.hasMenuActive||(this.style.removeClasses(["pmui-item-active"]),this.style.applyStyle(),this.setFocused(!1)))};PMUI.extendNamespace("PMUI.item.MenuItem",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,f){a.superclass.call(this,b,f);this.listeners=this.itemAnchor=this.checked=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.MenuItemElement",a);a.prototype.type="CheckboxItem";a.prototype.init=function(a){var f={checked:!1,listeners:{click:function(){}}};$.extend(!0,f,a);this.setListeners(f.listeners);this.setChecked(f.checked)};a.prototype.setListeners=function(a){this.listeners=a;return this};a.prototype.setChecked=function(a){"boolean"===typeof a&&(this.checked=
a);return this};a.prototype.toggleCheckbox=function(){var a;a=this.itemAnchor.firstChild;this.checked?(this.checked=!1,jQuery(a).removeClass("pmui-check-checked"),jQuery(a).addClass("pmui-check-unchecked")):(this.checked=!0,jQuery(a).removeClass("pmui-check-unchecked"),jQuery(a).addClass("pmui-check-checked"))};a.prototype.createHTML=function(){var b,f;a.superclass.prototype.createHTML.call(this);this.itemAnchor=PMUI.createHTMLElement("a");this.itemAnchor.href="#";this.itemAnchor.className="pmui-item-link";
b=PMUI.createHTMLElement("span");b.innerHTML=this.text;b.className="pmui-text";f=PMUI.createHTMLElement("span");f.className="pmui-item-icon ";f.className+=this.checked?"pmui-check-checked":"pmui-check-unchecked";this.itemAnchor.appendChild(f);this.itemAnchor.appendChild(b);this.html.appendChild(this.itemAnchor);return this.html};a.prototype.defineEvents=function(){var a;that=this;that.addEvent("click").listen(that.html,function(f){f.preventDefault();that.toggleCheckbox();a=that.listeners.click;a(that,
f);f.stopPropagation()});this.html&&(that.addEvent("mouseover").listen(that.html,function(a){a.preventDefault();that.setActiveItem(!0);a.stopPropagation()}),that.addEvent("mouseout").listen(that.html,function(a){a.preventDefault();that.setActiveItem(!1);a.stopPropagation()}),that.addEvent("mouseup").listen(that.html,function(a){a.stopPropagation()}),that.addEvent("mousedown").listen(that.html,function(a){a.stopPropagation()}))};a.prototype.setActiveItem=function(a){this.disabled||(a?this.style.addClasses(["pmui-item-active"]):
this.style.removeClasses(["pmui-item-active"]),this.style.applyStyle());return this};PMUI.extendNamespace("PMUI.item.CheckboxItem",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b,f){a.superclass.call(this,b,f)};PMUI.inheritFrom("PMUI.core.MenuItemElement",a);a.prototype.type="SeparatorItem";a.prototype.createHTML=function(){var a,f;f=PMUI.createHTMLElement("li");f.className="pmui-item-separator";a=PMUI.createHTMLElement("span");a.className="pmui-separator";a.innerHTML=" ";f.appendChild(a);return this.html=f};PMUI.extendNamespace("PMUI.item.SeparatorItem",a);"undefined"!==typeof exports&&(module.exports=a)})();
(function(){var a=function(b){a.superclass.call(this,b);this.listeners=this.className=this.currentItem=this.parent=null;a.prototype.init.call(this,b)};PMUI.inheritFrom("PMUI.core.Panel",a);a.prototype.type="Menu";a.prototype.family="ui";a.prototype.init=function(a){var f={text:" ",parent:null,items:[],parentMenu:null,positionMode:"absolute",visible:!1,className:"pmui-menu-container",currentItem:null,factory:{products:{menuitem:PMUI.item.MenuItem,menucheckbox:PMUI.item.CheckboxItem,menuseparator:PMUI.item.SeparatorItem},
defaultProduct:"menuitem"},listeners:{clickParent:function(){},destroy:function(){}}};jQuery.extend(!0,f,a);this.setFactory(f.factory).setListeners(f.listeners).setClassName(f.className).setPositionMode(f.positionMode).setItemsMenu(f.items).setVisible(f.visible)};a.prototype.setItemsMenu=function(a){var f,c,d=a.length;this.clearItems();for(c=0;c<d;c+=1)f=this.factory.make(a[c]),this.addItem(f);this.calculateDimension();return this};a.prototype.setListeners=function(a){this.listeners=a;return this};
a.prototype.setClassName=function(a){this.className=a;return this};a.prototype.setParentWidget=function(a){"object"===typeof a&&(this.parent=a);return this};a.prototype.createHTML=function(){a.superclass.prototype.createHTML.call(this);this.style.addClasses([this.className]);this.setZOrder(1E3);this.generateMenu();return this.html};a.prototype.generateMenu=function(){var a,f;f=PMUI.createHTMLElement("ul");f.className="pmui-list";for(a=0;a<this.items.getSize();a+=1)f.appendChild(this.getItems()[a].getHTML());
this.html.appendChild(f);return this};a.prototype.show=function(a,f){this.setPosition({x:a,y:f});this.setVisible(!0)};a.prototype.removeMenu=function(){this.setVisible(!1);document.body.removeChild(this.html)};a.prototype.setDimension=function(a,f){this.setWidth(a);this.setHeight(f);return this};a.prototype.calculateDimension=function(){var a=0,f=20,c,d,e=this.getItems();for(c=0;c<e.length;c+=1){switch(e[c].getType()){case "MenuItem":case "CheckboxItem":f+=20;break;case "SeparatorItem":f+=0}d=e[c].text||
"";""!==d&&(d=this.calculateWidth(d),d>a&&(a=d))}this.setDimension(71+a,f);return this};a.prototype.defineEvents=function(){var a,f;if(0<this.items.getSize()){f=this.getItems();for(a=0;a<f.length;a+=1)f[a].defineEvents()}};PMUI.extendNamespace("PMUI.ui.Menu",a);"undefined"!==typeof exports&&(module.exports=a)})();

View File

@@ -1 +0,0 @@
/var/www/pmui/build/js/min/pmui-1.0.0.min.js

View File

@@ -1 +0,0 @@
/var/www/pmui/libraries/restclient/restclient.js

View File

@@ -1 +0,0 @@
/var/www/michelangelofe/translations.js

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff