-
Notifications
You must be signed in to change notification settings - Fork 0
/
dest.html
398 lines (391 loc) · 289 KB
/
dest.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<!DOCTYPE html>
<html>
<head>
<script>
/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
</script>
<script>
/* cytoscape.min.js */
/**
* This file is part of cytoscape.js 2.0.2.
*
* Cytoscape.js is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Cytoscape.js is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* cytoscape.js. If not, see <http://www.gnu.org/licenses/>.
*/
var cytoscape;(function(){var a=cytoscape=function(){return cytoscape.init.apply(cytoscape,arguments)};a.init=function(b){if(b===undefined){b={}}if(a.is.plainObject(b)){return new a.Core(b)}else{if(a.is.string(b)){return a.extension.apply(a.extension,arguments)}}};a.fn={};if(typeof exports!=="undefined"){exports=module.exports=cytoscape}window.cytoscape=cytoscape})();(function(a){a.is={string:function(b){return b!=null&&typeof b==typeof""},fn:function(b){return b!=null&&typeof b===typeof function(){}
},array:function(b){return b!=null&&b instanceof Array},plainObject:function(b){return b!=null&&typeof b===typeof{}&&!a.is.array(b)&&b.constructor===Object},number:function(b){return b!=null&&typeof b===typeof 1&&!isNaN(b)},integer:function(b){return a.is.number(b)&&Math.floor(b)===b},color:function(b){return b!=null&&typeof b===typeof""&&$.Color(b).toString()!==""},bool:function(b){return b!=null&&typeof b===typeof true},elementOrCollection:function(b){return a.is.element(b)||a.is.collection(b)},element:function(b){return b instanceof a.Element&&b._private.single
},collection:function(b){return b instanceof a.Collection&&!b._private.single},core:function(b){return b instanceof a.Core},style:function(b){return b instanceof a.Style},stylesheet:function(b){return b instanceof a.Stylesheet},event:function(b){return b instanceof a.Event},emptyString:function(b){if(!b){return true}else{if(a.is.string(b)){if(b===""||b.match(/^\s+$/)){return true}}}return false},nonemptyString:function(b){if(b&&a.is.string(b)&&b!==""&&!b.match(/^\s+$/)){return true}return false},domElement:function(b){if(typeof HTMLElement==="undefined"){return false
}else{return b instanceof HTMLElement}}}})(cytoscape);(function(a){a.util={extend:function(){var l,d,b,c,h,j,g=arguments[0]||{},f=1,e=arguments.length,k=false;if(typeof g==="boolean"){k=g;g=arguments[1]||{};f=2}if(typeof g!=="object"&&!a.is.fn(g)){g={}}if(e===f){g=this;--f}for(;f<e;f++){if((l=arguments[f])!=null){for(d in l){b=g[d];c=l[d];if(g===c){continue}if(k&&c&&(a.is.plainObject(c)||(h=a.is.array(c)))){if(h){h=false;j=b&&a.is.array(b)?b:[]}else{j=b&&a.is.plainObject(b)?b:{}}g[d]=a.util.extend(k,j,c)
}else{if(c!==undefined){g[d]=c}}}}}return g},error:function(b){if(console){if(console.error){console.error(b)}else{if(console.log){console.log(b)}else{throw b}}}else{throw b}},clone:function(d){var c={};for(var b in d){if(d.hasOwnProperty(b)){c[b]=d[b]}}return c},copy:function(b){if(b==null){return b}if(a.is.array(b)){return b.slice()}else{if(a.is.plainObject(b)){return a.util.clone(b)}else{return b}}},mapEmpty:function(d){var c=true;if(d!=null){for(var b in d){c=false;break}}return c},pushMap:function(b){var c=a.util.getMap(b);
if(c==null){a.util.setMap($.extend({},b,{value:[b.value]}))}else{c.push(b.value)}},setMap:function(c){var g=c.map;var e;var f=c.keys;var b=f.length;for(var d=0;d<b;d++){var e=f[d];if(a.is.plainObject(e)){a.util.error("Tried to set map with object key")}if(d<f.length-1){if(g[e]==null){g[e]={}}g=g[e]}else{g[e]=c.value}}},getMap:function(c){var g=c.map;var f=c.keys;var b=f.length;for(var e=0;e<b;e++){var d=f[e];if(a.is.plainObject(d)){a.util.error("Tried to get map with object key")}g=g[d];if(g==null){return g
}}return g},deleteMap:function(k){var e=k.map;var j=k.keys;var d=j.length;var c=k.keepChildren;for(var f=0;f<d;f++){var g=j[f];if(a.is.plainObject(g)){a.util.error("Tried to delete map with object key")}var h=f===k.keys.length-1;if(h){if(c){for(var b in e){if(!c[b]){delete e[b]}}}else{delete e[g]}}else{e=e[g]}}},capitalize:function(b){if(a.is.emptyString(b)){return b}return b.charAt(0).toUpperCase()+b.substring(1)},camel2dash:function(h){var e=[];for(var f=0;f<h.length;f++){var g=h[f];var b=g.toLowerCase();
var d=g!==b;if(d){e.push("-");e.push(b)}else{e.push(g)}}var c=e.length===h.length;if(c){return h}return e.join("")},dash2camel:function(f){var b=[];var e=false;for(var c=0;c<f.length;c++){var d=f[c];var g=d==="-";if(g){e=true}else{if(e){b.push(d.toUpperCase())}else{b.push(d)}e=false}}return b.join("")},trim:function(d){var c,b;for(c=0;c<d.length&&d[c]===" ";c++){}for(b=d.length-1;b>c&&d[b]===" ";b--){}return d.substring(c,b+1)},hex2tuple:function(h){if(!(h.length===4||h.length===7)||h[0]!=="#"){return
}var f=h.length===4;var e,d,c;var i=16;if(f){e=parseInt(h[1]+h[1],i);d=parseInt(h[2]+h[2],i);c=parseInt(h[3]+h[3],i)}else{e=parseInt(h[1]+h[2],i);d=parseInt(h[3]+h[4],i);c=parseInt(h[5]+h[6],i)}return[e,d,c]},hsl2tuple:function(z){var u;var k=a.util.regex.number;var o,A,j,w,c,t,v;var i=new RegExp("^"+a.util.regex.hsla+"$").exec(z);if(i){o=parseInt(i[1]);if(o<0){o=(360-(-1*o%360))%360}else{if(o>360){o=o%360}}o/=360;A=parseFloat(i[2]);if(A<0||A>100){return}A=A/100;j=parseFloat(i[3]);if(j<0||j>100){return
}j=j/100;w=i[4];if(w!==undefined){w=parseFloat(w);if(w<0||w>1){return}}if(A===0){c=t=v=Math.round(j*255)}else{function f(h,g,b){if(b<0){b+=1}if(b>1){b-=1}if(b<1/6){return h+(g-h)*6*b}if(b<1/2){return g}if(b<2/3){return h+(g-h)*(2/3-b)*6}return h}var d=j<0.5?j*(1+A):j+A-j*A;var e=2*j-d;c=Math.round(255*f(e,d,o+1/3));t=Math.round(255*f(e,d,o));v=Math.round(255*f(e,d,o-1/3))}u=[c,t,v,w]}return u},rgb2tuple:function(k){var h;var d=a.util.regex.number;var b=new RegExp("^"+a.util.regex.rgba+"$").exec(k);
if(b){h=[];var l=[];for(var e=1;e<=3;e++){var g=b[e];if(g[g.length-1]==="%"){l[e]=true}g=parseFloat(g);if(l[e]){g=g/100*255}if(g<0||g>255){return}h.push(Math.floor(g))}var f=l[1]||l[2]||l[3];var j=l[1]&&l[2]&&l[3];if(f&&!j){return}var c=b[4];if(c!==undefined){c=parseFloat(c);if(c<0||c>1){return}h.push(c)}}return h},colorname2tuple:function(b){return a.util.colors[b.toLowerCase()]},color2tuple:function(b){return a.util.colorname2tuple(b)||a.util.hex2tuple(b)||a.util.rgb2tuple(b)||a.util.hsl2tuple(b)
},tuple2hex:function(d){var f=d[0];var e=d[1];var c=d[2];function h(b){var g=b.toString(16);if(g.length===1){g="0"+g}return g}return"#"+h(f)+h(e)+h(c)},colors:{transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}};
a.util.regex={};a.util.regex.number="(?:\\d*\\.\\d+|\\d+|\\d*\\.\\d+[eE]\\d+)";a.util.regex.rgba="rgb[a]?\\(("+a.util.regex.number+"[%]?)\\s*,\\s*("+a.util.regex.number+"[%]?)\\s*,\\s*("+a.util.regex.number+"[%]?)(?:\\s*,\\s*("+a.util.regex.number+"))?\\)";a.util.regex.rgbaNoBackRefs="rgb[a]?\\((?:"+a.util.regex.number+"[%]?)\\s*,\\s*(?:"+a.util.regex.number+"[%]?)\\s*,\\s*(?:"+a.util.regex.number+"[%]?)(?:\\s*,\\s*(?:"+a.util.regex.number+"))?\\)";a.util.regex.hsla="hsl[a]?\\(("+a.util.regex.number+")\\s*,\\s*("+a.util.regex.number+"[%])\\s*,\\s*("+a.util.regex.number+"[%])(?:\\s*,\\s*("+a.util.regex.number+"))?\\)";
a.util.regex.hslaNoBackRefs="hsl[a]?\\((?:"+a.util.regex.number+")\\s*,\\s*(?:"+a.util.regex.number+"[%])\\s*,\\s*(?:"+a.util.regex.number+"[%])(?:\\s*,\\s*(?:"+a.util.regex.number+"))?\\)";a.util.regex.hex3="\\#[0-9a-fA-F]{3}";a.util.regex.hex6="\\#[0-9a-fA-F]{6}"})(cytoscape);(function(b){b.math={};b.math.boxInBezierVicinity=function(o,j,u,k,q,i,p,h,l,f,m){var v=Math.min(o,u)-m;var s=Math.min(j,k)-m;var t=Math.max(o,u)+m;var r=Math.max(j,k)+m;if(q>=v&&q<=t&&i>=s&&i<=r){return 2}else{if(l>=v&&l<=t&&f>=s&&f<=r){return 2
}else{if(p>=v&&p<=t&&h>=s&&h<=r){return 1}}}var g=Math.min(q,p,l);var e=Math.min(i,h,f);var d=Math.max(q,p,l);var c=Math.max(i,h,f);if(g>t||d<v||e>r||c<s){return 0}return 1};b.math.checkStraightEdgeCrossesBox=function(r,k,A,o,t,g,s,d,q){var B=Math.min(r,A)-q;var w=Math.min(k,o)-q;var z=Math.max(r,A)+q;var v=Math.max(k,o)+q;var h=s-t;var m=t;var u;var e=d-g;var l=g;var p;if(Math.abs(h)<0.0001){return(t>=B&&t<=z&&Math.min(g,d)<=w&&Math.max(g,d)>=v)}var c=(B-m)/h;if(c>0&&c<=1){u=e*c+l;if(u>=w&&u<=v){return true
}}var j=(z-m)/h;if(j>0&&j<=1){u=e*j+l;if(u>=w&&u<=v){return true}}var f=(w-l)/e;if(f>0&&f<=1){p=h*f+m;if(p>=B&&p<=z){return true}}var i=(v-l)/e;if(i>0&&i<=1){p=h*i+m;if(p>=B&&p<=z){return true}}return false};b.math.checkBezierCrossesBox=function(w,h,L,A,q,U,l,R,j,O,d){var s=Math.min(w,L)-d;var p=Math.min(h,A)-d;var T=Math.max(w,L)+d;var Q=Math.max(h,A)+d;if(q>=s&&q<=T&&U>=p&&U<=Q){return true}else{if(j>=s&&j<=T&&O>=p&&O<=Q){return true}}var v=q-2*l+j;var g=-2*q+2*l;var H=q;var B=[];if(Math.abs(v)<0.0001){var M=(s-q)/g;
var z=(T-q)/g;B.push(M,z)}else{var E=g*g-4*v*(H-s);var t,r;if(E>0){var F=Math.sqrt(E);t=(-g+F)/(2*v);r=(-g-F)/(2*v);B.push(t,r)}var D=g*g-4*v*(H-T);var o,k;if(D>0){var F=Math.sqrt(D);o=(-g+F)/(2*v);k=(-g-F)/(2*v);B.push(o,k)}}B.sort(function(W,V){return W-V});var u=U-2*R+O;var e=-2*U+2*R;var G=U;var K=[];if(Math.abs(u)<0.0001){var f=(p-U)/e;var I=(Q-U)/e;K.push(f,I)}else{var m=e*e-4*u*(G-p);var c,S;if(m>0){var F=Math.sqrt(m);c=(-e+F)/(2*u);S=(-e-F)/(2*u);K.push(c,S)}var i=e*e-4*u*(G-Q);var P,N;if(i>0){var F=Math.sqrt(i);
P=(-e+F)/(2*u);N=(-e-F)/(2*u);K.push(P,N)}}K.sort(function(W,V){return W-V});for(var C=0;C<B.length;C+=2){for(var J=1;J<K.length;J+=2){if(B[C]<K[J]&&K[J]>=0&&B[C]<=1&&B[C+1]>K[J-1]&&K[J-1]<=1&&B[C+1]>=0){return true}}}return false};b.math.inBezierVicinity=function(i,h,t,e,s,d,r,c,A){var k=0.25*t+0.5*s+0.25*r;var j=0.25*e+0.5*d+0.25*c;var o,m,w,u;var g,f,l;var z=function(C,I,D,B,H,G,E,F){g=(G-B)*(C-D)+(D-H)*(I-B);f=g*g;sideSquared=(G-B)*(G-B)+(D-H)*(D-H);if(F){if(g>0){return false}}else{if(g<0){return false
}}return(f/sideSquared>E)};var q=(k+s)/2;var p=(j+d)/2;var v=true;if(z(q,p,t,e,s,d,0,v)){v=!v}return(!z(i,h,t,e,s,d,A,v)&&!z(i,h,s,d,r,c,A,v)&&!z(i,h,r,c,t,e,A,v))};b.math.solveCubic=function(o,m,l,k,v){m/=o;l/=o;k/=o;var f,g,e,i,u,p,h,j;g=(3*l-(m*m))/9;e=-(27*k)+m*(9*l-2*(m*m));e/=54;f=g*g*g+e*e;v[1]=0;h=(m/3);if(f>0){u=e+Math.sqrt(f);u=((u<0)?-Math.pow(-u,(1/3)):Math.pow(u,(1/3)));p=e-Math.sqrt(f);p=((p<0)?-Math.pow(-p,(1/3)):Math.pow(p,(1/3)));v[0]=-h+u+p;h+=(u+p)/2;v[4]=v[2]=-h;h=Math.sqrt(3)*(-p+u)/2;
v[3]=h;v[5]=-h;return}v[5]=v[3]=0;if(f==0){j=((e<0)?-Math.pow(-e,(1/3)):Math.pow(e,(1/3)));v[0]=-h+2*j;v[4]=v[2]=-(j+h);return}g=-g;i=g*g*g;i=Math.acos(e/Math.sqrt(i));j=2*Math.sqrt(g);v[0]=-h+j*Math.cos(i/3);v[2]=-h+j*Math.cos((i+2*Math.PI)/3);v[4]=-h+j*Math.cos((i+4*Math.PI)/3);return};b.math.sqDistanceToQuadraticBezier=function(q,p,v,j,u,h,t,g){var D=1*v*v-4*v*u+2*v*t+4*u*u-4*u*t+t*t+j*j-4*j*h+2*j*g+4*h*h-4*h*g+g*g;var C=1*9*v*u-3*v*v-3*v*t-6*u*u+3*u*t+9*j*h-3*j*j-3*j*g-6*h*h+3*h*g;var A=1*3*v*v-6*v*u+v*t-v*q+2*u*u+2*u*q-t*q+3*j*j-6*j*h+j*g-j*p+2*h*h+2*h*p-g*p;
var z=1*v*u-v*v+v*q-u*q+j*h-j*j+j*p-h*p;a("coefficients: "+D/D+", "+C/D+", "+A/D+", "+z/D);var k=[];this.solveCubic(D,C,A,z,k);var e=1e-7;var B=[];for(var l=0;l<6;l+=2){if(Math.abs(k[l+1])<e&&k[l]>=0&&k[l]<=1){B.push(k[l])}}B.push(1);B.push(0);var f=-1;var w;var o,m,r;for(var s=0;s<B.length;s++){o=Math.pow(1-B[s],2)*v+2*(1-B[s])*B[s]*u+B[s]*B[s]*t;m=Math.pow(1-B[s],2)*j+2*(1-B[s])*B[s]*h+B[s]*B[s]*g;r=Math.pow(o-q,2)+Math.pow(m-p,2);a("distance for param "+B[s]+": "+Math.sqrt(r));if(f>=0){if(r<f){f=r;
w=B[s]}}else{f=r;w=B[s]}}a("given: ( "+q+", "+p+"), ( "+v+", "+j+"), ( "+u+", "+h+"), ( "+t+", "+g+")");a("roots: "+k);a("params: "+B);a("closest param: "+w);return f};var a=function(c){if(false){console.log(c)}}})(cytoscape);(function(a){a.instances=[];a.instanceCounter=0;a.lastInstanceTime;a.registerInstance=function(b,g){var i;if(a.is.core(b)){i=b}else{if(a.is.domElement(b)){g=b}}var f=a.getRegistrationForInstance(b,g);if(f){if(!f.cy){f.cy=b;f.domElement=g}else{a.util.error("Tried to register on a pre-existing registration")
}return f}else{var e=+new Date;var d;if(!a.lastInstanceTime||a.lastInstanceTime===e){a.instanceCounter=0}else{++a.instanceCounter}a.lastInstanceTime=e;d=a.instanceCounter;var h="cy-"+e+"-"+d;var c={id:h,cy:i,domElement:g,readies:[]};a.instances.push(c);a.instances[h]=c;return c}};a.removeRegistrationForInstance=function(b,e){var g;if(a.is.core(b)){g=b}else{if(a.is.domElement(b)){e=b}}if(a.is.core(g)){var f=g._private.instanceId;delete a.instances[f];a.instances.splice(f,1)}else{if(a.is.domElement(e)){for(var c=0;
c<a.instances.length;c++){var d=a.instances[c];if(d.domElement===e){delete a.instances[d.id];a.instances.splice(c,1);c--}}}}};a.getRegistrationForInstance=function(b,e){var g;if(a.is.core(b)){if(b.registered()){g=b}}else{if(a.is.domElement(b)){e=b}}if(a.is.core(g)){var f=g._private.instanceId;return a.instances[f]}else{if(a.is.domElement(e)){for(var c=a.instances.length-1;c>=0;c--){var d=a.instances[c];if(d.domElement===e){return d}}}}}})(cytoscape);(function(c){var f={};c.extensions=f;var d={};c.modules=d;
function b(j,i,k){var h={};h[i]=k;switch(j){case"core":case"collection":c.fn[j](h)}return c.util.setMap({map:f,keys:[j,i],value:k})}function g(i,h){return c.util.getMap({map:f,keys:[i,h]})}function e(k,i,j,h,l){return c.util.setMap({map:d,keys:[k,i,j,h],value:l})}function a(k,i,j,h){return c.util.getMap({map:d,keys:[k,i,j,h]})}c.extension=function(){if(arguments.length==2){return g.apply(this,arguments)}else{if(arguments.length==3){return b.apply(this,arguments)}else{if(arguments.length==4){return a.apply(this,arguments)
}else{if(arguments.length==5){return e.apply(this,arguments)}else{$.error("Invalid extension access syntax")}}}}}})(cytoscape);(function(b,a){if(!b){return}b.fn.cytoscape=function(h){var k=b(this);if(h==="get"){var g=a.getRegistrationForInstance(k[0]);return g.cy}else{if(a.is.fn(h)){var f=h;var c=k[0];var g=a.getRegistrationForInstance(c);if(!g){g=a.registerInstance(c)}if(g&&g.cy&&g.cy.ready()){g.cy.trigger("ready",[],f)}else{g.readies.push(f)}}else{if(a.is.plainObject(h)){return k.each(function(){var i=b.extend({},h,{container:b(this)[0]});
cytoscape(i)})}else{var c=k[0];var j=[];var d=[];for(var e=1;e<arguments.length;e++){d[e-1]=arguments[e]}k.each(function(){var l=a.getRegistrationForInstance(c);var o=l.cy;var m=h;if(o&&a.is.fn(o[m])){var i=o[m].apply(o,d);j.push(i)}});if(j.length===1){j=j[0]}else{if(j.length==0){j=b(this)}}return j}}}};b.cytoscape=cytoscape;if(b.fn.cy==null&&b.cy==null){b.fn.cy=b.fn.cytoscape;b.cy=b.cytoscape}})(typeof jQuery!=="undefined"?jQuery:null,cytoscape);(function(a){a.Event=function(e,d){if(!(this instanceof a.Event)){return new a.Event(e,d)
}if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=(e.defaultPrevented||e.returnValue===false||e.getPreventDefault&&e.getPreventDefault())?c:b}else{this.type=e}if(d){a.util.extend(this,d)}this.timeStamp=e&&e.timeStamp||+new Date};function b(){return false}function c(){return true}a.Event.prototype={preventDefault:function(){this.isDefaultPrevented=c;var d=this.originalEvent;if(!d){return}if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=c;
var d=this.originalEvent;if(!d){return}if(d.stopPropagation){d.stopPropagation()}d.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=c;this.stopPropagation()},isDefaultPrevented:b,isPropagationStopped:b,isImmediatePropagationStopped:b}})(cytoscape);(function(a){a.define={data:function(c){var b={field:"data",bindingEvent:"data",allowBinding:false,allowSetting:false,allowGetting:false,settingEvent:"data",settingTriggersEvent:false,triggerFnName:"trigger",immutableKeys:{},updateMappers:false};
c=a.util.extend({},b,c);return function(e,s){var g=c;var z=this;var f=z.length!==undefined;var t=f?z:[z];var w=f?z[0]:z;if(a.is.string(e)){if(g.allowGetting&&s===undefined){var q;if(w){q=w._private[g.field][e]}return q}else{if(g.allowSetting&&s!==undefined){var d=!g.immutableKeys[e];if(d){for(var o=0,h=t.length;o<h;o++){t[o]._private[g.field][e]=s}if(g.updateMappers){z.updateMappers()}if(g.settingTriggersEvent){z[g.triggerFnName](g.settingEvent)}}}}}else{if(g.allowSetting&&a.is.plainObject(e)){var m=e;
var j,u;for(j in m){u=m[j];var d=!g.immutableKeys[j];if(d){for(var o=0,h=t.length;o<h;o++){t[o]._private[g.field][j]=u}}}if(g.updateMappers){z.updateMappers()}if(g.settingTriggersEvent){z[g.triggerFnName](g.settingEvent)}}else{if(g.allowBinding&&a.is.fn(e)){var r=e;z.bind(g.bindingEvent,r)}else{if(g.allowGetting&&e===undefined){var q;if(w){q=w._private[g.field]}return q}}}}return z}},batchData:function(d){var c={field:"data",event:"data",triggerFnName:"trigger",immutableKeys:{},updateMappers:false};
var b=d=a.util.extend({},c,d);return function(f){var s=this;var h=s.length!==undefined;var u=h?s:s._private.elements;if(u.length===0){return s}var j=h?u[0]._private.cy:s;for(var o=0;o<u.length;o++){var t=u[o];var g=t._private.data.id;var r=f[g];if(r!==undefined&&r!==null){var m=r;var l,p;for(l in m){p=m[l];var e=!b.immutableKeys[l];if(e){t._private[b.field][l]=p}}}}var q=new a.Collection(j,u);if(b.updateMappers){q.updateMappers()}q[b.triggerFnName](b.event);return s}},removeData:function(c){var b={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:false,immutableKeys:{}};
c=a.util.extend({},b,c);return function(q){var g=c;var v=this;var f=v.length!==undefined;var r=f?v:[v];var t=f?v[0]:v;if(a.is.string(q)){var u=q.split(/\s+/);var j=u.length;for(var k=0;k<j;k++){var s=u[k];if(a.is.emptyString(s)){continue}var e=!g.immutableKeys[s];if(e){for(var o=0,h=r.length;o<h;o++){delete r[o]._private[g.field][s]}}}if(g.triggerEvent){v[g.triggerFnName](g.event)}}else{if(q===undefined){for(var o=0,h=r.length;o<h;o++){var m=r[o]._private[g.field];for(var s in m){var d=!g.immutableKeys[s];
if(d){delete m[s]}}}if(g.triggerEvent){v[g.triggerFnName](g.event)}}}return v}},event:{regex:/(\w+)(\.\w+)?/,optionalTypeRegex:/(\w+)?(\.\w+)?/,props:"altKey bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase metaKey offsetX offsetY originalTarget pageX pageY prevValue relatedTarget screenX screenY shiftKey target view which".split(/\s+/),aliases:"mousedown mouseup click mouseover mouseout mousemove touchstart touchmove touchend grab drag free".split(/\s+/),aliasesOn:function(e){var b=a.define.event.aliases;
for(var d=0;d<b.length;d++){var c=b[d];e[c]=function(f,g){if(a.is.fn(g)){this.on(c,f,g)}else{if(a.is.fn(f)){g=f;this.on(c,g)}else{this.trigger(c)}}return this}}},falseCallback:function(){return false}},on:function(c){var b={unbindSelfOnTrigger:false,unbindAllBindersOnTrigger:false};c=a.util.extend({},b,c);return function(e,u,B,k){var r=this;var d=r.length!==undefined;var f=d?r:[r];var z=d?r[0]:r;var w=a.is.string(e);var s=c;if(a.is.plainObject(u)){k=B;B=u;u=undefined}else{if(a.is.fn(u)||u===false){k=u;
B=undefined;u=undefined}}if(a.is.fn(B)||B===false){k=B;B=undefined}if(!(a.is.fn(k)||k===false)&&w){return r}if(w){var A={};A[e]=k;e=A}for(var l in e){k=e[l];if(k===false){k=a.define.event.falseCallback}if(!a.is.fn(k)){continue}l=l.split(/\s+/);for(var v=0;v<l.length;v++){var q=l[v];if(a.is.emptyString(q)){continue}var m=q.match(a.define.event.regex);if(m){var g=m[1];var o=m[2]?m[2]:undefined;var h={callback:k,data:B,delegated:u?true:false,selector:u,type:g,namespace:o,unbindSelfOnTrigger:s.unbindSelfOnTrigger,unbindAllBindersOnTrigger:s.unbindAllBindersOnTrigger,binders:f};
for(var t=0;t<f.length;t++){f[t]._private.listeners.push(h)}}}}return r}},off:function(c){var b={};c=a.util.extend({},b,c);return function(e,B,l){var t=this;var d=t.length!==undefined;var f=d?t:[t];var F=d?t[0]:t;var E=a.is.string(e);var u=c;if(arguments.length===0){for(var C=0;C<f.length;C++){f[C]._private.listeners=[]}return t}if(a.is.fn(B)||B===false){l=B;B=undefined}if(E){var H={};H[e]=l;e=H}for(var m in e){l=e[m];if(l===false){l=a.define.event.falseCallback}m=m.split(/\s+/);for(var D=0;D<m.length;
D++){var s=m[D];if(a.is.emptyString(s)){continue}var o=s.match(a.define.event.optionalTypeRegex);if(o){var g=o[1]?o[1]:undefined;var r=o[2]?o[2]:undefined;for(var C=0;C<f.length;C++){var v=f[C]._private.listeners;for(var A=0;A<v.length;A++){var k=v[A];var q=!r||r===k.namespace;var w=!g||k.type===g;var z=!l||l===k.callback;var G=q&&w&&z;if(G){v.splice(A,1);A--}}}}}}return t}},trigger:function(c){var b={};c=a.util.extend({},b,c);return function(F,g,A){var q=this;var v=q.length!==undefined;var B=v?q:[q];
var G=v?q[0]:q;var L=a.is.string(F);var h=a.is.plainObject(F);var f=a.is.event(F);var T=c;var C=this._private.cy||this;if(L){var N=F.split(/\s+/);F=[];for(var Y=0;Y<N.length;Y++){var I=N[Y];if(a.is.emptyString(I)){continue}var o=I.match(a.define.event.regex);var ad=o[1];var O=o[2]?o[2]:undefined;F.push({type:ad,namespace:O})}}else{if(h){var aa=F;F=[aa]}}if(g){if(!a.is.array(g)){g=[g]}}else{g=[]}for(var Y=0;Y<F.length;Y++){var r=F[Y];for(var X=0;X<B.length;X++){var M=B[X];var R=M._private.listeners;
var d=a.is.element(M);var E=d;var I;if(f){I=r;I.cyTarget=I.cyTarget||M;I.cy=I.cy||C;I.namespace=I.namespace||r.namespace}else{I=new a.Event(r,{cyTarget:M,cy:C,namespace:r.namespace});var H=a.define.event.props;for(var W=0;W<H.length;W++){var z=H[W];I[z]=r[z]}}if(A){R=[{namespace:I.namespace,type:I.type,callback:A}]}for(var W=0;W<R.length;W++){var e=R[W];var P=!e.namespace||e.namespace===I.namespace;var w=e.type===I.type;var Q=e.delegated?(M!==I.cyTarget&&a.is.element(I.cyTarget)&&I.cyTarget.is(e.selector)):(true);
var J=P&&w&&Q;if(J){var S=[I];S=S.concat(g);if(e.data){I.data=e.data}else{I.data=undefined}if(e.unbindSelfOnTrigger||e.unbindAllBindersOnTrigger){R.splice(W,1);W--}if(e.unbindAllBindersOnTrigger){var u=e.binders;for(var V=0;V<u.length;V++){var t=u[V];if(!t||t===M){continue}var D=t._private.listeners;for(var U=0;U<D.length;U++){var ab=D[U];if(ab===e){D.splice(U,1);U--}}}}var ac=e.delegated?I.cyTarget:M;var K=e.callback.apply(ac,S);if(K===false||I.isPropagationStopped()){E=false;if(K===false){I.stopPropagation();
I.preventDefault()}}}}if(E){var s=M.parent();var Z=s.length!==0;if(Z){s=s[0];s.trigger(I)}else{C.trigger(I)}}}}return q}}}})(cytoscape);(function($$,window){var isTouch=("ontouchstart" in window)||window.DocumentTouch&&document instanceof DocumentTouch;$$.Style=function(cy){if(!(this instanceof $$.Style)){return new $$.Style(cy)}if(!$$.is.core(cy)){$$.util.error("A style must have a core reference");return}this._private={cy:cy,coreStyle:{}};this.length=0;this.addDefaultStylesheet()};$$.style=$$.Style;
$$.styfn=$$.Style.prototype;$$.fn.style=function(fnMap,options){for(var fnName in fnMap){var fn=fnMap[fnName];$$.Style.prototype=fn}};$$.stylesheet=$$.Stylesheet=function(){if(!(this instanceof $$.Stylesheet)){return new $$.Stylesheet()}this.length=0};$$.Stylesheet.prototype.selector=function(selector){var i=this.length++;this[i]={selector:selector,properties:[]};return this};$$.Stylesheet.prototype.css=function(name,value){var i=this.length-1;if($$.is.string(name)){this[i].properties.push({name:name,value:value})
}else{if($$.is.plainObject(name)){map=name;for(var j=0;j<$$.style.properties.length;j++){var prop=$$.style.properties[j];var mapVal=map[prop.name];if(mapVal===undefined){mapVal=map[$$.util.dash2camel(prop.name)]}if(mapVal!==undefined){var name=prop.name;var value=mapVal;this[i].properties.push({name:name,value:value})}}}}return this};$$.style.fromJson=function(cy,json){var style=new $$.Style(cy);for(var i=0;i<json.length;i++){var context=json[i];var selector=context.selector;var props=context.css;
style.selector(selector);for(var name in props){var value=props[name];style.css(name,value)}}return style};$$.styfn.fromJson=function(json){var style=this;style.resetToDefault();for(var i=0;i<json.length;i++){var context=json[i];var selector=context.selector;var props=context.css;style.selector(selector);for(var name in props){var value=props[name];style.css(name,value)}}return style};$$.Stylesheet.prototype.generateStyle=function(cy){var style=new $$.Style(cy);for(var i=0;i<this.length;i++){var context=this[i];
var selector=context.selector;var props=context.properties;style.selector(selector);for(var j=0;j<props.length;j++){var prop=props[j];style.css(prop.name,prop.value)}}return style};$$.Stylesheet.prototype.assignToStyle=function(style,addDefaultStylesheet){style.clear();if(addDefaultStylesheet||addDefaultStylesheet===undefined){style.addDefaultStylesheet()}for(var i=0;i<this.length;i++){var context=this[i];var selector=context.selector;var props=context.properties;style.selector(selector);for(var j=0;
j<props.length;j++){var prop=props[j];style.css(prop.name,prop.value)}}};(function(){var number=$$.util.regex.number;var rgba=$$.util.regex.rgbaNoBackRefs;var hsla=$$.util.regex.hslaNoBackRefs;var hex3=$$.util.regex.hex3;var hex6=$$.util.regex.hex6;$$.style.types={zeroOneNumber:{number:true,min:0,max:1,unitless:true},nonNegativeInt:{number:true,min:0,integer:true,unitless:true},size:{number:true,min:0,enums:["auto"]},bgSize:{number:true,min:0,allowPercent:true},color:{color:true},lineStyle:{enums:["solid","dotted","dashed"]},curveStyle:{enums:["bundled","bezier"]},fontFamily:{regex:"^([\\w- ]+(?:\\s*,\\s*[\\w- ]+)*)$"},fontVariant:{enums:["small-caps","normal"]},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","capitalize","uppercase","lowercase"]},nodeShape:{enums:["rectangle","roundrectangle","ellipse","triangle","square","pentagon","hexagon","heptagon","octagon"]},arrowShape:{enums:["tee","triangle","square","circle","diamond","none"]},visibility:{enums:["hidden","visible"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},positionx:{enums:["left","center","right"],number:true,allowPercent:true},positiony:{enums:["top","center","bottom"],number:true,allowPercent:true},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"]},cursor:{enums:["auto","crosshair","default","e-resize","n-resize","ne-resize","nw-resize","pointer","progress","s-resize","sw-resize","text","w-resize","wait","grab","grabbing"]},text:{string:true},data:{mapping:true,regex:"^data\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},mapData:{mapping:true,regex:"^mapData\\(([\\w\\.]+)\\s*\\,\\s*("+number+")\\s*\\,\\s*("+number+")\\s*,\\s*("+number+"|\\w+|"+rgba+"|"+hsla+"|"+hex3+"|"+hex6+")\\s*\\,\\s*("+number+"|\\w+|"+rgba+"|"+hsla+"|"+hex3+"|"+hex6+")\\)$"},url:{regex:"^url\\s*\\(\\s*([^\\s]+)\\s*\\s*\\)|none|(.+)$"}};
var t=$$.style.types;$$.style.properties=[{name:"cursor",type:t.cursor},{name:"text-valign",type:t.valign},{name:"text-halign",type:t.halign},{name:"color",type:t.color},{name:"content",type:t.text},{name:"text-outline-color",type:t.color},{name:"text-outline-width",type:t.size},{name:"text-outline-opacity",type:t.zeroOneNumber},{name:"text-opacity",type:t.zeroOneNumber},{name:"text-decoration",type:t.textDecoration},{name:"text-transform",type:t.textTransform},{name:"font-family",type:t.fontFamily},{name:"font-style",type:t.fontStyle},{name:"font-variant",type:t.fontVariant},{name:"font-weight",type:t.fontWeight},{name:"font-size",type:t.size},{name:"min-zoomed-font-size",type:t.size},{name:"visibility",type:t.visibility},{name:"opacity",type:t.zeroOneNumber},{name:"z-index",type:t.nonNegativeInt},{name:"overlay-padding",type:t.size},{name:"overlay-color",type:t.color},{name:"overlay-opacity",type:t.zeroOneNumber},{name:"background-color",type:t.color},{name:"background-opacity",type:t.zeroOneNumber},{name:"background-image",type:t.url},{name:"background-position-x",type:t.positionx},{name:"background-position-y",type:t.positiony},{name:"background-repeat",type:t.bgRepeat},{name:"background-size-x",type:t.bgSize},{name:"background-size-y",type:t.bgSize},{name:"border-color",type:t.color},{name:"border-opacity",type:t.zeroOneNumber},{name:"border-width",type:t.size},{name:"border-style",type:t.lineStyle},{name:"height",type:t.size},{name:"width",type:t.size},{name:"padding-left",type:t.size},{name:"padding-right",type:t.size},{name:"padding-top",type:t.size},{name:"padding-bottom",type:t.size},{name:"shape",type:t.nodeShape},{name:"source-arrow-shape",type:t.arrowShape},{name:"target-arrow-shape",type:t.arrowShape},{name:"source-arrow-color",type:t.color},{name:"target-arrow-color",type:t.color},{name:"line-style",type:t.lineStyle},{name:"line-color",type:t.color},{name:"control-point-step-size",type:t.size},{name:"curve-style",type:t.curveStyle},{name:"selection-box-color",type:t.color},{name:"selection-box-opacity",type:t.zeroOneNumber},{name:"selection-box-border-color",type:t.color},{name:"selection-box-border-width",type:t.size},{name:"panning-cursor",type:t.cursor},{name:"active-bg-color",type:t.color},{name:"active-bg-opacity",type:t.zeroOneNumber},{name:"active-bg-size",type:t.size}];
var props=$$.style.properties;for(var i=0;i<props.length;i++){var prop=props[i];props[prop.name]=prop}})();$$.styfn.addDefaultStylesheet=function(){var fontFamily=this.containerPropertyAsString("font-family")||"sans-serif";var fontStyle=this.containerPropertyAsString("font-style")||"normal";var fontVariant=this.containerPropertyAsString("font-variant")||"normal";var fontWeight=this.containerPropertyAsString("font-weight")||"normal";var color=this.containerPropertyAsString("color")||"#000";var textTransform=this.containerPropertyAsString("text-transform")||"none";
var textDecoration=this.containerPropertyAsString("text-decoration")||"none";var fontSize=this.containerPropertyAsString("font-size")||12;this.selector("node, edge").css({cursor:"default","text-valign":"top","text-halign":"center",color:color,content:undefined,"text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":textTransform,"font-family":fontFamily,"font-style":fontStyle,"font-variant":fontVariant,"font-weight":fontWeight,"font-size":fontSize,"min-zoomed-font-size":0,visibility:"visible",opacity:1,"z-index":0,content:"","overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"background-color":"#888","background-opacity":1,"background-image":"none","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,"padding-top":0,"padding-bottom":0,"padding-left":0,"padding-right":0,shape:"ellipse","source-arrow-shape":"none","target-arrow-shape":"none","source-arrow-color":"#bbb","target-arrow-color":"#bbb","line-style":"solid","line-color":"#bbb","control-point-step-size":40,"curve-style":"bezier"}).selector("$node > node").css({width:"auto",height:"auto",shape:"rectangle","background-opacity":0.5,"padding-top":10,"padding-right":10,"padding-left":10,"padding-bottom":10}).selector("edge").css({width:1,}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":0.25}).selector("core").css({"selection-box-color":"#ddd","selection-box-opacity":0.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"panning-cursor":"grabbing","active-bg-color":"black","active-bg-opacity":0.15,"active-bg-size":isTouch?40:15})
};$$.styfn.clear=function(){this._private.newStyle=true;for(var i=0;i<this.length;i++){delete this[i]}this.length=0;return this};$$.styfn.resetToDefault=function(){this.clear();this.addDefaultStylesheet();return this};$$.styfn.core=function(){return this._private.coreStyle};$$.styfn.parse=function(name,value,propIsBypass){name=$$.util.camel2dash(name);var property=$$.style.properties[name];var passedValue=value;if(!property){return null}if(value===undefined||value===null){return null}var valueIsString=$$.is.string(value);
if(valueIsString){value=$$.util.trim(value)}var type=property.type;if(!type){return null}if(propIsBypass&&(value===""||value===null)){return{name:name,value:value,bypass:true,deleteBypass:true}}var data,mapData;if(!valueIsString){}else{if(data=new RegExp($$.style.types.data.regex).exec(value)){return{name:name,value:data,strValue:value,mapped:$$.style.types.data,field:data[1],bypass:propIsBypass}}else{if(mapData=new RegExp($$.style.types.mapData.regex).exec(value)){if(!(type.color||type.number)){return false
}var valueMin=this.parse(name,mapData[4]);if(!valueMin||valueMin.mapped){return false}var valueMax=this.parse(name,mapData[5]);if(!valueMax||valueMax.mapped){return false}if(valueMin.value===valueMax.value){return false}else{if(type.color){var c1=valueMin.value;var c2=valueMax.value;var same=c1[0]===c2[0]&&c1[1]===c2[1]&&c1[2]===c2[2]&&(c1[3]===c2[3]||((c1[3]==null||c1[3]===1)&&(c2[3]==null||c2[3]===1)));if(same){return false}}}return{name:name,value:mapData,strValue:value,mapped:$$.style.types.mapData,field:mapData[1],fieldMin:parseFloat(mapData[2]),fieldMax:parseFloat(mapData[3]),valueMin:valueMin.value,valueMax:valueMax.value,bypass:propIsBypass}
}}}if(type.number){var units;if(!type.unitless){if(valueIsString){var match=value.match("^("+$$.util.regex.number+")(px|em"+(type.allowPercent?"|\\%":"")+")?$");if(!type.enums){if(!match){return null}value=match[1];units=match[2]||"px"}}else{units="px"}}value=parseFloat(value);if(isNaN(value)&&type.enums!==undefined){value=passedValue;for(var i=0;i<type.enums.length;i++){var en=type.enums[i];if(en===value){return{name:name,value:value,strValue:value,bypass:propIsBypass}}}return null}if(type.integer&&!$$.is.integer(value)){return null
}if((type.min!==undefined&&value<type.min)||(type.max!==undefined&&value>type.max)){return null}var ret={name:name,value:value,strValue:""+value+(units?units:""),units:units,bypass:propIsBypass,pxValue:type.unitless||units==="%"?undefined:(units==="px"||!units?(value):(this.getEmSizeInPixels()*value))};return ret}else{if(type.color){var tuple=$$.util.color2tuple(value);return{name:name,value:tuple,strValue:value,bypass:propIsBypass}}else{if(type.enums){for(var i=0;i<type.enums.length;i++){var en=type.enums[i];
if(en===value){return{name:name,value:value,strValue:value,bypass:propIsBypass}}}}else{if(type.regex){var regex=new RegExp(type.regex);var m=regex.exec(value);if(m){return{name:name,value:m,strValue:value,bypass:propIsBypass}}else{return null}}else{if(type.string){return{name:name,value:value,strValue:value,bypass:propIsBypass}}else{return null}}}}}};$$.styfn.getEmSizeInPixels=function(){var cy=this._private.cy;var domElement=cy.container();if(window&&domElement){var pxAsStr=window.getComputedStyle(domElement).getPropertyValue("font-size");
var px=parseFloat(pxAsStr);return px}else{return 1}};$$.styfn.containerCss=function(propName){var cy=this._private.cy;var domElement=cy.container();if(window&&domElement){return window.getComputedStyle(domElement).getPropertyValue(propName)}};$$.styfn.containerProperty=function(propName){var propStr=this.containerCss(propName);var prop=this.parse(propName,propStr);return prop};$$.styfn.containerPropertyAsString=function(propName){var prop=this.containerProperty(propName);if(prop){return prop.strValue
}};$$.styfn.selector=function(selectorStr){var selector=selectorStr==="core"?null:new $$.Selector(selectorStr);var i=this.length++;this[i]={selector:selector,properties:[]};return this};$$.styfn.css=function(){var args=arguments;switch(args.length){case 1:var map=args[0];for(var i=0;i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var mapVal=map[prop.name];if(mapVal===undefined){mapVal=map[$$.util.dash2camel(prop.name)]}if(mapVal!==undefined){this.cssRule(prop.name,mapVal)}}break;
case 2:this.cssRule(args[0],args[1]);break;default:break}return this};$$.styfn.cssRule=function(name,value){var property=this.parse(name,value);if(property){var i=this.length-1;this[i].properties.push(property);var currentSelectorIsCore=!this[i].selector;if(currentSelectorIsCore){this._private.coreStyle[property.name]=property}}return this};$$.styfn.applyParsedProperty=function(ele,parsedProp,context){parsedProp=$$.util.clone(parsedProp);var prop=parsedProp;var style=ele._private.style;var fieldVal,flatProp;
var type=$$.style.properties[prop.name].type;var propIsBypass=prop.bypass;var origProp=style[prop.name];var origPropIsBypass=origProp&&origProp.bypass;if((parsedProp.name==="height"||parsedProp.name==="width")&&parsedProp.value==="auto"&&ele.isNode()&&!ele.isParent()){return false}if(propIsBypass&&prop.deleteBypass){var currentProp=style[prop.name];if(!currentProp){return true}else{if(currentProp.bypass&¤tProp.bypassed){style[prop.name]=currentProp.bypassed;return true}else{return false}}}switch(prop.mapped){case $$.style.types.mapData:fieldVal=ele._private.data[prop.field];
if(!$$.is.number(fieldVal)){return false}var percent=(fieldVal-prop.fieldMin)/(prop.fieldMax-prop.fieldMin);if(type.color){var r1=prop.valueMin[0];var r2=prop.valueMax[0];var g1=prop.valueMin[1];var g2=prop.valueMax[1];var b1=prop.valueMin[2];var b2=prop.valueMax[2];var a1=prop.valueMin[3]==null?1:prop.valueMin[3];var a2=prop.valueMax[3]==null?1:prop.valueMax[3];var clr=[Math.round(r1+(r2-r1)*percent),Math.round(g1+(g2-g1)*percent),Math.round(b1+(b2-b1)*percent),Math.round(a1+(a2-a1)*percent)];flatProp={bypass:prop.bypass,name:prop.name,value:clr,strValue:["rgba(",clr[0],", ",clr[1],", ",clr[2],", ",clr[3],")"].join("")}
}else{if(type.number){var calcValue=prop.valueMin+(prop.valueMax-prop.valueMin)*percent;flatProp=this.parse(prop.name,calcValue,prop.bypass)}else{return false}}if(!flatProp){flatProp=this.parse(prop.name,origProp.strValue,prop.bypass)}flatProp.mapping=prop;prop=flatProp;break;case $$.style.types.data:fieldVal=eval("ele._private.data."+prop.field);flatProp=this.parse(prop.name,fieldVal,prop.bypass);if(!flatProp){flatProp=this.parse(prop.name,origProp.strValue,prop.bypass)}flatProp.mapping=prop;prop=flatProp;
break;case undefined:break;default:return false}if(propIsBypass){if(origPropIsBypass){prop.bypassed=origProp.bypassed}else{prop.bypassed=origProp}style[prop.name]=prop}else{var prevProp;if(origPropIsBypass){prevProp=origProp.bypassed;origProp.bypassed=prop}else{prevProp=style[prop.name];style[prop.name]=prop}if(prevProp&&prevProp.mapping&&prop.mapping&&prevProp.context===context){prevProp=prevProp.prev}if(prevProp&&prevProp!==prop){prop.prev=prevProp}}prop.context=context;return true};$$.styfn.rollBackContext=function(ele,context){for(var j=0;
j<context.properties.length;j++){var prop=context.properties[j];var eleProp=ele._private.style[prop.name];if(eleProp.bypassed){eleProp=eleProp.bypassed}var first=true;var lastEleProp;var l=0;while(eleProp.prev){var prev=eleProp.prev;if(eleProp.context===context){if(first){ele._private.style[prop.name]=prev}else{if(lastEleProp){lastEleProp.prev=prev}}}lastEleProp=eleProp;eleProp=prev;first=false;l++}}};$$.styfn.apply=function(eles){var self=this;for(var ie=0;ie<eles.length;ie++){var ele=eles[ie];if(self._private.newStyle){ele._private.styleCxts=[];
ele._private.style={}}for(var i=0;i<this.length;i++){var context=this[i];var contextSelectorMatches=context.selector&&context.selector.filter(ele).length>0;var props=context.properties;if(contextSelectorMatches){for(var j=0;j<props.length;j++){var prop=props[j];if(!ele._private.styleCxts[i]||prop.mapped){this.applyParsedProperty(ele,prop,context)}}ele._private.styleCxts[i]=context}else{if(ele._private.styleCxts[i]){this.rollBackContext(ele,context)}delete ele._private.styleCxts[i]}}}self._private.newStyle=false
};$$.styfn.update=function(){var cy=this._private.cy;var eles=cy.elements();eles.updateStyle()};$$.styfn.getRenderedStyle=function(ele){var ele=ele[0];if(ele){var rstyle={};var style=ele._private.style;var cy=this._private.cy;var zoom=cy.zoom();for(var i=0;i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var styleProp=style[prop.name];if(styleProp){var val=styleProp.unitless?styleProp.strValue:(styleProp.pxValue*zoom)+"px";rstyle[prop.name]=val;rstyle[$$.util.dash2camel(prop.name)]=val
}}return rstyle}};$$.styfn.getRawStyle=function(ele){var ele=ele[0];if(ele){var rstyle={};var style=ele._private.style;for(var i=0;i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var styleProp=style[prop.name];if(styleProp){rstyle[prop.name]=styleProp.strValue;rstyle[$$.util.dash2camel(prop.name)]=styleProp.strValue}}return rstyle}};$$.styfn.getValueStyle=function(ele){var rstyle,style;if($$.is.element(ele)){rstyle={};style=ele._private.style}else{rstyle={};style=ele}if(style){for(var i=0;
i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var styleProp=style[prop.name]||style[$$.util.dash2camel(prop.name)];if(styleProp!==undefined&&!$$.is.plainObject(styleProp)){styleProp=this.parse(prop.name,styleProp)}if(styleProp){var val=styleProp.value===undefined?styleProp:styleProp.value;rstyle[prop.name]=val;rstyle[$$.util.dash2camel(prop.name)]=val}}}return rstyle};$$.styfn.updateFunctionalProperties=function(eles){for(var i=0;i<eles.length;i++){var ele=eles[i];var style=ele._private.style;
for(var j=0;j<$$.style.properties.length;j++){var prop=$$.style.properties[j];var propInStyle=style[prop.name];if(propInStyle&&propInStyle.mapping){var mapping=propInStyle.mapping;this.applyParsedProperty(ele,mapping)}}}};$$.styfn.applyBypass=function(eles,name,value){var props=[];if(name==="*"||name==="**"){if(value!==undefined){for(var i=0;i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var name=prop.name;var parsedProp=this.parse(name,value,true);if(parsedProp){props.push(parsedProp)
}}}}else{if($$.is.string(name)){var parsedProp=this.parse(name,value,true);if(parsedProp){props.push(parsedProp)}}else{if($$.is.plainObject(name)){var specifiedProps=name;for(var i=0;i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var name=prop.name;var value=specifiedProps[name];if(value===undefined){value=specifiedProps[$$.util.dash2camel(name)]}if(value!==undefined){var parsedProp=this.parse(name,value,true);if(parsedProp){props.push(parsedProp)}}}}else{return false}}}if(props.length===0){return false
}var ret=false;for(var i=0;i<eles.length;i++){var ele=eles[i];for(var j=0;j<props.length;j++){var prop=props[j];ret=this.applyParsedProperty(ele,prop)||ret}}return ret};$$.styfn.removeAllBypasses=function(eles){for(var i=0;i<$$.style.properties.length;i++){var prop=$$.style.properties[i];var name=prop.name;var value="";var parsedProp=this.parse(name,value,true);for(var j=0;j<eles.length;j++){var ele=eles[j];this.applyParsedProperty(ele,parsedProp)}}}})(cytoscape,typeof window==="undefined"?null:window);
(function(a){var c={showOverlay:true,hideEdgesOnViewport:false};var b=a.util.copy(c);a.defaults=function(d){c=a.util.extend({},b,d)};a.fn.core=function(d,f){for(var e in d){var g=d[e];a.Core.prototype[e]=g}};a.Core=function(h){if(!(this instanceof a.Core)){return new a.Core(h)}var i=this;h=a.util.extend({},c,h);var d=h.container;var f=a.getRegistrationForInstance(i,d);if(f&&f.cy){f.domElement.innerHTML="";f.cy.notify({type:"destroy"});a.removeRegistrationForInstance(f.cy,f.domElement)}f=a.registerInstance(i,d);
var g=f.readies;var e=h;e.layout=a.util.extend({name:typeof window==="undefined"?"null":"grid"},e.layout);e.renderer=a.util.extend({name:typeof window==="undefined"?"null":"canvas"},e.renderer);this._private={ready:false,instanceId:f.id,options:e,elements:[],id2index:{},listeners:[],aniEles:[],scratch:{},layout:null,renderer:null,notificationsEnabled:true,minZoom:1e-50,maxZoom:1e+50,zoomEnabled:e.zoomEnabled===undefined?true:e.zoomEnabled,panEnabled:e.panEnabled===undefined?true:e.panEnabled,boxSelectionEnabled:e.boxSelectionEnabled===undefined?true:e.boxSelectionEnabled,zoom:a.is.number(e.zoom)?e.zoom:1,pan:{x:a.is.plainObject(e.pan)&&a.is.number(e.pan.x)?e.pan.x:0,y:a.is.plainObject(e.pan)&&a.is.number(e.pan.y)?e.pan.y:0,},hasCompoundNodes:false};
if(a.is.number(e.minZoom)&&a.is.number(e.maxZoom)&&e.minZoom<e.maxZoom){this._private.minZoom=e.minZoom;this._private.maxZoom=e.maxZoom}else{if(a.is.number(e.minZoom)&&e.maxZoom===undefined){this._private.minZoom=e.minZoom}else{if(a.is.number(e.maxZoom)&&e.minZoom===undefined){this._private.maxZoom=e.maxZoom}}}this._private.style=a.is.stylesheet(e.style)?e.style.generateStyle(this):(a.is.array(e.style)?a.style.fromJson(this,e.style):new a.Style(i));i.initRenderer(a.util.extend({showOverlay:e.showOverlay,hideEdgesOnViewport:e.hideEdgesOnViewport},e.renderer));
i.load(e.elements,function(){i.startAnimationLoop();i._private.ready=true;if(a.is.fn(e.ready)){i.bind("ready",e.ready)}for(var j=0;j<g.length;j++){var k=g[j];i.bind("ready",k)}f.readies=[];i.trigger("ready")},e.done)};a.corefn=a.Core.prototype;a.fn.core({ready:function(){return this._private.ready},registered:function(){if(this._private&&this._private.instanceId!=null){return true}else{return false}},registeredId:function(){return this._private.instanceId},getElementById:function(e){var d=this._private.id2index[e];
if(d!==undefined){return this._private.elements[d]}return new a.Collection(this)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},addToPool:function(e){var j=this._private.elements;var l=this._private.id2index;for(var g=0;g<e.length;g++){var h=e[g];var k=h._private.data.id;var f=l[k];var d=f!==undefined;if(!d){f=j.length;j.push(h);l[k]=f;h._private.index=f}}return this},removeFromPool:function(p){var d=this._private.elements;var g=this._private.id2index;for(var k=0;k<p.length;k++){var o=p[k];
var e=o._private.data.id;var l=g[e];var m=l!==undefined;if(m){delete this._private.id2index[e];d.splice(l,1);for(var h=l;h<d.length;h++){var f=d[h]._private.data.id;g[f]--}}}},container:function(){return this._private.options.container},options:function(){return a.util.copy(this._private.options)},json:function(e){var d={};var f=this;d.elements={};f.elements().each(function(g,h){var j=h.group();if(!d.elements[j]){d.elements[j]=[]}d.elements[j].push(h.json())});d.style=f.style();d.scratch=f.scratch();
d.zoomEnabled=f._private.zoomEnabled;d.panEnabled=f._private.panEnabled;d.layout=f._private.options.layout;d.renderer=f._private.options.renderer;return d}})})(cytoscape);(function(a,b){a.fn.core({add:function(d){var c;var e=this;if(a.is.elementOrCollection(d)){var u=d;var o=[];for(var h=0;h<u.length;h++){var t=u[h];o.push(t.json())}c=new a.Collection(e,o)}else{if(a.is.array(d)){var o=d;c=new a.Collection(e,o)}else{if(a.is.plainObject(d)&&(a.is.array(d.nodes)||a.is.array(d.edges))){var l=d;var o=[];
var p=["nodes","edges"];for(var h=0,q=p.length;h<q;h++){var r=p[h];var m=l[r];if(a.is.array(m)){for(var f=0,g=m.length;f<g;f++){var s=m[f];var k=a.util.extend({},s,{group:r});o.push(k)}}}c=new a.Collection(e,o)}else{var s=d;c=(new a.Element(e,s)).collection()}}}return c.filter(function(){return !this.removed()})},remove:function(d){if(a.is.elementOrCollection(d)){d=d}else{if(a.is.string(d)){var c=d;d=this.$(c)}}return d.remove()},load:function(f,g,e){var i=this;var d=i.elements();if(d.length>0){d.remove()
}i.notifications(false);var c=[];if(f!=null){if(a.is.plainObject(f)||a.is.array(f)){i.add(f)}}function h(){i.one("layoutready",function(j){i.notifications(true);i.trigger(j);i.notify({type:"load",collection:i.elements(),style:i._private.style});i.one("load",g);i.trigger("load")}).one("layoutstop",function(){i.one("done",e);i.trigger("done")});i.layout(i._private.options.layout)}if(true||b&&b.chrome){setTimeout(function(){h()},30)}else{h()}return this}})})(cytoscape,typeof window==="undefined"?null:window);
(function(a){a.fn.core({addToAnimationPool:function(b){var h=this;var c=h._private.aniEles;var e=[];for(var d=0;d<c.length;d++){var g=c[d]._private.data.id;e[g]=true}for(var d=0;d<b.length;d++){var f=b[d];var g=f._private.data.id;if(!e[g]){c.push(f)}}},startAnimationLoop:function(){var g=this;var f=1000/60;var l=false;var i=true;g._private.aniEles=[];var j=typeof window==="undefined"?function(){}:(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame);
if(j==null||!i){j=function(m){window.setTimeout(function(){m(+new Date)},f)}}var c=g.container();function k(){function m(){j(function(o){d(o);k()},c)}if(l){setTimeout(function(){m()},f)}else{m()}}k();function d(r){r=+new Date;var C=g._private.aniEles;for(var w=0;w<C.length;w++){var B=C[w];var z=B._private.animation.current;var v=B._private.animation.queue;if(z.length===0){var o=v;var u=o.length>0?o.shift():null;if(u!=null){u.callTime=+new Date;z.push(u)}}var A=[];for(var t=0;t<z.length;t++){var s=z[t];
e(B,s,r);if(z[t].done){A.push(s);z.splice(t,1);t--}}for(var t=0;t<A.length;t++){var s=A[t];var p=s.params.complete;if(a.is.fn(p)){p.apply(B,[r])}}}if(C.length>0){g.notify({type:"draw",collection:C})}for(var t=0;t<C.length;t++){var B=C[t];var v=B._private.animation.queue;var z=B._private.animation.current;var m=z.length>0||v.length>0;if(!m){C.splice(t,1);t--}}}function e(F,w,s){var o=g._private.style;var C=w.properties;var v=w.params;var t=w.callTime;var B;if(w.duration===0){B=1}else{B=Math.min(1,(s-t)/w.duration)
}if(B<0){B=0}else{if(B>1){B=1}}if(C.delay==null){var A=w.startPosition;var r=C.position;var E=F._private.position;if(r){if(b(A.x,r.x)){E.x=h(A.x,r.x,B)}if(b(A.y,r.y)){E.y=h(A.y,r.y,B)}}if(C.css){var D=a.style.properties;for(var z=0;z<D.length;z++){var m=D[z].name;var u=C.css[m];if(u!==undefined){var q=w.startStyle[m];var p=h(q,u,B);o.applyBypass(F,m,p)}}}}if(a.is.fn(v.step)){v.step.apply(F,[s])}if(B>=1){w.done=true}return B}function b(o,m){if(o==null||m==null){return false}if(a.is.number(o)&&a.is.number(m)){return true
}else{if((o)&&(m)){return true}}return false}function h(p,q,v){if(v<0){v=0}else{if(v>1){v=1}}if(a.is.number(p)&&a.is.number(q)){return p+(q-p)*v}else{if(a.is.number(p[0])&&a.is.number(q[0])){var t=p;var s=q;function o(A,r){var B=r-A;var z=A;return Math.round(v*B+z)}var m=o(t[0],s[0]);var u=o(t[1],s[1]);var w=o(t[2],s[2]);return"rgb("+m+", "+u+", "+w+")"}}return undefined}}})})(cytoscape);(function(a){a.fn.core({data:a.define.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true}),removeData:a.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true}),batchData:a.define.batchData({field:"data",event:"data",triggerFnName:"trigger",immutableKeys:{id:true,source:true,target:true,parent:true},updateMappers:true}),scratch:a.define.data({field:"scratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeScratch:a.define.removeData({field:"scratch",triggerEvent:false}),})
})(cytoscape);(function(a){a.fn.core({on:a.define.on(),one:a.define.on({unbindSelfOnTrigger:true}),once:a.define.on({unbindAllBindersOnTrigger:true}),off:a.define.off(),trigger:a.define.trigger(),});a.corefn.bind=a.corefn.on;a.corefn.unbind=a.corefn.off;a.define.event.aliasesOn(a.corefn)})(cytoscape);(function(a){a.fn.core({png:function(){var c=this;var b=this._private.renderer;return b.png()}})})(cytoscape);(function(a){a.fn.core({layout:function(b){var c=this;if(this._private.layoutRunning){return this
}if(b==null){b=this._private.options.layout}this.initLayout(b);c.trigger("layoutstart");this._private.layoutRunning=true;this.one("layoutstop",function(){this._private.layoutRunning=false});this._private.layout.run();return this},initLayout:function(d){if(d==null){a.util.error("Layout options must be specified to run a layout");return}if(d.name==null){a.util.error("A `name` must be specified to run a layout");return}var c=d.name;var b=a.extension("layout",c);if(b==null){a.util.error("Can not apply layout: No such layout `%s` found; did you include its JS file?",c);
return}this._private.layout=new b(a.util.extend({},d,{renderer:this._private.renderer,cy:this}));this._private.options.layout=d}})})(cytoscape);(function(a){a.fn.core({notify:function(e){if(!this._private.notificationsEnabled){return}var d=this.renderer();var f=this;if(a.is.element(e.collection)){var b=e.collection;e.collection=new a.Collection(f,[b])}else{if(a.is.array(e.collection)){var c=e.collection;e.collection=new a.Collection(f,c)}}d.notify(e)},notifications:function(b){var c=this._private;
if(b===undefined){return c.notificationsEnabled}else{c.notificationsEnabled=b?true:false}},noNotifications:function(b){this.notifications(false);b();this.notifications(true)}})})(cytoscape);(function(a){a.fn.core({renderTo:function(b,d,e){var c=this._private.renderer;c.renderTo(b,d,e)},renderer:function(){return this._private.renderer},initRenderer:function(c){var d=this;var b=a.extension("renderer",c.name);if(b==null){a.util.error("Can not initialise: No such renderer `%s` found; did you include its JS file?",c.name);
return}this._private.renderer=new b(a.util.extend({},c,{cy:d,style:d._private.style}))}})})(cytoscape);(function(a){a.fn.core({collection:function(b){if(a.is.string(b)){return this.$(b)}else{if(a.is.elementOrCollection(b)){return b.collection()}}return new a.Collection(this)},nodes:function(b){var c=this.$("node");if(b){return c.filter(b)}return c},edges:function(b){var c=this.$("edge");if(b){return c.filter(b)}return c},$:function(c){var b=new a.Collection(this,this._private.elements);if(c){return b.filter(c)
}return b}});a.corefn.elements=a.corefn.filter=a.corefn.$})(cytoscape);(function(a){a.fn.core({style:function(b){return this._private.style}})})(cytoscape);(function(a){a.fn.core({panningEnabled:function(b){if(b!==undefined){this._private.panEnabled=b?true:false}else{return this._private.panEnabled}return this},zoomingEnabled:function(b){if(b!==undefined){this._private.zoomEnabled=b?true:false}else{return this._private.zoomEnabled}return this},boxSelectionEnabled:function(b){if(b!==undefined){this._private.boxSelectionEnabled=b?true:false
}else{return this._private.boxSelectionEnabled}return this},pan:function(){var c=arguments;var g=this._private.pan;var d,f,e,b,h;switch(c.length){case 0:return g;case 1:if(!this._private.panEnabled){return this}else{if(a.is.string(c[0])){d=c[0];return g[d]}else{if(a.is.plainObject(c[0])){e=c[0];b=e.x;h=e.y;if(a.is.number(b)){g.x=b}if(a.is.number(h)){g.y=h}this.trigger("pan")}}}break;case 2:if(!this._private.panEnabled){return this}d=c[0];f=c[1];if((d==="x"||d==="y")&&a.is.number(f)){g[d]=f}this.trigger("pan");
break;default:break}this.notify({type:"viewport"});return this},panBy:function(h){var c=arguments;var g=this._private.pan;var d,f,e,b,i;if(!this._private.panEnabled){return this}switch(c.length){case 1:if(a.is.plainObject(c[0])){e=c[0];b=e.x;i=e.y;if(a.is.number(b)){g.x+=b}if(a.is.number(i)){g.y+=i}this.trigger("pan")}break;case 2:d=c[0];f=c[1];if((d==="x"||d==="y")&&a.is.number(f)){g[d]+=f}this.trigger("pan");break;default:break}this.notify({type:"viewport"});return this},fit:function(g,i){if(a.is.number(g)&&i===undefined){i=g;
g=undefined}if(!this._private.panEnabled||!this._private.zoomEnabled){return this}if(a.is.string(g)){var f=g;g=this.$(f)}else{if(!a.is.elementOrCollection(g)){g=this.elements()}}var j=g.boundingBox();var d=this.style();var b=parseFloat(d.containerCss("width"));var c=parseFloat(d.containerCss("height"));var e;i=a.is.number(i)?i:0;if(!isNaN(b)&&!isNaN(c)){e=this._private.zoom=Math.min((b-2*i)/j.w,(c-2*i)/j.h);e=e>this._private.maxZoom?this._private.maxZoom:e;e=e<this._private.minZoom?this._private.minZoom:e;
this._private.pan={x:(b-e*(j.x1+j.x2))/2,y:(c-e*(j.y1+j.y2))/2}}this.trigger("pan zoom");this.notify({type:"viewport"});return this},minZoom:function(b){if(b===undefined){return this._private.minZoom}else{if(a.is.number(b)){this._private.minZoom=b}}return this},maxZoom:function(b){if(b===undefined){return this._private.maxZoom}else{if(a.is.number(b)){this._private.maxZoom=b}}return this},zoom:function(d){var j;var k;if(d===undefined){return this._private.zoom}else{if(a.is.number(d)){k=d;j={x:0,y:0}
}else{if(a.is.plainObject(d)){k=d.level;if(d.renderedPosition){var l=d.renderedPosition;var b=this._private.pan;var i=this._private.zoom;j={x:(l.x-b.x)/i,y:(l.y-b.y)/i}}else{if(d.position){j=d.position}}if(j&&!this._private.panEnabled){return this}}}}if(!this._private.zoomEnabled){return this}if(!a.is.number(k)||!a.is.number(j.x)||!a.is.number(j.y)){return this}k=k>this._private.maxZoom?this._private.maxZoom:k;k=k<this._private.minZoom?this._private.minZoom:k;var g=this._private.pan;var h=this._private.zoom;
var f=k;var e={x:-f/h*(j.x-g.x)+j.x,y:-f/h*(j.y-g.y)+j.y};this._private.zoom=k;this._private.pan=e;var c=g.x!==e.x||g.y!==e.y;this.trigger("zoom"+(c?" pan":""));this.notify({type:"viewport"});return this},boundingBox:function(c){var b=this.$(c);return b.boundingBox()},center:function(g){if(!this._private.panEnabled||!this._private.zoomEnabled){return this}if(a.is.string(g)){var b=g;g=cy.elements(b)}else{if(!a.is.elementOrCollection(g)){g=cy.elements()}}var i=g.boundingBox();var e=this.style();var c=parseFloat(e.containerCss("width"));
var d=parseFloat(e.containerCss("height"));var f=this._private.zoom;this.pan({x:(c-f*(i.x1+i.x2))/2,y:(d-f*(i.y1+i.y2))/2});this.trigger("pan");this.notify({type:"viewport"});return this},reset:function(){if(!this._private.panEnabled||!this._private.zoomEnabled){return this}this.pan({x:0,y:0});if(this._private.maxZoom>1&&this._private.minZoom<1){this.zoom(1)}this.notify({type:"viewport"});return this}})})(cytoscape);(function(b){b.fn.collection=b.fn.eles=function(c,e){for(var d in c){var f=c[d];b.Collection.prototype[d]=f
}};var a={prefix:{nodes:"n",edges:"e"},id:{nodes:0,edges:0},generate:function(h,d,g){var c=b.is.element(d)?d._private:d;var e=c.group;var f=g!=null?g:this.prefix[e]+this.id[e];if(h.getElementById(f).empty()){this.id[e]++}else{while(!h.getElementById(f).empty()){f=this.prefix[e]+(++this.id[e])}}return f}};b.Element=function(d,f,h){if(!(this instanceof b.Element)){return new b.Element(d,f,h)}var o=this;h=(h===undefined||h?true:false);if(d===undefined||f===undefined||!b.is.core(d)){b.util.error("An element must have a core reference and parameters set");
return}if(f.group!=="nodes"&&f.group!=="edges"){b.util.error("An element must be of type `nodes` or `edges`; you specified `"+f.group+"`");return}this.length=1;this[0]=this;this._private={cy:d,single:true,data:f.data||{},position:f.position||{},autoWidth:undefined,autoHeight:undefined,listeners:[],group:f.group,style:{},rstyle:{},styleCxts:[],removed:true,selected:f.selected?true:false,selectable:f.selectable===undefined?true:(f.selectable?true:false),locked:f.locked?true:false,grabbed:false,grabbable:f.grabbable===undefined?true:(f.grabbable?true:false),active:false,classes:{},animation:{current:[],queue:[]},rscratch:{},scratch:{},edges:[],children:[]};
if(f.renderedPosition){var p=f.renderedPosition;var j=d.pan();var m=d.zoom();this._private.position={x:(p.x-j.x)/m,y:(p.y-j.y)/m}}if(b.is.string(f.classes)){var e=f.classes.split(/\s+/);for(var g=0,c=e.length;g<c;g++){var k=e[g];if(!k||k===""){continue}o._private.classes[k]=true}}if(h===undefined||h){this.restore()}};b.Collection=function(h,c){if(!(this instanceof b.Collection)){return new b.Collection(h,c)}if(h===undefined||!b.is.core(h)){b.util.error("A collection must have a reference to the core");
return}var d={};var f=[];var p=false;if(!c){c=[]}else{if(c.length>0&&b.is.plainObject(c[0])&&!b.is.element(c[0])){p=true;var s=[];var j={};for(var o=0,g=c.length;o<g;o++){var q=c[o];if(q.data==null){q.data={}}var m=q.data;if(m.id==null){m.id=a.generate(h,q)}else{if(h.getElementById(m.id).length!=0||j[m.id]){continue}}var r=new b.Element(h,q,false);s.push(r);j[m.id]=true}c=s}}for(var o=0,g=c.length;o<g;o++){var k=c[o];if(!k){continue}var e=k._private.data.id;if(!d[e]){d[e]=k;f.push(k)}}for(var o=0,g=f.length;
o<g;o++){this[o]=f[o]}this.length=f.length;this._private={cy:h,ids:d};if(p){this.restore()}};b.elefn=b.elesfn=b.Element.prototype=b.Collection.prototype;b.elesfn.cy=function(){return this._private.cy};b.elesfn.element=function(){return this[0]};b.elesfn.collection=function(){if(b.is.collection(this)){return this}else{return new b.Collection(this._private.cy,[this])}};b.elesfn.json=function(){var g=this.element();if(g==null){return undefined}var h=g._private;var f=b.util.copy({data:h.data,position:h.position,group:h.group,bypass:h.bypass,removed:h.removed,selected:h.selected,selectable:h.selectable,locked:h.locked,grabbed:h.grabbed,grabbable:h.grabbable,classes:""});
var e=[];for(var c in h.classes){e.push(c)}for(var d=0;d<e.length;d++){var c=e[d];f.classes+=c+(d<e.length-1?" ":"")}return f};b.elesfn.restore=function(s){var r=this;var J=[];var f=r.cy();if(s===undefined){s=true}var p=[];var z=[],e=[];var v=0;var d=0;for(var F=0,B=r.length;F<B;F++){var o=r[F];if(o.isNode()){z.push(o);v++}else{e.push(o);d++}}p=z.concat(e);for(var F=0,B=p.length;F<B;F++){var o=p[F];if(!o.removed()){continue}var q=o._private;var K=q.data;if(K.id===undefined){K.id=a.generate(f,o)}else{if(b.is.emptyString(K.id)||!b.is.string(K.id)){continue
}else{if(f.getElementById(K.id).length!=0){continue}}}var t=K.id;if(o.isEdge()){var h=o;var u=["source","target"];var w=u.length;for(var C=0;C<w;C++){var c=u[C];var L=K[c];if(L==null||L===""){continue}else{if(f.getElementById(L).empty()){continue}}}var k=f.getElementById(K.source);var E=f.getElementById(K.target);k._private.edges.push(h);E._private.edges.push(h)}q.ids={};q.ids[K.id]=o;q.removed=false;f.addToPool(o);J.push(o)}for(var F=0;F<v;F++){var A=p[F];var K=A._private.data;var t=K.id;var D=A._private.data.parent;
var g=D!=null;if(g){var m=f.getElementById(D);if(m.empty()){delete K.parent}else{var G=false;var I=m;while(!I.empty()){if(A.same(I)){G=true;delete K.parent;break}I=I.parent()}if(!G){m[0]._private.children.push(A);f._private.hasCompoundNodes=true}}}}J=new b.Collection(f,J);if(J.length>0){var H=J.add(J.connectedNodes()).add(J.parent());H.updateStyle(s);if(s){J.rtrigger("add")}else{J.trigger("add")}}return r};b.elesfn.removed=function(){var c=this[0];return c&&c._private.removed};b.elesfn.inside=function(){var c=this[0];
return c&&!c._private.removed};b.elesfn.remove=function(r){var q=this;var A=[];var C=[];var f={};var c=q._private.cy;if(r===undefined){r=true}function B(E){var l=E._private.edges;for(var D=0;D<l.length;D++){m(l[D])}}function j(E){var D=E._private.children;for(var l=0;l<D.length;l++){m(D[l])}}function m(i){var l=f[i.id()];if(l){return}else{f[i.id()]=true}if(i.isNode()){C.push(i);B(i);j(i)}else{C.unshift(i)}}for(var w=0,s=q.length;w<s;w++){var k=q[w];m(k)}function o(F,E){var i=F._private.edges;for(var l=0;
l<i.length;l++){var D=i[l];if(E===D){i.splice(l,1);break}}}function d(D,E){E=E[0];D=D[0];var l=D._private.children;for(var i=0;i<l.length;i++){if(l[i][0]===E[0]){l.splice(i,1);break}}}for(var w=0;w<C.length;w++){var k=C[w];k._private.removed=true;c.removeFromPool(k);A.push(k);if(k.isEdge()){var g=k.source()[0];var z=k.target()[0];o(g,k);o(z,k)}else{var h=k.parent();if(h.length!==0){d(h,k)}}}var p=c._private.elements;c._private.hasCompoundNodes=false;for(var w=0;w<p.length;w++){var k=p[w];if(k.isParent()){c._private.hasCompoundNodes=true;
break}}var v=new b.Collection(this.cy(),A);if(v.size()>0){if(r){this.cy().notify({type:"remove",collection:v})}v.trigger("remove")}var e={};for(var w=0;w<C.length;w++){var k=C[w];var t=k._private.group==="nodes";var u=k._private.data.parent;if(t&&u!==undefined&&!e[u]){e[u]=true;var h=c.getElementById(u);if(h&&h.length!==0&&!h._private.removed&&h.children().length===0){h.updateStyle()}}}return this}})(cytoscape);(function(a){a.fn.eles({animated:function(){var b=this[0];if(b){return b._private.animation.current.length>0
}},clearQueue:function(){for(var b=0;b<this.length;b++){var c=this[b];c._private.animation.queue=[]}return this},delay:function(c,b){this.animate({delay:c},{duration:c,complete:b});return this},animate:function(k,f){var d=+new Date;var e=this._private.cy;var c=e.style();var b;if(f===undefined){f={}}if(f.duration===undefined){f.duration=400}switch(f.duration){case"slow":f.duration=600;break;case"fast":f.duration=200;break}if(k==null||(k.position==null&&k.css==null&&k.delay==null)){return this}if(k.css){k.css=c.getValueStyle(k.css)
}for(var j=0;j<this.length;j++){var m=this[j];var l=m._private.position;var h={x:l.x,y:l.y};var g=c.getValueStyle(m);if(m.animated()&&(f.queue===undefined||f.queue)){b=m._private.animation.queue}else{b=m._private.animation.current}b.push({properties:k,duration:f.duration,params:f,callTime:d,startPosition:h,startStyle:g})}e.addToAnimationPool(this);return this},stop:function(f,h){for(var e=0;e<this.length;e++){var c=this[e];var b=c._private.animation.current;for(var d=0;d<b.length;d++){var g=b[d];
if(h){g.duration=0}}if(f){c._private.animation.queue=[]}}this.cy().notify({collection:this,type:"draw"});return this}})})(cytoscape);(function(a){a.fn.eles({addClass:function(g){g=g.split(/\s+/);var c=this;var k=[];for(var f=0;f<g.length;f++){var b=g[f];if(a.is.emptyString(b)){continue}for(var d=0;d<c.length;d++){var h=c[d];var e=h._private.classes[b];h._private.classes[b]=true;if(!e){k.push(h)}}}if(k.length>0){new a.Collection(this._private.cy,k).updateStyle()}c.trigger("class");return c},hasClass:function(b){var c=this[0];
return c!=null&&c._private.classes[b]},toggleClass:function(h,g){var b=h.split(/\s+/);var o=this;var e=[];for(var f=0,k=o.length;f<k;f++){var p=o[f];for(var c=0;c<b.length;c++){var m=b[c];if(a.is.emptyString(m)){continue}var d=p._private.classes[m];var l=g||(g===undefined&&!d);if(l){p._private.classes[m]=true;if(!d){e.push(p)}}else{p._private.classes[m]=false;if(d){e.push(p)}}}}if(e.length>0){new a.Collection(this._private.cy,e).updateStyle()}o.trigger("class");return o},removeClass:function(g){g=g.split(/\s+/);
var c=this;var k=[];for(var f=0;f<c.length;f++){var h=c[f];for(var d=0;d<g.length;d++){var b=g[d];if(!b||b===""){continue}var e=h._private.classes[b];delete h._private.classes[b];if(e){k.push(h)}}}if(k.length>0){new a.Collection(c._private.cy,k).updateStyle()}c.trigger("class");return c}})})(cytoscape);(function(a){a.fn.eles({allAre:function(b){return this.filter(b).length===this.length},is:function(b){return this.filter(b).length>0},same:function(b){b=this.cy().collection(b);if(this.length!==b.length){return false
}return this.intersect(b).length===this.length},anySame:function(b){b=this.cy().collection(b);return this.intersect(b).length>0},allAreNeighbors:function(b){b=this.cy().collection(b);return this.neighborhood().intersect(b).length===b.length}})})(cytoscape);(function(b){var a=1.4;var c=1;b.fn.eles({updateStyle:function(d){var f=this._private.cy;var e=f.style();d=d||d===undefined?true:false;e.apply(this);if(d){this.rtrigger("style")}else{this.trigger("style")}return this},updateMappers:function(d){var h=this._private.cy;
var f=h.style();d=d||d===undefined?true:false;for(var e=0;e<this.length;e++){var g=this[e];f.apply(g)}if(d){this.rtrigger("style")}else{this.trigger("style")}return this},data:b.define.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateMappers:true}),removeData:b.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateMappers:true}),batchData:b.define.batchData({field:"data",event:"data",triggerFnName:"trigger",immutableKeys:{id:true,source:true,target:true,parent:true},updateMappers:true}),scratch:b.define.data({field:"scratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeScratch:b.define.removeData({field:"scratch",triggerEvent:false}),rscratch:b.define.data({field:"rscratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeRscratch:b.define.removeData({field:"rscratch",triggerEvent:false}),id:function(){var d=this[0];
if(d){return d._private.data.id}},position:b.define.data({field:"position",bindingEvent:"position",allowBinding:true,allowSetting:true,settingEvent:"position",settingTriggersEvent:true,triggerFnName:"rtrigger",allowGetting:true,validKeys:["x","y"]}),positions:function(h){if(b.is.plainObject(h)){this.position(h)}else{if(b.is.fn(h)){var e=h;for(var d=0;d<this.length;d++){var f=this[d];var h=e.apply(f,[d,f]);if(h&&!f.locked()){var g=f._private.position;g.x=h.x;g.y=h.y}}this.rtrigger("position")}}return this
},renderedPosition:function(f){var e=this[0];var j=this.cy();var d=j.zoom();var h=j.pan();if(e&&e.isNode()){var i=e._private.position;var g={x:i.x*d+h.x,y:i.y*d+h.y};if(f===undefined){return g}else{return g[f]}}},renderedCss:function(f){var e=this[0];if(e){var d=e.cy().style().getRenderedStyle(e);if(f===undefined){return d}else{return d[f]}}},css:function(d,h){var f=this.cy().style();if(b.is.plainObject(d)){var e=d;f.applyBypass(this,e);this.rtrigger("style")}else{if(b.is.string(d)){if(h===undefined){var g=this[0];
if(g){return g._private.style[d].strValue}else{return}}else{f.applyBypass(this,d,h);this.rtrigger("style")}}else{if(d===undefined){var g=this[0];if(g){return f.getRawStyle(g)}else{return}}}}return this},removeCss:function(){var f=this.cy().style();var d=this;for(var e=0;e<d.length;e++){var g=d[e];f.removeAllBypasses(g)}this.rtrigger("style")},show:function(){this.css("visibility","visible");return this},hide:function(){this.css("visibility","hidden");return this},visible:function(){var h=this[0];
if(h){if(h.css("visibility")!=="visible"){return false}if(h.isNode()){var e=h.parents();for(var f=0;f<e.length;f++){var g=e[f];var d=g.css("visibility");if(d!=="visible"){return false}}return true}else{if(h.isEdge()){var j=h.source();var k=h.target();return j.visible()&&k.visible()}}}},hidden:function(){var d=this[0];if(d){return !this.visible()}},width:function(){var e=this[0];if(e){var d=this._private.style.width;return d.strValue==="auto"?e._private.autoWidth:d.pxValue}},outerWidth:function(){var g=this[0];
if(g){var f=this._private.style;var e=f.width.strValue==="auto"?g._private.autoWidth:f.width.pxValue;var d=f["border-width"]?f["border-width"].pxValue*a+c:0;return e+d}},renderedWidth:function(){var e=this[0];if(e){var d=this.width();return d*this.cy().zoom()}},renderedOuterWidth:function(){var e=this[0];if(e){var d=this.outerWidth();return d*this.cy().zoom()}},height:function(){var e=this[0];if(e&&e.isNode()){var d=this._private.style.height;return d.strValue==="auto"?e._private.autoHeight:d.pxValue
}},outerHeight:function(){var g=this[0];if(g){var f=this._private.style;var d=f.height.strValue==="auto"?g._private.autoHeight:f.height.pxValue;var e=f["border-width"]?f["border-width"].pxValue*a+c:0;return d+e}},renderedHeight:function(){var e=this[0];if(e){var d=this.height();return d*this.cy().zoom()}},renderedOuterHeight:function(){var e=this[0];if(e){var d=this.outerHeight();return d*this.cy().zoom()}},offset:function(){var g=this[0];if(g&&g.isNode()){var j={x:g._private.position.x,y:g._private.position.y};
var d=g.parents();for(var e=0;e<d.length;e++){var f=d[e];var h=f._private.position;j.x+=h.x;j.y+=h.y}return j}},renderedOffset:function(){var e=this[0];if(e&&e.isNode()){var g=this.offset();var h=this.cy();var d=h.zoom();var f=h.pan();return{x:g.x*d+f.x,y:g.y*d+f.y}}},boundingBox:function(e){var J=this;if(!e||(b.is.elementOrCollection(e)&&e.length===0)){J=this}else{if(b.is.string(e)){J=this.filter(e)}else{if(b.is.elementOrCollection(e)){J=e}}}var p=Infinity;var o=-Infinity;var V=Infinity;var T=-Infinity;
for(var R=0;R<J.length;R++){var U=J[R];var B,A,m,l,G,F;if(U.isNode()){var v=U._private.position;G=v.x;F=v.y;var H=U.outerWidth();var C=H/2;var S=U.outerHeight();var L=S/2;B=G-C;A=G+C;m=F-L;l=F+L;p=B<p?B:p;o=A>o?A:o;V=m<V?m:V;T=l>T?l:T}else{var z=U.source()[0]._private.position;var d=U.target()[0]._private.position;var D=U._private.rstyle;G=D.labelX;F=D.labelY;B=z.x;A=d.x;m=z.y;l=d.y;if(B>A){var f=B;B=A;A=f}if(m>l){var f=m;m=l;l=f}p=B<p?B:p;o=A>o?A:o;V=m<V?m:V;T=l>T?l:T;var k=D.bezierPts||[];var H=U._private.style.width.value;
for(var Q=0;Q<k.length;Q++){var P=k[Q];p=P.x-H<p?P.x-H:p;o=P.x+H>o?P.x+H:o;V=P.y-H<V?P.y-H:V;T=P.y+H>T?P.y+H:T}}var O=U._private.style;var N=O.content.value;var q=O["font-size"];var u=O["text-halign"];var I=O["text-valign"];var g=U._private.rstyle.labelWidth;if(N&&q&&g!=undefined&&u&&I){var E=q.value;var t=g;var M,K,s,r;switch(u.value){case"left":M=B-t;K=B;break;case"center":M=G-t/2;K=G+t/2;break;case"right":M=A;K=A+t;break}if(U.isEdge()){M=G-t/2;K=G+t/2}switch(I.value){case"top":s=m-E;r=m;break;
case"center":s=F-E/2;r=F+E/2;break;case"bottom":s=l;r=l+E;break}if(U.isEdge()){s=F-E/2;r=F+E/2}p=M<p?M:p;o=K>o?K:o;V=s<V?s:V;T=r>T?r:T}}return{x1:p,x2:o,y1:V,y2:T,w:o-p,h:T-V}}})})(cytoscape);(function(b){function a(d){return function(){var f=this;if(f.length===0){return}if(f.isNode()&&!f.removed()){var k=0;var j=f[0];var e=j._private.edges;for(var g=0;g<e.length;g++){var h=e[g];k+=d(j,h)}return k}else{return}}}b.fn.eles({degree:a(function(e,d){if(d.source().same(d.target())){return 2}else{return 1
}}),indegree:a(function(e,d){if(d.target().same(e)){return 1}else{return 0}}),outdegree:a(function(e,d){if(d.source().same(e)){return 1}else{return 0}})});function c(e,d){return function(){var g=undefined;var f=this.nodes();for(var h=0;h<f.length;h++){var j=f[h];var k=j[e]();if(k!==undefined&&(g===undefined||d(k,g))){g=k}}return g}}b.fn.eles({minDegree:c("degree",function(e,d){return e<d}),maxDegree:c("degree",function(e,d){return e>d}),minIndegree:c("indegree",function(e,d){return e<d}),maxIndegree:c("indegree",function(e,d){return e>d
}),minOutdegree:c("outdegree",function(e,d){return e<d}),maxOutdegree:c("outdegree",function(e,d){return e>d})});b.fn.eles({totalDegree:function(){var f=0;var d=this.nodes();for(var e=0;e<d.length;e++){f+=d[e].degree()}return f}})})(cytoscape);(function(a){a.fn.eles({on:a.define.on(),one:a.define.on({unbindSelfOnTrigger:true}),once:a.define.on({unbindAllBindersOnTrigger:true}),off:a.define.off(),trigger:a.define.trigger(),rtrigger:function(b,c){this.cy().notify({type:b,collection:this.filter(function(){return !this.removed()
})});this.trigger(b,c);return this}});a.elesfn.bind=a.elesfn.on;a.elesfn.unbind=a.elesfn.off;a.define.event.aliasesOn(a.elesfn)})(cytoscape);(function(a){a.fn.eles({isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source().id()===this.target().id()},group:function(){var b=this[0];if(b){return b._private.group}}})})(cytoscape);(function(a){a.fn.eles({each:function(d){if(a.is.fn(d)){for(var c=0;c<this.length;
c++){var e=this[c];var b=d.apply(e,[c,e]);if(b===false){break}}}return this},toArray:function(){var c=[];for(var b=0;b<this.length;b++){c.push(this[b])}return c},slice:function(f,b){var e=[];var c=this.length;if(b==null){b=c}if(f<0){f=c+f}for(var d=f;d>=0&&d<b&&d<c;d++){e.push(this[d])}return new a.Collection(this.cy(),e)},size:function(){return this.length},eq:function(b){return this[b]},empty:function(){return this.length===0},nonempty:function(){return !this.empty()}})})(cytoscape);(function(b){function c(d){return function(){var e=arguments;
if(e.length===2){var j=e[0];var g=e[1];this.bind(d.event,j,g)}else{if(e.length===1){var g=e[0];this.bind(d.event,g)}else{if(e.length===0){for(var f=0;f<this.length;f++){var h=this[f];if(!d.ableField||h._private[d.ableField]){h._private[d.field]=d.value}}this.updateStyle();this.trigger(d.event)}}}return this}}function a(d){b.elesfn[d.field]=function(){var e=this[0];if(e){return e._private[d.field]}};b.elesfn[d.on]=c({event:d.on,field:d.field,ableField:d.ableField,value:true});b.elesfn[d.off]=c({event:d.off,field:d.field,ableField:d.ableField,value:false})
}a({field:"locked",on:"lock",off:"unlock"});a({field:"grabbable",on:"grabify",off:"ungrabify"});a({field:"selected",ableField:"selectable",on:"select",off:"unselect"});a({field:"selectable",on:"selectify",off:"unselectify"});b.elesfn.grabbed=function(){var d=this[0];if(d){return d._private.grabbed}};a({field:"active",on:"activate",off:"unactivate"});b.elesfn.inactive=function(){var d=this[0];if(d){return !d._private.active}}})(cytoscape);(function(b){b.fn.eles({nodes:function(e){return this.filter(function(g,f){return f.isNode()
}).filter(e)},edges:function(e){return this.filter(function(g,f){return f.isEdge()}).filter(e)},filter:function(f){var j=this._private.cy;if(b.is.fn(f)){var h=[];for(var e=0;e<this.length;e++){var g=this[e];if(f.apply(g,[e,g])){h.push(g)}}return new b.Collection(j,h)}else{if(b.is.string(f)||b.is.elementOrCollection(f)){return new b.Selector(f).filter(this)}else{if(f===undefined){return this}}}return new b.Collection(j)},not:function(h){var k=this._private.cy;if(!h){return this}else{if(b.is.string(h)){h=this.filter(h)
}var j=[];for(var g=0;g<this.length;g++){var f=this[g];var e=h._private.ids[f.id()];if(!e){j.push(f)}}return new b.Collection(k,j)}},intersect:function(m){var p=this;var i=this._private.cy;if(b.is.string(m)){var j=m;return this.filter(j)}var e=[];var l=this;var k=m;var o=this.length<m.length;var h=o?l._private.ids:k._private.ids;var g=o?k._private.ids:l._private.ids;for(var f in h){var q=g[f];if(q){e.push(q)}}return new b.Collection(i,e)},add:function(m){var o=this;var g=this._private.cy;if(!m){return this
}if(b.is.string(m)){var h=m;m=g.elements(h)}var e=[];var f={};function l(i){if(!i){return}if(!f[i.id()]){e.push(i);f[i.id()]=true}}for(var k=0;k<o.length;k++){var j=o[k];l(j)}for(var k=0;k<m.length;k++){var j=m[k];l(j)}return new b.Collection(g,e)}});b.fn.eles({breadthFirstSearch:function(m,h){m=m||function(){};var g=this._private.cy;var p=this;var k=[];var s={};var l={};var A={};var z=[];for(var B=0;B<p.length;B++){if(p[B].isNode()){k.unshift(p[B]);s[p[B].id()]=true;l[p[B].id()]=0;z.push(p[B])}}B=0;
while(k.length!==0){var r=k.shift();var E=0;var o=A[r.id()];while(o){E++;o=A[o]}l[r.id()]=E;var D=m.call(r,B,E);B++;if(D===true){return new b.Collection(g,[r])}else{if(D===false){break}}var f=r.connectedEdges(h?'[source = "'+r.id()+'"]':undefined);for(var w=0;w<f.length;w++){var C=f[w];var q=C.connectedNodes('[id != "'+r.id()+'"]');if(q.length!==0){q=q[0];if(!s[q.id()]){s[q.id()]=true;k.unshift(q);A[q.id()]=r.id();z.push(q);z.push(C)}}}}return new b.Collection(g,z)},depthFirstSearch:function(p,j){p=p||function(){};
var h=this._private.cy;var u=this;var k=[];var A=[];var m={};var C={};var F={};var l={};var q={};function f(i){var t=i.id();return m[t]||C[t]||F[t]||l[t]}for(var B=0;B<u.length;B++){if(u[B].isNode()){k.push(u[B]);A[u[B].id()]=true}}while(k.length!==0){var z=k[k.length-1];var E=p.call(z);var o=false;if(E===true){return new b.Collection(h,[z])}var g=z.connectedEdges(j?'[source = "'+z.id()+'"]':undefined);for(var B=0;B<g.length;B++){var D=g[B];if(f(D)){continue}var s=D.connectedNodes('[id != "'+z.id()+'"]');
if(s.length!==0){s=s[0];var r=s.id();if(!A[r]&&!q[r]){l[r]=true;A[r]=true;k.push(s);o=true;break}else{if(A[r]){C[r]=true}else{F[r]=true}}}}if(!o){q[z.id()]=true;k.pop()}}},roots:function(f){var e=this;var g=[];for(var h=0;h<e.length;h++){var k=e[h];if(!k.isNode()){continue}var j=k.connectedEdges('[target = "'+k.id()+'"][source != "'+k.id()+'"]').length>0;if(!j){g.push(k)}}return new b.Collection(this._private.cy,g).filter(f)},kruskal:function(l){l=l||function(){return 1};function m(v){for(var u=0;
u<o.length;u++){var t=o[u];if(t.anySame(v)){return{eles:t,index:u}}}}var g=new b.Collection(this._private.cy,[]);var o=[];var e=this.nodes();for(var k=0;k<e.length;k++){o.push(e[k].collection())}var j=this.edges();var h=j.toArray().sort(function(u,t){var i=l.call(u);var v=l.call(t);return i-v});for(var k=0;k<h.length;k++){var f=h[k];var s=f.source()[0];var q=f.target()[0];var r=m(s);var p=m(q);if(r.eles!==p.eles){g=g.add(f);o[r.index]=r.eles.add(p.eles);o.splice(p.index,1)}}return e.add(g)},dijkstra:function(B,C,f){var e=this._private.cy;
f=!b.is.fn(C)?C:f;f=f===undefined||f;C=b.is.fn(C)?C:function(){return 1};if(this.length===0||!B||!b.is.elementOrCollection(B)||B.length===0){return new b.Collection(e,[])}var q=this[0];B=B[0];var o={};var l={};var p=e.nodes();for(var s=0;s<p.length;s++){o[p[s].id()]=Infinity}o[q.id()]=0;var g=p;var w=function(E){var D=Infinity;var u;for(var v in o){if(o[v]<D&&E.$("#"+v).length!==0){D=o[v];u=v}}return u};var t=function(H,G){var F=H.edgesWith(G);var E=Infinity;var D;for(var I=0;I<F.length;I++){var J=F[I];
var K=C.call(J);if(K<E){E=K;D=J}}return{edge:D,dist:E}};while(g.length!==0){var h=w(g);var k=g.filter("#"+h);if(k.length===0){continue}g=g.not(k);if(k.same(B)){break}if(o[h]===Math.Infinite){break}var r=k.neighborhood().nodes();for(var s=0;s<r.length;s++){var j=r[s];var z=j.id();var m=t(k,j);var A=o[h]+m.dist;if(A<o[z]){o[z]=A;l[z]={node:j,edge:m.edge}}}}}});b.elesfn.bfs=b.elesfn.breadthFirstSearch;b.elesfn.dfs=b.elesfn.depthFirstSearch;b.fn.eles({neighborhood:function(m){var e=[];var l=this._private.cy;
var f=this.nodes();for(var q=0;q<f.length;q++){var k=f[q];var h=k.connectedEdges();for(var p=0;p<h.length;p++){var g=h[p];var o=g.connectedNodes().not(k);if(o.length>0){e.push(o[0])}e.push(g[0])}}return(new b.Collection(l,e)).filter(m)},closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});b.fn.eles({source:d({attr:"source"}),target:d({attr:"target"})});function d(e){return function(f){var h=[];var g=this.edges();
var o=this._private.cy;for(var j=0;j<g.length;j++){var k=g[j];var m=k._private.data[e.attr];var l=o.getElementById(m);if(l.length>0){h.push(l)}}return new b.Collection(o,h).filter(f)}}b.fn.eles({edgesWith:a(),edgesTo:a({thisIs:"source"})});function a(e){return function(r){var f=[];var j=this._private.cy;var g=e||{};if(b.is.string(r)){r=j.$(r)}var l=r.connectedEdges();var s=this._private.ids;for(var m=0;m<l.length;m++){var h=l[m];var o;var q=h._private.data;if(g.thisIs){var k=q[g.thisIs];o=s[k]}else{o=s[q.source]||s[q.target]
}if(o){f.push(h)}}return new b.Collection(j,f)}}b.fn.eles({connectedEdges:function(l){var e=[];var k=this._private.cy;var f=this.nodes();for(var p=0;p<f.length;p++){var h=f[p];var o=h._private.edges;for(var m=0;m<o.length;m++){var g=o[m];e.push(g)}}return new b.Collection(k,e).filter(l)},connectedNodes:function(e){var j=[];var k=this._private.cy;var f=this.edges();for(var g=0;g<f.length;g++){var h=f[g];j.push(h.source()[0]);j.push(h.target()[0])}return new b.Collection(k,j).filter(e)},parallelEdges:c(),codirectedEdges:c({codirected:true}),parallelIndex:function(){var g=this[0];
if(g.isEdge()){var e=g.source()[0];var m=e._private.edges;var l=0;for(var j=0;j<m.length;j++){var h=m[j];var p=h===g;if(p){return l}var o=g._private.data.source===h._private.data.source&&g._private.data.target===h._private.data.target;var f=g._private.data.source===h._private.data.target&&g._private.data.target===h._private.data.source;var k=o||f;if(k){l++}}}},parallelSize:function(){var g=this[0];if(g.isEdge()){var e=g.source()[0];var m=e._private.edges;var j=0;for(var k=0;k<m.length;k++){var h=m[k];
var o=g._private.data.source===h._private.data.source&&g._private.data.target===h._private.data.target;var f=g._private.data.source===h._private.data.target&&g._private.data.target===h._private.data.source;var l=o||f;if(l){j++}}return j}}});function c(f){var e={codirected:false};f=b.util.extend({},e,f);return function(C){var l=this._private.cy;var u=[];var k=this.edges();var v=f;for(var D=0;D<k.length;D++){var t=k[D];var E=t.source()[0];var r=E.id();var A=t.target()[0];var o=A.id();var z=E._private.edges;
for(var B=0;B<z.length;B++){var s=z[B];var g=s._private.data;var m=g.target;var q=g.source;var h=m===o&&q===r;var w=r===m&&o===q;if((v.codirected&&h)||(!v.codirected&&(h||w))){u.push(s)}}}return new b.Collection(l,u).filter(C)}}b.fn.eles({parent:function(e){var f=[];var k=this._private.cy;for(var g=0;g<this.length;g++){var j=this[g];var h=k.getElementById(j._private.data.parent);if(h.size()>0){f.push(h)}}return new b.Collection(k,f).filter(e)},parents:function(f){var g=[];var e=this.parent();while(e.nonempty()){for(var h=0;
h<e.length;h++){var j=e[h];g.push(j)}e=e.parent()}return new b.Collection(this.cy(),g).filter(f)},children:function(e){var g=[];for(var f=0;f<this.length;f++){var h=this[f];g=g.concat(h._private.children)}return new b.Collection(this.cy(),g).filter(e)},siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e){return e._private.children.length!==0}},isChild:function(){var e=this[0];if(e){return e._private.data.parent!==undefined&&e.parent().length!==0
}},descendants:function(e){var f=[];function g(h){for(var j=0;j<h.length;j++){var k=h[j];f.push(k);if(k.children().nonempty()){g(k.children())}}}g(this.children());return new b.Collection(this.cy(),f).filter(e)}})})(cytoscape);(function($$){$$.fn.selector=function(map,options){for(var name in map){var fn=map[name];$$.Selector.prototype[name]=fn}};$$.Selector=function(onlyThisGroup,selector){if(!(this instanceof $$.Selector)){return new $$.Selector(onlyThisGroup,selector)}if(selector===undefined&&onlyThisGroup!==undefined){selector=onlyThisGroup;
onlyThisGroup=undefined}var self=this;self._private={selectorText:null,invalid:true};function newQuery(){return{classes:[],colonSelectors:[],data:[],group:null,ids:[],meta:[],collection:null,filter:null,parent:null,ancestor:null,subject:null,child:null,descendant:null}}if(!selector||($$.is.string(selector)&&selector.match(/^\s*$/))){if(onlyThisGroup==null){self.length=0}else{self[0]=newQuery();self[0].group=onlyThisGroup;self.length=1}}else{if($$.is.element(selector)){var collection=new $$.Collection(self.cy(),[selector]);
self[0]=newQuery();self[0].collection=collection;self.length=1}else{if($$.is.collection(selector)){self[0]=newQuery();self[0].collection=selector;self.length=1}else{if($$.is.fn(selector)){self[0]=newQuery();self[0].filter=selector;self.length=1}else{if($$.is.string(selector)){var metaChar="[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]";var variable="(?:[\\w-]|(?:\\\\"+metaChar+"))+";var comparatorOp="=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=";var boolOp="\\?|\\!|\\^";
var string="\"(?:\\\\\"|[^\"])+\"|'(?:\\\\'|[^'])+'";var number=$$.util.regex.number;var value=string+"|"+number;var meta="degree|indegree|outdegree";var separator="\\s*,\\s*";var className=variable;var descendant="\\s+";var child="\\s+>\\s+";var subject="\\$";var id=variable;function cleanMetaChars(str){return str.replace(new RegExp("\\\\("+metaChar+")","g"),"\1")}var ops=comparatorOp.split("|");for(var i=0;i<ops.length;i++){var op=ops[i];comparatorOp+="|@"+op}var currentSubject=null;var exprs={group:{query:true,regex:"(node|edge|\\*)",populate:function(group){this.group=group=="*"?group:group+"s"
}},state:{query:true,regex:"(:selected|:unselected|:locked|:unlocked|:visible|:hidden|:grabbed|:free|:removed|:inside|:grabbable|:ungrabbable|:animated|:unanimated|:selectable|:unselectable|:parent|:child|:active|:inactive|:touch)",populate:function(state){this.colonSelectors.push(state)}},id:{query:true,regex:"\\#("+id+")",populate:function(id){this.ids.push(cleanMetaChars(id))}},className:{query:true,regex:"\\.("+className+")",populate:function(className){this.classes.push(cleanMetaChars(className))
}},dataExists:{query:true,regex:"\\[\\s*("+variable+")\\s*\\]",populate:function(variable){this.data.push({field:cleanMetaChars(variable)})}},dataCompare:{query:true,regex:"\\[\\s*("+variable+")\\s*("+comparatorOp+")\\s*("+value+")\\s*\\]",populate:function(variable,comparatorOp,value){this.data.push({field:cleanMetaChars(variable),operator:comparatorOp,value:value})}},dataBool:{query:true,regex:"\\[\\s*("+boolOp+")\\s*("+variable+")\\s*\\]",populate:function(boolOp,variable){this.data.push({field:cleanMetaChars(variable),operator:boolOp})
}},metaCompare:{query:true,regex:"\\{\\s*("+meta+")\\s*("+comparatorOp+")\\s*("+number+")\\s*\\}",populate:function(meta,comparatorOp,number){this.meta.push({field:cleanMetaChars(meta),operator:comparatorOp,value:number})}},nextQuery:{separator:true,regex:separator,populate:function(){self[++i]=newQuery();currentSubject=null}},child:{separator:true,regex:child,populate:function(){var childQuery=newQuery();childQuery.parent=this;childQuery.subject=currentSubject;self[i]=childQuery}},descendant:{separator:true,regex:descendant,populate:function(){var descendantQuery=newQuery();
descendantQuery.ancestor=this;descendantQuery.subject=currentSubject;self[i]=descendantQuery}},subject:{modifier:true,regex:subject,populate:function(){if(currentSubject!=null&&this.subject!=this){$$.util.error("Redefinition of subject in selector `"+selector+"`");return false}currentSubject=this;this.subject=this},}};var j=0;for(var name in exprs){exprs[j]=exprs[name];exprs[j].name=name;j++}exprs.length=j;self._private.selectorText=selector;var remaining=selector;var i=0;function consumeExpr(expectation){var expr;
var match;var name;for(var j=0;j<exprs.length;j++){var e=exprs[j];var n=e.name;if($$.is.fn(expectation)&&!expectation(n,e)){continue}var m=remaining.match(new RegExp("^"+e.regex));if(m!=null){match=m;expr=e;name=n;var consumed=m[0];remaining=remaining.substring(consumed.length);break}}return{expr:expr,match:match,name:name}}function consumeWhitespace(){var match=remaining.match(/^\s+/);if(match){var consumed=match[0];remaining=remaining.substring(consumed.length)}}self[0]=newQuery();consumeWhitespace();
for(;;){var check=consumeExpr();if(check.expr==null){$$.util.error("The selector `"+selector+"`is invalid");return}else{var args=[];for(var j=1;j<check.match.length;j++){args.push(check.match[j])}var ret=check.expr.populate.apply(self[i],args);if(ret===false){return}}if(remaining.match(/^\s*$/)){break}}self.length=i+1;for(j=0;j<self.length;j++){var query=self[j];if(query.subject!=null){for(;;){if(query.subject==query){break}if(query.parent!=null){var parent=query.parent;var child=query;child.parent=null;
parent.child=child;query=parent}else{if(query.ancestor!=null){var ancestor=query.ancestor;var descendant=query;descendant.ancestor=null;ancestor.descendant=descendant;query=ancestor}else{$$.util.error("When adjusting references for the selector `"+query+"`, neither parent nor ancestor was found");break}}}self[j]=query.subject}}if(onlyThisGroup!=null){for(var j=0;j<self.length;j++){if(self[j].group!=null&&self[j].group!=onlyThisGroup){$$.util.error("Group `"+self[j].group+"` conflicts with implicit group `"+onlyThisGroup+"` in selector `"+selector+"`");
return}self[j].group=onlyThisGroup}}}else{$$.util.error("A selector must be created from a string; found "+selector);return}}}}}self._private.invalid=false};$$.selfn=$$.Selector.prototype;$$.selfn.size=function(){return this.length};$$.selfn.eq=function(i){return this[i]};$$.selfn.find=function(){};$$.selfn.filter=function(collection,addLiveFunction){var self=this;var cy=collection.cy();if(self._private.invalid){return new $$.Collection(cy)}var queryMatches=function(query,element){if(query.group!=null&&query.group!="*"&&query.group!=element._private.group){return false
}var allColonSelectorsMatch=true;for(var k=0;k<query.colonSelectors.length;k++){var sel=query.colonSelectors[k];var renderer=cy.renderer();switch(sel){case":selected":allColonSelectorsMatch=element.selected();break;case":unselected":allColonSelectorsMatch=!element.selected();break;case":selectable":allColonSelectorsMatch=element.selectable();break;case":unselectable":allColonSelectorsMatch=!element.selectable();break;case":locked":allColonSelectorsMatch=element.locked();break;case":unlocked":allColonSelectorsMatch=!element.locked();
break;case":visible":allColonSelectorsMatch=element.visible();break;case":hidden":allColonSelectorsMatch=!element.visible();break;case":grabbed":allColonSelectorsMatch=element.grabbed();break;case":free":allColonSelectorsMatch=!element.grabbed();break;case":removed":allColonSelectorsMatch=element.removed();break;case":inside":allColonSelectorsMatch=!element.removed();break;case":grabbable":allColonSelectorsMatch=element.grabbable();break;case":ungrabbable":allColonSelectorsMatch=!element.grabbable();
break;case":animated":allColonSelectorsMatch=element.animated();break;case":unanimated":allColonSelectorsMatch=!element.animated();break;case":parent":allColonSelectorsMatch=element.children().nonempty();break;case":child":allColonSelectorsMatch=element.parent().nonempty();break;case":active":allColonSelectorsMatch=element.active();break;case":inactive":allColonSelectorsMatch=!element.active();break;case":touch":allColonSelectorsMatch=window&&document&&(("ontouchstart" in window)||window.DocumentTouch&&document instanceof DocumentTouch);
break}if(!allColonSelectorsMatch){break}}if(!allColonSelectorsMatch){return false}var allIdsMatch=true;for(var k=0;k<query.ids.length;k++){var id=query.ids[k];var actualId=element._private.data.id;allIdsMatch=allIdsMatch&&(id==actualId);if(!allIdsMatch){break}}if(!allIdsMatch){return false}var allClassesMatch=true;for(var k=0;k<query.classes.length;k++){var cls=query.classes[k];allClassesMatch=allClassesMatch&&element.hasClass(cls);if(!allClassesMatch){break}}if(!allClassesMatch){return false}function operandsMatch(params){var allDataMatches=true;
for(var k=0;k<query[params.name].length;k++){var data=query[params.name][k];var operator=data.operator;var value=data.value;var field=data.field;var matches;if(operator!=null&&value!=null){var fieldStr=""+params.fieldValue(field);var valStr=""+eval(value);var caseInsensitive=false;if(operator.charAt(0)=="@"){fieldStr=fieldStr.toLowerCase();valStr=valStr.toLowerCase();operator=operator.substring(1);caseInsensitive=true}if(operator=="="){operator="=="}switch(operator){case"*=":matches=fieldStr.search(valStr)>=0;
break;case"$=":matches=new RegExp(valStr+"$").exec(fieldStr)!=null;break;case"^=":matches=new RegExp("^"+valStr).exec(fieldStr)!=null;break;default:if(caseInsensitive){var expr="fieldStr "+operator+" valStr";matches=eval(expr)}else{var expr=params.fieldRef(field)+" "+operator+" "+value;matches=eval(expr)}}}else{if(operator!=null){switch(operator){case"?":matches=params.fieldTruthy(field);break;case"!":matches=!params.fieldTruthy(field);break;case"^":matches=params.fieldUndefined(field);break}}else{matches=!params.fieldUndefined(field)
}}if(!matches){allDataMatches=false;break}}return allDataMatches}var allDataMatches=operandsMatch({name:"data",fieldValue:function(field){return element._private.data[field]},fieldRef:function(field){return"element._private.data."+field},fieldUndefined:function(field){return element._private.data[field]===undefined},fieldTruthy:function(field){if(element._private.data[field]){return true}return false}});if(!allDataMatches){return false}var allMetaMatches=operandsMatch({name:"meta",fieldValue:function(field){return element[field]()
},fieldRef:function(field){return"element."+field+"()"},fieldUndefined:function(field){return element[field]()==undefined},fieldTruthy:function(field){if(element[field]()){return true}return false}});if(!allMetaMatches){return false}if(query.collection!=null){var matchesAny=query.collection._private.ids[element.id()]!=null;if(!matchesAny){return false}}if(query.filter!=null&&element.collection().filter(query.filter).size()==0){return false}function confirmRelations(query,elements){if(query!=null){var matches=false;
elements=elements();for(var i=0;i<elements.size();i++){if(queryMatches(query,elements.eq(i))){matches=true;break}}return matches}else{return true}}if(!confirmRelations(query.parent,function(){return element.parent()})){return false}if(!confirmRelations(query.ancestor,function(){return element.parents()})){return false}if(!confirmRelations(query.child,function(){return element.children()})){return false}if(!confirmRelations(query.descendant,function(){return element.descendants()})){return false}return true
};var selectorFunction=function(i,element){for(var j=0;j<self.length;j++){var query=self[j];if(queryMatches(query,element)){return true}}return false};if(self._private.selectorText==null){selectorFunction=function(){return true}}var filteredCollection=collection.filter(selectorFunction);return filteredCollection};$$.selfn.toString=$$.selfn.selector=function(){var str="";function clean(obj){if($$.is.string(obj)){return obj}return""}function queryToString(query){var str="";var group=clean(query.group);
str+=group.substring(0,group.length-1);for(var j=0;j<query.data.length;j++){var data=query.data[j];str+="["+data.field+clean(data.operator)+clean(data.value)+"]"}for(var j=0;j<query.meta.length;j++){var meta=query.meta[j];str+="{"+meta.field+clean(meta.operator)+clean(meta.value)+"}"}for(var j=0;j<query.colonSelectors.length;j++){var sel=query.colonSelectors[i];str+=sel}for(var j=0;j<query.ids.length;j++){var sel="#"+query.ids[i];str+=sel}for(var j=0;j<query.classes.length;j++){var sel="."+query.classes[i];
str+=sel}if(query.parent!=null){str=queryToString(query.parent)+" > "+str}if(query.ancestor!=null){str=queryToString(query.ancestor)+" "+str}if(query.child!=null){str+=" > "+queryToString(query.child)}if(query.descendant!=null){str+=" "+queryToString(query.descendant)}return str}for(var i=0;i<this.length;i++){var query=this[i];str+=queryToString(query);if(this.length>1&&i<this.length-1){str+=", "}}return str}})(cytoscape);(function(a){function b(c){}b.prototype.notify=function(c){};a("renderer","null",b)
})(cytoscape);(function(w){var v=("ontouchstart" in window)||window.DocumentTouch&&document instanceof DocumentTouch;var m=function(){return Date.now()};var b={};var q={};var c=z.prototype;var p=400;var e=5,D=0,d=2,u=3,G=4,a=2;function z(I){this.options=I;this.data={select:[undefined,undefined,undefined,undefined,0],renderer:this,cy:I.cy,container:I.cy.container(),canvases:new Array(e),canvasRedrawReason:new Array(e),canvasNeedsRedraw:new Array(e),bufferCanvases:new Array(a)};this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:false,initialPan:[null,null],capture:false};
this.timeoutData={panTimeout:null};this.dragData={possibleDragElements:[]};this.touchData={start:null,capture:false,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:true,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]};this.zoomData={freeToZoom:false,lastPointerX:null};this.redraws=0;this.bindings=[];this.init();for(var J=0;J<e;J++){this.data.canvases[J]=document.createElement("canvas");this.data.canvases[J].style.position="absolute";
this.data.canvases[J].setAttribute("data-id","layer"+J);this.data.canvases[J].style.zIndex=String(e-J);this.data.container.appendChild(this.data.canvases[J]);this.data.canvasRedrawReason[J]=new Array();this.data.canvasNeedsRedraw[J]=false}this.data.canvases[G].setAttribute("data-id","layer"+G+"-node");this.data.canvases[D].setAttribute("data-id","layer"+D+"-selectbox");this.data.canvases[d].setAttribute("data-id","layer"+d+"-drag");this.data.canvases[u].setAttribute("data-id","layer"+u+"-overlay");
for(var J=0;J<a;J++){this.data.bufferCanvases[J]=document.createElement("canvas");this.data.bufferCanvases[J].style.position="absolute";this.data.bufferCanvases[J].setAttribute("data-id","buffer"+J);this.data.bufferCanvases[J].style.zIndex=String(-J-1);this.data.bufferCanvases[J].style.visibility="visible";this.data.container.appendChild(this.data.bufferCanvases[J])}var H=document.createElement("div");this.data.container.appendChild(H);this.data.overlay=H;H.style.position="absolute";H.style.zIndex=1000;
if(I.showOverlay){var K=document.createElement("a");H.appendChild(K);this.data.link=K;K.innerHTML="cytoscape.js";K.style.font="14px helvetica";K.style.position="absolute";K.style.right=0;K.style.bottom=0;K.style.padding="1px 3px";K.style.paddingLeft="5px";K.style.paddingTop="5px";K.style.opacity=0;K.style["-webkit-tap-highlight-color"]="transparent";K.style.background="red";K.href="http://cytoscape.github.io/cytoscape.js/";K.target="_blank"}this.hideEdgesOnViewport=I.hideEdgesOnViewport;this.load()
}z.prototype.notify=function(i){if(i.type=="destroy"){this.destroy();return}else{if(i.type=="add"||i.type=="remove"||i.type=="load"){this.updateNodesCache();this.updateEdgesCache()}}if(i.type=="viewport"){this.data.canvasNeedsRedraw[D]=true;this.data.canvasRedrawReason[D].push("viewchange")}this.data.canvasNeedsRedraw[d]=true;this.data.canvasRedrawReason[d].push("notify");this.data.canvasNeedsRedraw[G]=true;this.data.canvasRedrawReason[G].push("notify");this.redraws++;this.redraw()};z.prototype.registerBinding=function(J,I,H,i){this.bindings.push({target:J,event:I,handler:H,useCapture:i});
J.addEventListener(I,H,i)};z.prototype.destroy=function(){this.destroyed=true;for(var I=0;I<this.bindings.length;I++){var J=this.bindings[I];var H=J;H.target.removeEventListener(H.event,H.handler,H.useCapture)}};z.prototype.png=function(){var H=this.data;if(this.data.container.clientHeight>0&&this.data.container.clientWidth>0){context=H.bufferCanvases[1].getContext("2d");context.globalCompositeOperation="copy";context.drawImage(H.canvases[4],0,0);context.globalCompositeOperation="source-over";context.drawImage(H.canvases[2],0,0);
context.drawImage(H.canvases[0],0,0);context=H.bufferCanvases[0].getContext("2d");context.globalCompositeOperation="copy";context.drawImage(H.bufferCanvases[1],0,0)}var i=this.data.bufferCanvases[0];return i.toDataURL("image/png")};z.prototype.load=function(){var R=this;var P=function(ad,Y,ae){if(!Y){var ab=ad.parents();for(var ac=0;ac<ab.size();ac++){if(ab[ac]._private.selected){return}}}var af=ad.descendants();function aa(ah){while(ah.parent().nonempty()&&ah.parent().id()!==ad.id()){parent=ah.parent()[0];
var ag=parent._private.style;if(ag.width.value!=="auto"||ag.height.value!=="auto"){return true}ah=ah.parent()}return false}for(var ac=0;ac<af.size();ac++){if((Y||!af[ac]._private.selected)){af[ac]._private.rscratch.inDragLayer=true;ae.push(af[ac]);for(var Z=0;Z<af[ac]._private.edges.length;Z++){af[ac]._private.edges[Z]._private.rscratch.inDragLayer=true}}}};var S=function(Z,aa){Z._private.grabbed=true;Z._private.rscratch.inDragLayer=true;aa.push(Z);for(var Y=0;Y<Z._private.edges.length;Y++){Z._private.edges[Y]._private.rscratch.inDragLayer=true
}};var W=function(ad,ab){var ac=ad;while(ac.parent().nonempty()){ac=ac.parent()[0]}if(ac==ad&&ab){return}var Y=ac.descendants().add(ac);for(var aa=0;aa<Y.size();aa++){Y[aa]._private.rscratch.inDragLayer=ab;for(var Z=0;Z<Y[aa]._private.edges.length;Z++){Y[aa]._private.edges[Z]._private.rscratch.inDragLayer=ab}}};z.prototype.nodeIsDraggable=function(Y){if(Y._private.style.opacity.value!=0&&Y._private.style.visibility.value=="visible"&&!Y._private.locked&&Y._private.grabbable){return true}return false
};R.registerBinding(window,"resize",function(Y){R.data.canvasNeedsRedraw[G]=true;R.data.canvasNeedsRedraw[u]=true;R.matchCanvasSize(R.data.container);R.redraw()},true);R.registerBinding(R.data.container,"contextmenu",function(Y){Y.preventDefault()});R.registerBinding(R.data.container,"mousedown",function(ab){ab.preventDefault();R.hoverData.capture=true;R.hoverData.which=ab.which;var Y=R.data.cy;var ae=R.projectIntoViewport(ab.pageX,ab.pageY);var af=R.data.select;var aa=R.findNearestElement(ae[0],ae[1],true);
var ah=R.hoverData.down;var ac=R.dragData.possibleDragElements;var ad=new w.Event(ab,{type:"grab"});if(ab.which==3){if(aa){aa.activate();aa.trigger(new w.Event(ab,{type:"cxttapstart"}));R.hoverData.down=aa;R.hoverData.downTime=(new Date()).getTime();R.hoverData.cxtDragged=false}}else{if(ab.which==1){if(aa){aa.activate()}if(aa!=null&&R.nodeIsDraggable(aa)){if(aa._private.group=="nodes"&&aa._private.selected==false){ac=R.dragData.possibleDragElements=[];S(aa,ac);aa.trigger(ad);if(aa._private.style.width.value=="auto"||aa._private.style.height.value=="auto"){P(aa,true,ac)
}W(aa,true)}if(aa._private.group=="nodes"&&aa._private.selected==true){ac=R.dragData.possibleDragElements=[];var ai=false;var ag=Y.$("node:selected");for(var Z=0;Z<ag.length;Z++){if(R.nodeIsDraggable(ag[Z])){S(ag[Z],ac);if(!ai){aa.trigger(ad);ai=true}if(ag[Z]._private.style.width.value=="auto"||ag[Z]._private.style.height.value=="auto"){P(ag[Z],false,ac)}W(ag[Z],true)}}}aa.trigger(new w.Event(ab,{type:"mousedown"})).trigger(new w.Event(ab,{type:"tapstart"})).trigger(new w.Event(ab,{type:"vmousedown"}))
}else{if(aa==null){Y.trigger(new w.Event(ab,{type:"mousedown"})).trigger(new w.Event(ab,{type:"tapstart"})).trigger(new w.Event(ab,{type:"vmousedown"}))}}R.hoverData.down=aa;R.hoverData.downTime=(new Date()).getTime();if(aa==null||aa.isEdge()){af[4]=1;var aj=Math.max(0,p-(+new Date-R.hoverData.downTime));clearTimeout(R.bgActiveTimeout);R.bgActiveTimeout=setTimeout(function(){if(aa){aa.unactivate()}R.data.bgActivePosistion={x:ae[0],y:ae[1]};R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("bgactive");
R.redraw()},aj)}}}af[0]=af[2]=ae[0];af[1]=af[3]=ae[1];R.redraw()},false);R.registerBinding(window,"mousemove",function(ap){var af=false;var al=R.hoverData.capture;if(!al){var ag=R.findContainerPageCoords();if(ap.pageX>ag[0]&&ap.pageX<ag[0]+R.data.container.clientWidth&&ap.pageY>ag[1]&&ap.pageY<ag[1]+R.data.container.clientHeight){}else{return}}var aa=R.data.cy;var ae=R.projectIntoViewport(ap.pageX,ap.pageY);var aj=R.data.select;var aq=R.findNearestElement(ae[0],ae[1],true);var ah=R.hoverData.last;
var ai=R.hoverData.down;var am=[ae[0]-aj[2],ae[1]-aj[3]];var ak=R.getCachedNodes();var Z=R.getCachedEdges();var ac=R.dragData.possibleDragElements;var ab=ap.shiftKey;af=true;var an=new w.Event(ap,{type:"mousemove"});if(aq!=null){aq.trigger(an)}else{if(aq==null){aa.trigger(an)}}if(R.hoverData.which===3){var ad=new w.Event(ap,{type:"cxtdrag"});if(ai){ai.trigger(ad)}else{aa.trigger(ad)}R.hoverData.cxtDragged=true}else{if(R.hoverData.dragging){af=true;if(aa.panningEnabled()){var Y={x:am[0]*aa.zoom(),y:am[1]*aa.zoom()};
aa.panBy(Y)}ae=R.projectIntoViewport(ap.pageX,ap.pageY)}else{if(aj[4]==1&&(ai==null||ai.isEdge())&&(!aa.boxSelectionEnabled()||+new Date-R.hoverData.downTime>=p)&&(Math.abs(aj[3]-aj[1])+Math.abs(aj[2]-aj[0])<4)&&aa.panningEnabled()){R.hoverData.dragging=true;aj[4]=0}else{if(aa.boxSelectionEnabled()&&Math.pow(aj[2]-aj[0],2)+Math.pow(aj[3]-aj[1],2)>7&&aj[4]){clearTimeout(R.bgActiveTimeout)}if(ai&&ai.isEdge()&&ai.active()){ai.unactivate()}if(aq!=ah){if(ah){ah.trigger(new w.Event(ap,{type:"mouseout"}))
}if(aq){aq.trigger(new w.Event(ap,{type:"mouseover"}))}R.hoverData.last=aq}if(ai&&ai.isNode()&&R.nodeIsDraggable(ai)){R.dragData.didDrag=true;var ar=[];for(var ao=0;ao<ac.length;ao++){if(ac[ao]._private.group=="nodes"&&R.nodeIsDraggable(ac[ao])){ac[ao]._private.position.x+=am[0];ac[ao]._private.position.y+=am[1];ar.push(ac[ao])}}(new w.Collection(aa,ar)).trigger(new w.Event(ap,{type:"drag"})).trigger(new w.Event(ap,{type:"position"}));if(aj[2]==aj[0]&&aj[3]==aj[1]){R.data.canvasNeedsRedraw[G]=true;
R.data.canvasRedrawReason[G].push("Node(s) and edge(s) moved to drag layer")}R.data.canvasNeedsRedraw[d]=true;R.data.canvasRedrawReason[d].push("Nodes dragged")}if(aa.boxSelectionEnabled()){R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("Mouse moved, redraw selection box")}af=true}}}aj[2]=ae[0];aj[3]=ae[1];R.redraw();if(af){if(ap.stopPropagation){ap.stopPropagation()}if(ap.preventDefault){ap.preventDefault()}ap.cancelBubble=true;ap.returnValue=false;return false}},false);R.registerBinding(window,"mouseup",function(at){var am=R.hoverData.capture;
if(!am){return}R.hoverData.capture=false;var Z=R.data.cy;var ae=R.projectIntoViewport(at.pageX,at.pageY);var ak=R.data.select;var au=R.findNearestElement(ae[0],ae[1],true);var al=R.getCachedNodes();var Y=R.getCachedEdges();var ac=R.dragData.possibleDragElements;var ag=R.hoverData.down;var ab=at.shiftKey;R.data.bgActivePosistion=undefined;clearTimeout(R.bgActiveTimeout);if(ag){ag.unactivate()}if(R.hoverData.which===3){var ad=new w.Event(at,{type:"cxttapend"});if(ag){ag.trigger(ad)}else{Z.trigger(ad)
}if(!R.hoverData.cxtDragged){var aj=new w.Event(at,{type:"cxttap"});if(ag){ag.trigger(aj)}else{Z.trigger(aj)}}R.hoverData.cxtDragged=false;R.hoverData.which=null}else{if((ag==null)&&!R.dragData.didDrag&&!(Math.pow(ak[2]-ak[0],2)+Math.pow(ak[3]-ak[1],2)>7&&ak[4])&&!R.hoverData.dragging){Z.$(":selected").unselect();if(ac.length>0){R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("De-select")}R.dragData.possibleDragElements=ac=[]}if(Math.pow(ak[2]-ak[0],2)+Math.pow(ak[3]-ak[1],2)==0){if(au!=null){au.trigger(new w.Event(at,{type:"click"})).trigger(new w.Event(at,{type:"tap"})).trigger(new w.Event(at,{type:"vclick"}))
}else{if(au==null){Z.trigger(new w.Event(at,{type:"click"})).trigger(new w.Event(at,{type:"tap"})).trigger(new w.Event(at,{type:"vclick"}))}}}if(au!=null){au.trigger(new w.Event(at,{type:"mouseup"})).trigger(new w.Event(at,{type:"tapend"})).trigger(new w.Event(at,{type:"vmouseup"}))}else{if(au==null){Z.trigger(new w.Event(at,{type:"mouseup"})).trigger(new w.Event(at,{type:"tapend"})).trigger(new w.Event(at,{type:"vmouseup"}))}}if(au==ag&&!R.dragData.didDrag){if(au!=null&&au._private.selectable){if(!ab){Z.$(":selected").unselect()
}if(au.selected()){au.unselect()}else{au.select()}W(au,false);R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("sglslct")}}else{if(au==ag){if(au!=null&&au._private.grabbed){var an=Z.$(":grabbed");for(var aq=0;aq<an.length;aq++){var ah=an[aq];ah._private.grabbed=false;var ai=ah._private.edges;for(var ap=0;ap<ai.length;ap++){ai[ap]._private.rscratch.inDragLayer=false}W(ah,false)}var ar=new w.Event(at,{type:"free"});an.trigger(ar)}}}if(Z.boxSelectionEnabled()&&Math.pow(ak[2]-ak[0],2)+Math.pow(ak[3]-ak[1],2)>7&&ak[4]){if(!ab){Z.$(":selected").unselect()
}var aa=[];var af=R.getAllInBox(ak[0],ak[1],ak[2],ak[3]);var ao=new w.Event(at,{type:"select"});for(var aq=0;aq<af.length;aq++){if(af[aq]._private.selectable){ac.push(af[aq]);aa.push(af[aq])}}(new w.Collection(Z,aa)).select();if(af.length>0){R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("Selection")}}R.hoverData.dragging=false;if(!ak[4]){var ar=new w.Event(at,{type:"free"});for(var aq=0;aq<ac.length;aq++){if(ac[aq]._private.group=="nodes"){ac[aq]._private.rscratch.inDragLayer=false;
var ai=ac[aq]._private.edges;for(var ap=0;ap<ai.length;ap++){ai[ap]._private.rscratch.inDragLayer=false}W(ac[aq],false)}else{if(ac[aq]._private.group=="edges"){ac[aq]._private.rscratch.inDragLayer=false}}}if(ag){ag.trigger(ar)}R.data.canvasNeedsRedraw[d]=true;R.data.canvasRedrawReason[d].push("Node/nodes back from drag");R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("Node/nodes back from drag")}}ak[4]=0;R.hoverData.down=null;R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("Mouse up, selection box gone");
R.dragData.didDrag=false;R.redraw()},false);var M=function(aa){var ac=R.data.cy;var ab=R.projectIntoViewport(aa.pageX,aa.pageY);var Z=[ab[0]*ac.zoom()+ac.pan().x,ab[1]*ac.zoom()+ac.pan().y];if(R.zoomData.freeToZoom){aa.preventDefault();var Y=aa.wheelDeltaY/1000||aa.detail/-32;if(ac.panningEnabled()&&ac.zoomingEnabled()){ac.zoom({level:ac.zoom()*Math.pow(10,Y),position:{x:Z[0],y:Z[1]}})}R.data.wheel=true;clearTimeout(R.data.wheelTimeout);R.data.wheelTimeout=setTimeout(function(){R.data.wheel=false;
R.data.canvasNeedsRedraw[G]=true;R.redraw()},100)}};R.registerBinding(R.data.container,"mousewheel",M,true);R.registerBinding(R.data.container,"DOMMouseScroll",M,true);R.registerBinding(R.data.container,"MozMousePixelScroll",function(Y){if(R.zoomData.freeToZoom){Y.preventDefault()}},false);R.registerBinding(R.data.container,"mousemove",function(Y){if(R.zoomData.lastPointerX&&R.zoomData.lastPointerX!=Y.pageX&&!R.zoomData.freeToZoom){R.zoomData.freeToZoom=true}R.zoomData.lastPointerX=Y.pageX},false);
R.registerBinding(R.data.container,"mouseout",function(Y){R.zoomData.freeToZoom=false;R.zoomData.lastPointerX=null},false);R.registerBinding(R.data.container,"mouseout",function(Y){R.data.cy.trigger(new w.Event(Y,{type:"mouseout"}))},false);R.registerBinding(R.data.container,"mouseover",function(Y){R.data.cy.trigger(new w.Event(Y,{type:"mouseover"}))},false);var H,N,T,X;var U;var K,J;var L,V;var O=R.data.container.clientWidth,Q=R.data.container.clientHeight;var i;function I(Z,ab,Y,aa){return Math.sqrt((Y-Z)*(Y-Z)+(aa-ab)*(aa-ab))
}R.registerBinding(R.data.container,"touchstart",function(au){if(au.target!==R.data.link){au.preventDefault()}R.touchData.capture=true;R.data.bgActivePosistion=undefined;var ab=R.data.cy;var am=R.getCachedNodes();var aa=R.getCachedEdges();var Z=R.touchData.now;var aq=R.touchData.earlier;if(au.touches[0]){var ae=R.projectIntoViewport(au.touches[0].pageX,au.touches[0].pageY);Z[0]=ae[0];Z[1]=ae[1]}if(au.touches[1]){var ae=R.projectIntoViewport(au.touches[1].pageX,au.touches[1].pageY);Z[2]=ae[0];Z[3]=ae[1]
}if(au.touches[2]){var ae=R.projectIntoViewport(au.touches[2].pageX,au.touches[2].pageY);Z[4]=ae[0];Z[5]=ae[1]}if(au.touches[1]){function at(aw){for(var ax=0;ax<aw.length;ax++){aw[ax]._private.grabbed=false;aw[ax]._private.rscratch.inDragLayer=false;if(aw[ax].active()){aw[ax].unactivate()}}}at(am);at(aa);var ad=R.findContainerPageCoords();V=ad[1];L=ad[0];H=au.touches[0].pageX-L;N=au.touches[0].pageY-V;T=au.touches[1].pageX-L;X=au.touches[1].pageY-V;i=0<=H&&H<=O&&0<=T&&T<=O&&0<=N&&N<=Q&&0<=X&&X<=Q;
var al=ab.pan();var Y=ab.zoom();U=I(H,N,T,X);K=[(H+T)/2,(N+X)/2];J=[(K[0]-al.x)/Y,(K[1]-al.y)/Y];if(U<100){var ag=R.findNearestElement(Z[0],Z[1],true);var af=R.findNearestElement(Z[2],Z[3],true);var ac=new w.Event(au,{type:"cxttapstart"});if(ag&&ag.isNode()){ag.activate().trigger(ac);R.touchData.start=ag}else{if(af&&af.isNode()){af.activate().trigger(ac);R.touchData.start=af}else{ab.trigger(ac);R.touchData.start=null}}if(R.touchData.start){R.touchData.start._private.grabbed=false}R.touchData.cxt=true;
R.touchData.cxtDragged=false;R.data.bgActivePosistion=undefined;R.redraw();return}}if(au.touches[2]){}else{if(au.touches[1]){}else{if(au.touches[0]){var av=R.findNearestElement(Z[0],Z[1],true);if(av!=null){av.activate();R.touchData.start=av;if(av._private.group=="nodes"&&R.nodeIsDraggable(av)){var ah=R.dragData.touchDragEles=[];S(av,ah);av.trigger(new w.Event(au,{type:"grab"}));if(av.selected()){ah=R.dragData.touchDragEles=[];var aj=ab.$("node:selected");for(var an=0;an<aj.length;an++){var ar=aj[an];
if(R.nodeIsDraggable(ar)){ah.push(ar);ar._private.rscratch.inDragLayer=true;var ai=ar._private.edges;for(var ao=0;ao<ai.length;ao++){ai[ao]._private.rscratch.inDragLayer=true}if(ar._private.style.width.value=="auto"||ar._private.style.height.value=="auto"){P(ar,false,ah)}W(ar,true)}}}else{if(av._private.style.width.value=="auto"||av._private.style.height.value=="auto"){P(av,true,ah)}W(av,true)}}av.trigger(new w.Event(au,{type:"touchstart"})).trigger(new w.Event(au,{type:"tapstart"})).trigger(new w.Event(au,{type:"vmousdown"}))
}if(av==null){ab.trigger(new w.Event(au,{type:"touchstart"})).trigger(new w.Event(au,{type:"tapstart"})).trigger(new w.Event(au,{type:"vmousedown"}));R.data.bgActivePosistion={x:ae[0],y:ae[1]};R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("bgactive")}for(var ap=0;ap<Z.length;ap++){aq[ap]=Z[ap];R.touchData.startPosition[ap]=Z[ap]}R.touchData.singleTouchMoved=false;R.touchData.singleTouchStartTime=m();var ak=setTimeout(function(){if(R.touchData.singleTouchMoved==false&&m()-R.touchData.singleTouchStartTime>250){if(R.touchData.start){R.touchData.start.trigger(new w.Event(au,{type:"taphold"}))
}else{R.data.cy.trigger(new w.Event(au,{type:"taphold"}));ab.$(":selected").unselect()}}},1000)}}}R.redraw()},false);R.registerBinding(window,"touchmove",function(aH){var aA=R.data.select;var an=R.touchData.capture;an&&aH.preventDefault();var al=R.data.cy;var aw=R.getCachedNodes();var af=R.getCachedEdges();var az=R.touchData.now;var Z=R.touchData.earlier;if(aH.touches[0]){var aq=R.projectIntoViewport(aH.touches[0].pageX,aH.touches[0].pageY);az[0]=aq[0];az[1]=aq[1]}if(aH.touches[1]){var aq=R.projectIntoViewport(aH.touches[1].pageX,aH.touches[1].pageY);
az[2]=aq[0];az[3]=aq[1]}if(aH.touches[2]){var aq=R.projectIntoViewport(aH.touches[2].pageX,aH.touches[2].pageY);az[4]=aq[0];az[5]=aq[1]}var ab=[];for(var aE=0;aE<az.length;aE++){ab[aE]=az[aE]-Z[aE]}if(an&&R.touchData.cxt){var ap=aH.touches[0].pageX-L,ac=aH.touches[0].pageY-V;var ak=aH.touches[1].pageX-L,Y=aH.touches[1].pageY-V;var au=I(ap,ac,ak,Y);var aF=au/U;if(aF>=1.5||au>=150){R.touchData.cxt=false;if(R.touchData.start){R.touchData.start.unactivate();R.touchData.start=null}R.data.bgActivePosistion=undefined;
R.data.canvasNeedsRedraw[D]=true;var aa=new w.Event(aH,{type:"cxttapend"});if(R.touchData.start){R.touchData.start.trigger(aa)}else{al.trigger(aa)}}}if(an&&R.touchData.cxt){var aa=new w.Event(aH,{type:"cxtdrag"});R.data.bgActivePosistion=undefined;R.data.canvasNeedsRedraw[D]=true;if(R.touchData.start){R.touchData.start.trigger(aa)}else{al.trigger(aa)}if(R.touchData.start){R.touchData.start._private.grabbed=false}R.touchData.cxtDragged=true}else{if(an&&aH.touches[2]&&al.boxSelectionEnabled()){R.data.bgActivePosistion=undefined;
clearTimeout(this.threeFingerSelectTimeout);this.lastThreeTouch=+new Date;R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("Touch moved, redraw selection box");if(!aA||aA.length===0||aA[0]===undefined){aA[0]=(az[0]+az[2]+az[4])/3;aA[1]=(az[1]+az[3]+az[5])/3;aA[2]=(az[0]+az[2]+az[4])/3+1;aA[3]=(az[1]+az[3]+az[5])/3+1}else{aA[2]=(az[0]+az[2]+az[4])/3;aA[3]=(az[1]+az[3]+az[5])/3}aA[4]=1}else{if(an&&aH.touches[1]&&al.zoomingEnabled()&&al.panningEnabled()){R.data.bgActivePosistion=undefined;
R.data.canvasNeedsRedraw[D]=true;var ap=aH.touches[0].pageX-L,ac=aH.touches[0].pageY-V;var ak=aH.touches[1].pageX-L,Y=aH.touches[1].pageY-V;var au=I(ap,ac,ak,Y);var aF=au/U;if(aF!=1&&i){var aJ=ap-H;var aI=ac-N;var av=ak-T;var at=Y-X;var aD=(aJ+av)/2;var aB=(aI+at)/2;var ae=al.zoom();var ad=ae*aF;var ah=al.pan();var ay=J[0]*ae+ah.x;var ax=J[1]*ae+ah.y;var ag={x:-ad/ae*(ay-ah.x-aD)+ay,y:-ad/ae*(ax-ah.y-aB)+ax};al._private.zoom=ad;al._private.pan=ag;al.trigger("pan zoom").notify("viewport");U=au;H=ap;
N=ac;T=ak;X=Y;R.pinching=true}if(aH.touches[0]){var aq=R.projectIntoViewport(aH.touches[0].pageX,aH.touches[0].pageY);az[0]=aq[0];az[1]=aq[1]}if(aH.touches[1]){var aq=R.projectIntoViewport(aH.touches[1].pageX,aH.touches[1].pageY);az[2]=aq[0];az[3]=aq[1]}if(aH.touches[2]){var aq=R.projectIntoViewport(aH.touches[2].pageX,aH.touches[2].pageY);az[4]=aq[0];az[5]=aq[1]}}else{if(aH.touches[0]){var ao=R.touchData.start;var ai=R.touchData.last;if(ao!=null&&ao._private.group=="nodes"&&R.nodeIsDraggable(ao)){var aj=R.dragData.touchDragEles;
for(var aC=0;aC<aj.length;aC++){var am=aj[aC];if(R.nodeIsDraggable(am)){R.dragData.didDrag=true;am._private.position.x+=ab[0];am._private.position.y+=ab[1]}}(new w.Collection(al,aj)).trigger(new w.Event(aH,{type:"drag"})).trigger(new w.Event(aH,{type:"position"}));R.data.canvasNeedsRedraw[d]=true;R.data.canvasRedrawReason[d].push("touchdrag node");if(R.touchData.startPosition[0]==Z[0]&&R.touchData.startPosition[1]==Z[1]){R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("node drag started")
}}if(ao!=null){ao.trigger(new w.Event(aH,{type:"touchmove"}))}if(ao==null){var ar=R.findNearestElement(az[0],az[1],true);if(ar!=null){ar.trigger(new w.Event(aH,{type:"touchmove"}))}if(ar==null){al.trigger(new w.Event(aH,{type:"touchmove"}))}}if(ar!=ai){if(ai){ai.trigger(new w.Event(aH,{type:"touchout"}))}if(ar){ar.trigger(new w.Event(aH,{type:"touchover"}))}}R.touchData.last=ar;for(var aG=0;aG<az.length;aG++){if(az[aG]&&R.touchData.startPosition[aG]&&Math.abs(az[aG]-R.touchData.startPosition[aG])>4){R.touchData.singleTouchMoved=true
}}if(an&&(ao==null||ao.isEdge())&&al.panningEnabled()){if(ao){ao.unactivate();if(!R.data.bgActivePosistion){R.data.bgActivePosistion={x:az[0],y:az[1]}}R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("bgactive")}al.panBy({x:ab[0]*al.zoom(),y:ab[1]*al.zoom()});R.swipePanning=true;var aq=R.projectIntoViewport(aH.touches[0].pageX,aH.touches[0].pageY);az[0]=aq[0];az[1]=aq[1]}}}}}for(var aE=0;aE<az.length;aE++){Z[aE]=az[aE]}R.redraw()},false);R.registerBinding(window,"touchend",function(aq){var aj=R.touchData.capture;
if(!aj){return}R.touchData.capture=false;aq.preventDefault();var ag=R.data.select;R.swipePanning=false;var ab=R.data.cy;var ai=R.getCachedNodes();var aa=R.getCachedEdges();var Z=R.touchData.now;var an=R.touchData.earlier;var ac=R.touchData.start;if(aq.touches[0]){var ad=R.projectIntoViewport(aq.touches[0].pageX,aq.touches[0].pageY);Z[0]=ad[0];Z[1]=ad[1]}if(aq.touches[1]){var ad=R.projectIntoViewport(aq.touches[1].pageX,aq.touches[1].pageY);Z[2]=ad[0];Z[3]=ad[1]}if(aq.touches[2]){var ad=R.projectIntoViewport(aq.touches[2].pageX,aq.touches[2].pageY);
Z[4]=ad[0];Z[5]=ad[1]}if(R.touchData.cxt){ctxTapend=new w.Event(aq,{type:"cxttapend"});if(ac){ac.unactivate();ac.trigger(ctxTapend)}else{ab.trigger(ctxTapend)}if(!R.touchData.cxtDragged){var ah=new w.Event(aq,{type:"cxttap"});if(ac){ac.trigger(ah)}else{ab.trigger(ah)}}if(R.touchData.start){R.touchData.start._private.grabbed=false}R.touchData.cxt=false;R.touchData.start=null;R.redraw();return}var Y=+new Date;if(!aq.touches[2]&&ab.boxSelectionEnabled()){clearTimeout(this.threeFingerSelectTimeout);this.threeFingerSelectTimeout=setTimeout(function(){var ar=[];
var av=R.getAllInBox(ag[0],ag[1],ag[2],ag[3]);ag[0]=undefined;ag[1]=undefined;ag[2]=undefined;ag[3]=undefined;ag[4]=0;R.data.canvasNeedsRedraw[D]=true;R.data.canvasRedrawReason[D].push("Touch moved, redraw selection box");var au=new w.Event(aq,{type:"select"});for(var at=0;at<av.length;at++){if(av[at]._private.selectable){ar.push(av[at])}}(new w.Collection(ab,ar)).select();if(av.length>0){R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("Selection")}},100)}if(!aq.touches[1]){R.pinching=false
}var al=false;if(ac!=null){ac._private.active=false;al=true;ac.trigger(new w.Event(aq,{type:"unactivate"}))}if(aq.touches[2]){R.data.bgActivePosistion=undefined}else{if(aq.touches[1]){}else{if(aq.touches[0]){}else{if(!aq.touches[0]){R.data.bgActivePosistion=undefined;if(ac!=null){if(ac._private.grabbed==true){ac._private.grabbed=false;ac.trigger(new w.Event(aq,{type:"free"}));ac._private.rscratch.inDragLayer=false}var af=ac._private.edges;for(var am=0;am<af.length;am++){af[am]._private.rscratch.inDragLayer=false
}W(ac,false);if(ac.selected()){var ae=ab.$("node:selected");for(var ak=0;ak<ae.length;ak++){var ao=ae[ak];ao._private.rscratch.inDragLayer=false;var af=ao._private.edges;for(var am=0;am<af.length;am++){af[am]._private.rscratch.inDragLayer=false}W(ao,false)}}R.data.canvasNeedsRedraw[d]=true;R.data.canvasRedrawReason[d].push("touchdrag node end");R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("touchdrag node end");ac.trigger(new w.Event(aq,{type:"touchend"})).trigger(new w.Event(aq,{type:"tapend"})).trigger(new w.Event(aq,{type:"vmouseup"}));
R.touchData.start=null}else{var ap=R.findNearestElement(Z[0],Z[1],true);if(ap!=null){ap.trigger(new w.Event(aq,{type:"touchend"})).trigger(new w.Event(aq,{type:"tapend"})).trigger(new w.Event(aq,{type:"vmouseup"}))}if(ap==null){ab.trigger(new w.Event(aq,{type:"touchend"})).trigger(new w.Event(aq,{type:"tapend"})).trigger(new w.Event(aq,{type:"vmouseup"}))}}if(ac!=null&&!R.dragData.didDrag&&ac._private.selectable&&(Math.sqrt(Math.pow(R.touchData.startPosition[0]-Z[0],2)+Math.pow(R.touchData.startPosition[1]-Z[1],2)))<6){if(ac.selected()){ac._private.selected=false;
ac.trigger(new w.Event(aq,{type:"unselect"}))}else{ac._private.selected=true;ac.trigger(new w.Event(aq,{type:"select"}))}al=true;R.data.canvasNeedsRedraw[G]=true;R.data.canvasRedrawReason[G].push("sglslct")}if(R.touchData.singleTouchMoved==false){if(ac){ac.trigger(new w.Event(aq,{type:"tap"})).trigger(new w.Event(aq,{type:"vclick"}))}else{ab.trigger(new w.Event(aq,{type:"tap"})).trigger(new w.Event(aq,{type:"vclick"}))}}R.touchData.singleTouchMoved=true}}}}for(var am=0;am<Z.length;am++){an[am]=Z[am]
}R.dragData.didDrag=false;if(al&&ac){ac.updateStyle(false)}R.redraw()},false)};z.prototype.init=function(){};z.prototype.getCachedNodes=function(){var i=this.data;var H=this.data.cy;if(i.cache==undefined){i.cache={}}if(i.cache.cachedNodes==undefined){i.cache.cachedNodes=H.nodes()}return i.cache.cachedNodes};z.prototype.updateNodesCache=function(){var i=this.data;var H=this.data.cy;if(i.cache==undefined){i.cache={}}i.cache.cachedNodes=H.nodes()};z.prototype.getCachedEdges=function(){var i=this.data;
var H=this.data.cy;if(i.cache==undefined){i.cache={}}if(i.cache.cachedEdges==undefined){i.cache.cachedEdges=H.edges()}return i.cache.cachedEdges};z.prototype.updateEdgesCache=function(){var i=this.data;var H=this.data.cy;if(i.cache==undefined){i.cache={}}i.cache.cachedEdges=H.edges()};z.prototype.projectIntoViewport=function(I,i){n=this.data.container;var L=false;var J=this.findContainerPageCoords();var K=J[0];var H=J[1];x=I-K;y=i-H;x-=this.data.cy.pan().x;y-=this.data.cy.pan().y;x/=this.data.cy.zoom();
y/=this.data.cy.zoom();return[x,y]};z.prototype.findContainerPageCoords=function(){var i,M;var J=0;var I=0;var L;L=this.data.container;var K=false;while(L!=null){var H=window.getComputedStyle(L);if(H.getPropertyValue("position").toLowerCase()==="fixed"){J=L.offsetLeft+window.scrollX;I=L.offsetTop+window.scrollY;L=null}else{if(typeof(L.offsetLeft)=="number"){J+=L.offsetLeft;I+=L.offsetTop;if(L==document.body||L==document.header){K=true}if(!K){J-=L.scrollLeft;I-=L.scrollTop}}}if(L){L=L.offsetParent
}}return[J,I]};z.prototype.findNearestElement=function(V,U,J){var Q=this.data;var K=this.getCachedNodes();var O=this.getCachedEdges();var R=[];var W=this.data.cy.zoom();var M=(v?256:32)/W;var T=(v?16:0)/W;for(var P=0;P<K.length;P++){if(q[this.getNodeShape(K[P])].checkPointRough(V,U,K[P]._private.style["border-width"].value/2,this.getNodeWidth(K[P])+T,this.getNodeHeight(K[P])+T,K[P]._private.position.x,K[P]._private.position.y)&&q[this.getNodeShape(K[P])].checkPoint(V,U,K[P]._private.style["border-width"].value/2,(this.getNodeWidth(K[P])+T),(this.getNodeHeight(K[P])+T),K[P]._private.position.x,K[P]._private.position.y)){if(J){if(K[P]._private.style.opacity.value!=0&&K[P]._private.style.visibility.value=="visible"){R.push(K[P])
}}else{R.push(K[P])}}}var I;for(var P=0;P<O.length;P++){var L=O[P];var N=L._private.rscratch;I=false;if(N.edgeType=="self"){if((this.inBezierVicinity(V,U,N.startX,N.startY,N.cp2ax,N.cp2ay,N.selfEdgeMidX,N.selfEdgeMidY,Math.pow(L._private.style.width.value/2,2))&&(Math.pow(O[P]._private.style.width.value/2,2)+M>this.sqDistanceToQuadraticBezier(V,U,N.startX,N.startY,N.cp2ax,N.cp2ay,N.selfEdgeMidX,N.selfEdgeMidY)))||(this.inBezierVicinity(V,U,N.selfEdgeMidX,N.selfEdgeMidY,N.cp2cx,N.cp2cy,N.endX,N.endY,Math.pow(O[P]._private.style.width.value/2,2))&&(Math.pow(O[P]._private.style.width.value/2,2)+M>this.sqDistanceToQuadraticBezier(V,U,N.selfEdgeMidX,N.selfEdgeMidY,N.cp2cx,N.cp2cy,N.endX,N.endY)))){I=true
}}else{if(N.edgeType=="straight"){if(this.inLineVicinity(V,U,N.startX,N.startY,N.endX,N.endY,O[P]._private.style.width.value*2)&&Math.pow(O[P]._private.style.width.value/2,2)+M>this.sqDistanceToFiniteLine(V,U,N.startX,N.startY,N.endX,N.endY)){I=true}}else{if(N.edgeType=="bezier"){if(this.inBezierVicinity(V,U,N.startX,N.startY,N.cp2x,N.cp2y,N.endX,N.endY,Math.pow(O[P]._private.style.width.value/2,2))&&(Math.pow(O[P]._private.style.width.value/2,2)+M>this.sqDistanceToQuadraticBezier(V,U,N.startX,N.startY,N.cp2x,N.cp2y,N.endX,N.endY))){I=true
}}}}if(!R.length||R[R.length-1]!=O[P]){if((b[O[P]._private.style["source-arrow-shape"].value].roughCollide(V,U,O[P]._private.rscratch.arrowStartX,O[P]._private.rscratch.arrowStartY,this.getArrowWidth(O[P]._private.style.width.value),this.getArrowHeight(O[P]._private.style.width.value),[O[P]._private.rscratch.arrowStartX-O[P].source()[0]._private.position.x,O[P]._private.rscratch.arrowStartY-O[P].source()[0]._private.position.y],0)&&b[O[P]._private.style["source-arrow-shape"].value].collide(V,U,O[P]._private.rscratch.arrowStartX,O[P]._private.rscratch.arrowStartY,this.getArrowWidth(O[P]._private.style.width.value),this.getArrowHeight(O[P]._private.style.width.value),[O[P]._private.rscratch.arrowStartX-O[P].source()[0]._private.position.x,O[P]._private.rscratch.arrowStartY-O[P].source()[0]._private.position.y],0))||(b[O[P]._private.style["target-arrow-shape"].value].roughCollide(V,U,O[P]._private.rscratch.arrowEndX,O[P]._private.rscratch.arrowEndY,this.getArrowWidth(O[P]._private.style.width.value),this.getArrowHeight(O[P]._private.style.width.value),[O[P]._private.rscratch.arrowEndX-O[P].target()[0]._private.position.x,O[P]._private.rscratch.arrowEndY-O[P].target()[0]._private.position.y],0)&&b[O[P]._private.style["target-arrow-shape"].value].collide(V,U,O[P]._private.rscratch.arrowEndX,O[P]._private.rscratch.arrowEndY,this.getArrowWidth(O[P]._private.style.width.value),this.getArrowHeight(O[P]._private.style.width.value),[O[P]._private.rscratch.arrowEndX-O[P].target()[0]._private.position.x,O[P]._private.rscratch.arrowEndY-O[P].target()[0]._private.position.y],0))){I=true
}}if(I){if(J){var H=Q.cy.getElementById(O[P]._private.data.source);var S=Q.cy.getElementById(O[P]._private.data.target);if(O[P]._private.style.opacity.value!=0&&O[P]._private.style.visibility.value=="visible"&&H._private.style.opacity.value!=0&&H._private.style.visibility.value=="visible"&&S._private.style.opacity.value!=0&&S._private.style.visibility.value=="visible"){R.push(O[P])}}else{R.push(O[P])}}}R.sort(C);if(R.length>0){return R[R.length-1]}else{return null}};z.prototype.getAllInBox=function(J,T,H,S){var O=this.data;
var I=this.getCachedNodes();var M=this.getCachedEdges();var P=[];var R=Math.min(J,H);var L=Math.max(J,H);var U=Math.min(T,S);var Q=Math.max(T,S);J=R;H=L;T=U;S=Q;var K;for(var N=0;N<I.length;N++){if(q[this.getNodeShape(I[N])].intersectBox(J,T,H,S,this.getNodeWidth(I[N]),this.getNodeHeight(I[N]),I[N]._private.position.x,I[N]._private.position.y,I[N]._private.style["border-width"].value/2)){P.push(I[N])}}for(var N=0;N<M.length;N++){if(M[N]._private.rscratch.edgeType=="self"){if((K=this.boxInBezierVicinity(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.cp2ax,M[N]._private.rscratch.cp2ay,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value))&&(K==2||(K==1&&this.checkBezierInBox(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.cp2ax,M[N]._private.rscratch.cp2ay,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value)))||(K=this.boxInBezierVicinity(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.cp2cx,M[N]._private.rscratch.cp2cy,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value))&&(K==2||(K==1&&this.checkBezierInBox(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.cp2cx,M[N]._private.rscratch.cp2cy,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value)))){P.push(M[N])
}}if(M[N]._private.rscratch.edgeType=="bezier"&&(K=this.boxInBezierVicinity(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.cp2x,M[N]._private.rscratch.cp2y,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value))&&(K==2||(K==1&&this.checkBezierInBox(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.cp2x,M[N]._private.rscratch.cp2y,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value)))){P.push(M[N])
}if(M[N]._private.rscratch.edgeType=="straight"&&(K=this.boxInBezierVicinity(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.startX*0.5+M[N]._private.rscratch.endX*0.5,M[N]._private.rscratch.startY*0.5+M[N]._private.rscratch.endY*0.5,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value))&&(K==2||(K==1&&this.checkStraightEdgeInBox(J,T,H,S,M[N]._private.rscratch.startX,M[N]._private.rscratch.startY,M[N]._private.rscratch.endX,M[N]._private.rscratch.endY,M[N]._private.style.width.value)))){P.push(M[N])
}}return P};z.prototype.updateAllCompounds=function(K){for(var H=K.length-1;H>=0;H--){if(K[H].isNode()&&(K[H]._private.style.width.value=="auto"||K[H]._private.style.height.value=="auto")&&K[H].children().length>0){var J=K[H];var I=this.calcCompoundBounds(J);J._private.position.x=I.x;J._private.position.y=I.y;J._private.autoWidth=I.width;J._private.autoHeight=I.height}}};z.prototype.calcCompoundBounds=function(N){var M=N.descendants().not(":removed");var H={x:N._private.position.x,y:N._private.position.y,width:N._private.autoWidth,height:N._private.autoHeight};
if(N._private.style.visibility.value!="visible"){return H}var I=[];for(var P=0;P<M.size();P++){if(M[P]._private.style.visibility.value=="visible"){I.push(M[P])}}if(I.length==0){return H}M=I;var J=this.borderValue(M,"left");var Q=this.borderValue(M,"right");var O=this.borderValue(M,"top");var L=this.borderValue(M,"bottom");var T=this.getNodePadding(N);var S=(J-T.left+Q+T.right)/2;var R=(O-T.top+L+T.bottom)/2;var K=(Q-J)+T.left+T.right;var U=(L-O)+T.top+T.bottom;H={x:S,y:R,width:K,height:U};return H
};z.prototype.borderValue=function(J,R){var N,I;var S=1/0,P=-1/0;var i=this;var Q=function(V){var U={};U.x=V._private.position.x;U.y=V._private.position.y;U.width=V.outerWidth();U.height=V.outerHeight();return U};var L=function(V){var W=String(V._private.style.content.value);var X=V._private.style["text-transform"].value;if(X=="none"){}else{if(X=="uppercase"){W=W.toUpperCase()}else{if(X=="lowercase"){W=W.toLowerCase()}}}var U=i.data.canvases[4].getContext("2d");return U.measureText(W).width};var T=function(Y){var W={};
var U=i.getNodeWidth(Y);var Z=i.getNodeHeight(Y);W.height=Y._private.style["font-size"].value;W.width=W.height;var X=Y._private.style["text-halign"].strValue;if(X=="left"){W.x=Y._private.position.x-U/2;W.left=W.x-W.width;W.right=W.x}else{if(X=="right"){W.x=Y._private.position.x+U/2;W.left=W.x;W.right=W.x+W.width}else{W.x=Y._private.position.x;W.left=W.x-W.width/2;W.right=W.x+W.width/2}}var V=Y._private.style["text-valign"].strValue;if(V=="top"){W.y=Y._private.position.y-Z/2;W.top=W.y-W.height;W.bottom=W.y
}else{if(V=="bottom"){W.y=Y._private.position.y+Z/2;W.top=W.y;W.bottom=W.y+W.height}else{W.y=Y._private.position.y;W.top=W.y-W.height/2;W.bottom=W.y+W.height/2}}return W};for(E=0;E<J.length;E++){N=Q(J[E]);I=T(J[E]);if(R=="left"){var H=Math.min(N.x-N.width/2,I.left);if(H<S){S=H}}else{if(R=="right"){var O=Math.max(N.x+N.width/2,I.right);if(O>P){P=O}}else{if(R=="top"){var M=Math.min(N.y-N.height/2,I.top);if(M<S){S=M}}else{if(R=="bottom"){var K=Math.max(N.y+N.height/2,I.bottom);if(K>P){P=K}}}}}}if((R=="left")||(R=="top")){return S
}else{return P}};z.prototype.getNodeWidth=function(i){if(i._private.style.width.value=="auto"||i._private.style.height.value=="auto"){return i._private.autoWidth}else{return i._private.style.width.value}};z.prototype.getNodeHeight=function(i){if(i._private.style.width.value=="auto"||i._private.style.height.value=="auto"){return i._private.autoHeight}else{return i._private.style.height.value}};z.prototype.getNodeShape=function(H){var i=H._private.style.shape.value;if(H.isParent()){if(i==="rectangle"||i==="roundrectangle"){return i
}else{return"rectangle"}}return i};z.prototype.getNodePadding=function(I){var K=I._private.style["padding-left"].value;var H=I._private.style["padding-right"].value;var J=I._private.style["padding-top"].value;var i=I._private.style["padding-bottom"].value;if(isNaN(K)){K=0}if(isNaN(H)){H=0}if(isNaN(J)){J=0}if(isNaN(i)){i=0}return{left:K,right:H,top:J,bottom:i}};z.prototype.matchCanvasSize=function(J){var O=this.data;var N=J.clientWidth;var I=J.clientHeight;var L,H=N,K=I;if("devicePixelRatio" in window){H*=devicePixelRatio;
K*=devicePixelRatio}for(var M=0;M<e;M++){L=O.canvases[M];if(L.width!==H||L.height!==K){L.width=H;L.height=K;L.style.width=N+"px";L.style.height=I+"px"}}for(var M=0;M<a;M++){L=O.bufferCanvases[M];if(L.width!==H||L.height!==K){L.width=H;L.height=K}}this.data.overlay.style.width=N+"px";this.data.overlay.style.height=I+"px"};var f=function(i){if(i._private.group=="nodes"){return i.parents().size()}else{if(i._private.group=="edges"){return Math.max(i.source()[0].parents().size(),i.target()[0].parents().size())
}else{return 0}}};z.prototype.getCachedZSortedEles=function(){var M=this.lastZOrderCachedNodes;var L=this.lastZOrderCachedEdges;var J=this.getCachedNodes();var I=this.getCachedEdges();var H=[];if(!M||!L||M!==J||L!==I){for(var K=0;K<J.length;K++){H.push(J[K])}for(var K=0;K<I.length;K++){H.push(I[K])}H.sort(C);this.cachedZSortedEles=H}else{H=this.cachedZSortedEles}this.lastZOrderCachedNodes=J;this.lastZOrderCachedEdges=I;return H};var C=function(I,H){var i=I._private.style["z-index"].value-H._private.style["z-index"].value;
var K=0;var J=0;if(I.cy().hasCompoundNodes()){K=f(I);J=f(H)}if(K-J===0){if(I._private.group==="nodes"&&H._private.group==="edges"){return 1}else{if(I._private.group==="edges"&&H._private.group==="nodes"){return -1}else{if(i===0){return I._private.index-H._private.index}else{return i}}}}else{return K-J}return 0};z.prototype.renderTo=function(i,H,I){this.redraw(i,true,H,I)};z.prototype.redraw=function(M,K,Q,I){var i=this;if(this.averageRedrawTime===undefined){this.averageRedrawTime=0}var J=1000/60;
var P=1000;var N=this.averageRedrawTime;N=Math.max(J,N);N=Math.min(N,P);if(this.lastDrawTime===undefined){this.lastDrawTime=0}var O=+new Date;var H=O-this.lastDrawTime;var L=H>=N;if(!M){if(!L){clearTimeout(this.redrawTimeout);this.redrawTimeout=setTimeout(function(){i.redraw()},N);return}this.lastDrawTime=O}setTimeout(function(){var ai=O;var ad=100;var V=i.data.cy;var ar=i.data;var al=i.getCachedNodes();var U=i.getCachedEdges();i.matchCanvasSize(ar.container);var R=V.zoom();var ac=Q!==undefined?Q:R;
var ak=V.pan();var ao={x:ak.x,y:ak.y};if(I){ao=I}if("devicePixelRatio" in window){ac*=devicePixelRatio;ao.x*=devicePixelRatio;ao.y*=devicePixelRatio}var ah=[];for(var am=0;am<al.length;am++){ah.push(al[am])}for(var am=0;am<U.length;am++){ah.push(U[am])}if(ar.canvasNeedsRedraw[d]||ar.canvasNeedsRedraw[G]||K){if(i.hideEdgesOnViewport&&(i.pinching||i.hoverData.dragging||i.data.wheel||i.swipePanning)){}else{i.findEdgeControlPoints(U)}var ah=i.getCachedZSortedEles();if(V.hasCompoundNodes()){i.updateAllCompounds(ah)
}}var aa;var X;var T;if(ar.canvasNeedsRedraw[G]||K){if(!aa||!X){aa=[];X=[];for(var ae=0;ae<ah.length;ae++){T=ah[ae];if(T._private.rscratch.inDragLayer){aa.push(T)}else{X.push(T)}}}var W=M||ar.canvases[G].getContext("2d");W.setTransform(1,0,0,1,0,0);W.clearRect(0,0,W.canvas.width,W.canvas.height);if(!K){W.translate(ao.x,ao.y);W.scale(ac,ac)}if(I){W.translate(I.x,I.y)}if(Q){W.scale(Q,Q)}for(var ae=0;ae<X.length;ae++){T=X[ae];if(T._private.group=="nodes"){i.drawNode(W,T)}else{if(T._private.group=="edges"){i.drawEdge(W,T)
}}}for(var ae=0;ae<X.length;ae++){T=X[ae];if(T._private.group=="nodes"){i.drawNodeText(W,T)}else{if(T._private.group=="edges"){i.drawEdgeText(W,T)}}if(T._private.group=="nodes"){i.drawNode(W,T,true)}else{if(T._private.group=="edges"){i.drawEdge(W,T,true)}}}if(!K){ar.canvasNeedsRedraw[G]=false;ar.canvasRedrawReason[G]=[]}}if(ar.canvasNeedsRedraw[d]||K){if(!aa||!X){aa=[];X=[];for(var ae=0;ae<ah.length;ae++){T=ah[ae];if(T._private.rscratch.inDragLayer){aa.push(T)}else{X.push(T)}}}var W=M||ar.canvases[d].getContext("2d");
if(!K){W.setTransform(1,0,0,1,0,0);W.clearRect(0,0,W.canvas.width,W.canvas.height);W.translate(ao.x,ao.y);W.scale(ac,ac)}if(I){W.translate(I.x,I.y)}if(Q){W.scale(Q,Q)}var T;for(var ae=0;ae<aa.length;ae++){T=aa[ae];if(T._private.group=="nodes"){i.drawNode(W,T)}else{if(T._private.group=="edges"){i.drawEdge(W,T)}}}for(var ae=0;ae<aa.length;ae++){T=aa[ae];if(T._private.group=="nodes"){i.drawNodeText(W,T)}else{if(T._private.group=="edges"){i.drawEdgeText(W,T)}}if(T._private.group=="nodes"){i.drawNode(W,T,true)
}else{if(T._private.group=="edges"){i.drawEdge(W,T,true)}}}if(!K){ar.canvasNeedsRedraw[d]=false;ar.canvasRedrawReason[d]=[]}}if(ar.canvasNeedsRedraw[D]){var W=M||ar.canvases[D].getContext("2d");if(!K){W.setTransform(1,0,0,1,0,0);W.clearRect(0,0,W.canvas.width,W.canvas.height);W.translate(ao.x,ao.y);W.scale(ac,ac)}if(I){W.translate(I.x,I.y)}if(Q){W.scale(Q,Q)}var S=V.style()._private.coreStyle;if(ar.select[4]==1){var R=ar.cy.zoom();var aq=S["selection-box-border-width"].value/R;W.lineWidth=aq;W.fillStyle="rgba("+S["selection-box-color"].value[0]+","+S["selection-box-color"].value[1]+","+S["selection-box-color"].value[2]+","+S["selection-box-opacity"].value+")";
W.fillRect(ar.select[0],ar.select[1],ar.select[2]-ar.select[0],ar.select[3]-ar.select[1]);if(aq>0){W.strokeStyle="rgba("+S["selection-box-border-color"].value[0]+","+S["selection-box-border-color"].value[1]+","+S["selection-box-border-color"].value[2]+","+S["selection-box-opacity"].value+")";W.strokeRect(ar.select[0],ar.select[1],ar.select[2]-ar.select[0],ar.select[3]-ar.select[1])}}if(ar.bgActivePosistion){var R=ar.cy.zoom();var ab=ar.bgActivePosistion;W.fillStyle="rgba("+S["active-bg-color"].value[0]+","+S["active-bg-color"].value[1]+","+S["active-bg-color"].value[2]+","+S["active-bg-opacity"].value+")";
W.beginPath();W.arc(ab.x,ab.y,S["active-bg-size"].pxValue/R,0,2*Math.PI);W.fill()}if(!K){ar.canvasNeedsRedraw[D]=false;ar.canvasRedrawReason[D]=[]}}if(i.options.showOverlay){var W=ar.canvases[u].getContext("2d");W.lineJoin="round";W.font="14px helvetica";W.strokeStyle="#fff";W.lineWidth="4";W.fillStyle="#666";W.textAlign="right";var ag="cytoscape.js";var af=W.canvas.width;var an=W.canvas.height;var aj=4;var ap=W.measureText(ag).width;var Z=14;W.clearRect(0,0,af,an);W.strokeText(ag,af-aj,an-aj);W.fillText(ag,af-aj,an-aj);
ar.overlayDrawn=true}var Y=+new Date;if(i.averageRedrawTime===undefined){i.averageRedrawTime=Y-ai}i.averageRedrawTime=i.averageRedrawTime/2+(Y-ai)/2},0)};var l={};var h=30*300;z.prototype.getCachedImage=function(H,I){if(l[H]&&l[H].image){l[H].keepTime=h;return l[H].image}var i=l[H];if(i==undefined){l[H]=new Object();l[H].image=new Image();l[H].image.onload=I;l[H].image.src=H;l[H].keepTime=h;i=l[H]}return i.image};z.prototype.swapCachedImage=function(H){if(l[H]){if(l[H].image&&l[H].image.complete){var I=l[H].image;
var i=document.createElement("canvas");i.width=I.width;i.height=I.height;i.getContext("2d").drawImage(I,0,0);l[H].image=i;l[H].swappedWithCanvas=true;return i}else{return null}}else{return null}};z.prototype.updateImageCaches=function(){for(var i in l){if(l[i].keepTime<=0){if(l[i].image!=undefined){l[i].image.src=undefined;l[i].image=undefined}l[i]=undefined}else{l[i]-=1}}};z.prototype.drawImage=function(i,N,M,K,J,O,I){I.widthScale=0.5;I.heightScale=0.5;I.rotate=O;var L;var H;canvas.drawImage(I,N,M)
};z.prototype.drawEdge=function(I,K,L){if(this.hideEdgesOnViewport&&(this.dragData.didDrag||this.pinching||this.hoverData.dragging||this.data.wheel||this.swipePanning)){return}var M,Q;M=K.source()[0];Q=K.target()[0];if(K._private.style.visibility.value!="visible"||M._private.style.visibility.value!="visible"||Q._private.style.visibility.value!="visible"){return}var U=K._private.style["overlay-padding"].value;var S=K._private.style["overlay-opacity"].value;var T=K._private.style["overlay-color"].value;
if(L){I.strokeStyle="rgba( "+T[0]+", "+T[1]+", "+T[2]+", "+S+" )";I.lineCap="round";if(K._private.rscratch.edgeType=="self"){I.lineCap="butt"}}else{I.strokeStyle="rgba("+K._private.style["line-color"].value[0]+","+K._private.style["line-color"].value[1]+","+K._private.style["line-color"].value[2]+","+K._private.style.opacity.value+")"}if(K._private.style.width.value<=0){return}var R=K._private.style.width.value+(L?2*U:0);var O=L?"solid":K._private.style["line-style"].value;I.lineWidth=R;this.findEndpoints(K);
if(K._private.rscratch.edgeType=="self"){var i=K._private.rscratch;this.drawStyledEdge(K,I,[i.startX,i.startY,i.cp2ax,i.cp2ay,i.selfEdgeMidX,i.selfEdgeMidY],O,R);this.drawStyledEdge(K,I,[i.selfEdgeMidX,i.selfEdgeMidY,i.cp2cx,i.cp2cy,i.endX,i.endY],O,R)}else{if(K._private.rscratch.edgeType=="straight"){var J=Q._private.position.x-M._private.position.x;var H=Q._private.position.y-M._private.position.y;var P=K._private.rscratch.endX-K._private.rscratch.startX;var N=K._private.rscratch.endY-K._private.rscratch.startY;
if(J*P+H*N<0){K._private.rscratch.straightEdgeTooShort=true}else{var i=K._private.rscratch;this.drawStyledEdge(K,I,[i.startX,i.startY,i.endX,i.endY],O,R);K._private.rscratch.straightEdgeTooShort=false}}else{var i=K._private.rscratch;this.drawStyledEdge(K,I,[i.startX,i.startY,i.cp2x,i.cp2y,i.endX,i.endY],O,R)}}if(K._private.rscratch.noArrowPlacement!==true&&K._private.rscratch.startX!==undefined){this.drawArrowheads(I,K,L)}};var t=function(P,L,J){var I=Math.sqrt(Math.pow(P[4]-P[0],2)+Math.pow(P[5]-P[1],2));
I+=Math.sqrt(Math.pow((P[4]+P[0])/2-P[2],2)+Math.pow((P[5]+P[1])/2-P[3],2));var O=Math.ceil(I/L);var H=I/L;var M;if(O>0){M=new Array(O*2)}else{return null}for(var K=0;K<O;K++){var N=K/O;M[K*2]=P[0]*(1-N)*(1-N)+2*(P[2])*(1-N)*N+P[4]*(N)*(N);M[K*2+1]=P[1]*(1-N)*(1-N)+2*(P[3])*(1-N)*N+P[5]*(N)*(N)}return M};var s=function(P,L,J){var I=Math.sqrt(Math.pow(P[2]-P[0],2)+Math.pow(P[3]-P[1],2));var O=Math.ceil(I/L);var M;if(O>0){M=new Array(O*2)}else{return null}var H=[P[2]-P[0],P[3]-P[1]];for(var K=0;K<O;
K++){var N=K/O;M[K*2]=H[0]*N+P[0];M[K*2+1]=H[1]*N+P[1]}return M};var r=function(I,i,H){pt1=_genpts(I,i);pt2=_genpts(I,H)};z.prototype.createBuffer=function(H,I){var i=document.createElement("canvas");i.width=H;i.height=I;return[i,i.getContext("2d")]};z.prototype.drawStyledEdge=function(O,K,ab,L,U){var J=this.data.cy;var I=J.zoom();function aa(ae,ad,ac,i){return(1-i)*(1-i)*ae+2*(1-i)*i*ad+i*i*ac}if(O._private.rstyle.bezierPts===undefined){O._private.rstyle.bezierPts=[]}var W=O._private.rstyle.bezierPts.length;
if(O.isLoop()){if(W>=12){O._private.rstyle.bezierPts=[]}else{}}else{O._private.rstyle.bezierPts=[]}var R=O._private.rstyle.bezierPts;if(ab.length===6){R.push({x:aa(ab[0],ab[2],ab[4],0.05),y:aa(ab[1],ab[3],ab[5],0.05)});R.push({x:aa(ab[0],ab[2],ab[4],0.25),y:aa(ab[1],ab[3],ab[5],0.25)});R.push({x:aa(ab[0],ab[2],ab[4],0.35),y:aa(ab[1],ab[3],ab[5],0.35)});R.push({x:aa(ab[0],ab[2],ab[4],0.65),y:aa(ab[1],ab[3],ab[5],0.65)});R.push({x:aa(ab[0],ab[2],ab[4],0.75),y:aa(ab[1],ab[3],ab[5],0.75)});R.push({x:aa(ab[0],ab[2],ab[4],0.95),y:aa(ab[1],ab[3],ab[5],0.95)})
}if(L=="solid"){K.beginPath();K.moveTo(ab[0],ab[1]);if(ab.length==3*2){K.quadraticCurveTo(ab[2],ab[3],ab[4],ab[5])}else{K.lineTo(ab[2],ab[3])}K.stroke()}else{if(L=="dotted"){var T;if(ab.length==3*2){T=t(ab,16,true)}else{T=s(ab,16,true)}if(!T){return}var N=Math.max(U*1.6,3.4)*I;var M=N*2,Q=N*2;M=Math.max(M,1);Q=Math.max(Q,1);var X=this.createBuffer(M,Q);var V=X[1];V.setTransform(1,0,0,1,0,0);V.clearRect(0,0,M,Q);V.fillStyle=K.strokeStyle;V.beginPath();V.arc(M/2,Q/2,N*0.5,0,Math.PI*2,false);V.fill();
K.beginPath();for(var Y=0;Y<T.length/2;Y++){K.drawImage(X[0],T[Y*2]-M/2/I,T[Y*2+1]-Q/2/I,M/I,Q/I)}}else{if(L=="dashed"){var T;if(ab.length==3*2){T=t(ab,14,true)}else{T=s(ab,14,true)}if(!T){return}var M=U*2*I;var Q=7.8*I;M=Math.max(M,1);Q=Math.max(Q,1);var X=this.createBuffer(M,Q);var V=X[1];V.setTransform(1,0,0,1,0,0);V.clearRect(0,0,M,Q);if(K.strokeStyle){V.strokeStyle=K.strokeStyle}V.lineWidth=U*J.zoom();V.beginPath();V.moveTo(M/2,Q*0.2);V.lineTo(M/2,Q*0.8);V.stroke();var H=false;var P,Z;if(ab.length==2*2){P=[ab[2]-ab[0],ab[3]-T[1]];
Z=Math.acos((P[0]*0+P[1]*-1)/Math.sqrt(P[0]*P[0]+P[1]*P[1]));if(P[0]<0){Z=-Z+2*Math.PI}}else{if(ab.length==3*2){H=true}}for(var Y=0;Y<T.length/2;Y++){var S=Y/(Math.max(T.length/2-1,1));if(H){P=[2*(1-S)*(ab[2]-ab[0])+2*S*(ab[4]-ab[2]),2*(1-S)*(ab[3]-ab[1])+2*S*(ab[5]-ab[3])];Z=Math.acos((P[0]*0+P[1]*-1)/Math.sqrt(P[0]*P[0]+P[1]*P[1]));if(P[0]<0){Z=-Z+2*Math.PI}}K.translate(T[Y*2],T[Y*2+1]);K.rotate(Z);K.translate(-M/2/I,-Q/2/I);K.drawImage(X[0],0,0,M/I,Q/I);K.translate(M/2/I,Q/2/I);K.rotate(-Z);K.translate(-T[Y*2],-T[Y*2+1])
}}else{this.drawStyledEdge(O,K,ab,"solid",U)}}}};z.prototype.drawEdgeText=function(I,J){if(this.hideEdgesOnViewport&&(this.dragData.didDrag||this.pinching||this.hoverData.dragging||this.data.wheel||this.swipePanning)){return}if(J._private.style.visibility.value!="visible"){return}var L=J._private.style["font-size"].pxValue*J.cy().zoom();var H=J._private.style["min-zoomed-font-size"].pxValue;if(L<H){return}I.textAlign="center";I.textBaseline="middle";var M,K;var O,N;if(J._private.rscratch.edgeType=="self"){O=J._private.rscratch.selfEdgeMidX;
N=J._private.rscratch.selfEdgeMidY}else{if(J._private.rscratch.edgeType=="straight"){O=(J._private.rscratch.startX+J._private.rscratch.endX)/2;N=(J._private.rscratch.startY+J._private.rscratch.endY)/2}else{if(J._private.rscratch.edgeType=="bezier"){O=0.25*J._private.rscratch.startX+2*0.5*0.5*J._private.rscratch.cp2x+(0.5*0.5)*J._private.rscratch.endX;N=Math.pow(1-0.5,2)*J._private.rscratch.startY+2*(1-0.5)*0.5*J._private.rscratch.cp2y+(0.5*0.5)*J._private.rscratch.endY}}}M=O;K=N;var i=J._private.rstyle;
i.labelX=M;i.labelY=K;this.drawText(I,J,M,K)};z.prototype.drawNode=function(K,M,L){var U,J;if(M._private.style.visibility.value!="visible"){return}var W=1;var S=M.parents();for(var O=0;O<S.length;O++){var T=S[O];var P=T._private.style.opacity.value;W=P*W;if(P===0){return}}U=this.getNodeWidth(M);J=this.getNodeHeight(M);K.lineWidth=M._private.style["border-width"].pxValue;if(L===undefined||!L){K.fillStyle="rgba("+M._private.style["background-color"].value[0]+","+M._private.style["background-color"].value[1]+","+M._private.style["background-color"].value[2]+","+(M._private.style["background-opacity"].value*M._private.style.opacity.value*W)+")";
K.strokeStyle="rgba("+M._private.style["border-color"].value[0]+","+M._private.style["border-color"].value[1]+","+M._private.style["border-color"].value[2]+","+(M._private.style["border-opacity"].value*M._private.style.opacity.value*W)+")";var I=M._private.style["background-image"].value[2]||M._private.style["background-image"].value[1];if(I!=undefined){var H=this;var N=this.getCachedImage(I,function(){H.data.canvasNeedsRedraw[G]=true;H.data.canvasRedrawReason[G].push("image finished load");H.data.canvasNeedsRedraw[d]=true;
H.data.canvasRedrawReason[d].push("image finished load");H.swapCachedImage(I);H.redraw()});if(N.complete==false){q[H.getNodeShape(M)].drawPath(K,M._private.position.x,M._private.position.y,U,J);K.stroke();K.fillStyle="#555555";K.fill()}else{this.drawInscribedImage(K,N,M)}}else{q[this.getNodeShape(M)].draw(K,M._private.position.x,M._private.position.y,U,J)}if(M._private.style["border-width"].value>0){K.stroke()}}else{var V=M._private.style["overlay-padding"].value;var Q=M._private.style["overlay-opacity"].value;
var R=M._private.style["overlay-color"].value;if(Q>0){K.fillStyle="rgba( "+R[0]+", "+R[1]+", "+R[2]+", "+Q+" )";q[this.getNodeShape(M)].draw(K,M._private.position.x,M._private.position.y,U+V*2,J+V*2)}}};z.prototype.drawInscribedImage=function(I,N,L){var i=this;var P=this.data.cy._private.zoom;var K=L._private.position.x;var J=L._private.position.y;var O=this.getNodeWidth(L);var H=this.getNodeHeight(L);I.save();q[i.getNodeShape(L)].drawPath(I,K,J,O,H);I.clip();var M=[N.width,N.height];I.drawImage(N,K-M[0]/2,J-M[1]/2,M[0],M[1]);
I.restore();if(L._private.style["border-width"].value>0){I.stroke()}};z.prototype.drawNodeText=function(I,J){if(J._private.style.visibility.value!="visible"){return}var M=J._private.style["font-size"].pxValue*J.cy().zoom();var i=J._private.style["min-zoomed-font-size"].pxValue;if(M<i){return}var N,L;var P=this.getNodeWidth(J);var H=this.getNodeHeight(J);var K=J._private.style["text-halign"].strValue;if(K=="left"){I.textAlign="right";N=J._private.position.x-P/2}else{if(K=="right"){I.textAlign="left";
N=J._private.position.x+P/2}else{if(K=="center"){I.textAlign="center";N=J._private.position.x}else{I.textAlign="center";N=J._private.position.x}}}var O=J._private.style["text-valign"].strValue;if(O=="top"){I.textBaseline="bottom";L=J._private.position.y-H/2}else{if(O=="bottom"){I.textBaseline="top";L=J._private.position.y+H/2}else{if(O=="middle"||O=="center"){I.textBaseline="middle";L=J._private.position.y}else{I.textBaseline="middle";L=J._private.position.y}}}this.drawText(I,J,N,L)};z.prototype.drawText=function(H,L,O,N){var X=1;
var T=L.parents();for(var M=0;M<T.length;M++){var U=T[M];var R=U._private.style.opacity.value;X=R*X;if(R===0){return}}var S=L._private.style["font-style"].strValue;var K=L._private.style["font-size"].value+"px";var W=L._private.style["font-family"].strValue;var Q=L._private.style["font-variant"].strValue;var I=L._private.style["font-weight"].strValue;H.font=S+" "+I+" "+K+" "+W;var V=String(L._private.style.content.value);var J=L._private.style["text-transform"].value;if(J=="none"){}else{if(J=="uppercase"){V=V.toUpperCase()
}else{if(J=="lowercase"){V=V.toLowerCase()}}}H.lineJoin="round";H.fillStyle="rgba("+L._private.style.color.value[0]+","+L._private.style.color.value[1]+","+L._private.style.color.value[2]+","+(L._private.style["text-opacity"].value*L._private.style.opacity.value*X)+")";H.strokeStyle="rgba("+L._private.style["text-outline-color"].value[0]+","+L._private.style["text-outline-color"].value[1]+","+L._private.style["text-outline-color"].value[2]+","+(L._private.style["text-opacity"].value*L._private.style.opacity.value*X)+")";
if(V!=undefined){var P=2*L._private.style["text-outline-width"].value;if(P>0){H.lineWidth=P;H.strokeText(V,O,N)}if(isNaN(O)){O=0}if(isNaN(N)){N=0}H.fillText(""+V,O,N);L._private.rstyle.labelWidth=H.measureText(V).width}};z.prototype.drawBackground=function(I,H,i,J,K){};z.prototype.findEdgeControlPoints=function(Z){var H={};var ac=this.data.cy;var M=[];var V;for(var aq=0;aq<Z.length;aq++){V=Z[aq]._private.data.source>Z[aq]._private.data.target?Z[aq]._private.data.target+"-"+Z[aq]._private.data.source:Z[aq]._private.data.source+"-"+Z[aq]._private.data.target;
if(H[V]==undefined){H[V]=[]}H[V].push(Z[aq]);M.push(V)}var ad,aj;for(var al=0;al<M.length;al++){V=M[al];ad=ac.getElementById(H[V][0]._private.data.source);aj=ac.getElementById(H[V][0]._private.data.target);var ab=(ad._private.position.x+aj._private.position.x)/2;var aa=(ad._private.position.y+aj._private.position.y)/2;var U,T;if(H[V].length>1){U=aj._private.position.y-ad._private.position.y;T=ad._private.position.x-aj._private.position.x;var S=Math.sqrt(U*U+T*T);U/=S;T/=S}var R;for(var aq=0;aq<H[V].length;
aq++){R=H[V][aq];var O=R._private.rscratch.lastEdgeIndex;var N=aq;var J=R._private.rscratch.lastNumEdges;var I=H[V].length;var ai=R._private.rscratch.lastSrcCtlPtX;var ah=ad._private.position.x;var Y=R._private.rscratch.lastSrcCtlPtY;var X=ad._private.position.y;var at=R._private.rscratch.lastSrcCtlPtW;var ar=ad.outerWidth();var an=R._private.rscratch.lastSrcCtlPtH;var am=ad.outerHeight();var ap=R._private.rscratch.lastTgtCtlPtX;var ao=aj._private.position.x;var af=R._private.rscratch.lastTgtCtlPtY;
var ae=aj._private.position.y;var Q=R._private.rscratch.lastTgtCtlPtW;var P=aj.outerWidth();var L=R._private.rscratch.lastTgtCtlPtH;var K=aj.outerHeight();if(ai===ah&&Y===X&&at===ar&&an===am&&ap===ao&&af===ae&&Q===P&&L===K&&O===N&&J===I){continue}else{var ag=R._private.rscratch;ag.lastSrcCtlPtX=ah;ag.lastSrcCtlPtY=X;ag.lastSrcCtlPtW=ar;ag.lastSrcCtlPtH=am;ag.lastTgtCtlPtX=ao;ag.lastTgtCtlPtY=ae;ag.lastTgtCtlPtW=P;ag.lastTgtCtlPtH=K;ag.lastEdgeIndex=N;ag.lastNumEdges=I}if(ad._private.data.id==aj._private.data.id){var ak=R._private.style["control-point-step-size"].pxValue;
R._private.rscratch.edgeType="self";R._private.rscratch.cp2ax=ad._private.position.x;R._private.rscratch.cp2ay=ad._private.position.y-(1+Math.pow(this.getNodeHeight(ad),1.12)/100)*ak*(aq/3+1);R._private.rscratch.cp2cx=ad._private.position.x-(1+Math.pow(this.getNodeWidth(ad),1.12)/100)*ak*(aq/3+1);R._private.rscratch.cp2cy=ad._private.position.y;R._private.rscratch.selfEdgeMidX=(R._private.rscratch.cp2ax+R._private.rscratch.cp2cx)/2;R._private.rscratch.selfEdgeMidY=(R._private.rscratch.cp2ay+R._private.rscratch.cp2cy)/2
}else{if(H[V].length%2==1&&aq==Math.floor(H[V].length/2)){R._private.rscratch.edgeType="straight"}else{var ak=R._private.style["control-point-step-size"].value;var W=(0.5-H[V].length/2+aq)*ak;R._private.rscratch.edgeType="bezier";R._private.rscratch.cp2x=ab+U*W;R._private.rscratch.cp2y=aa+T*W}}}}return H};z.prototype.findEndpoints=function(J){var L;var i=J.source()[0];var P=J.target()[0];var U=Math.max(this.getNodeWidth(i),this.getNodeHeight(i));var K=Math.max(this.getNodeWidth(P),this.getNodeHeight(P));
U=0;K/=2;var I=[J.source().position().x,J.source().position().y];var M=[J.target().position().x,J.target().position().y];if(J._private.rscratch.edgeType=="self"){var R=[J._private.rscratch.cp2cx,J._private.rscratch.cp2cy];L=q[this.getNodeShape(P)].intersectLine(P._private.position.x,P._private.position.y,this.getNodeWidth(P),this.getNodeHeight(P),R[0],R[1],P._private.style["border-width"].value/2);var H=this.shortenIntersection(L,R,b[J._private.style["target-arrow-shape"].value].spacing(J));var Q=this.shortenIntersection(L,R,b[J._private.style["target-arrow-shape"].value].gap(J));
J._private.rscratch.endX=Q[0];J._private.rscratch.endY=Q[1];J._private.rscratch.arrowEndX=H[0];J._private.rscratch.arrowEndY=H[1];var R=[J._private.rscratch.cp2ax,J._private.rscratch.cp2ay];L=q[this.getNodeShape(i)].intersectLine(i._private.position.x,i._private.position.y,this.getNodeWidth(i),this.getNodeHeight(i),R[0],R[1],i._private.style["border-width"].value/2);var N=this.shortenIntersection(L,R,b[J._private.style["source-arrow-shape"].value].spacing(J));var O=this.shortenIntersection(L,R,b[J._private.style["source-arrow-shape"].value].gap(J));
J._private.rscratch.startX=O[0];J._private.rscratch.startY=O[1];J._private.rscratch.arrowStartX=N[0];J._private.rscratch.arrowStartY=N[1]}else{if(J._private.rscratch.edgeType=="straight"){L=q[this.getNodeShape(P)].intersectLine(P._private.position.x,P._private.position.y,this.getNodeWidth(P),this.getNodeHeight(P),i.position().x,i.position().y,P._private.style["border-width"].value/2);if(L.length==0){J._private.rscratch.noArrowPlacement=true}else{J._private.rscratch.noArrowPlacement=false}var H=this.shortenIntersection(L,[i.position().x,i.position().y],b[J._private.style["target-arrow-shape"].value].spacing(J));
var Q=this.shortenIntersection(L,[i.position().x,i.position().y],b[J._private.style["target-arrow-shape"].value].gap(J));J._private.rscratch.endX=Q[0];J._private.rscratch.endY=Q[1];J._private.rscratch.arrowEndX=H[0];J._private.rscratch.arrowEndY=H[1];L=q[this.getNodeShape(i)].intersectLine(i._private.position.x,i._private.position.y,this.getNodeWidth(i),this.getNodeHeight(i),P.position().x,P.position().y,i._private.style["border-width"].value/2);if(L.length==0){J._private.rscratch.noArrowPlacement=true
}else{J._private.rscratch.noArrowPlacement=false}var N=this.shortenIntersection(L,[P.position().x,P.position().y],b[J._private.style["source-arrow-shape"].value].spacing(J));var O=this.shortenIntersection(L,[P.position().x,P.position().y],b[J._private.style["source-arrow-shape"].value].gap(J));J._private.rscratch.startX=O[0];J._private.rscratch.startY=O[1];J._private.rscratch.arrowStartX=N[0];J._private.rscratch.arrowStartY=N[1]}else{if(J._private.rscratch.edgeType=="bezier"){var R=[J._private.rscratch.cp2x,J._private.rscratch.cp2y];
var T=I[0]*0.25+M[0]*0.25+R[0]*0.5;var S=I[1]*0.25+M[1]*0.25+R[1]*0.5;L=q[this.getNodeShape(P)].intersectLine(P._private.position.x,P._private.position.y,this.getNodeWidth(P),this.getNodeHeight(P),R[0],R[1],P._private.style["border-width"].value/2);var H=this.shortenIntersection(L,R,b[J._private.style["target-arrow-shape"].value].spacing(J));var Q=this.shortenIntersection(L,R,b[J._private.style["target-arrow-shape"].value].gap(J));J._private.rscratch.endX=Q[0];J._private.rscratch.endY=Q[1];J._private.rscratch.arrowEndX=H[0];
J._private.rscratch.arrowEndY=H[1];L=q[this.getNodeShape(i)].intersectLine(i._private.position.x,i._private.position.y,this.getNodeWidth(i),this.getNodeHeight(i),R[0],R[1],i._private.style["border-width"].value/2);var N=this.shortenIntersection(L,R,b[J._private.style["source-arrow-shape"].value].spacing(J));var O=this.shortenIntersection(L,R,b[J._private.style["source-arrow-shape"].value].gap(J));J._private.rscratch.startX=O[0];J._private.rscratch.startY=O[1];J._private.rscratch.arrowStartX=N[0];
J._private.rscratch.arrowStartY=N[1]}else{if(J._private.rscratch.isArcEdge){return}}}}};z.prototype.findEdges=function(L){var I=this.getCachedEdges();var K={};var H=[];for(var J=0;J<L.length;J++){K[L[J]._private.data.id]=L[J]}for(var J=0;J<I.length;J++){if(K[I[J]._private.data.source]||K[I[J]._private.data.target]){H.push(I[J])}}return H};z.prototype.intersectLineEllipse=function(Q,P,M,L,J,H){var I=M-Q;var i=L-P;I/=J;i/=H;var N=Math.sqrt(I*I+i*i);var K=N-1;if(K<0){return[]}var O=K/N;return[(M-Q)*O+Q,(L-P)*O+P]
};z.prototype.dotProduct=function(H,i){if(H.length!=2||i.length!=2){throw"dot product: arguments are not vectors"}return(H[0]*i[0]+H[1]*i[1])};z.prototype.intersectLineCircle=function(S,H,R,i,N,M,I){var U=[R-S,i-H];var Q=[S,H];var W=[N,M];var T=[S-N,H-M];var Y=U[0]*U[0]+U[1]*U[1];var X=2*(T[0]*U[0]+T[1]*U[1]);var W=(T[0]*T[0]+T[1]*T[1])-I*I;var V=X*X-4*Y*W;if(V<0){return[]}t1=(-X+Math.sqrt(V))/(2*Y);t2=(-X-Math.sqrt(V))/(2*Y);var J=Math.min(t1,t2);var L=Math.max(t1,t2);var K=[];if(J>=0&&J<=1){K.push(J)
}if(L>=0&&L<=1){K.push(L)}if(K.length==0){return[]}var aa=K[0]*U[0]+S;var Z=K[0]*U[1]+H;if(K.length>1){if(K[0]==K[1]){return[aa,Z]}else{var P=K[1]*U[0]+S;var O=K[1]*U[1]+H;return[aa,Z,P,O]}}else{return[aa,Z]}};z.prototype.findCircleNearPoint=function(K,J,L,P,O){var H=P-K;var i=O-J;var I=Math.sqrt(H*H+i*i);var N=H/I;var M=i/I;return[K+N*L,J+M*L]};z.prototype.findMaxSqDistanceToOrigin=function(K){var H=0.000001;var J;for(var I=0;I<K.length/2;I++){J=K[I*2]*K[I*2]+K[I*2+1]*K[I*2+1];if(J>H){H=J}}return H
};z.prototype.finiteLinesIntersect=function(L,S,J,Q,H,P,T,N,R){var M=(T-H)*(S-P)-(N-P)*(L-H);var O=(J-L)*(S-P)-(Q-S)*(L-H);var K=(N-P)*(J-L)-(T-H)*(Q-S);if(K!=0){var I=M/K;var i=O/K;if(0<=I&&I<=1&&0<=i&&i<=1){return[L+I*(J-L),S+I*(Q-S)]}else{if(!R){return[]}else{return[L+I*(J-L),S+I*(Q-S)]}}}else{if(M==0||O==0){if([L,J,T].sort()[1]==T){return[T,N]}if([L,J,H].sort()[1]==H){return[H,P]}if([H,T,J].sort()[1]==J){return[J,Q]}return[]}else{return[]}}};z.prototype.boxIntersectEllipse=function(I,R,i,P,Q,H,U,M,K){if(i<I){var J=I;
I=i;i=J}if(P<R){var S=R;R=P;P=S}var T=[M-H/2-Q,K];var O=[M+H/2+Q,K];var L=[M,K-U/2-Q];var N=[M,K+U/2+Q];if(i<T[0]){return false}if(I>O[0]){return false}if(R>N[1]){return false}if(P<L[1]){return false}if(I<=O[0]&&O[0]<=i&&R<=O[1]&&O[1]<=P){return true}if(I<=T[0]&&T[0]<=i&&R<=T[1]&&T[1]<=P){return true}if(I<=L[0]&&L[0]<=i&&R<=L[1]&&L[1]<=P){return true}if(I<=N[0]&&N[0]<=i&&R<=N[1]&&N[1]<=P){return true}I=(I-M)/(H/2+Q);i=(i-M)/(H/2+Q);R=(R-K)/(U/2+Q);P=(P-K)/(U/2+Q);if(I*I+R*R<=1){return true}if(i*i+R*R<=1){return true
}if(i*i+P*P<=1){return true}if(I*I+P*P<=1){return true}return false};z.prototype.boxIntersectPolygon=function(ad,N,ab,K,P,W,V,T,R,ah,U){if(ab<ad){var ac=ad;ad=ab;ab=ac}if(K<N){var M=N;N=K;K=M}var S=new Array(P.length);var ae=Math.asin(ah[1]/(Math.sqrt(ah[0]*ah[0]+ah[1]*ah[1])));if(ah[0]<0){ae=ae+Math.PI/2}else{ae=-ae-Math.PI/2}var I=Math.cos(-ae);var H=Math.sin(-ae);for(var aa=0;aa<S.length/2;aa++){S[aa*2]=W/2*(P[aa*2]*I-P[aa*2+1]*H);S[aa*2+1]=V/2*(P[aa*2+1]*I+P[aa*2]*H);S[aa*2]+=T;S[aa*2+1]+=R}var L=S[0];
var Q=S[0];var J=S[1];var O=S[1];for(var aa=1;aa<S.length/2;aa++){if(S[aa*2]>Q){Q=S[aa*2]}if(S[aa*2]<L){L=S[aa*2]}if(S[aa*2+1]>O){O=S[aa*2+1]}if(S[aa*2+1]<J){J=S[aa*2+1]}}if(ab<L-U){return false}if(ad>Q+U){return false}if(K<J-U){return false}if(N>O+U){return false}var Z;if(U>0){var ai=B.expandPolygon(S,-U);Z=B.joinLines(ai)}else{Z=S}for(var aa=0;aa<S.length/2;aa++){if(ad<=S[aa*2]&&S[aa*2]<=ab){if(N<=S[aa*2+1]&&S[aa*2+1]<=K){return true}}}for(var aa=0;aa<Z.length/2;aa++){var Y=Z[aa*2];var X=Z[aa*2+1];
var ag;var af;if(aa<Z.length/2-1){ag=Z[(aa+1)*2];af=Z[(aa+1)*2+1]}else{ag=Z[0];af=Z[1]}if(B.finiteLinesIntersect(Y,X,ag,af,ad,N,ab,N,false).length>0){return true}if(B.finiteLinesIntersect(Y,X,ag,af,ad,K,ab,K,false).length>0){return true}if(B.finiteLinesIntersect(Y,X,ag,af,ad,N,ad,K,false).length>0){return true}if(B.finiteLinesIntersect(Y,X,ag,af,ab,N,ab,K,false).length>0){return true}}return false};z.prototype.polygonIntersectLine=function(N,M,H,K,I,Q,P,O){var Y=[];var L;var J=new Array(H.length);
for(var U=0;U<J.length/2;U++){J[U*2]=H[U*2]*Q+K;J[U*2+1]=H[U*2+1]*P+I}var T;if(O>0){var X=B.expandPolygon(J,-O);T=B.joinLines(X)}else{T=J}var S,R,W,V;for(var U=0;U<T.length/2;U++){S=T[U*2];R=T[U*2+1];if(U<T.length/2-1){W=T[(U+1)*2];V=T[(U+1)*2+1]}else{W=T[0];V=T[1]}L=this.finiteLinesIntersect(N,M,K,I,S,R,W,V);if(L.length!=0){Y.push(L[0],L[1])}}return Y};z.prototype.shortenIntersection=function(L,K,I){var i=[L[0]-K[0],L[1]-K[1]];var J=Math.sqrt(i[0]*i[0]+i[1]*i[1]);var H=(J-I)/J;if(H<0){return[]}else{return[K[0]+H*i[0],K[1]+H*i[1]]
}};b.arrow={_points:[-0.15,-0.3,0,0,0.15,-0.3],collide:function(M,J,I,H,i,O,K,L){var N=b.arrow._points;return c.pointInsidePolygon(M,J,N,I,H,i,O,K,L)},roughCollide:function(H,N,M,J,I,i,L,K){if(typeof(b.arrow._farthestPointSqDistance)=="undefined"){b.arrow._farthestPointSqDistance=c.findMaxSqDistanceToOrigin(b.arrow._points)}return c.checkInBoundingCircle(H,N,b.arrow._farthestPointSqDistance,0,I,i,M,J)},draw:function(I){var J=b.arrow._points;for(var H=0;H<J.length/2;H++){I.lineTo(J[H*2],J[H*2+1])}},spacing:function(i){return 0
},gap:function(i){return i._private.style.width.value*2}};b.triangle=b.arrow;b.none={collide:function(H,N,M,J,I,i,L,K){return false},roughCollide:function(H,N,M,J,I,i,L,K){return false},draw:function(i){},spacing:function(i){return 0},gap:function(i){return 0}};b.circle={_baseRadius:0.15,collide:function(P,M,J,I,i,S,N,O){if(i!=S){var H=Math.asin(N[1]/(Math.sqrt(N[0]*N[0]+N[1]*N[1])));var R=Math.cos(-H);var L=Math.sin(-H);var K=[P*R-M*L,M*R+P*L];var Q=(S+O)/(i+O);M/=Q;I/=Q;return(Math.pow(J-P,2)+Math.pow(I-M,2)<=Math.pow((i+O)*b.circle._baseRadius,2))
}else{return(Math.pow(J-P,2)+Math.pow(I-M,2)<=Math.pow((i+O)*b.circle._baseRadius,2))}},roughCollide:function(H,N,M,J,I,i,L,K){return true},draw:function(i){i.arc(0,0,b.circle._baseRadius,0,Math.PI*2,false)},spacing:function(i){return c.getArrowWidth(i._private.style.width.value)*b.circle._baseRadius},gap:function(i){return i._private.style.width.value*2}};b.inhibitor={_points:[-0.25,0,-0.25,-0.1,0.25,-0.1,0.25,0],collide:function(M,J,I,H,i,O,K,L){var N=b.inhibitor._points;return c.pointInsidePolygon(M,J,N,I,H,i,O,K,L)
},roughCollide:function(H,N,M,J,I,i,L,K){if(typeof(b.inhibitor._farthestPointSqDistance)=="undefined"){b.inhibitor._farthestPointSqDistance=c.findMaxSqDistanceToOrigin(b.inhibitor._points)}return c.checkInBoundingCircle(H,N,b.inhibitor._farthestPointSqDistance,0,I,i,M,J)},draw:function(I){var J=b.inhibitor._points;for(var H=0;H<J.length/2;H++){I.lineTo(J[H*2],J[H*2+1])}},spacing:function(i){return 4},gap:function(i){return 4}};b.square={_points:[-0.12,0,0.12,0,0.12,-0.24,-0.12,-0.24],collide:function(M,J,I,H,i,O,K,L){var N=b.square._points;
return c.pointInsidePolygon(M,J,N,I,H,i,O,K,L)},roughCollide:function(H,N,M,J,I,i,L,K){if(typeof(b.square._farthestPointSqDistance)=="undefined"){b.square._farthestPointSqDistance=c.findMaxSqDistanceToOrigin(b.square._points)}return c.checkInBoundingCircle(H,N,b.square._farthestPointSqDistance,0,I,i,M,J)},draw:function(I){var J=b.square._points;for(var H=0;H<J.length/2;H++){I.lineTo(J[H*2],J[H*2+1])}},spacing:function(i){return 0},gap:function(i){return i._private.style.width.value*2}};b.diamond={_points:[-0.14,-0.14,0,-0.28,0.14,-0.14,0,0],collide:function(M,J,I,H,i,O,K,L){var N=b.diamond._points;
return c.pointInsidePolygon(M,J,N,I,H,i,O,K,L)},roughCollide:function(H,N,M,J,I,i,L,K){if(typeof(b.diamond._farthestPointSqDistance)=="undefined"){b.diamond._farthestPointSqDistance=c.findMaxSqDistanceToOrigin(b.diamond._points)}return c.checkInBoundingCircle(H,N,b.diamond._farthestPointSqDistance,0,I,i,M,J)},draw:function(i){i.lineTo(-0.14,-0.14);i.lineTo(0,-0.28);i.lineTo(0.14,-0.14);i.lineTo(0,0)},spacing:function(i){return 0},gap:function(i){return i._private.style.width.value*2}};b.tee=b.inhibitor;
z.prototype.getArrowWidth=function(i){return Math.max(Math.pow(i*13.37,0.9),29)};z.prototype.getArrowHeight=function(i){return Math.max(Math.pow(i*13.37,0.9),29)};z.prototype.drawArrowheads=function(H,J,K){if(K){return}var I,i;var M=J._private.rscratch.arrowStartX;var L=J._private.rscratch.arrowStartY;I=M-J.source().position().x;i=L-J.source().position().y;H.fillStyle="rgba("+J._private.style["source-arrow-color"].value[0]+","+J._private.style["source-arrow-color"].value[1]+","+J._private.style["source-arrow-color"].value[2]+","+J._private.style.opacity.value+")";
H.lineWidth=J._private.style.width.value;this.drawArrowShape(H,J._private.style["source-arrow-shape"].value,M,L,I,i);var O=J._private.rscratch.arrowEndX;var N=J._private.rscratch.arrowEndY;I=O-J.target().position().x;i=N-J.target().position().y;H.fillStyle="rgba("+J._private.style["target-arrow-color"].value[0]+","+J._private.style["target-arrow-color"].value[1]+","+J._private.style["target-arrow-color"].value[2]+","+J._private.style.opacity.value+")";H.lineWidth=J._private.style.width.value;this.drawArrowShape(H,J._private.style["target-arrow-shape"].value,O,N,I,i)
};z.prototype.drawArrowShape=function(L,H,i,N,K,I){var M=Math.asin(I/(Math.sqrt(K*K+I*I)));if(K<0){M=M+Math.PI/2}else{M=-(Math.PI/2+M)}L.translate(i,N);L.moveTo(0,0);L.rotate(-M);var J=this.getArrowWidth(L.lineWidth);L.scale(J,J);L.beginPath();b[H].draw(L);L.closePath();L.fill();L.scale(1/J,1/J);L.rotate(M);L.translate(-i,-N)};var k=function(I,H){var N=1/I*2*Math.PI;var L=I%2==0?Math.PI/2+N/2:Math.PI/2;L+=H;var P=new Array(I*2);var J;for(var K=0;K<I;K++){J=K*N+L;P[2*K]=Math.cos(J);P[2*K+1]=Math.sin(-J)
}var R=0;var Q=0;for(var K=0;K<P.length/2;K++){if(Math.abs(P[2*K]>R)){R=Math.abs(P[2*K])}if(Math.abs(P[2*K+1]>Q)){Q=Math.abs(P[2*K+1])}}var M=0.0005;var O=Math.max(R,Q);for(var K=0;K<P.length/2;K++){if(O>M){P[2*K]*=(1/O);P[2*K+1]*=(1/O)}}return P};var B=c;q.ellipse={draw:function(H,K,J,I,i){q.ellipse.drawPath(H,K,J,I,i);H.fill()},drawPath:function(H,K,J,I,i){H.beginPath();H.translate(K,J);H.scale(I/2,i/2);H.arc(0,0,1,0,Math.PI*2*0.999,false);H.closePath();H.scale(2/I,2/i);H.translate(-K,-J)},intersectLine:function(L,K,J,I,H,N,M){var i=c.intersectLineEllipse(H,N,L,K,J/2+M,I/2+M);
return i},intersectBox:function(I,N,i,L,H,O,K,J,M){return z.prototype.boxIntersectEllipse(I,N,i,L,M,H,O,K,J)},checkPointRough:function(H,M,L,I,i,K,J){return true},checkPoint:function(H,M,L,I,i,K,J){H-=K;M-=J;H/=(I/2+L);M/=(i/2+L);return(Math.pow(H,2)+Math.pow(M,2)<=1)}};q.triangle={points:k(3,0),draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.triangle.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.triangle.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.triangle.points,K,J,I/2,H/2,L)
},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.triangle.points;return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.triangle.points,L,I,i,K,J)},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.triangle.points,K,J,I,i,[0,-1],L)}};q.square={points:k(4,0),draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.square.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.square.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.square.points,K,J,I/2,H/2,L)
},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.square.points;return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.square.points,L,I,i,K,J)},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.square.points,K,J,I,i,[0,-1],L)}};q.rectangle=q.square;q.octogon={};q.roundrectangle={points:k(4,0),draw:function(H,K,J,I,i){B.drawRoundRectangle(H,K,J,I,i,10)},drawPath:function(H,K,J,I,i){B.drawRoundRectanglePath(H,K,J,I,i,10)
},intersectLine:function(K,J,I,H,i,M,L){return B.roundRectangleIntersectLine(i,M,K,J,I,H,L)},intersectBox:function(I,N,i,L,H,O,K,J,M){return B.roundRectangleIntersectBox(I,N,i,L,H,O,K,J,M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.roundrectangle.points,L,I,i,K,J)},checkPoint:function(N,L,M,i,O,J,H){var K=B.getRoundRectangleRadius(i,O);if(B.pointInsidePolygon(N,L,q.roundrectangle.points,J,H,i,O-2*K,[0,-1],M)){return true}if(B.pointInsidePolygon(N,L,q.roundrectangle.points,J,H,i-2*K,O,[0,-1],M)){return true
}var I=function(Q,V,U,S,R,P,T){Q-=U;V-=S;Q/=(R/2+T);V/=(P/2+T);return(Math.pow(Q,2)+Math.pow(V,2)<=1)};if(I(N,L,J-i/2+K,H-O/2+K,K*2,K*2,M)){return true}if(I(N,L,J+i/2-K,H-O/2+K,K*2,K*2,M)){return true}if(I(N,L,J+i/2-K,H+O/2-K,K*2,K*2,M)){return true}if(I(N,L,J-i/2+K,H+O/2-K,K*2,K*2,M)){return true}return false}};q.roundrectangle2={roundness:4.99,draw:function(I,H,i){if(H<=roundness*2){return}B.drawPolygon(I._private.position.x,I._private.position.y,H,i,nodeSapes.roundrectangle2.points)},intersectLine:function(J,I,H,i,K){return B.findPolygonIntersection(J,I,H,i,K,q.square.points)
},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.square.points}};q.pentagon={points:k(5,0),draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.pentagon.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.pentagon.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.pentagon.points,K,J,I/2,H/2,L)},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.pentagon.points;return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.pentagon.points,L,I,i,K,J)
},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.pentagon.points,K,J,I,i,[0,-1],L)}};q.hexagon={points:k(6,0),draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.hexagon.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.hexagon.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.hexagon.points,K,J,I/2,H/2,L)},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.hexagon.points;return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)
},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.hexagon.points,L,I,i,K,J)},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.hexagon.points,K,J,I,i,[0,-1],L)}};q.heptagon={points:k(7,0),draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.heptagon.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.heptagon.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.heptagon.points,K,J,I/2,H/2,L)},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.heptagon.points;
return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.heptagon.points,L,I,i,K,J)},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.heptagon.points,K,J,I,i,[0,-1],L)}};q.octagon={points:k(8,0),draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.octagon.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.octagon.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.octagon.points,K,J,I/2,H/2,L)
},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.octagon.points;return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.octagon.points,L,I,i,K,J)},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.octagon.points,K,J,I,i,[0,-1],L)}};var j=new Array(20);var g=k(5,0);var F=k(5,Math.PI/5);var o=0.5*(3-Math.sqrt(5));o*=1.57;for(var E=0;E<F.length/2;E++){F[E*2]*=o;F[E*2+1]*=o}for(var E=0;E<20/4;E++){j[E*4]=g[E*2];
j[E*4+1]=g[E*2+1];j[E*4+2]=F[E*2];j[E*4+3]=F[E*2+1]}q.star5={points:j,draw:function(H,K,J,I,i){B.drawPolygon(H,K,J,I,i,q.star5.points)},drawPath:function(H,K,J,I,i){B.drawPolygonPath(H,K,J,I,i,q.star5.points)},intersectLine:function(K,J,I,H,i,M,L){return B.polygonIntersectLine(i,M,q.star5.points,K,J,I/2,H/2,L)},intersectBox:function(I,N,i,L,H,P,K,J,M){var O=q.star5.points;return B.boxIntersectPolygon(I,N,i,L,O,H,P,K,J,[0,-1],M)},checkPointRough:function(H,M,L,I,i,K,J){return B.checkInBoundingBox(H,M,q.star5.points,L,I,i,K,J)
},checkPoint:function(H,M,L,I,i,K,J){return B.pointInsidePolygon(H,M,q.star5.points,K,J,I,i,[0,-1],L)}};z.prototype.expandPolygon=function(T,J){var K=new Array(T.length*2);var S,R,Q,P;for(var N=0;N<T.length/2;N++){S=T[N*2];R=T[N*2+1];if(N<T.length/2-1){Q=T[(N+1)*2];P=T[(N+1)*2+1]}else{Q=T[0];P=T[1]}var O=(P-R);var M=-(Q-S);var L=Math.sqrt(O*O+M*M);var I=O/L;var H=M/L;K[N*4]=S+I*J;K[N*4+1]=R+H*J;K[N*4+2]=Q+I*J;K[N*4+3]=P+H*J}return K};z.prototype.joinLines=function(Q){var P=new Array(Q.length/2);var S,R,O,N;
var L,K,J,I;for(var M=0;M<Q.length/4;M++){S=Q[M*4];R=Q[M*4+1];O=Q[M*4+2];N=Q[M*4+3];if(M<Q.length/4-1){L=Q[(M+1)*4];K=Q[(M+1)*4+1];J=Q[(M+1)*4+2];I=Q[(M+1)*4+3]}else{L=Q[0];K=Q[1];J=Q[2];I=Q[3]}var H=this.finiteLinesIntersect(S,R,O,N,L,K,J,I,true);P[M*2]=H[0];P[M*2+1]=H[1]}return P};z.prototype.pointInsidePolygon=function(S,Q,M,P,N,W,V,ac,U){var O=new Array(M.length);var ab=Math.asin(ac[1]/(Math.sqrt(ac[0]*ac[0]+ac[1]*ac[1])));if(ac[0]<0){ab=ab+Math.PI/2}else{ab=-ab-Math.PI/2}var J=Math.cos(-ab);
var H=Math.sin(-ab);for(var Y=0;Y<O.length/2;Y++){O[Y*2]=W/2*(M[Y*2]*J-M[Y*2+1]*H);O[Y*2+1]=V/2*(M[Y*2+1]*J+M[Y*2]*H);O[Y*2]+=P;O[Y*2+1]+=N}var X;if(U>0){var ad=B.expandPolygon(O,-U);X=B.joinLines(ad)}else{X=O}var aa,L,Z,K;var I;var R=0;var T=0;for(var Y=0;Y<X.length/2;Y++){aa=X[Y*2];L=X[Y*2+1];if(Y+1<X.length/2){Z=X[(Y+1)*2];K=X[(Y+1)*2+1]}else{Z=X[(Y+1-X.length/2)*2];K=X[(Y+1-X.length/2)*2+1]}if(aa==S&&Z==S){}else{if((aa>=S&&S>=Z)||(aa<=S&&S<=Z)){I=(S-aa)/(Z-aa)*(K-L)+L;if(I>Q){R++}if(I<Q){T++}}else{continue
}}}if(R%2==0){return false}else{return true}};z.prototype.drawPolygonPath=function(K,I,N,M,H,L){K.translate(I,N);K.scale(M/2,H/2);K.beginPath();K.moveTo(L[0],L[1]);for(var J=1;J<L.length/2;J++){K.lineTo(L[J*2],L[J*2+1])}K.closePath();K.scale(2/M,2/H);K.translate(-I,-N)};z.prototype.drawPolygon=function(I,H,L,K,i,J){this.drawPolygonPath(I,H,L,K,i,J);I.fill()};z.prototype.getRoundRectangleRadius=function(H,i){return Math.min(H/2,i/2,10)};z.prototype.drawRoundRectanglePath=function(H,N,M,i,O,K){var I=i/2;
var L=O/2;var J=this.getRoundRectangleRadius(i,O);H.translate(N,M);H.beginPath();H.moveTo(0,-L);H.arcTo(I,-L,I,0,J);H.arcTo(I,L,0,L,J);H.arcTo(-I,L,-I,0,J);H.arcTo(-I,-L,0,-L,J);H.lineTo(0,-L);H.closePath();H.translate(-N,-M)};z.prototype.drawRoundRectangle=function(J,I,L,K,H,i){this.drawRoundRectanglePath(J,I,L,K,H,i);J.fill()};z.prototype.roundRectangleIntersectLine=function(ae,ad,ap,am,H,J,ai){var ag=this.getRoundRectangleRadius(H,J);var U=H/2;var K=J/2;var I;var O=ap-U+ag-ai;var N=am-K-ai;var ak=ap+U-ag+ai;
var aj=N;I=this.finiteLinesIntersect(ae,ad,ap,am,O,N,ak,aj,false);if(I.length>0){return I}var ah=ap+U+ai;var af=am-K+ag-ai;var i=ah;var an=am+K-ag+ai;I=this.finiteLinesIntersect(ae,ad,ap,am,ah,af,i,an,false);if(I.length>0){return I}var ab=ap-U+ag-ai;var Z=am+K+ai;var S=ap+U-ag+ai;var R=Z;I=this.finiteLinesIntersect(ae,ad,ap,am,ab,Z,S,R,false);if(I.length>0){return I}var Y=ap-U-ai;var X=am-K+ag-ai;var W=Y;var V=am+K-ag+ai;I=this.finiteLinesIntersect(ae,ad,ap,am,Y,X,W,V,false);if(I.length>0){return I
}var T;var Q=ap-U+ag;var P=am-K+ag;T=this.intersectLineCircle(ae,ad,ap,am,Q,P,ag+ai);if(T.length>0&&T[0]<=Q&&T[1]<=P){return[T[0],T[1]]}var M=ap+U-ag;var L=am-K+ag;T=this.intersectLineCircle(ae,ad,ap,am,M,L,ag+ai);if(T.length>0&&T[0]>=M&&T[1]<=L){return[T[0],T[1]]}var ao=ap+U-ag;var al=am+K-ag;T=this.intersectLineCircle(ae,ad,ap,am,ao,al,ag+ai);if(T.length>0&&T[0]>=ao&&T[1]>=al){return[T[0],T[1]]}var ac=ap-U+ag;var aa=am+K-ag;T=this.intersectLineCircle(ae,ad,ap,am,ac,aa,ag+ai);if(T.length>0&&T[0]<=ac&&T[1]>=aa){return[T[0],T[1]]
}};z.prototype.roundRectangleIntersectBox=function(M,S,L,R,T,Q,O,N,P){var I=this.getRoundRectangleRadius(T,Q);var H=O-T/2-P;var i=N-Q/2+I-P;var V=O+T/2+P;var U=N+Q/2-I+P;var Y=O-T/2+I-P;var W=N-Q/2-P;var K=O+T/2-I+P;var J=N+Q/2+P;var ab=Math.min(M,L);var aa=Math.max(M,L);var Z=Math.min(S,R);var X=Math.max(S,R);if(aa<H){return false}else{if(ab>V){return false}}if(X<W){return false}else{if(Z>J){return false}}if(H>=ab&&H<=aa&&i>=Z&&i<=X){return true}if(V>=ab&&V<=aa&&i>=Z&&i<=X){return true}if(V>=ab&&V<=aa&&U>=Z&&U<=X){return true
}if(H>=ab&&H<=aa&&U>=Z&&U<=X){return true}if(ab>=H&&ab<=V&&Z>=i&&Z<=U){return true}if(aa>=H&&aa<=V&&Z>=i&&Z<=U){return true}if(aa>=H&&aa<=V&&X>=i&&X<=U){return true}if(ab>=H&&ab<=V&&X>=i&&X<=U){return true}if(Y>=ab&&Y<=aa&&W>=Z&&W<=X){return true}if(K>=ab&&K<=aa&&W>=Z&&W<=X){return true}if(K>=ab&&K<=aa&&J>=Z&&J<=X){return true}if(Y>=ab&&Y<=aa&&J>=Z&&J<=X){return true}if(ab>=Y&&ab<=K&&Z>=W&&Z<=J){return true}if(aa>=Y&&aa<=K&&Z>=W&&Z<=J){return true}if(aa>=Y&&aa<=K&&X>=W&&X<=J){return true}if(ab>=Y&&ab<=K&&X>=W&&X<=J){return true
}if(this.boxIntersectEllipse(ab,Z,aa,X,P,I*2,I*2,Y+P,i+P)){return true}if(this.boxIntersectEllipse(ab,Z,aa,X,P,I*2,I*2,K-P,i+P)){return true}if(this.boxIntersectEllipse(ab,Z,aa,X,P,I*2,I*2,K-P,U-P)){return true}if(this.boxIntersectEllipse(ab,Z,aa,X,P,I*2,I*2,Y+P,U-P)){return true}return false};z.prototype.checkInBoundingCircle=function(H,N,I,M,J,i,L,K){H=(H-L)/(J+M);N=(N-K)/(i+M);return(H*H+N*N)<=I};z.prototype.checkInBoundingBox=function(R,P,S,Q,J,T,N,M){var L=S[0],K=S[1];var I=S[0],H=S[1];for(var O=1;
O<S.length/2;O++){if(S[O*2]<L){L=S[O*2]}else{if(S[O*2]>I){I=S[O*2]}}if(S[O*2+1]<K){K=S[O*2+1]}else{if(S[O*2+1]>H){H=S[O*2+1]}}}R-=N;P-=M;R/=J;P/=T;if(R<L){return false}else{if(R>I){return false}}if(P<K){return false}else{if(P>H){return false}}return true};z.prototype.boxInBezierVicinity=function(T,N,Z,Q,V,M,U,L,R,J,S){var P=0.25*V+0.5*U+0.25*R;var O=0.25*M+0.5*L+0.25*J;var aa=Math.min(T,Z)-S;var X=Math.min(N,Q)-S;var Y=Math.max(T,Z)+S;var W=Math.max(N,Q)+S;if(V>=aa&&V<=Y&&M>=X&&M<=W){return 1}else{if(R>=aa&&R<=Y&&J>=X&&J<=W){return 1
}else{if(P>=aa&&P<=Y&&O>=X&&O<=W){return 1}else{if(U>=aa&&U<=Y&&L>=X&&L<=W){return 1}}}}var K=Math.min(V,P,R);var I=Math.min(M,O,J);var H=Math.max(V,P,R);var i=Math.max(M,O,J);if(K>Y||H<aa||I>W||i<X){return 0}return 1};z.prototype.checkBezierInBox=function(L,K,T,Q,J,P,I,O,i,N,M){function H(X,W,V,U){return(1-U)*(1-U)*X+2*(1-U)*U*W+U*U*V}function S(V){var U=H(J,I,i,V);var W=H(P,O,N,V);return L<=U&&U<=T&&K<=W&&W<=Q}for(var R=0;R<=1;R+=0.25){if(!S(R)){return false}}return true};z.prototype.checkStraightEdgeInBox=function(J,I,O,N,H,M,i,L,K){return J<=H&&H<=O&&J<=i&&i<=O&&I<=M&&M<=N&&I<=L&&L<=N
};z.prototype.checkStraightEdgeCrossesBox=function(U,O,ab,R,W,K,V,H,T){var ac=Math.min(U,ab)-T;var Z=Math.min(O,R)-T;var aa=Math.max(U,ab)+T;var Y=Math.max(O,R)+T;var L=V-W;var Q=W;var X;var I=H-K;var P=K;var S;if(Math.abs(L)<0.0001){return(W>=ac&&W<=aa&&Math.min(K,H)<=Z&&Math.max(K,H)>=Y)}var i=(ac-Q)/L;if(i>0&&i<=1){X=I*i+P;if(X>=Z&&X<=Y){return true}}var N=(aa-Q)/L;if(N>0&&N<=1){X=I*N+P;if(X>=Z&&X<=Y){return true}}var J=(Z-P)/I;if(J>0&&J<=1){S=L*J+Q;if(S>=ac&&S<=aa){return true}}var M=(Y-P)/I;
if(M>0&&M<=1){S=L*M+Q;if(S>=ac&&S<=aa){return true}}return false};z.prototype.checkBezierCrossesBox=function(Z,L,am,ab,T,aw,P,at,N,ap,H){var V=Math.min(Z,am)-H;var S=Math.min(L,ab)-H;var av=Math.max(Z,am)+H;var ar=Math.max(L,ab)+H;if(T>=V&&T<=av&&aw>=S&&aw<=ar){return true}else{if(N>=V&&N<=av&&ap>=S&&ap<=ar){return true}}var Y=T-2*P+N;var K=-2*T+2*P;var ai=T;var ac=[];if(Math.abs(Y)<0.0001){var an=(V-T)/K;var aa=(av-T)/K;ac.push(an,aa)}else{var af=K*K-4*Y*(ai-V);var W,U;if(af>0){var ag=Math.sqrt(af);
W=(-K+ag)/(2*Y);U=(-K-ag)/(2*Y);ac.push(W,U)}var ae=K*K-4*Y*(ai-av);var R,O;if(ae>0){var ag=Math.sqrt(ae);R=(-K+ag)/(2*Y);O=(-K-ag)/(2*Y);ac.push(R,O)}}ac.sort(function(ay,ax){return ay-ax});var X=aw-2*at+ap;var I=-2*aw+2*at;var ah=aw;var al=[];if(Math.abs(X)<0.0001){var J=(S-aw)/I;var aj=(ar-aw)/I;al.push(J,aj)}else{var Q=I*I-4*X*(ah-S);var i,au;if(Q>0){var ag=Math.sqrt(Q);i=(-I+ag)/(2*X);au=(-I-ag)/(2*X);al.push(i,au)}var M=I*I-4*X*(ah-ar);var aq,ao;if(M>0){var ag=Math.sqrt(M);aq=(-I+ag)/(2*X);
ao=(-I-ag)/(2*X);al.push(aq,ao)}}al.sort(function(ay,ax){return ay-ax});for(var ad=0;ad<ac.length;ad+=2){for(var ak=1;ak<al.length;ak+=2){if(ac[ad]<al[ak]&&al[ak]>=0&&ac[ad]<=1&&ac[ad+1]>al[ak-1]&&al[ak-1]<=1&&ac[ad+1]>=0){return true}}}return false};z.prototype.inLineVicinity=function(Q,O,L,J,K,I,M){var R=M;var H=Math.min(L,K);var i=Math.max(L,K);var P=Math.min(J,I);var N=Math.max(J,I);return H-R<=Q&&Q<=i+R&&P-R<=O&&O<=N+R};z.prototype.inBezierVicinity=function(N,M,X,I,W,H,V,i,ac){var P=0.25*X+0.5*W+0.25*V;
var O=0.25*I+0.5*H+0.25*i;var K={x1:Math.min(X,V,P),x2:Math.max(X,V,P),y1:Math.min(I,i,O),y2:Math.max(I,i,O)};if(N<K.x1||N>K.x2||M<K.y1||M>K.y2){return false}else{}var S,R,aa,Y;var L,J,Q;var ab=function(ae,ak,af,ad,aj,ai,ag,ah){L=(ai-ad)*(ae-af)+(af-aj)*(ak-ad);J=L*L;sideSquared=(ai-ad)*(ai-ad)+(af-aj)*(af-aj);if(ah){if(L>0){return false}}else{if(L<0){return false}}return(J/sideSquared>ag)};var U=(P+W)/2;var T=(O+H)/2;var Z=true;if(ab(U,T,X,I,W,H,0,Z)){Z=!Z}return(!ab(N,M,X,I,W,H,ac,Z)&&!ab(N,M,W,H,V,i,ac,Z)&&!ab(N,M,V,i,X,I,ac,Z))
};z.prototype.solveCubic=function(O,N,M,L,S){N/=O;M/=O;L/=O;var Q,H,i,J,R,P,I,K;H=(3*M-(N*N))/9;i=-(27*L)+N*(9*M-2*(N*N));i/=54;Q=H*H*H+i*i;S[1]=0;I=(N/3);if(Q>0){R=i+Math.sqrt(Q);R=((R<0)?-Math.pow(-R,(1/3)):Math.pow(R,(1/3)));P=i-Math.sqrt(Q);P=((P<0)?-Math.pow(-P,(1/3)):Math.pow(P,(1/3)));S[0]=-I+R+P;I+=(R+P)/2;S[4]=S[2]=-I;I=Math.sqrt(3)*(-P+R)/2;S[3]=I;S[5]=-I;return}S[5]=S[3]=0;if(Q==0){K=((i<0)?-Math.pow(-i,(1/3)):Math.pow(i,(1/3)));S[0]=-I+2*K;S[4]=S[2]=-(K+I);return}H=-H;J=H*H*H;J=Math.acos(i/Math.sqrt(J));
K=2*Math.sqrt(H);S[0]=-I+K*Math.cos(J/3);S[2]=-I+K*Math.cos((J+2*Math.PI)/3);S[4]=-I+K*Math.cos((J+4*Math.PI)/3);return};z.prototype.sqDistanceToQuadraticBezier=function(R,Q,W,L,V,K,U,J){var ac=1*W*W-4*W*V+2*W*U+4*V*V-4*V*U+U*U+L*L-4*L*K+2*L*J+4*K*K-4*K*J+J*J;var ab=1*9*W*V-3*W*W-3*W*U-6*V*V+3*V*U+9*L*K-3*L*L-3*L*J-6*K*K+3*K*J;var Z=1*3*W*W-6*W*V+W*U-W*R+2*V*V+2*V*R-U*R+3*L*L-6*L*K+L*J-L*Q+2*K*K+2*K*Q-J*Q;var Y=1*W*V-W*W+W*R-V*R+L*K-L*L+L*Q-K*Q;A("coefficients: "+ac/ac+", "+ab/ac+", "+Z/ac+", "+Y/ac);
var M=[];this.solveCubic(ac,ab,Z,Y,M);var H=1e-7;var aa=[];for(var N=0;N<6;N+=2){if(Math.abs(M[N+1])<H&&M[N]>=0&&M[N]<=1){aa.push(M[N])}}aa.push(1);aa.push(0);var I=-1;var X;var P,O,S;for(var T=0;T<aa.length;T++){P=Math.pow(1-aa[T],2)*W+2*(1-aa[T])*aa[T]*V+aa[T]*aa[T]*U;O=Math.pow(1-aa[T],2)*L+2*(1-aa[T])*aa[T]*K+aa[T]*aa[T]*J;S=Math.pow(P-R,2)+Math.pow(O-Q,2);A("distance for param "+aa[T]+": "+Math.sqrt(S));if(I>=0){if(S<I){I=S;X=aa[T]}}else{I=S;X=aa[T]}}A("given: ( "+R+", "+Q+"), ( "+W+", "+L+"), ( "+V+", "+K+"), ( "+U+", "+J+")");
A("roots: "+M);A("params: "+aa);A("closest param: "+X);return I};z.prototype.sqDistanceToFiniteLine=function(O,L,H,N,i,M){var I=[O-H,L-N];var R=[i-H,M-N];var J=R[0]*R[0]+R[1]*R[1];var Q=I[0]*I[0]+I[1]*I[1];var P=I[0]*R[0]+I[1]*R[1];var K=P*P/J;if(P<0){return Q}if(K>J){return(O-i)*(O-i)+(L-M)*(L-M)}return(Q-K)};var A=function(){};w("renderer","canvas",z)})(cytoscape);(function(a){var b={ready:function(){},stop:function(){}};function c(d){this.options=a.util.extend(true,{},b,d)}c.prototype.run=function(){var d=this.options;
var e=d.cy;e.nodes().positions(function(){return{x:0,y:0}});e.one("layoutready",d.ready);e.trigger("layoutready");e.one("layoutstop",d.stop);e.trigger("layoutstop")};c.prototype.stop=function(){var d=this.options;cy.one("layoutstop",d.stop);cy.trigger("layoutstop")};a("layout","null",c)})(cytoscape);(function(a){var c={ready:undefined,stop:undefined,fit:true,padding:30};function b(d){this.options=a.util.extend(true,{},c,d)}b.prototype.run=function(){var h=this.options;var j=h.cy;var g=j.nodes();var f=j.edges();
var e=j.container();var i=e.clientWidth;var d=e.clientHeight;g.positions(function(l,k){if(k.locked()){return false}return{x:Math.round(Math.random()*i),y:Math.round(Math.random()*d)}});j.one("layoutready",h.ready);j.trigger("layoutready");if(h.fit){j.fit(h.padding)}j.one("layoutstop",h.stop);j.trigger("layoutstop")};b.prototype.stop=function(){};a("layout","random",b)})(cytoscape);(function(a){var c={fit:true,rows:undefined,columns:undefined,ready:undefined,stop:undefined};function b(d){this.options=a.util.extend({},c,d)
}b.prototype.run=function(){var z=this.options;var h=z;var g=z.cy;var u=g.nodes();var f=g.edges();var q=g.container();var t=q.clientWidth;var s=q.clientHeight;if(s==0||t==0){u.positions(function(){return{x:0,y:0}})}else{var i=u.size();var o=Math.sqrt(i*s/t);var m=Math.round(o);var p=Math.round(t/s*o);function l(B){if(B==undefined){return Math.min(m,p)}else{var A=Math.min(m,p);if(A==m){m=B}else{p=B}}}function e(B){if(B==undefined){return Math.max(m,p)}else{var A=Math.max(m,p);if(A==m){m=B}else{p=B
}}}if(h.rows!=null&&h.columns!=null){m=h.rows;p=h.columns}else{if(h.rows!=null&&h.columns==null){m=h.rows;p=Math.ceil(i/m)}else{if(h.rows==null&&h.columns!=null){p=h.columns;m=Math.ceil(i/p)}else{if(p*m>i){var w=l();var r=e();if((w-1)*r>=i){l(w-1)}else{if((r-1)*w>=i){e(r-1)}}}else{while(p*m<i){var w=l();var r=e();if((r+1)*w>=i){e(r+1)}else{l(w+1)}}}}}}var v=t/p;var d=s/m;var k=0;var j=0;u.positions(function(C,B){if(B.locked()){return false}var A=j*v+v/2;var D=k*d+d/2;j++;if(j>=p){j=0;k++}return{x:A,y:D}
})}if(z.fit){g.reset()}g.one("layoutready",z.ready);g.trigger("layoutready");g.one("layoutstop",z.stop);g.trigger("layoutstop")};b.prototype.stop=function(){};a("layout","grid",b)})(cytoscape);(function(a){var c={fit:true,ready:undefined,stop:undefined,positions:undefined,zoom:undefined,pan:undefined,padding:30};function b(d){this.options=a.util.extend(true,{},c,d)}b.prototype.run=function(){var g=this.options;var i=g.cy;var f=i.nodes();var e=i.edges();var d=i.container();function h(j){if(g.positions==null){return null
}if(g.positions[j._private.data.id]==null){return null}return g.positions[j._private.data.id]}f.positions(function(k,l){var j=h(l);if(l.locked()||j==null){return false}return j});if(g.pan!=null){i.pan(g.pan)}if(g.zoom!=null){i.zoom(g.zoom)}i.one("layoutready",g.ready);i.trigger("layoutready");if(g.fit){i.fit(g.padding)}i.one("layoutstop",g.stop);i.trigger("layoutstop")};a("layout","preset",b);a("core","presetLayout",function(){var f=this;var d={};var e={};f.nodes().each(function(g,h){e[h.data("id")]=h.position()
});d.positions=e;d.name="preset";d.zoom=f.zoom();d.pan=f.pan();return d})})(cytoscape);(function(a){var b={liveUpdate:true,ready:undefined,stop:undefined,maxSimulationTime:4000,fit:true,padding:[50,50,50,50],ungrabifyWhileSimulating:true,repulsion:undefined,stiffness:undefined,friction:undefined,gravity:true,fps:undefined,precision:undefined,nodeMass:undefined,edgeLength:undefined,stepSize:1,stableEnergy:function(d){var f=d;return(f.max<=0.5)||(f.mean<=0.3)}};function c(d){this.options=a.util.extend({},b,d)
}c.prototype.run=function(){var k=this.options;var j=k.cy;var v=j.nodes();var i=j.edges();var q=j.container();var u=q.clientWidth;var s=q.clientHeight;if(j.nodes().size()<=1){if(k.fit){j.reset()}j.nodes().position({x:Math.round(u/2),y:Math.round(s/2)});j.one("layoutstop",k.stop);j.trigger("layoutstop");j.one("layoutstop",k.stop);j.trigger("layoutstop");return}var m=this.system=arbor.ParticleSystem(k.repulsion,k.stiffness,k.friction,k.gravity,k.fps,k.dt,k.precision);this.system=m;if(k.liveUpdate&&k.fit){j.reset()
}var t=250;var g;var p=false;var f=+new Date;var r={init:function(z){},redraw:function(){var A=m.energy();if(k.stableEnergy!=null&&A!=null&&A.n>0&&k.stableEnergy(A)){m.stop();return}clearTimeout(g);g=setTimeout(w,t);var B=[];m.eachNode(function(H,C){var G=H.name;var E=H.data;var D=E.element;if(D==null){return}var F=D._private.position;if(!D.locked()&&!D.grabbed()){F.x=C.x;F.y=C.y;B.push(D)}});var z=(+new Date-f)>=16;if(k.liveUpdate&&B.length>0&&z){new a.Collection(j,B).rtrigger("position");f=+new Date
}if(!p){p=true;j.one("layoutready",k.ready);j.trigger("layoutready")}}};m.renderer=r;m.screenSize(u,s);m.screenPadding(k.padding[0],k.padding[1],k.padding[2],k.padding[3]);m.screenStep(k.stepSize);function o(z,A){if(A==null){return undefined}else{if(typeof A==typeof function(){}){return A.apply(z,[z._private.data,{nodes:v.length,edges:i.length,element:z}])}else{return A}}}function d(D){var G=D.x;var E=D.y;var H=u;var B=s;var A=-2;var I=2;var F=-2;var z=2;var C=4;return{x:G/H*C+A,y:E/B*C+I}}var l=function(A){grabbed=this;
var B=m.fromScreen(this.position());var z=arbor.Point(B.x,B.y);this.scratch().arbor.p=z;switch(A.type){case"grab":this.scratch().arbor.fixed=true;break;case"dragstop":this.scratch().arbor.fixed=false;this.scratch().arbor.tempMass=1000;break}};v.bind("grab drag dragstop",l);v.each(function(B,C){var E=this._private.data.id;var A=o(this,k.nodeMass);var z=this._private.locked;var D=d({x:C.position().x,y:C.position().y});if(C.locked()){return}this.scratch().arbor=m.addNode(E,{element:this,mass:A,fixed:z,x:z?D.x:undefined,y:z?D.y:undefined})
});i.each(function(){var C=this.id();var A=this.source().id();var B=this.target().id();var z=o(this,k.edgeLength);this.scratch().arbor=m.addEdge(A,B,{length:z})});function h(z){if(k.fit){j.fit()}z()}var e=v.filter(":grabbable");if(k.ungrabifyWhileSimulating){e.ungrabify()}var w=function(){if(window.isIE){h(function(){z()})}else{z()}function z(){if(!k.liveUpdate){if(k.fit){j.reset()}j.nodes().rtrigger("position")}v.unbind("grab drag dragstop",l);if(k.ungrabifyWhileSimulating){e.grabify()}j.one("layoutstop",k.stop);
j.trigger("layoutstop")}};m.start();setTimeout(function(){m.stop()},k.maxSimulationTime)};c.prototype.stop=function(){if(this.system!=null){system.stop()}};a("layout","arbor",c)})(cytoscape);(function(a){var c={fit:true,ready:undefined,stop:undefined,rStepSize:10,padding:30,startAngle:3/2*Math.PI,counterclockwise:false};function b(d){this.options=a.util.extend({},c,d)}b.prototype.run=function(){var o=this.options;var w=o;var m=o.cy;var f=m.nodes();var p=m.edges();var g=m.container();var h=g.clientWidth;
var v=g.clientHeight;var e={x:h/2,y:v/2};var u=50;var j=w.startAngle;var s=2*Math.PI/f.length;var t=0;for(var q=0;q<f.length;q++){var l=f[q];t=Math.max(l.outerWidth(),l.outerHeight())}var d=h/2-t;function k(){var r=0;var i=s;var B={x:e.x+d*Math.cos(r),y:e.y+d*Math.sin(r)};var z={x:e.x+d*Math.cos(i),y:e.y+d*Math.sin(i)};var A=Math.sqrt((z.x-B.x)*(z.x-B.x)+(z.y-B.y)*(z.y-B.y));return A}while(k()<t){d+=w.rStepSize}var q=0;f.positions(function(){var i=this;var z=d*Math.cos(j);var r=d*Math.sin(j);var A={x:e.x+z,y:e.y+r};
q++;j=w.counterclockwise?j-s:j+s;return A});if(o.fit){m.fit(w.padding)}m.one("layoutready",o.ready);m.trigger("layoutready");m.one("layoutstop",o.stop);m.trigger("layoutstop")};b.prototype.stop=function(){};a("layout","circle",b)})(cytoscape);(function(a){var b={fit:true,ready:undefined,stop:undefined,directed:true,padding:30,circle:false,roots:undefined};function c(d){this.options=a.util.extend({},b,d)}c.prototype.run=function(){var N=this.options;var m=N;var j=N.cy;var F=j.nodes();var g=j.edges();
var A=j.container();var E=A.clientWidth;var C=A.clientHeight;var o;if(a.is.elementOrCollection(m.roots)){o=m.roots}else{if(a.is.array(m.roots)){var I=[];for(var J=0;J<m.roots.length;J++){var D=m.roots[J];var z=j.getElementById(D);o.push(z)}o=new a.Collection(j,I)}else{o=F.roots()}}var q=[];var l={};var p={};o.bfs(function(h,Q){var w=this[0];if(!q[Q]){q[Q]=[]}q[Q].push(w);l[w.id()]=true;p[w.id()]=Q},m.directed);var M=[];for(var J=0;J<F.length;J++){var z=F[J];if(l[z.id()]){continue}else{M.push(z)}}var f=M.length*3;
var d=0;while(M.length!==0&&d<f){var H=M.shift();var G=H.neighborhood().nodes();var L=false;for(var J=0;J<G.length;J++){var P=p[G[J].id()];if(P!==undefined){q[P].push(H);L=true;break}}if(!L){M.push(H)}d++}while(M.length!==0){var H=M.shift();var r=H.bfs();var L=false;for(var J=0;J<r.length;J++){var P=p[r[J].id()];if(P!==undefined){q[P].push(H);L=true;break}}if(!L){if(q.length===0){q.push([])}q[0].push(H)}}function k(){for(var Q=0;Q<q.length;Q++){var h=q[Q];for(var w=0;w<h.length;w++){var R=h[w];R._private.scratch.BreadthFirstLayout={depth:Q,index:w}
}}}k();var B=0;for(var J=0;J<F.length;J++){var v=F[J].outerWidth();var K=F[J].outerHeight();B=Math.max(B,v,K)}B*=1.75;var e={};function u(Y){if(e[Y.id()]){return e[Y.id()]}var Q=Y._private.scratch.BreadthFirstLayout.depth;var X=Y.neighborhood().nodes();var S=0;var T=0;for(var w=0;w<X.length;w++){var V=X[w];var U=V.edgesWith(Y);var R=V._private.scratch.BreadthFirstLayout.index;var h=V._private.scratch.BreadthFirstLayout.depth;var W=q[h].length;if(Q>h||Q===0){S+=R/W;T++}}T=Math.max(1,T);S=S/T;if(T===0){S=undefined
}e[Y.id()]=S;return S}for(var t=0;t<3;t++){for(var J=0;J<q.length;J++){var P=J;var s=[];q[J]=q[J].sort(function(i,h){var w=u(i);var Q=u(h);return w-Q})}k()}var O={x:E/2,y:C/2};F.positions(function(){var V=this[0];var i=V._private.scratch.BreadthFirstLayout;var w=i.depth;var Q=i.index;var U=Math.max(E/(q[w].length+1),B);var T=Math.max(C/(q.length+1),B);var S=Math.min(E/2/q.length,C/2/q.length);S=Math.max(S,B);if(m.circle){var R=S*w+S-(q.length>0&&q[0].length<=3?S/2:0);var h=2*Math.PI/q[w].length*Q;
if(w===0&&q[0].length===1){R=1}return{x:O.x+R*Math.cos(h),y:O.y+R*Math.sin(h)}}else{return{x:(Q+1)*U,y:(w+1)*T}}});if(N.fit){j.fit(m.padding)}j.one("layoutready",N.ready);j.trigger("layoutready");j.one("layoutstop",N.stop);j.trigger("layoutstop")};c.prototype.stop=function(){};a("layout","breadthfirst",c)})(cytoscape);
</script>
</head>
<body><h1>Finding the shortest path in a graph</h1><h2>Input a matrix of the graph:</h2><form action="/calc/" method="POST"><textarea style="width: 150px; height: 150px;" name="intext">1 2
3 4</textarea><br><input type="submit" value="Calculate"></form><h2>Results:</h2><textarea style="width: 150px; height: 150px;" name="result">1 2
3 4
</textarea><div style="height:700px; width: 400px" name="cy" id="cy"></div><script>$('#cy').cytoscape({ style: cytoscape.stylesheet() .selector('node') .css({ 'content': 'data(name)', 'text-valign': 'center', 'color': 'white', 'text-outline-width': 2, 'text-outline-color': '#888', }) .selector('edge') .css({ 'target-arrow-shape': 'triangle' }) .selector(':selected') .css({ 'background-color': 'black', 'line-color': 'black', 'target-arrow-color': 'black', 'source-arrow-color': 'black' }) .selector('.faded') .css({ 'opacity': 0.25, 'text-opacity': 0 }), elements: { nodes: [{ data: { id: '0', name: '0' } },{ data: { id: '1', name: '1' } }], edges: [{ data: { source: '0', target: '0' } },{ data: { source: '0', target: '1' } },{ data: { source: '1', target: '0' } },{ data: { source: '1', target: '1' } }] }, ready: function(){ window.cy = this; cy.elements().unselectify(); cy.on('tap', 'node', function(e){ var node = e.cyTarget; var neighborhood = node.neighborhood().add(node); cy.elements().addClass('faded'); neighborhood.removeClass('faded'); }); cy.on('tap', function(e){ if( e.cyTarget === cy ){ cy.elements().removeClass('faded'); } }); }});</script></body></html>