Add VES Collector GUI
[clamp.git] / src / main / resources / META-INF / resources / designer / index.js
1 function activateMenu(){
2         isImportSchema = true;  
3 }
4 var abootDiagram=null;
5
6 function cldsOpenDiagram(modelXml)
7 {
8         cldsModelXml = modelXml;
9         console.log("cldsOpenDiagram: cldsModelXml=" + cldsModelXml);
10         $("#cldsopendiagrambtn").click();
11 }
12 function cldsGetDiagram()
13 {
14         console.log("cldsGetDiagram: starting...");
15         $("#cldsgetdiagrambtn").click();
16         console.log("cldsGetDiagram: modelXML=" + modelXML);
17         return modelXML;
18 }
19 function uploaddata(file)
20 {
21         uploadfile= file;
22         $("#uploadmodel").click();
23         
24 }
25 function visibility_model()
26 {       
27         $("#openmodel").click();
28         
29 }
30 (function e(t, n, r) {
31     function s(o, u) {
32         if (!n[o]) {
33             if (!t[o]) {
34                 var a = typeof require == "function" && require;
35                 if (!u && a) return a(o, !0);
36                 if (i) return i(o, !0);
37                 var f = new Error("Cannot find module '" + o + "'");
38                 throw f.code = "MODULE_NOT_FOUND", f
39             }
40             var l = n[o] = {
41                 exports: {}
42             };
43             t[o][0].call(l.exports, function(e) {
44                 var n = t[o][1][e];
45                 return s(n ? n : e)
46             }, l, l.exports, e, t, n, r)
47         }
48         return n[o].exports
49     }
50     var i = typeof require == "function" && require;
51     for (var o = 0; o < r.length; o++) s(r[o]);
52     return s;
53 })
54                 
55         ({
56     "\\bpmn-js-examples-master\\modeler\\app\\index.js":
57
58         [function(require, module, exports) {
59
60         'use strict';
61
62
63
64         var $ = require('jquery'),
65             BpmnModeler = require('bpmn-js/lib/Modeler');
66
67         var container = $('#js-drop-zone');
68
69         var canvas = $('#js-canvas');
70
71         var renderer = new BpmnModeler({
72             container: canvas
73         });
74         abootDiagram=renderer;
75
76         var newDiagramXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bpmn2:definitions xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:bpmn2=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd\" id=\"sample-diagram\" targetNamespace=\"http://bpmn.io/schema/bpmn\">\n  <bpmn2:process id=\"Process_1\" isExecutable=\"false\">\n    <bpmn2:startEvent id=\"StartEvent_1\"/>\n  </bpmn2:process>\n  <bpmndi:BPMNDiagram id=\"BPMNDiagram_1\">\n    <bpmndi:BPMNPlane id=\"BPMNPlane_1\" bpmnElement=\"Process_1\">\n      <bpmndi:BPMNShape id=\"_BPMNShape_StartEvent_2\" bpmnElement=\"StartEvent_1\">\n        <dc:Bounds height=\"36.0\" width=\"36.0\" x=\"25.0\" y=\"240.0\"/>\n      </bpmndi:BPMNShape>\n    </bpmndi:BPMNPlane>\n  </bpmndi:BPMNDiagram>\n</bpmn2:definitions>";
77         //
78         /*file_generate_test_case.addEventListener('click', function(e) {
79                 
80
81         });*/
82
83        
84
85         function createNewDiagram(newDiagramXML) {
86             openDiagram(newDiagramXML);
87             
88         }
89        
90         function openDiagram(xml) {
91             renderer.importXML(xml, function(err) {
92
93                 if (err) {
94                     container
95                         .removeClass('with-diagram')
96                         .addClass('with-error');
97
98                     container.find('.error pre').text(err.message);
99
100                     console.error(err);
101                 } else {
102                     container
103                         .removeClass('with-error')
104                         .addClass('with-diagram');
105                 }
106
107
108             });
109         }
110
111         function saveSVG(done) {
112             renderer.saveSVG(done);
113         }
114
115         function saveDiagram(done) {
116
117             renderer.saveXML({
118                 format: true
119             }, function(err, xml) {
120                 done(err, xml);
121             });
122         }
123        
124
125         function registerFileDrop(container, callback) {
126
127             function handleFileSelect(e) {
128                 e.stopPropagation();
129                 e.preventDefault();
130
131                 var files = e.dataTransfer.files;
132
133                 var file = files[0];
134
135                 var reader = new FileReader();
136
137                 reader.onload = function(e) {
138
139                     var xml = e.target.result;
140
141                     callback(xml);
142                 };
143
144                 reader.readAsText(file);
145             }
146
147             function handleDragOver(e) {
148                 e.stopPropagation();
149                 e.preventDefault();
150
151                 e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
152             }
153             if(container.get(0)){
154               container.get(0).addEventListener('dragover', handleDragOver, false);
155               container.get(0).addEventListener('drop', handleFileSelect, false);  
156             }            
157         }
158
159
160         // //// file drag / drop ///////////////////////
161
162         // check file api availability
163         if (!window.FileList || !window.FileReader) {
164             window.alert(
165                 'Looks like you use an older browser that does not support drag and drop. ' +
166                 'Try using Chrome, Firefox or the Internet Explorer > 10.');
167         } else {
168             registerFileDrop(container, openDiagram);
169         }
170
171         // bootstrap diagram functions
172         function openNewWin(linkURL) {
173                 window.open(""+linkURL+"","_self"/*, "", "scrollbars, top="+winTop+", left="+winLeft+", height="+winHeight+", width="+winWidth+""*/);
174                 }
175
176         
177         $(document).on('ready', function(e) {
178
179             /* $('#js-create-diagram').click(function(e) {*/
180             e.stopPropagation();
181             e.preventDefault();
182
183             createNewDiagram(newDiagramXML);
184             
185             /*});*/
186             var fileInput = document.getElementById('fileInput');
187             var file_generate_test_case = document.getElementById('file_generate_test_case');
188            
189             var downloadLink = $('#js-download-diagram');
190             var downloadSvgLink = $('#js-download-svg');
191             var readLink = $('#file_generate_test_case');
192             $('.buttons a').click(function(e) {
193                 if (!$(this).is('.active')) {
194                     e.preventDefault();
195                     e.stopPropagation();
196                 }
197             });
198             $('#openmodel').click(function() {
199                 
200                 createNewDiagram(modelXML);
201                 
202             }
203                 );
204                 
205             $('#cldsgetdiagrambtn').click(function() {
206                                 console.log("cldsgetdiagrambtn: starting...");
207                                 exportArtifacts();
208                                 console.log("cldsgetdiagrambtn: modelXML=" + modelXML);
209               });
210             $('#cldsopendiagrambtn').click(function() {
211                                 console.log("cldsopendiagrambtn: cldsModelXml=" + cldsModelXml);
212                 createNewDiagram(cldsModelXml);
213                 exportArtifacts();
214               });
215             $('#uploadmodel').click(function() {
216                 var file = uploadfile;
217                 var textType = /text.*/;
218
219                 var reader = new FileReader();
220
221                 reader.onload = function(e) {
222                     newDiagramXML = reader.result;
223                     e.stopPropagation();
224                     e.preventDefault();
225                     createNewDiagram(newDiagramXML);
226                     
227                 }
228
229                 reader.readAsText(file);
230                 exportArtifacts();
231               });
232            if(fileInput){
233               fileInput.addEventListener('change', function(e) {
234                   var file = fileInput.files[0];
235                   var textType = /text.*/;
236
237
238                   var reader = new FileReader();
239
240                   reader.onload = function(e) {
241                       newDiagramXML = reader.result;
242                       e.stopPropagation();
243                       e.preventDefault();
244                       createNewDiagram(newDiagramXML);
245                       
246                   }
247
248                   reader.readAsText(file);
249                   exportArtifacts();
250               }); 
251            }
252            
253            function setEncoded(link, name, data) {
254                 var encodedData = encodeURIComponent(data);
255                
256                 var el=document.getElementById(selected_model);
257                var text = (el.innerText || el.textContent);
258                 
259                
260                 if (data) {
261                         //var linkURL='data:application/bpmn20-xml;charset=UTF-8,' + encodedData;
262                     link.addClass('active').attr({
263                         'href':'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,/*openNewWin( linkURL )*//*'*/
264                         'download': text.trim()+'.utmxml',
265                         'target':'_blank'
266                     });
267                     
268                 } else {
269                     link.removeClass('active');
270                 }
271             }
272             function setReadEncoded(link, name, data) {
273                 var encodedData = encodeURIComponent(data);
274                 
275                 if (data) {
276                     link.addClass('active').attr({
277                         'href': 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,
278                         'download': name
279                     });
280                     
281                     
282                 } else {
283                     link.removeClass('active');
284                 }
285             }
286             var _ = require('lodash');
287            /*var model = $( "#modelName" ).val();
288            */
289
290             var exportArtifacts = _.debounce(function() {
291
292                 saveSVG(function(err, svg) {
293                     setEncoded(downloadSvgLink, 'diagram.svg', err ? null : svg);
294                 });
295
296                 saveDiagram(function(err, xml) {
297                     setEncoded(downloadLink, "model.utmxml", err ? null : xml);
298                 });
299                
300             }, 500);
301
302             renderer.on('commandStack.changed', exportArtifacts);
303         });
304     }, {
305         "bpmn-js/lib/Modeler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Modeler.js",
306         "jquery": "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js",
307         "lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js"
308     }],
309     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Modeler.js": [function(require, module, exports) {
310         'use strict';
311
312         var inherits = require('inherits');
313
314         var IdSupport = require('bpmn-moddle/lib/id-support'),
315             Ids = require('ids');
316
317         var Viewer = require('./Viewer');
318
319         var initialDiagram =
320             '<?xml version="1.0" encoding="UTF-8"?>' +
321             '<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
322             'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
323             'xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" ' +
324             'xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" ' +
325             'targetNamespace="http://bpmn.io/schema/bpmn" ' +
326             'id="Definitions_1">' +
327             '<bpmn:process id="Process_1" isExecutable="false">' +
328             '<bpmn:startEvent id="StartEvent_1"/>' +
329             '</bpmn:process>' +
330             '<bpmndi:BPMNDiagram id="BPMNDiagram_1">' +
331             '<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">' +
332             '<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">' +
333             '<dc:Bounds height="36.0" width="36.0" x="50.0" y="102.0"/>' +
334             '</bpmndi:BPMNShape>' +
335             '</bpmndi:BPMNPlane>' +
336             '</bpmndi:BPMNDiagram>' +
337             '</bpmn:definitions>';
338
339
340         /**
341          * A modeler for BPMN 2.0 diagrams.
342          * 
343          *  ## Extending the Modeler
344          * 
345          * In order to extend the viewer pass extension modules to bootstrap via the
346          * `additionalModules` option. An extension module is an object that exposes
347          * named services.
348          * 
349          * The following example depicts the integration of a simple logging component
350          * that integrates with interaction events:
351          * 
352          * 
353          * ```javascript
354          *  // logging component function InteractionLogger(eventBus) {
355          * eventBus.on('element.hover', function(event) { console.log() }) }
356          * 
357          * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
358          *  // extension module var extensionModule = { __init__: [ 'interactionLogger' ],
359          * interactionLogger: [ 'type', InteractionLogger ] };
360          *  // extend the viewer var bpmnModeler = new Modeler({ additionalModules: [
361          * extensionModule ] }); bpmnModeler.importXML(...); ```
362          * 
363          *  ## Customizing / Replacing Components
364          * 
365          * You can replace individual diagram components by redefining them in override
366          * modules. This works for all components, including those defined in the core.
367          * 
368          * Pass in override modules via the `options.additionalModules` flag like this:
369          * 
370          * ```javascript function CustomContextPadProvider(contextPad) {
371          * 
372          * contextPad.registerProvider(this);
373          * 
374          * this.getContextPadEntries = function(element) { // no entries, effectively
375          * disable the context pad return {}; }; }
376          * 
377          * CustomContextPadProvider.$inject = [ 'contextPad' ];
378          * 
379          * var overrideModule = { contextPadProvider: [ 'type', CustomContextPadProvider ] };
380          * 
381          * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]}); ```
382          * 
383          * @param {Object}
384          *            [options] configuration options to pass to the viewer
385          * @param {DOMElement}
386          *            [options.container] the container to render the viewer in,
387          *            defaults to body.
388          * @param {String|Number}
389          *            [options.width] the width of the viewer
390          * @param {String|Number}
391          *            [options.height] the height of the viewer
392          * @param {Object}
393          *            [options.moddleExtensions] extension packages to provide
394          * @param {Array
395          *            <didi.Module>} [options.modules] a list of modules to override the
396          *            default modules
397          * @param {Array
398          *            <didi.Module>} [options.additionalModules] a list of modules to
399          *            use with the default modules
400          */
401         function Modeler(options) {
402             Viewer.call(this, options);
403         }
404
405         inherits(Modeler, Viewer);
406
407         Modeler.prototype.createDiagram = function(done) {
408             return this.importXML(initialDiagram, done);
409         };
410
411         Modeler.prototype.createModdle = function() {
412             var moddle = Viewer.prototype.createModdle.call(this);
413
414             IdSupport.extend(moddle, new Ids([32, 36, 1]));
415
416             return moddle;
417         };
418
419
420         Modeler.prototype._interactionModules = [
421             // non-modeling components
422             require('./features/label-editing'),
423             require('./features/keyboard'),
424             require('diagram-js/lib/navigation/zoomscroll'),
425             require('diagram-js/lib/navigation/movecanvas'),
426             require('diagram-js/lib/navigation/touch')
427         ];
428
429         Modeler.prototype._modelingModules = [
430             // modeling components
431             require('diagram-js/lib/features/move'),
432             require('diagram-js/lib/features/bendpoints'),
433             require('diagram-js/lib/features/resize'),
434             require('diagram-js/lib/features/space-tool'),
435             require('diagram-js/lib/features/lasso-tool'),
436             //require('./features/keyboard'),
437             require('./features/snapping'),
438             require('./features/modeling'),
439             require('./features/context-pad'),
440             require('./features/palette')
441         ];
442
443
444         // modules the modeler is composed of
445         //
446         // - viewer modules
447         // - interaction modules
448         // - modeling modules
449
450         Modeler.prototype._modules = [].concat(
451             Modeler.prototype._modules,
452             Modeler.prototype._interactionModules,
453             Modeler.prototype._modelingModules);
454
455
456         module.exports = Modeler;
457
458     }, {
459         "./Viewer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Viewer.js",
460         "./features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js",
461         "./features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js",
462         "./features/label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
463         "./features/modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js",
464         "./features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js",
465         "./features/snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js",
466         "bpmn-moddle/lib/id-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js",
467         "diagram-js/lib/features/bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js",
468         "diagram-js/lib/features/lasso-tool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js",
469         "diagram-js/lib/features/move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js",
470         "diagram-js/lib/features/resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js",
471         "diagram-js/lib/features/space-tool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js",
472         "diagram-js/lib/navigation/movecanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js",
473         "diagram-js/lib/navigation/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js",
474         "diagram-js/lib/navigation/zoomscroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js",
475         "ids": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js",
476         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
477     }],
478     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Viewer.js": [function(require, module, exports) {
479         'use strict';
480
481         var assign = require('lodash/object/assign'),
482             omit = require('lodash/object/omit'),
483             isString = require('lodash/lang/isString'),
484             isNumber = require('lodash/lang/isNumber');
485
486         var domify = require('min-dom/lib/domify'),
487             domQuery = require('min-dom/lib/query'),
488             domRemove = require('min-dom/lib/remove');
489
490         var Diagram = require('diagram-js'),
491             BpmnModdle = require('bpmn-moddle');
492
493         var Importer = require('./import/Importer');
494
495
496         function initListeners(diagram, listeners) {
497             var events = diagram.get('eventBus');
498
499             listeners.forEach(function(l) {
500                 events.on(l.event, l.handler);
501             });
502         }
503
504         function checkValidationError(err) {
505
506             // check if we can help the user by indicating wrong BPMN 2.0 xml
507             // (in case he or the exporting tool did not get that right)
508
509             var pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/;
510             var match = pattern.exec(err.message);
511
512             if (match) {
513                 err.message =
514                     'unparsable content <' + match[1] + '> detected; ' +
515                     'this may indicate an invalid BPMN 2.0 diagram file' + match[2];
516             }
517
518             return err;
519         }
520
521         var DEFAULT_OPTIONS = {
522             width: '100%',
523             height: '100%',
524             position: 'relative',
525             container: 'body'
526         };
527
528
529
530         /**
531          * Ensure the passed argument is a proper unit (defaulting to px)
532          */
533         function ensureUnit(val) {
534             return val + (isNumber(val) ? 'px' : '');
535         }
536
537         /**
538          * A viewer for BPMN 2.0 diagrams.
539          * 
540          * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that
541          * include additional features.
542          * 
543          *  ## Extending the Viewer
544          * 
545          * In order to extend the viewer pass extension modules to bootstrap via the
546          * `additionalModules` option. An extension module is an object that exposes
547          * named services.
548          * 
549          * The following example depicts the integration of a simple logging component
550          * that integrates with interaction events:
551          * 
552          * 
553          * ```javascript
554          *  // logging component function InteractionLogger(eventBus) {
555          * eventBus.on('element.hover', function(event) { console.log() }) }
556          * 
557          * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
558          *  // extension module var extensionModule = { __init__: [ 'interactionLogger' ],
559          * interactionLogger: [ 'type', InteractionLogger ] };
560          *  // extend the viewer var bpmnViewer = new Viewer({ additionalModules: [
561          * extensionModule ] }); bpmnViewer.importXML(...); ```
562          * 
563          * @param {Object}
564          *            [options] configuration options to pass to the viewer
565          * @param {DOMElement}
566          *            [options.container] the container to render the viewer in,
567          *            defaults to body.
568          * @param {String|Number}
569          *            [options.width] the width of the viewer
570          * @param {String|Number}
571          *            [options.height] the height of the viewer
572          * @param {Object}
573          *            [options.moddleExtensions] extension packages to provide
574          * @param {Array
575          *            <didi.Module>} [options.modules] a list of modules to override the
576          *            default modules
577          * @param {Array
578          *            <didi.Module>} [options.additionalModules] a list of modules to
579          *            use with the default modules
580          */
581         function Viewer(options) {
582
583             this.options = options = assign({}, DEFAULT_OPTIONS, options || {});
584
585             var parent = options.container;
586
587             // support jquery element
588             // unwrap it if passed
589             if (parent.get) {
590                 parent = parent.get(0);
591             }
592
593             // support selector
594             if (isString(parent)) {
595                 parent = domQuery(parent);
596             }
597
598             var container = this.container = domify('<div class="bjs-container"></div>');
599             if(parent && parent.appendChild){
600               parent.appendChild(container);  
601             }
602             
603
604             assign(container.style, {
605                 width: ensureUnit(options.width),
606                 height: ensureUnit(options.height),
607                 position: options.position
608             });
609
610             /**
611              * The code in the <project-logo></project-logo> area must not be changed,
612              * see http://bpmn.io/license for more information
613              * 
614              * <project-logo>
615              */
616
617             /* jshint -W101 */
618
619             // inlined ../resources/bpmnjs.png
620             var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';
621
622             /* jshint +W101 */
623
624             var linkMarkup =
625                   '<a href="http://bpmn.io" ' +
626                      'target="_blank" ' +
627                      'class="bjs-powered-by" ' +
628                      'title="Powered by bpmn.io" ' +
629                      'style="position: absolute; bottom: 15px; right: 15px; z-index: 100">' +
630                       '<img src="data:image/png;base64,' + logoData + '">' +
631                   '</a>';
632                   if(container && container.appendChild){
633                     container.appendChild(domify(linkMarkup));        
634                   }
635             
636
637             /* </project-logo> */
638         }
639
640         Viewer.prototype.importXML = function(xml, done) {
641
642             var self = this;
643
644             this.moddle = this.createModdle();
645
646             this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
647
648                 if (err) {
649                     err = checkValidationError(err);
650                     return done(err);
651                 }
652
653                 var parseWarnings = context.warnings;
654
655                 self.importDefinitions(definitions, function(err, importWarnings) {
656                     if (err) {
657                         return done(err);
658                     }
659
660                     done(null, parseWarnings.concat(importWarnings || []));
661                 });
662             });
663         };
664
665         Viewer.prototype.saveXML = function(options, done) {
666
667             if (!done) {
668                 done = options;
669                 options = {};
670             }
671
672             var definitions = this.definitions;
673
674             if (!definitions) {
675                 return done(new Error('no definitions loaded'));
676             }
677
678             this.moddle.toXML(definitions, options, done);
679         };
680        
681
682         Viewer.prototype.createModdle = function() {
683             return new BpmnModdle(this.options.moddleExtensions);
684         };
685
686         Viewer.prototype.saveSVG = function(options, done) {
687
688             if (!done) {
689                 done = options;
690                 options = {};
691             }
692
693             var canvas = this.get('canvas');
694
695             var contentNode = canvas.getDefaultLayer(),
696                 defsNode = canvas._svg.select('defs');
697
698             var contents = contentNode.innerSVG(),
699                 defs = (defsNode && defsNode.outerSVG()) || '';
700
701             var bbox = contentNode.getBBox();
702
703             var svg =
704                 '<?xml version="1.0" encoding="utf-8"?>\n' +
705                 '<!-- created with bpmn-js / http://bpmn.io -->\n' +
706                 '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
707                 '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
708                 'width="' + bbox.width + '" height="' + bbox.height + '" ' +
709                 'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
710                 defs + contents +
711                 '</svg>';
712
713             done(null, svg);
714         };
715
716         Viewer.prototype.get = function(name) {
717
718             if (!this.diagram) {
719                 throw new Error('no diagram loaded');
720             }
721
722             return this.diagram.get(name);
723         };
724
725         Viewer.prototype.invoke = function(fn) {
726
727             if (!this.diagram) {
728                 throw new Error('no diagram loaded');
729             }
730
731             return this.diagram.invoke(fn);
732         };
733
734         Viewer.prototype.importDefinitions = function(definitions, done) {
735
736             // use try/catch to not swallow synchronous exceptions
737             // that may be raised during model parsing
738             try {
739                 if (this.diagram) {
740                     this.clear();
741                 }
742
743                 this.definitions = definitions;
744
745                 var diagram = this.diagram = this._createDiagram(this.options);
746
747                 this._init(diagram);
748
749                 Importer.importBpmnDiagram(diagram, definitions, done);
750             } catch (e) {
751                 done(e);
752             }
753         };
754
755         Viewer.prototype._init = function(diagram) {
756             initListeners(diagram, this.__listeners || []);
757         };
758
759         Viewer.prototype._createDiagram = function(options) {
760
761             var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);
762
763             // add self as an available service
764             modules.unshift({
765                 bpmnjs: ['value', this],
766                 moddle: ['value', this.moddle]
767             });
768
769             options = omit(options, 'additionalModules');
770
771             options = assign(options, {
772                 canvas: {
773                     container: this.container
774                 },
775                 modules: modules
776             });
777
778             return new Diagram(options);
779         };
780
781
782         Viewer.prototype.getModules = function() {
783             return this._modules;
784         };
785
786         /**
787          * Remove all drawn elements from the viewer.
788          * 
789          * After calling this method the viewer can still be reused for opening another
790          * diagram.
791          */
792         Viewer.prototype.clear = function() {
793             var diagram = this.diagram;
794
795             if (diagram) {
796                 diagram.destroy();
797             }
798         };
799
800         /**
801          * Destroy the viewer instance and remove all its remainders from the document
802          * tree.
803          */
804         Viewer.prototype.destroy = function() {
805             // clear underlying diagram
806             this.clear();
807
808             // remove container
809             domRemove(this.container);
810         };
811
812         /**
813          * Register an event listener on the viewer
814          * 
815          * @param {String}
816          *            event
817          * @param {Function}
818          *            handler
819          */
820         Viewer.prototype.on = function(event, handler) {
821             var diagram = this.diagram,
822                 listeners = this.__listeners = this.__listeners || [];
823
824             listeners.push({
825                 event: event,
826                 handler: handler
827             });
828
829             if (diagram) {
830                 diagram.get('eventBus').on(event, handler);
831             }
832         };
833
834         // modules the viewer is composed of
835         Viewer.prototype._modules = [
836             require('./core'),
837             require('diagram-js/lib/features/selection'),
838             require('diagram-js/lib/features/overlays')
839         ];
840
841         module.exports = Viewer;
842
843     }, {
844         "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\core\\index.js",
845         "./import/Importer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js",
846         "bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js",
847         "diagram-js": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js",
848         "diagram-js/lib/features/overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
849         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
850         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
851         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
852         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
853         "lodash/object/omit": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js",
854         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js",
855         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js",
856         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
857     }],
858     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\core\\index.js": [function(require, module, exports) {
859         module.exports = {
860             __depends__: [
861                 require('../draw'),
862                 require('../import')
863             ]
864         };
865     }, {
866         "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js",
867         "../import": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js"
868     }],
869     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js": [function(require, module, exports) {
870         'use strict';
871
872         var inherits = require('inherits'),
873             isArray = require('lodash/lang/isArray'),
874             isObject = require('lodash/lang/isObject'),
875             assign = require('lodash/object/assign'),
876             forEach = require('lodash/collection/forEach'),
877             every = require('lodash/collection/every'),
878             includes = require('lodash/collection/includes'),
879             some = require('lodash/collection/some');
880
881         var DefaultRenderer = require('diagram-js/lib/draw/Renderer'),
882             TextUtil = require('diagram-js/lib/util/Text'),
883             DiUtil = require('../util/DiUtil');
884
885         var createLine = DefaultRenderer.createLine;
886
887
888         function BpmnRenderer(events, styles, pathMap) {
889
890             DefaultRenderer.call(this, styles);
891
892             var TASK_BORDER_RADIUS = 10;
893             var INNER_OUTER_DIST = 3;
894
895             var LABEL_STYLE = {
896                 fontFamily: 'Arial, sans-serif',
897                 fontSize: '12px'
898             };
899
900             var textUtil = new TextUtil({
901                 style: LABEL_STYLE,
902                 size: {
903                     width: 100
904                 }
905             });
906
907             var markers = {};
908
909             function addMarker(id, element) {
910                 markers[id] = element;
911             }
912
913             function marker(id) {
914                 return markers[id];
915             }
916
917             function initMarkers(svg) {
918
919                 function createMarker(id, options) {
920                     var attrs = assign({
921                         fill: 'black',
922                         strokeWidth: 1,
923                         strokeLinecap: 'round',
924                         strokeDasharray: 'none'
925                     }, options.attrs);
926
927                     var ref = options.ref || {
928                         x: 0,
929                         y: 0
930                     };
931
932                     var scale = options.scale || 1;
933
934                     // fix for safari / chrome / firefox bug not correctly
935                     // resetting stroke dash array
936                     if (attrs.strokeDasharray === 'none') {
937                         attrs.strokeDasharray = [10000, 1];
938                     }
939
940                     var marker = options.element
941                         .attr(attrs)
942                         .marker(0, 0, 20, 20, ref.x, ref.y)
943                         .attr({
944                             markerWidth: 20 * scale,
945                             markerHeight: 20 * scale
946                         });
947
948                     return addMarker(id, marker);
949                 }
950
951
952                 createMarker('sequenceflow-end', {
953                     element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
954                     ref: {
955                         x: 11,
956                         y: 10
957                     },
958                     scale: 0.5
959                 });
960
961                 createMarker('messageflow-start', {
962                     element: svg.circle(6, 6, 3.5),
963                     attrs: {
964                         fill: 'white',
965                         stroke: 'black'
966                     },
967                     ref: {
968                         x: 6,
969                         y: 6
970                     }
971                 });
972
973                 createMarker('messageflow-end', {
974                     element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),
975                     attrs: {
976                         fill: 'white',
977                         stroke: 'black',
978                         strokeLinecap: 'butt'
979                     },
980                     ref: {
981                         x: 8.5,
982                         y: 5
983                     }
984                 });
985
986                 createMarker('data-association-end', {
987                     element: svg.path('M 1 5 L 11 10 L 1 15'),
988                     attrs: {
989                         fill: 'white',
990                         stroke: 'black'
991                     },
992                     ref: {
993                         x: 11,
994                         y: 10
995                     },
996                     scale: 0.5
997                 });
998
999                 createMarker('conditional-flow-marker', {
1000                     element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
1001                     attrs: {
1002                         fill: 'white',
1003                         stroke: 'black'
1004                     },
1005                     ref: {
1006                         x: -1,
1007                         y: 10
1008                     },
1009                     scale: 0.5
1010                 });
1011
1012                 createMarker('conditional-default-flow-marker', {
1013                     element: svg.path('M 1 4 L 5 16'),
1014                     attrs: {
1015                         stroke: 'black'
1016                     },
1017                     ref: {
1018                         x: -5,
1019                         y: 10
1020                     },
1021                     scale: 0.5
1022                 });
1023             }
1024
1025             function computeStyle(custom, traits, defaultStyles) {
1026                 if (!isArray(traits)) {
1027                     defaultStyles = traits;
1028                     traits = [];
1029                 }
1030
1031                 return styles.style(traits || [], assign(defaultStyles, custom || {}));
1032             }
1033
1034             function drawCircle(p, width, height, offset, attrs) {
1035
1036                 if (isObject(offset)) {
1037                     attrs = offset;
1038                     offset = 0;
1039                 }
1040
1041                 offset = offset || 0;
1042
1043                 attrs = computeStyle(attrs, {
1044                     stroke: 'black',
1045                     strokeWidth: 2,
1046                     fill: 'white'
1047                 });
1048
1049                 var cx = width / 2,
1050                     cy = height / 2;
1051
1052                 return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);
1053             }
1054
1055             function drawRect(p, width, height, r, offset, attrs) {
1056
1057                 if (isObject(offset)) {
1058                     attrs = offset;
1059                     offset = 0;
1060                 }
1061
1062                 offset = offset || 0;
1063
1064                 attrs = computeStyle(attrs, {
1065                     stroke: 'black',
1066                     strokeWidth: 2,
1067                     fill: 'white'
1068                 });
1069
1070                 return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);
1071             }
1072
1073             function drawDiamond(p, width, height, attrs) {
1074
1075                 var x_2 = width / 2;
1076                 var y_2 = height / 2;
1077
1078                 var points = [x_2, 0, width, y_2, x_2, height, 0, y_2];
1079
1080                 attrs = computeStyle(attrs, {
1081                     stroke: 'black',
1082                     strokeWidth: 2,
1083                     fill: 'white'
1084                 });
1085
1086                 return p.polygon(points).attr(attrs);
1087             }
1088
1089             function drawLine(p, waypoints, attrs) {
1090                 attrs = computeStyle(attrs, ['no-fill'], {
1091                     stroke: 'black',
1092                     strokeWidth: 2,
1093                     fill: 'none'
1094                 });
1095
1096                 return createLine(waypoints, attrs).appendTo(p);
1097             }
1098
1099             function drawPath(p, d, attrs) {
1100
1101                 attrs = computeStyle(attrs, ['no-fill'], {
1102                     strokeWidth: 2,
1103                     stroke: 'black'
1104                 });
1105
1106                 return p.path(d).attr(attrs);
1107             }
1108
1109             function as(type) {
1110                 return function(p, element) {
1111                     return handlers[type](p, element);
1112                 };
1113             }
1114
1115             function renderer(type) {
1116                 return handlers[type];
1117             }
1118
1119             function renderEventContent(element, p) {
1120
1121                 var event = getSemantic(element);
1122                 var isThrowing = isThrowEvent(event);
1123
1124                 if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
1125                     return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);
1126                 }
1127
1128                 if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
1129                     return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);
1130                 }
1131
1132                 if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
1133                     return renderer('bpmn:ConditionalEventDefinition')(p, element);
1134                 }
1135
1136                 if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
1137                     return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);
1138                 }
1139
1140                 if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
1141                     isTypedEvent(event, 'bpmn:TerminateEventDefinition', {
1142                         parallelMultiple: false
1143                     })) {
1144                     return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);
1145                 }
1146
1147                 if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
1148                     isTypedEvent(event, 'bpmn:TerminateEventDefinition', {
1149                         parallelMultiple: true
1150                     })) {
1151                     return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);
1152                 }
1153
1154                 if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
1155                     return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);
1156                 }
1157
1158                 if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
1159                     return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);
1160                 }
1161
1162                 if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
1163                     return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);
1164                 }
1165
1166                 if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
1167                     return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);
1168                 }
1169
1170                 if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
1171                     return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);
1172                 }
1173
1174                 if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
1175                     return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);
1176                 }
1177
1178                 return null;
1179             }
1180
1181             function renderLabel(p, label, options) {
1182                 return textUtil.createText(p, label || '', options).addClass('djs-label');
1183             }
1184
1185             function renderEmbeddedLabel(p, element, align) {
1186                 var semantic = getSemantic(element);
1187                 return renderLabel(p, semantic.name, {
1188                     box: element,
1189                     align: align,
1190                     padding: 5
1191                 });
1192             }
1193
1194             function renderExternalLabel(p, element, align) {
1195                 var semantic = getSemantic(element);
1196
1197                 if (!semantic.name) {
1198                     element.hidden = true;
1199                 }
1200
1201                 return renderLabel(p, semantic.name, {
1202                     box: element,
1203                     align: align,
1204                     style: {
1205                         fontSize: '11px'
1206                     }
1207                 });
1208             }
1209
1210             function renderLaneLabel(p, text, element) {
1211                 var textBox = renderLabel(p, text, {
1212                     box: {
1213                         height: 30,
1214                         width: element.height
1215                     },
1216                     align: 'center-middle'
1217                 });
1218
1219                 var top = -1 * element.height;
1220                 textBox.transform(
1221                     'rotate(270) ' +
1222                     'translate(' + top + ',' + 0 + ')'
1223                 );
1224             }
1225
1226             function createPathFromConnection(connection) {
1227                 var waypoints = connection.waypoints;
1228
1229                 var pathData = 'm  ' + waypoints[0].x + ',' + waypoints[0].y;
1230                 for (var i = 1; i < waypoints.length; i++) {
1231                     pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
1232                 }
1233                 return pathData;
1234             }
1235
1236             var handlers = {
1237                 'bpmn:Event': function(p, element, attrs) {
1238                     return drawCircle(p, element.width, element.height, attrs);
1239                 },
1240                 'bpmn:StartEvent': function(p, element) {
1241                     var attrs = {};
1242                     var semantic = getSemantic(element);
1243
1244                     if (!semantic.isInterrupting) {
1245                         attrs = {
1246                             strokeDasharray: '6',
1247                             strokeLinecap: 'round'
1248                         };
1249                     }
1250
1251                     var circle = renderer('bpmn:Event')(p, element, attrs);
1252
1253                     renderEventContent(element, p);
1254
1255                     return circle;
1256                 },
1257                 
1258                 'bpmn:MultiBranchConnector': function(p, element) {
1259                     var attrs = {};
1260                     element.height=80;
1261                     element.width=80;
1262                     var semantic = getSemantic(element);
1263
1264                     if (!semantic.isInterrupting) {
1265                         attrs = {
1266                             strokeDasharray: '6',
1267                             strokeLinecap: 'round'
1268                         };
1269                     }
1270
1271                     var circle = renderer('bpmn:Event')(p, element, attrs);
1272                     var height = element.height/2;
1273                     var width = element.width/2;
1274                     var value=Math.round((height+width)/4);
1275                     drawLine(p, [{
1276                         x: 0,
1277                         y: Math.round(element.height / 2)
1278                     }, {
1279                         x: element.width,
1280                         y: Math.round(element.height / 2)
1281                     }]);
1282                    drawLine(p, [{
1283                         x: Math.round(element.width / 2),
1284                         y: 0
1285                     }, {
1286                         x: Math.round(element.width / 2),
1287                         y: element.height
1288                     }]);
1289                     renderEventContent(element, p);
1290
1291                     return circle;
1292                 },
1293                 'bpmn:ParentReturn': function(p, element) {
1294                     var attrs = {};
1295                     var semantic = getSemantic(element);
1296
1297                     if (!semantic.isInterrupting) {
1298                         attrs = {
1299                             strokeDasharray: '6',
1300                             strokeLinecap: 'round'
1301                         };
1302                     }
1303
1304                     // var circle = renderer('bpmn:Event')(p, element, attrs);
1305                     drawLine(p, [{
1306                         x: 0,
1307                         y: 0
1308                     }, {
1309                         x: 0,
1310                         y: element.height / 2
1311                     }]);
1312                     drawLine(p, [{
1313                         x: 0,
1314                         y: element.height / 2
1315                     }, {
1316                         x: element.width / 2,
1317                         y: element.height
1318                     }]);
1319                     drawLine(p, [{
1320                         x: 0,
1321                         y: 0
1322                     }, {
1323                         x: element.width,
1324                         y: 0
1325                     }]);
1326                     drawLine(p, [{
1327                         x: element.width,
1328                         y: 0
1329                     }, {
1330                         x: element.width,
1331                         y: element.height / 2
1332                     }]);
1333                     drawLine(p, [
1334
1335                         {
1336                             x: element.width,
1337                             y: element.height / 2
1338                         }, {
1339                             x: element.width / 2,
1340                             y: element.height
1341                         }
1342                     ]);
1343                     var text2 = getSemantic(element).name;
1344                     renderLabel(p, text2, {
1345                         box: element,
1346                         align: 'center'
1347                     });
1348                     renderEventContent(element, p);
1349
1350                     return p;
1351                 },
1352                 'bpmn:SubProcessCall': function(p, element) {
1353                     var lane = renderer('bpmn:Lane')(p, element, {
1354                         fill: 'White'
1355                     });
1356
1357                     var expandedPool = DiUtil.isExpanded(element);
1358
1359                     if (expandedPool) {
1360                         drawLine(p, [{
1361                             x: 20,
1362                             y: 0
1363                         }, {
1364                             x: 20,
1365                             y: element.height
1366                         }]);
1367
1368                         drawLine(p, [{
1369                             x: element.width - 20,
1370                             y: 0
1371                         }, {
1372                             x: element.width - 20,
1373                             y: element.height
1374                         }]);
1375
1376                         var text2 = getSemantic(element).name;
1377                         renderLabel(p, text2, {
1378                             box: element,
1379                             align: 'center-middle'
1380                         });
1381
1382                         /*
1383                          * var text = getSemantic(element).name; renderLaneLabel(p,
1384                          * text, element);
1385                          */
1386                     } else {
1387                         // Collapsed pool draw text inline
1388                         var text2 = getSemantic(element).name;
1389                         renderLabel(p, text2, {
1390                             box: element,
1391                             align: 'center-middle'
1392                         });
1393                     }
1394
1395                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1396
1397                     if (participantMultiplicity) {
1398                         renderer('ParticipantMultiplicityMarker')(p, element);
1399                     }
1400
1401                     return lane;
1402
1403
1404                 },
1405                 'bpmn:InitiateProcess': function(p, element) {
1406                     var lane = renderer('bpmn:Lane')(p, element, {
1407                         fill: 'White'
1408                     });
1409
1410                     var expandedPool = DiUtil.isExpanded(element);
1411                                         openDiagram(newDiagramXML);
1412                     if (expandedPool) {
1413                          drawLine(p, [{
1414                              x: 0,
1415                              y: 20
1416                          }, {
1417                              x: element.width,
1418                              y: 20
1419                          }]);
1420
1421                          drawLine(p, [{
1422                              x: 20,
1423                              y: 0
1424                          }, {
1425                              x: 20,
1426                              y: element.height
1427                          }]);
1428                          var text2 = getSemantic(element).name;
1429                          renderLabel(p, text2, {
1430                              box: element,
1431                              align: 'center-middle'
1432                          });
1433                          
1434                     } else {
1435                         // Collapsed pool draw text inline
1436                         var text2 = getSemantic(element).name;
1437                         renderLabel(p, text2, {
1438                             box: element,
1439                             align: 'center-middle'
1440                         });
1441                     }
1442
1443                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1444
1445                     if (participantMultiplicity) {
1446                         renderer('ParticipantMultiplicityMarker')(p, element);
1447                     }
1448
1449                     return lane;
1450
1451
1452                 },
1453                 'bpmn:Collector': function(p, element) {
1454                     var lane = renderer('bpmn:Lane')(p, element, {
1455                         fill: 'White'
1456                     });
1457
1458                     var expandedPool = DiUtil.isExpanded(element);
1459
1460                     if (expandedPool) {
1461                          drawLine(p, [{
1462                              x: element.width,
1463                              y: 80
1464                          }, {
1465                              x: element.width,
1466                              y: 20
1467                          }]);
1468
1469                          drawLine(p, [{
1470                              x: 20,
1471                              y: 0
1472                          }, {
1473                              x: 20,
1474                              y: element.height
1475                          }]);
1476                          var text2 = getSemantic(element).name;
1477                          if(text2 == undefined )
1478                                 {
1479                                   text2 = 'Collector';
1480                                 }
1481                         
1482                          renderLabel(p, text2, {
1483                              box: element,
1484                              align: 'center-middle'
1485                          });
1486                          
1487                     } else {
1488                         // Collapsed pool draw text inline
1489                         var text2 = getSemantic(element).name;
1490                         renderLabel(p, text2, {
1491                             box: element,
1492                             align: 'center-middle'
1493                         });
1494                     }
1495
1496                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1497
1498                     if (participantMultiplicity) {
1499                         renderer('ParticipantMultiplicityMarker')(p, element);
1500                     }
1501
1502                     return lane;
1503
1504
1505                 },
1506                 'bpmn:VesCollector': function(p, element) {
1507                     var lane = renderer('bpmn:Lane')(p, element, {
1508                         fill: 'White'
1509                     });
1510
1511                     var expandedPool = DiUtil.isExpanded(element);
1512
1513                     if (expandedPool) {
1514                        drawLine(p, [{
1515                              x: element.width,
1516                              y: 80
1517                          }, {
1518                              x: element.width,
1519                              y: 20
1520                          }]);
1521
1522                          drawLine(p, [{
1523                              x: 20,
1524                              y: 0
1525                          }, {
1526                              x: 20,
1527                              y: element.height
1528                          }]);
1529
1530                         textUtil.createText(p, "V", { align: 'left-top', 'padding': {top:0,  left:5, right:element.width - 20, bottom:0} });
1531                         textUtil.createText(p, "E", { align: 'left-top', 'padding': {top:12, left:5, right:element.width - 20, bottom:0} });
1532                         textUtil.createText(p, "S", { align: 'left-top', 'padding': {top:24, left:5, right:element.width - 20, bottom:0} });
1533
1534                          var text2 = getSemantic(element).name;
1535                          if(text2 == undefined )
1536                           {
1537                             text2 = 'VesCollector';
1538                           }
1539
1540                         renderLabel(p, text2, {
1541                              box: element,
1542                              align: 'center-middle'
1543                          });
1544
1545                     } else {
1546                         // Collapsed pool draw text inline
1547                         var text2 = getSemantic(element).name;
1548                         renderLabel(p, text2, {
1549                             box: element,
1550                             align: 'center-middle'
1551                         });
1552                     }
1553
1554                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1555
1556                     if (participantMultiplicity) {
1557                         renderer('ParticipantMultiplicityMarker')(p, element);
1558                     }
1559
1560                     return lane;
1561                 },
1562
1563          'bpmn:StringMatch': function(p, element) {
1564                     var lane = renderer('bpmn:Lane')(p, element, {
1565                         fill: 'White'
1566                     });
1567
1568                     var expandedPool = DiUtil.isExpanded(element);
1569
1570                     if (expandedPool) {
1571
1572                          drawLine(p, [{
1573                              x: 0,
1574                              y: 20
1575                          }, {
1576                              x: element.width,
1577                              y: 20
1578                          }]);
1579                          var text2 = getSemantic(element).name;
1580                          if(text2 == undefined )
1581                         {
1582                           text2 = 'StringMatch';
1583                         }
1584                          renderLabel(p, text2, {
1585                              box: element,
1586                              align: 'center-middle'
1587                          });
1588
1589                     } else {
1590                         // Collapsed pool draw text inline
1591                         var text2 = getSemantic(element).name;
1592                         renderLabel(p, text2, {
1593                             box: element,
1594                             align: 'center-middle'
1595                         });
1596                     }
1597
1598                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1599
1600                     if (participantMultiplicity) {
1601                         renderer('ParticipantMultiplicityMarker')(p, element);
1602                     }
1603
1604                     return lane;
1605
1606
1607                    },
1608
1609                 'bpmn:TCA': function(p, element) {
1610                     var lane = renderer('bpmn:Lane')(p, element, {
1611                         fill: 'White'
1612                     });
1613
1614                     var expandedPool = DiUtil.isExpanded(element);
1615
1616                     if (expandedPool) {
1617                          
1618
1619                          drawLine(p, [{
1620                                  x: 0,
1621                              y: element.height - 20
1622                          }, {
1623                              x: element.width,
1624                              y: element.height - 20
1625                          }]);
1626                          var text2 = getSemantic(element).name;
1627                          if(text2 == undefined )
1628                         {
1629                           text2 = 'TCA';
1630                         }
1631                          renderLabel(p, text2, {
1632                              box: element,
1633                              align: 'center-middle'
1634                          });
1635                          
1636                     } else {
1637                         // Collapsed pool draw text inline
1638                         var text2 = getSemantic(element).name;
1639                         renderLabel(p, text2, {
1640                             box: element,
1641                             align: 'center-middle'
1642                         });
1643                     }
1644
1645                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1646
1647                     if (participantMultiplicity) {
1648                         renderer('ParticipantMultiplicityMarker')(p, element);
1649                     }
1650
1651                     return lane;
1652
1653
1654                 },
1655                                 'bpmn:GOC': function(p, element) {
1656                     var lane = renderer('bpmn:Lane')(p, element, {
1657                         fill: 'White'
1658                     });
1659
1660                     var expandedPool = DiUtil.isExpanded(element);
1661
1662                     if (expandedPool) {
1663                          
1664                          
1665
1666                          drawLine(p, [{
1667                              x: element.width/2,
1668                              y: element.height
1669                          }, {
1670                              x: element.width,
1671                              y: element.height/2
1672                          }]);
1673                          var text2 = getSemantic(element).name;
1674                          if(text2 == undefined )
1675                         {
1676                           text2 = 'GOC';
1677                         }
1678                          renderLabel(p, text2, {
1679                              box: element,
1680                              align: 'center-middle'
1681                          });
1682                          
1683                     } else {
1684                         // Collapsed pool draw text inline
1685                         var text2 = getSemantic(element).name;
1686                         renderLabel(p, text2, {
1687                             box: element,
1688                             align: 'center-middle'
1689                         });
1690                     }
1691
1692                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1693
1694                     if (participantMultiplicity) {
1695                         renderer('ParticipantMultiplicityMarker')(p, element);
1696                     }
1697
1698                     return lane;
1699
1700
1701                 },
1702                                 'bpmn:Policy': function(p, element) {
1703                     var lane = renderer('bpmn:Lane')(p, element, {
1704                         fill: 'White'
1705                     });
1706
1707                     var expandedPool = DiUtil.isExpanded(element);
1708
1709                     if (expandedPool) {
1710                          
1711                          
1712
1713                          drawLine(p, [{
1714                              x: 0,
1715                              y: element.height/2
1716                          }, {
1717                              x: element.width/2,
1718                              y: 0
1719                          }]);
1720                          var text2 = getSemantic(element).name;
1721                          if(text2 == undefined )
1722                         {
1723                           text2 = 'Policy';
1724                         }
1725                          renderLabel(p, text2, {
1726                              box: element,
1727                              align: 'center-middle'
1728                          });
1729                          
1730                     } else {
1731                         // Collapsed pool draw text inline
1732                         var text2 = getSemantic(element).name;
1733                         renderLabel(p, text2, {
1734                             box: element,
1735                             align: 'center-middle'
1736                         });
1737                     }
1738
1739                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1740
1741                     if (participantMultiplicity) {
1742                         renderer('ParticipantMultiplicityMarker')(p, element);
1743                     }
1744
1745                     return lane;
1746
1747
1748                 },
1749                 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
1750                     var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
1751                         xScaleFactor: 0.9,
1752                         yScaleFactor: 0.9,
1753                         containerWidth: element.width,
1754                         containerHeight: element.height,
1755                         position: {
1756                             mx: 0.235,
1757                             my: 0.315
1758                         }
1759                     });
1760
1761                     var fill = isThrowing ? 'black' : 'white';
1762                     var stroke = isThrowing ? 'white' : 'black';
1763
1764                     var messagePath = drawPath(p, pathData, {
1765                         strokeWidth: 1,
1766                         fill: fill,
1767                         stroke: stroke
1768                     });
1769
1770                     return messagePath;
1771                 },
1772                 'bpmn:TimerEventDefinition': function(p, element) {
1773
1774                     var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
1775                         strokeWidth: 2
1776                     });
1777
1778                     var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
1779                         xScaleFactor: 0.75,
1780                         yScaleFactor: 0.75,
1781                         containerWidth: element.width,
1782                         containerHeight: element.height,
1783                         position: {
1784                             mx: 0.5,
1785                             my: 0.5
1786                         }
1787                     });
1788
1789                     drawPath(p, pathData, {
1790                         strokeWidth: 2,
1791                         strokeLinecap: 'square'
1792                     });
1793
1794                     for (var i = 0; i < 12; i++) {
1795
1796                         var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
1797                             xScaleFactor: 0.75,
1798                             yScaleFactor: 0.75,
1799                             containerWidth: element.width,
1800                             containerHeight: element.height,
1801                             position: {
1802                                 mx: 0.5,
1803                                 my: 0.5
1804                             }
1805                         });
1806
1807                         var width = element.width / 2;
1808                         var height = element.height / 2;
1809
1810                         drawPath(p, linePathData, {
1811                             strokeWidth: 1,
1812                             strokeLinecap: 'square',
1813                             transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
1814                         });
1815                     }
1816
1817                     return circle;
1818                 },
1819                 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
1820                     var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
1821                         xScaleFactor: 1,
1822                         yScaleFactor: 1,
1823                         containerWidth: event.width,
1824                         containerHeight: event.height,
1825                         position: {
1826                             mx: 0.5,
1827                             my: 0.555
1828                         }
1829                     });
1830
1831                     var fill = isThrowing ? 'black' : 'none';
1832
1833                     return drawPath(p, pathData, {
1834                         strokeWidth: 1,
1835                         fill: fill
1836                     });
1837                 },
1838                 'bpmn:ConditionalEventDefinition': function(p, event) {
1839                     var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
1840                         xScaleFactor: 1,
1841                         yScaleFactor: 1,
1842                         containerWidth: event.width,
1843                         containerHeight: event.height,
1844                         position: {
1845                             mx: 0.5,
1846                             my: 0.222
1847                         }
1848                     });
1849
1850                     return drawPath(p, pathData, {
1851                         strokeWidth: 1
1852                     });
1853                 },
1854                 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
1855                     var pathData = pathMap.getScaledPath('EVENT_LINK', {
1856                         xScaleFactor: 1,
1857                         yScaleFactor: 1,
1858                         containerWidth: event.width,
1859                         containerHeight: event.height,
1860                         position: {
1861                             mx: 0.57,
1862                             my: 0.263
1863                         }
1864                     });
1865
1866                     var fill = isThrowing ? 'black' : 'none';
1867
1868                     return drawPath(p, pathData, {
1869                         strokeWidth: 1,
1870                         fill: fill
1871                     });
1872                 },
1873                 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
1874                     var pathData = pathMap.getScaledPath('EVENT_ERROR', {
1875                         xScaleFactor: 1.1,
1876                         yScaleFactor: 1.1,
1877                         containerWidth: event.width,
1878                         containerHeight: event.height,
1879                         position: {
1880                             mx: 0.2,
1881                             my: 0.722
1882                         }
1883                     });
1884
1885                     var fill = isThrowing ? 'black' : 'none';
1886
1887                     return drawPath(p, pathData, {
1888                         strokeWidth: 1,
1889                         fill: fill
1890                     });
1891                 },
1892                 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
1893                     var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
1894                         xScaleFactor: 1.0,
1895                         yScaleFactor: 1.0,
1896                         containerWidth: event.width,
1897                         containerHeight: event.height,
1898                         position: {
1899                             mx: 0.638,
1900                             my: -0.055
1901                         }
1902                     });
1903
1904                     var fill = isThrowing ? 'black' : 'none';
1905
1906                     return drawPath(p, pathData, {
1907                         strokeWidth: 1,
1908                         fill: fill
1909                     }).transform('rotate(45)');
1910                 },
1911                 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
1912                     var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
1913                         xScaleFactor: 1,
1914                         yScaleFactor: 1,
1915                         containerWidth: event.width,
1916                         containerHeight: event.height,
1917                         position: {
1918                             mx: 0.201,
1919                             my: 0.472
1920                         }
1921                     });
1922
1923                     var fill = isThrowing ? 'black' : 'none';
1924
1925                     return drawPath(p, pathData, {
1926                         strokeWidth: 1,
1927                         fill: fill
1928                     });
1929                 },
1930                 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
1931                     var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
1932                         xScaleFactor: 0.9,
1933                         yScaleFactor: 0.9,
1934                         containerWidth: event.width,
1935                         containerHeight: event.height,
1936                         position: {
1937                             mx: 0.5,
1938                             my: 0.2
1939                         }
1940                     });
1941
1942                     var fill = isThrowing ? 'black' : 'none';
1943
1944                     return drawPath(p, pathData, {
1945                         strokeWidth: 1,
1946                         fill: fill
1947                     });
1948                 },
1949                 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
1950                     var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
1951                         xScaleFactor: 1.1,
1952                         yScaleFactor: 1.1,
1953                         containerWidth: event.width,
1954                         containerHeight: event.height,
1955                         position: {
1956                             mx: 0.222,
1957                             my: 0.36
1958                         }
1959                     });
1960
1961                     var fill = isThrowing ? 'black' : 'none';
1962
1963                     return drawPath(p, pathData, {
1964                         strokeWidth: 1,
1965                         fill: fill
1966                     });
1967                 },
1968                 'bpmn:ParallelMultipleEventDefinition': function(p, event) {
1969                     var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
1970                         xScaleFactor: 1.2,
1971                         yScaleFactor: 1.2,
1972                         containerWidth: event.width,
1973                         containerHeight: event.height,
1974                         position: {
1975                             mx: 0.458,
1976                             my: 0.194
1977                         }
1978                     });
1979
1980                     return drawPath(p, pathData, {
1981                         strokeWidth: 1
1982                     });
1983                 },
1984                 'bpmn:EndEvent': function(p, element) {
1985                     var circle = renderer('bpmn:Event')(p, element, {
1986                         strokeWidth: 4
1987                     });
1988
1989                     renderEventContent(element, p, true);
1990
1991                     return circle;
1992                 },
1993                 'bpmn:TerminateEventDefinition': function(p, element) {
1994                     var circle = drawCircle(p, element.width, element.height, 8, {
1995                         strokeWidth: 4,
1996                         fill: 'black'
1997                     });
1998
1999                     return circle;
2000                 },
2001                 'bpmn:IntermediateEvent': function(p, element) {
2002                     var outer = renderer('bpmn:Event')(p, element, {
2003                         strokeWidth: 1
2004                     });
2005                     /* inner */
2006                     drawCircle(p, element.width, element.height, INNER_OUTER_DIST, {
2007                         strokeWidth: 1,
2008                         fill: 'none'
2009                     });
2010
2011                     renderEventContent(element, p);
2012
2013                     return outer;
2014                 },
2015                 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
2016                 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
2017
2018                 'bpmn:Activity': function(p, element, attrs) {
2019                     return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
2020                 },
2021
2022                 'bpmn:Task': function(p, element, attrs) {
2023                     var rect = renderer('bpmn:Activity')(p, element, attrs);
2024                     renderEmbeddedLabel(p, element, 'center-middle');
2025                     attachTaskMarkers(p, element);
2026                     return rect;
2027                 },
2028                 'bpmn:ServiceTask': function(p, element) {
2029                     var task = renderer('bpmn:Task')(p, element);
2030
2031                     var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2032                         abspos: {
2033                             x: 12,
2034                             y: 18
2035                         }
2036                     });
2037
2038                     /* service bg */
2039                     drawPath(p, pathDataBG, {
2040                         strokeWidth: 1,
2041                         fill: 'none'
2042                     });
2043
2044                     var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
2045                         abspos: {
2046                             x: 17.2,
2047                             y: 18
2048                         }
2049                     });
2050
2051                     /* service fill */
2052                     drawPath(p, fillPathData, {
2053                         strokeWidth: 0,
2054                         stroke: 'none',
2055                         fill: 'white'
2056                     });
2057
2058                     var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2059                         abspos: {
2060                             x: 17,
2061                             y: 22
2062                         }
2063                     });
2064
2065                     /* service */
2066                     drawPath(p, pathData, {
2067                         strokeWidth: 1,
2068                         fill: 'white'
2069                     });
2070
2071                     return task;
2072                 },
2073                 'bpmn:UserTask': function(p, element) {
2074                     var task = renderer('bpmn:Task')(p, element);
2075
2076                     var x = 15;
2077                     var y = 12;
2078
2079                     var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
2080                         abspos: {
2081                             x: x,
2082                             y: y
2083                         }
2084                     });
2085
2086                     /* user path */
2087                     drawPath(p, pathData, {
2088                         strokeWidth: 0.5,
2089                         fill: 'none'
2090                     });
2091
2092                     var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
2093                         abspos: {
2094                             x: x,
2095                             y: y
2096                         }
2097                     });
2098
2099                     /* user2 path */
2100                     drawPath(p, pathData2, {
2101                         strokeWidth: 0.5,
2102                         fill: 'none'
2103                     });
2104
2105                     var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
2106                         abspos: {
2107                             x: x,
2108                             y: y
2109                         }
2110                     });
2111
2112                     /* user3 path */
2113                     drawPath(p, pathData3, {
2114                         strokeWidth: 0.5,
2115                         fill: 'black'
2116                     });
2117
2118                     return task;
2119                 },
2120                 'bpmn:ManualTask': function(p, element) {
2121                     var task = renderer('bpmn:Task')(p, element);
2122
2123                     var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
2124                         abspos: {
2125                             x: 17,
2126                             y: 15
2127                         }
2128                     });
2129
2130                     /* manual path */
2131                     drawPath(p, pathData, {
2132                         strokeWidth: 0.25,
2133                         fill: 'white',
2134                         stroke: 'black'
2135                     });
2136
2137                     return task;
2138                 },
2139                 'bpmn:SendTask': function(p, element) {
2140                     var task = renderer('bpmn:Task')(p, element);
2141
2142                     var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2143                         xScaleFactor: 1,
2144                         yScaleFactor: 1,
2145                         containerWidth: 21,
2146                         containerHeight: 14,
2147                         position: {
2148                             mx: 0.285,
2149                             my: 0.357
2150                         }
2151                     });
2152
2153                     /* send path */
2154                     drawPath(p, pathData, {
2155                         strokeWidth: 1,
2156                         fill: 'black',
2157                         stroke: 'white'
2158                     });
2159
2160                     return task;
2161                 },
2162                 'bpmn:ReceiveTask': function(p, element) {
2163                     var semantic = getSemantic(element);
2164
2165                     var task = renderer('bpmn:Task')(p, element);
2166                     var pathData;
2167
2168                     if (semantic.instantiate) {
2169                         drawCircle(p, 28, 28, 20 * 0.22, {
2170                             strokeWidth: 1
2171                         });
2172
2173                         pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
2174                             abspos: {
2175                                 x: 7.77,
2176                                 y: 9.52
2177                             }
2178                         });
2179                     } else {
2180
2181                         pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2182                             xScaleFactor: 0.9,
2183                             yScaleFactor: 0.9,
2184                             containerWidth: 21,
2185                             containerHeight: 14,
2186                             position: {
2187                                 mx: 0.3,
2188                                 my: 0.4
2189                             }
2190                         });
2191                     }
2192
2193                     /* receive path */
2194                     drawPath(p, pathData, {
2195                         strokeWidth: 1
2196                     });
2197
2198                     return task;
2199                 },
2200                 'bpmn:ScriptTask': function(p, element) {
2201                     var task = renderer('bpmn:Task')(p, element);
2202
2203                     var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
2204                         abspos: {
2205                             x: 15,
2206                             y: 20
2207                         }
2208                     });
2209
2210                     /* script path */
2211                     drawPath(p, pathData, {
2212                         strokeWidth: 1
2213                     });
2214
2215                     return task;
2216                 },
2217                 'bpmn:BusinessRuleTask': function(p, element) {
2218                     var task = renderer('bpmn:Task')(p, element);
2219
2220                     var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
2221                         abspos: {
2222                             x: 8,
2223                             y: 8
2224                         }
2225                     });
2226
2227                     var businessHeaderPath = drawPath(p, headerPathData);
2228                     businessHeaderPath.attr({
2229                         strokeWidth: 1,
2230                         fill: 'AAA'
2231                     });
2232
2233                     var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
2234                         abspos: {
2235                             x: 8,
2236                             y: 8
2237                         }
2238                     });
2239
2240                     var businessPath = drawPath(p, headerData);
2241                     businessPath.attr({
2242                         strokeWidth: 1
2243                     });
2244
2245                     return task;
2246                 },
2247                 'bpmn:SubProcess': function(p, element, attrs) {
2248                     var rect = renderer('bpmn:Activity')(p, element, attrs);
2249
2250                     var semantic = getSemantic(element);
2251
2252                     var expanded = DiUtil.isExpanded(semantic);
2253
2254                     var isEventSubProcess = !!semantic.triggeredByEvent;
2255                     if (isEventSubProcess) {
2256                         rect.attr({
2257                             strokeDasharray: '1,2'
2258                         });
2259                     }
2260
2261                     renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
2262
2263                     if (expanded) {
2264                         attachTaskMarkers(p, element);
2265                     } else {
2266                         attachTaskMarkers(p, element, ['SubProcessMarker']);
2267                     }
2268
2269                     return rect;
2270                 },
2271                 'bpmn:AdHocSubProcess': function(p, element) {
2272                     return renderer('bpmn:SubProcess')(p, element);
2273                 },
2274                 'bpmn:Transaction': function(p, element) {
2275                     var outer = renderer('bpmn:SubProcess')(p, element);
2276
2277                     var innerAttrs = styles.style(['no-fill', 'no-events']);
2278
2279                     /* inner path */
2280                     drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
2281
2282                     return outer;
2283                 },
2284                 'bpmn:CallActivity': function(p, element) {
2285                     return renderer('bpmn:Task')(p, element, {
2286                         strokeWidth: 5
2287                     });
2288                 },
2289                 'bpmn:Participant': function(p, element) {
2290
2291                     var lane = renderer('bpmn:Lane')(p, element, {
2292                         fill: 'White'
2293                     });
2294
2295                     var expandedPool = DiUtil.isExpanded(element);
2296
2297                     if (expandedPool) {
2298                         drawLine(p, [{
2299                             x: 30,
2300                             y: 0
2301                         }, {
2302                             x: 30,
2303                             y: element.height
2304                         }]);
2305                         var text = getSemantic(element).name;
2306                         renderLaneLabel(p, text, element);
2307                     } else {
2308                         // Collapsed pool draw text inline
2309                         var text2 = getSemantic(element).name;
2310                         renderLabel(p, text2, {
2311                             box: element,
2312                             align: 'center-middle'
2313                         });
2314                     }
2315
2316                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
2317
2318                     if (participantMultiplicity) {
2319                         renderer('ParticipantMultiplicityMarker')(p, element);
2320                     }
2321
2322                     return lane;
2323                 },
2324                 'bpmn:Lane': function(p, element, attrs) {
2325                     var rect = drawRect(p, element.width, element.height, 0, attrs || {
2326                         fill: 'none'
2327                     });
2328
2329                     var semantic = getSemantic(element);
2330
2331                     if (semantic.$type === 'bpmn:Lane') {
2332                         var text = semantic.name;
2333                         renderLaneLabel(p, text, element);
2334                     }
2335
2336                     return rect;
2337                 },
2338                 'bpmn:InclusiveGateway': function(p, element) {
2339                     var diamond = drawDiamond(p, element.width, element.height);
2340
2341                     /* circle path */
2342                     drawCircle(p, element.width, element.height, element.height * 0.24, {
2343                         strokeWidth: 2.5,
2344                         fill: 'none'
2345                     });
2346
2347                     return diamond;
2348                 },
2349                 'bpmn:ExclusiveGateway': function(p, element) {
2350                     var diamond = drawDiamond(p, element.width, element.height);
2351                     renderEmbeddedLabel(p, element, 'center-middle');
2352
2353                     var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
2354                         xScaleFactor: 0.4,
2355                         yScaleFactor: 0.4,
2356                         containerWidth: element.width,
2357                         containerHeight: element.height,
2358                         position: {
2359                             mx: 0.32,
2360                             my: 0.3
2361                         }
2362                     });
2363
2364                     if (!!(getDi(element).isMarkerVisible)) {
2365                         drawPath(p, pathData, {
2366                             strokeWidth: 1,
2367                             fill: 'black'
2368                         });
2369                     }
2370
2371                     return diamond;
2372                 },
2373                 'bpmn:ComplexGateway': function(p, element) {
2374                     var diamond = drawDiamond(p, element.width, element.height);
2375
2376                     var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
2377                         xScaleFactor: 0.5,
2378                         yScaleFactor: 0.5,
2379                         containerWidth: element.width,
2380                         containerHeight: element.height,
2381                         position: {
2382                             mx: 0.46,
2383                             my: 0.26
2384                         }
2385                     });
2386
2387                     /* complex path */
2388                     drawPath(p, pathData, {
2389                         strokeWidth: 1,
2390                         fill: 'black'
2391                     });
2392
2393                     return diamond;
2394                 },
2395                 'bpmn:ParallelGateway': function(p, element) {
2396                     var diamond = drawDiamond(p, element.width, element.height);
2397
2398                     var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2399                         xScaleFactor: 0.6,
2400                         yScaleFactor: 0.6,
2401                         containerWidth: element.width,
2402                         containerHeight: element.height,
2403                         position: {
2404                             mx: 0.46,
2405                             my: 0.2
2406                         }
2407                     });
2408
2409                     /* parallel path */
2410                     drawPath(p, pathData, {
2411                         strokeWidth: 1,
2412                         fill: 'black'
2413                     });
2414
2415                     return diamond;
2416                 },
2417                 'bpmn:EventBasedGateway': function(p, element) {
2418
2419                     var semantic = getSemantic(element);
2420
2421                     var diamond = drawDiamond(p, element.width, element.height);
2422
2423                     /* outer circle path */
2424                     drawCircle(p, element.width, element.height, element.height * 0.20, {
2425                         strokeWidth: 1,
2426                         fill: 'none'
2427                     });
2428
2429                     var type = semantic.eventGatewayType;
2430                     var instantiate = !!semantic.instantiate;
2431
2432                     function drawEvent() {
2433
2434                         var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
2435                             xScaleFactor: 0.18,
2436                             yScaleFactor: 0.18,
2437                             containerWidth: element.width,
2438                             containerHeight: element.height,
2439                             position: {
2440                                 mx: 0.36,
2441                                 my: 0.44
2442                             }
2443                         });
2444
2445                         /* event path */
2446                         drawPath(p, pathData, {
2447                             strokeWidth: 2,
2448                             fill: 'none'
2449                         });
2450                     }
2451
2452                     if (type === 'Parallel') {
2453
2454                         var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2455                             xScaleFactor: 0.4,
2456                             yScaleFactor: 0.4,
2457                             containerWidth: element.width,
2458                             containerHeight: element.height,
2459                             position: {
2460                                 mx: 0.474,
2461                                 my: 0.296
2462                             }
2463                         });
2464
2465                         var parallelPath = drawPath(p, pathData);
2466                         parallelPath.attr({
2467                             strokeWidth: 1,
2468                             fill: 'none'
2469                         });
2470                     } else if (type === 'Exclusive') {
2471
2472                         if (!instantiate) {
2473                             var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
2474                             innerCircle.attr({
2475                                 strokeWidth: 1,
2476                                 fill: 'none'
2477                             });
2478                         }
2479
2480                         drawEvent();
2481                     }
2482
2483
2484                     return diamond;
2485                 },
2486                 'bpmn:Gateway': function(p, element) {
2487                     var diamond = drawDiamond(p, element.width, element.height);
2488                     renderEmbeddedLabel(p, element, 'center-middle');
2489
2490                     return diamond;
2491                 },
2492                 'bpmn:SequenceFlow': function(p, element) {
2493                     var pathData = createPathFromConnection(element);
2494                     var path = drawPath(p, pathData, {
2495                         strokeLinejoin: 'round',
2496                         markerEnd: marker('sequenceflow-end')
2497                     });
2498
2499                     var sequenceFlow = getSemantic(element);
2500                     var source = element.source.businessObject;
2501
2502                     // conditional flow marker
2503                     if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
2504                         path.attr({
2505                             markerStart: marker('conditional-flow-marker')
2506                         });
2507                     }
2508
2509                     // default marker
2510                     if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
2511                         path.attr({
2512                             markerStart: marker('conditional-default-flow-marker')
2513                         });
2514                     }
2515
2516                     return path;
2517                 },
2518                 'bpmn:Association': function(p, element, attrs) {
2519
2520                     attrs = assign({
2521                         strokeDasharray: '1,6',
2522                         strokeLinecap: 'round',
2523                         strokeLinejoin: 'round'
2524                     }, attrs || {});
2525
2526                     // TODO(nre): style according to directed state
2527                     return drawLine(p, element.waypoints, attrs);
2528                 },
2529                 'bpmn:DataInputAssociation': function(p, element) {
2530                     return renderer('bpmn:Association')(p, element, {
2531                         markerEnd: marker('data-association-end')
2532                     });
2533                 },
2534                 'bpmn:DataOutputAssociation': function(p, element) {
2535                     return renderer('bpmn:Association')(p, element, {
2536                         markerEnd: marker('data-association-end')
2537                     });
2538                 },
2539                 'bpmn:MessageFlow': function(p, element) {
2540
2541                     var semantic = getSemantic(element),
2542                         di = getDi(element);
2543
2544                     var pathData = createPathFromConnection(element);
2545                     var path = drawPath(p, pathData, {
2546                         markerEnd: marker('messageflow-end'),
2547                         markerStart: marker('messageflow-start'),
2548                         strokeDasharray: '10, 12',
2549                         strokeLinecap: 'round',
2550                         strokeLinejoin: 'round',
2551                         strokeWidth: '1.5px'
2552                     });
2553
2554                     if (semantic.messageRef) {
2555                         var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
2556
2557                         var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
2558                             abspos: {
2559                                 x: midPoint.x,
2560                                 y: midPoint.y
2561                             }
2562                         });
2563
2564                         var messageAttrs = {
2565                             strokeWidth: 1
2566                         };
2567
2568                         if (di.messageVisibleKind === 'initiating') {
2569                             messageAttrs.fill = 'white';
2570                             messageAttrs.stroke = 'black';
2571                         } else {
2572                             messageAttrs.fill = '#888';
2573                             messageAttrs.stroke = 'white';
2574                         }
2575
2576                         drawPath(p, markerPathData, messageAttrs);
2577                     }
2578
2579                     return path;
2580                 },
2581                 'bpmn:DataObject': function(p, element) {
2582                     var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
2583                         xScaleFactor: 1,
2584                         yScaleFactor: 1,
2585                         containerWidth: element.width,
2586                         containerHeight: element.height,
2587                         position: {
2588                             mx: 0.474,
2589                             my: 0.296
2590                         }
2591                     });
2592
2593                     var elementObject = drawPath(p, pathData, {
2594                         fill: 'white'
2595                     });
2596
2597                     var semantic = getSemantic(element);
2598
2599                     if (isCollection(semantic)) {
2600                         renderDataItemCollection(p, element);
2601                     }
2602
2603                     return elementObject;
2604                 },
2605                 'bpmn:DataObjectReference': as('bpmn:DataObject'),
2606                 'bpmn:DataInput': function(p, element) {
2607
2608                     var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2609
2610                     // page
2611                     var elementObject = renderer('bpmn:DataObject')(p, element);
2612
2613                     /* input arrow path */
2614                     drawPath(p, arrowPathData, {
2615                         strokeWidth: 1
2616                     });
2617
2618                     return elementObject;
2619                 },
2620                 'bpmn:DataOutput': function(p, element) {
2621                     var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2622
2623                     // page
2624                     var elementObject = renderer('bpmn:DataObject')(p, element);
2625
2626                     /* output arrow path */
2627                     drawPath(p, arrowPathData, {
2628                         strokeWidth: 1,
2629                         fill: 'black'
2630                     });
2631
2632                     return elementObject;
2633                 },
2634                 'bpmn:DataStoreReference': function(p, element) {
2635                     var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
2636                         xScaleFactor: 1,
2637                         yScaleFactor: 1,
2638                         containerWidth: element.width,
2639                         containerHeight: element.height,
2640                         position: {
2641                             mx: 0,
2642                             my: 0.133
2643                         }
2644                     });
2645
2646                     var elementStore = drawPath(p, DATA_STORE_PATH, {
2647                         strokeWidth: 2,
2648                         fill: 'white'
2649                     });
2650
2651                     return elementStore;
2652                 },
2653                 'bpmn:BoundaryEvent': function(p, element) {
2654
2655                     var semantic = getSemantic(element),
2656                         cancel = semantic.cancelActivity;
2657
2658                     var attrs = {
2659                         strokeLinecap: 'round',
2660                         strokeWidth: 1
2661                     };
2662
2663                     if (!cancel) {
2664                         attrs.strokeDasharray = '6';
2665                     }
2666
2667                     var outer = renderer('bpmn:Event')(p, element, attrs);
2668                     /* inner path */
2669                     drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
2670
2671                     renderEventContent(element, p);
2672
2673                     return outer;
2674                 },
2675                 'bpmn:Group': function(p, element) {
2676                     return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
2677                         strokeWidth: 1,
2678                         strokeDasharray: '8,3,1,3',
2679                         fill: 'none',
2680                         pointerEvents: 'none'
2681                     });
2682                 },
2683                 'label': function(p, element) {
2684                     return renderExternalLabel(p, element, '');
2685                 },
2686                 'bpmn:TextAnnotation': function(p, element) {
2687                     var style = {
2688                         'fill': 'none',
2689                         'stroke': 'none'
2690                     };
2691                     var textElement = drawRect(p, element.width, element.height, 0, 0, style);
2692                     var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
2693                         xScaleFactor: 1,
2694                         yScaleFactor: 1,
2695                         containerWidth: element.width,
2696                         containerHeight: element.height,
2697                         position: {
2698                             mx: 0.0,
2699                             my: 0.0
2700                         }
2701                     });
2702                     drawPath(p, textPathData);
2703
2704                     var text = getSemantic(element).text || '';
2705                     renderLabel(p, text, {
2706                         box: element,
2707                         align: 'left-middle',
2708                         padding: 5
2709                     });
2710
2711                     return textElement;
2712                 },
2713                 'ParticipantMultiplicityMarker': function(p, element) {
2714                     var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2715                         xScaleFactor: 1,
2716                         yScaleFactor: 1,
2717                         containerWidth: element.width,
2718                         containerHeight: element.height,
2719                         position: {
2720                             mx: ((element.width / 2) / element.width),
2721                             my: (element.height - 15) / element.height
2722                         }
2723                     });
2724
2725                     drawPath(p, subProcessPath);
2726                 },
2727                 'SubProcessMarker': function(p, element) {
2728                     var markerRect = drawRect(p, 14, 14, 0, {
2729                         strokeWidth: 1
2730                     });
2731
2732                     // Process marker is placed in the middle of the box
2733                     // therefore fixed values can be used here
2734                     markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
2735
2736                     var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
2737                         xScaleFactor: 1.5,
2738                         yScaleFactor: 1.5,
2739                         containerWidth: element.width,
2740                         containerHeight: element.height,
2741                         position: {
2742                             mx: (element.width / 2 - 7.5) / element.width,
2743                             my: (element.height - 20) / element.height
2744                         }
2745                     });
2746
2747                     drawPath(p, subProcessPath);
2748                 },
2749                 'ParallelMarker': function(p, element, position) {
2750                     var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2751                         xScaleFactor: 1,
2752                         yScaleFactor: 1,
2753                         containerWidth: element.width,
2754                         containerHeight: element.height,
2755                         position: {
2756                             mx: ((element.width / 2 + position.parallel) / element.width),
2757                             my: (element.height - 20) / element.height
2758                         }
2759                     });
2760                     drawPath(p, subProcessPath);
2761                 },
2762                 'SequentialMarker': function(p, element, position) {
2763                     var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
2764                         xScaleFactor: 1,
2765                         yScaleFactor: 1,
2766                         containerWidth: element.width,
2767                         containerHeight: element.height,
2768                         position: {
2769                             mx: ((element.width / 2 + position.seq) / element.width),
2770                             my: (element.height - 19) / element.height
2771                         }
2772                     });
2773                     drawPath(p, sequentialPath);
2774                 },
2775                 'CompensationMarker': function(p, element, position) {
2776                     var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
2777                         xScaleFactor: 1,
2778                         yScaleFactor: 1,
2779                         containerWidth: element.width,
2780                         containerHeight: element.height,
2781                         position: {
2782                             mx: ((element.width / 2 + position.compensation) / element.width),
2783                             my: (element.height - 13) / element.height
2784                         }
2785                     });
2786                     drawPath(p, compensationPath, {
2787                         strokeWidth: 1
2788                     });
2789                 },
2790                 'LoopMarker': function(p, element, position) {
2791                     var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
2792                         xScaleFactor: 1,
2793                         yScaleFactor: 1,
2794                         containerWidth: element.width,
2795                         containerHeight: element.height,
2796                         position: {
2797                             mx: ((element.width / 2 + position.loop) / element.width),
2798                             my: (element.height - 7) / element.height
2799                         }
2800                     });
2801
2802                     drawPath(p, loopPath, {
2803                         strokeWidth: 1,
2804                         fill: 'none',
2805                         strokeLinecap: 'round',
2806                         strokeMiterlimit: 0.5
2807                     });
2808                 },
2809                 'AdhocMarker': function(p, element, position) {
2810                     var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
2811                         xScaleFactor: 1,
2812                         yScaleFactor: 1,
2813                         containerWidth: element.width,
2814                         containerHeight: element.height,
2815                         position: {
2816                             mx: ((element.width / 2 + position.adhoc) / element.width),
2817                             my: (element.height - 15) / element.height
2818                         }
2819                     });
2820
2821                     drawPath(p, loopPath, {
2822                         strokeWidth: 1,
2823                         fill: 'black'
2824                     });
2825                 }
2826             };
2827
2828             function attachTaskMarkers(p, element, taskMarkers) {
2829                 var obj = getSemantic(element);
2830
2831                 var subprocess = includes(taskMarkers, 'SubProcessMarker');
2832                 var position;
2833
2834                 if (subprocess) {
2835                     position = {
2836                         seq: -21,
2837                         parallel: -22,
2838                         compensation: -42,
2839                         loop: -18,
2840                         adhoc: 10
2841                     };
2842                 } else {
2843                     position = {
2844                         seq: -3,
2845                         parallel: -6,
2846                         compensation: -27,
2847                         loop: 0,
2848                         adhoc: 10
2849                     };
2850                 }
2851
2852                 forEach(taskMarkers, function(marker) {
2853                     renderer(marker)(p, element, position);
2854                 });
2855
2856                 if (obj.$type === 'bpmn:AdHocSubProcess') {
2857                     renderer('AdhocMarker')(p, element, position);
2858                 }
2859                 if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
2860                     renderer('LoopMarker')(p, element, position);
2861                     return;
2862                 }
2863                 if (obj.loopCharacteristics &&
2864                     obj.loopCharacteristics.isSequential !== undefined &&
2865                     !obj.loopCharacteristics.isSequential) {
2866                     renderer('ParallelMarker')(p, element, position);
2867                 }
2868                 if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
2869                     renderer('SequentialMarker')(p, element, position);
2870                 }
2871                 if (!!obj.isForCompensation) {
2872                     renderer('CompensationMarker')(p, element, position);
2873                 }
2874             }
2875
2876             function drawShape(parent, element) {
2877                 var type = element.type;
2878                 var h = handlers[type];
2879
2880                 /* jshint -W040 */
2881                 if (!h) {
2882                     return DefaultRenderer.prototype.drawShape.apply(this, [parent, element]);
2883                 } else {
2884                     return h(parent, element);
2885                 }
2886             }
2887
2888             function drawConnection(parent, element) {
2889                 var type = element.type;
2890                 var h = handlers[type];
2891
2892                 /* jshint -W040 */
2893                 if (!h) {
2894                     return DefaultRenderer.prototype.drawConnection.apply(this, [parent, element]);
2895                 } else {
2896                     return h(parent, element);
2897                 }
2898             }
2899
2900             function renderDataItemCollection(p, element) {
2901
2902                 var yPosition = (element.height - 16) / element.height;
2903
2904                 var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
2905                     xScaleFactor: 1,
2906                     yScaleFactor: 1,
2907                     containerWidth: element.width,
2908                     containerHeight: element.height,
2909                     position: {
2910                         mx: 0.451,
2911                         my: yPosition
2912                     }
2913                 });
2914
2915                 /* collection path */
2916                 drawPath(p, pathData, {
2917                     strokeWidth: 2
2918                 });
2919             }
2920
2921             function isCollection(element, filter) {
2922                 return element.isCollection ||
2923                     (element.elementObjectRef && element.elementObjectRef.isCollection);
2924             }
2925
2926             function getDi(element) {
2927                 return element.businessObject.di;
2928             }
2929
2930             function getSemantic(element) {
2931                 return element.businessObject;
2932             }
2933
2934             /**
2935              * Checks if eventDefinition of the given element matches with semantic
2936              * type.
2937              * 
2938              * @return {boolean} true if element is of the given semantic type
2939              */
2940             function isTypedEvent(event, eventDefinitionType, filter) {
2941
2942                 function matches(definition, filter) {
2943                     return every(filter, function(val, key) {
2944
2945                         // we want a == conversion here, to be able to catch
2946                         // undefined == false and friends
2947                         /* jshint -W116 */
2948                         return definition[key] == val;
2949                     });
2950                 }
2951
2952                 return some(event.eventDefinitions, function(definition) {
2953                     return definition.$type === eventDefinitionType && matches(event, filter);
2954                 });
2955             }
2956
2957             function isThrowEvent(event) {
2958                 return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
2959             }
2960
2961
2962             // ///// cropping path customizations /////////////////////////
2963
2964             function componentsToPath(elements) {
2965                 return elements.join(',').replace(/,?([A-z]),?/g, '$1');
2966             }
2967
2968             function getCirclePath(shape) {
2969
2970                 var cx = shape.x + shape.width / 2,
2971                     cy = shape.y + shape.height / 2,
2972                     radius = shape.width / 2;
2973
2974                 var circlePath = [
2975                     ['M', cx, cy],
2976                     ['m', 0, -radius],
2977                     ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
2978                     ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
2979                     ['z']
2980                 ];
2981
2982                 return componentsToPath(circlePath);
2983             }
2984
2985             function getRoundRectPath(shape) {
2986
2987                 var radius = TASK_BORDER_RADIUS,
2988                     x = shape.x,
2989                     y = shape.y,
2990                     width = shape.width,
2991                     height = shape.height;
2992
2993                 var roundRectPath = [
2994                     ['M', x + radius, y],
2995                     ['l', width - radius * 2, 0],
2996                     ['a', radius, radius, 0, 0, 1, radius, radius],
2997                     ['l', 0, height - radius * 2],
2998                     ['a', radius, radius, 0, 0, 1, -radius, radius],
2999                     ['l', radius * 2 - width, 0],
3000                     ['a', radius, radius, 0, 0, 1, -radius, -radius],
3001                     ['l', 0, radius * 2 - height],
3002                     ['a', radius, radius, 0, 0, 1, radius, -radius],
3003                     ['z']
3004                 ];
3005
3006                 return componentsToPath(roundRectPath);
3007             }
3008
3009             function getDiamondPath(shape) {
3010
3011                 var width = shape.width,
3012                     height = shape.height,
3013                     x = shape.x,
3014                     y = shape.y,
3015                     halfWidth = width / 2,
3016                     halfHeight = height / 2;
3017
3018                 var diamondPath = [
3019                     ['M', x + halfWidth, y],
3020                     ['l', halfWidth, halfHeight],
3021                     ['l', -halfWidth, halfHeight],
3022                     ['l', -halfWidth, -halfHeight],
3023                     ['z']
3024                 ];
3025
3026                 return componentsToPath(diamondPath);
3027             }
3028
3029             function getRectPath(shape) {
3030                 var x = shape.x,
3031                     y = shape.y,
3032                     width = shape.width,
3033                     height = shape.height;
3034
3035                 var rectPath = [
3036                     ['M', x, y],
3037                     ['l', width, 0],
3038                     ['l', 0, height],
3039                     ['l', -width, 0],
3040                     ['z']
3041                 ];
3042
3043                 return componentsToPath(rectPath);
3044             }
3045
3046             function getShapePath(element) {
3047                 var obj = getSemantic(element);
3048
3049                 if (obj.$instanceOf('bpmn:Event')) {
3050                     return getCirclePath(element);
3051                 }
3052
3053                 if (obj.$instanceOf('bpmn:Activity')) {
3054                     return getRoundRectPath(element);
3055                 }
3056
3057                 if (obj.$instanceOf('bpmn:Gateway')) {
3058                     return getDiamondPath(element);
3059                 }
3060
3061                 return getRectPath(element);
3062             }
3063
3064
3065             // hook onto canvas init event to initialize
3066             // connection start/end markers on svg
3067             events.on('canvas.init', function(event) {
3068                 initMarkers(event.svg);
3069             });
3070
3071             this.drawShape = drawShape;
3072             this.drawConnection = drawConnection;
3073
3074             this.getShapePath = getShapePath;
3075         }
3076
3077         inherits(BpmnRenderer, DefaultRenderer);
3078
3079
3080         BpmnRenderer.$inject = ['eventBus', 'styles', 'pathMap'];
3081
3082         module.exports = BpmnRenderer;
3083
3084     }, {
3085         "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
3086         "diagram-js/lib/draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
3087         "diagram-js/lib/util/Text": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js",
3088         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
3089         "lodash/collection/every": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js",
3090         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3091         "lodash/collection/includes": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js",
3092         "lodash/collection/some": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js",
3093         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
3094         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
3095         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3096     }],
3097     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js": [function(require, module, exports) {
3098         'use strict';
3099
3100         var Snap = require('diagram-js/vendor/snapsvg');
3101
3102         /**
3103          * Map containing SVG paths needed by BpmnRenderer.
3104          */
3105
3106         function PathMap() {
3107
3108             /**
3109              * Contains a map of path elements
3110              * 
3111              * <h1>Path definition</h1>
3112              * A parameterized path is defined like this:
3113              * 
3114              * <pre>
3115              * 'GATEWAY_PARALLEL': {
3116              *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3117              *           '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3118              *   height: 17.5,
3119              *   width:  17.5,
3120              *   heightElements: [2.5, 7.5],
3121              *   widthElements: [2.5, 7.5]
3122              * }
3123              * </pre>
3124              * 
3125              * <p>
3126              * It's important to specify a correct <b>height and width</b> for the path
3127              * as the scaling is based on the ratio between the specified height and
3128              * width in this object and the height and width that is set as scale target
3129              * (Note x,y coordinates will be scaled with individual ratios).
3130              * </p>
3131              * <p>
3132              * The '<b>heightElements</b>' and '<b>widthElements</b>' array must
3133              * contain the values that will be scaled. The scaling is based on the
3134              * computed ratios. Coordinates on the y axis should be in the
3135              * <b>heightElement</b>'s array, they will be scaled using the computed
3136              * ratio coefficient. In the parameterized path the scaled values can be
3137              * accessed through the 'e' object in {} brackets.
3138              * <ul>
3139              * <li>The values for the y axis can be accessed in the path string using
3140              * {e.y0}, {e.y1}, ....</li>
3141              * <li>The values for the x axis can be accessed in the path string using
3142              * {e.x0}, {e.x1}, ....</li>
3143              * </ul>
3144              * The numbers x0, x1 respectively y0, y1, ... map to the corresponding
3145              * array index.
3146              * </p>
3147              */
3148             this.pathMap = {
3149                 'EVENT_MESSAGE': {
3150                     d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
3151                     height: 36,
3152                     width: 36,
3153                     heightElements: [6, 14],
3154                     widthElements: [10.5, 21]
3155                 },
3156                 'EVENT_SIGNAL': {
3157                     d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
3158                     height: 36,
3159                     width: 36,
3160                     heightElements: [18],
3161                     widthElements: [10, 20]
3162                 },
3163                 'EVENT_ESCALATION': {
3164                     d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +
3165                         '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',
3166                     height: 36,
3167                     width: 36,
3168                     heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
3169                     widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
3170                 },
3171                 'EVENT_CONDITIONAL': {
3172                     d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
3173                         'M {e.x2},{e.y3} l {e.x0},0 ' +
3174                         'M {e.x2},{e.y4} l {e.x0},0 ' +
3175                         'M {e.x2},{e.y5} l {e.x0},0 ' +
3176                         'M {e.x2},{e.y6} l {e.x0},0 ' +
3177                         'M {e.x2},{e.y7} l {e.x0},0 ' +
3178                         'M {e.x2},{e.y8} l {e.x0},0 ',
3179                     height: 36,
3180                     width: 36,
3181                     heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
3182                     widthElements: [10.5, 14.5, 12.5]
3183                 },
3184                 'EVENT_LINK': {
3185                     d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
3186                     height: 36,
3187                     width: 36,
3188                     heightElements: [4.4375, 6.75, 7.8125],
3189                     widthElements: [9.84375, 13.5]
3190                 },
3191                 'EVENT_ERROR': {
3192                     d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
3193                     height: 36,
3194                     width: 36,
3195                     heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
3196                     widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
3197                 },
3198                 'EVENT_CANCEL_45': {
3199                     d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3200                         '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3201                     height: 36,
3202                     width: 36,
3203                     heightElements: [4.75, 8.5],
3204                     widthElements: [4.75, 8.5]
3205                 },
3206                 'EVENT_COMPENSATION': {
3207                     d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
3208                     height: 36,
3209                     width: 36,
3210                     heightElements: [5, 10],
3211                     widthElements: [10]
3212                 },
3213                 'EVENT_TIMER_WH': {
3214                     d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
3215                     height: 36,
3216                     width: 36,
3217                     heightElements: [10, 2],
3218                     widthElements: [3, 7]
3219                 },
3220                 'EVENT_TIMER_LINE': {
3221                     d: 'M {mx},{my} ' +
3222                         'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
3223                     height: 36,
3224                     width: 36,
3225                     heightElements: [10, 3],
3226                     widthElements: [0, 0]
3227                 },
3228                 'EVENT_MULTIPLE': {
3229                     d: 'm {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
3230                     height: 36,
3231                     width: 36,
3232                     heightElements: [6.28099, 12.56199],
3233                     widthElements: [3.1405, 9.42149, 12.56198]
3234                 },
3235                 'EVENT_PARALLEL_MULTIPLE': {
3236                     d: 'm {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3237                         '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3238                     height: 36,
3239                     width: 36,
3240                     heightElements: [2.56228, 7.68683],
3241                     widthElements: [2.56228, 7.68683]
3242                 },
3243                 'GATEWAY_EXCLUSIVE': {
3244                     d: 'm {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
3245                         '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
3246                         '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
3247                     height: 17.5,
3248                     width: 17.5,
3249                     heightElements: [8.5, 6.5312, -6.5312, -8.5],
3250                     widthElements: [6.5, -6.5, 3, -3, 5, -5]
3251                 },
3252                 'GATEWAY_PARALLEL': {
3253                     d: 'm {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3254                         '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3255                     height: 30,
3256                     width: 30,
3257                     heightElements: [5, 12.5],
3258                     widthElements: [5, 12.5]
3259                 },
3260                 'GATEWAY_EVENT_BASED': {
3261                     d: 'm {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
3262                     height: 11,
3263                     width: 11,
3264                     heightElements: [-6, 6, 12, -12],
3265                     widthElements: [9, -3, -12]
3266                 },
3267                 'GATEWAY_COMPLEX': {
3268                     d: 'm {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
3269                         '{e.x2},0  -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
3270                         '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
3271                         '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
3272                     height: 17.125,
3273                     width: 17.125,
3274                     heightElements: [4.875, 3.4375, 2.125, 3],
3275                     widthElements: [3.4375, 2.125, 4.875, 3]
3276                 },
3277                 'DATA_OBJECT_PATH': {
3278                     d: 'm 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
3279                     height: 61,
3280                     width: 51,
3281                     heightElements: [10, 50, 60],
3282                     widthElements: [10, 40, 50, 60]
3283                 },
3284                 'DATA_OBJECT_COLLECTION_PATH': {
3285                     d: 'm {mx}, {my} ' +
3286                         'm  0 15  l 0 -15 ' +
3287                         'm  4 15  l 0 -15 ' +
3288                         'm  4 15  l 0 -15 ',
3289                     height: 61,
3290                     width: 51,
3291                     heightElements: [12],
3292                     widthElements: [1, 6, 12, 15]
3293                 },
3294                 'DATA_ARROW': {
3295                     d: 'm 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
3296                     height: 61,
3297                     width: 51,
3298                     heightElements: [],
3299                     widthElements: []
3300                 },
3301                 'DATA_STORE': {
3302                     d: 'm  {mx},{my} ' +
3303                         'l  0,{e.y2} ' +
3304                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3305                         'l  0,-{e.y2} ' +
3306                         'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
3307                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3308                         'm  -{e.x2},{e.y0}' +
3309                         'c  {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
3310                         'm  -{e.x2},{e.y0}' +
3311                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0',
3312                     height: 61,
3313                     width: 61,
3314                     heightElements: [7, 10, 45],
3315                     widthElements: [2, 58, 60]
3316                 },
3317                 'TEXT_ANNOTATION': {
3318                     d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
3319                     height: 30,
3320                     width: 10,
3321                     heightElements: [30],
3322                     widthElements: [10]
3323                 },
3324                 'MARKER_SUB_PROCESS': {
3325                     d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
3326                     height: 10,
3327                     width: 10,
3328                     heightElements: [],
3329                     widthElements: []
3330                 },
3331                 'MARKER_PARALLEL': {
3332                     d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
3333                     height: 10,
3334                     width: 10,
3335                     heightElements: [],
3336                     widthElements: []
3337                 },
3338                 'MARKER_SEQUENTIAL': {
3339                     d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
3340                     height: 10,
3341                     width: 10,
3342                     heightElements: [],
3343                     widthElements: []
3344                 },
3345                 'MARKER_COMPENSATION': {
3346                     d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
3347                     height: 10,
3348                     width: 21,
3349                     heightElements: [],
3350                     widthElements: []
3351                 },
3352                 'MARKER_LOOP': {
3353                     d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
3354                         '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
3355                         '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
3356                         'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
3357                     height: 13.9,
3358                     width: 13.7,
3359                     heightElements: [],
3360                     widthElements: []
3361                 },
3362                 'MARKER_ADHOC': {
3363                     d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
3364                         '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
3365                         '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
3366                         '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
3367                         '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
3368                     height: 4,
3369                     width: 15,
3370                     heightElements: [],
3371                     widthElements: []
3372                 },
3373                 'TASK_TYPE_SEND': {
3374                     d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
3375                     height: 14,
3376                     width: 21,
3377                     heightElements: [6, 14],
3378                     widthElements: [10.5, 21]
3379                 },
3380                 'TASK_TYPE_SCRIPT': {
3381                     d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
3382                         'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
3383                         'm -7,-12 l 5,0 ' +
3384                         'm -4.5,3 l 4.5,0 ' +
3385                         'm -3,3 l 5,0' +
3386                         'm -4,3 l 5,0',
3387                     height: 15,
3388                     width: 12.6,
3389                     heightElements: [6, 14],
3390                     widthElements: [10.5, 21]
3391                 },
3392                 'TASK_TYPE_USER_1': {
3393                     d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
3394                         '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
3395                         '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
3396                         'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
3397                         'm -8,6 l 0,5.5 m 11,0 l 0,-5'
3398                 },
3399                 'TASK_TYPE_USER_2': {
3400                     d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
3401                         '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
3402                 },
3403                 'TASK_TYPE_USER_3': {
3404                     d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
3405                         '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
3406                         '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
3407                 },
3408                 'TASK_TYPE_MANUAL': {
3409                     d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
3410                         '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
3411                         '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
3412                         '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
3413                         '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
3414                         '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
3415                         '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
3416                         '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
3417                         '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
3418                         '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
3419                         '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
3420                         '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
3421                 },
3422                 'TASK_TYPE_INSTANTIATING_SEND': {
3423                     d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
3424                 },
3425                 'TASK_TYPE_SERVICE': {
3426                     d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
3427                         '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
3428                         '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
3429                         'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
3430                         '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
3431                         '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
3432                         'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
3433                         '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
3434                         'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
3435                         'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
3436                         '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
3437                         'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
3438                         'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3439                         '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3440                         '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3441                 },
3442                 'TASK_TYPE_SERVICE_FILL': {
3443                     d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3444                         '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3445                         '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3446                 },
3447                 'TASK_TYPE_BUSINESS_RULE_HEADER': {
3448                     d: 'm {mx},{my} 0,4 20,0 0,-4 z'
3449                 },
3450                 'TASK_TYPE_BUSINESS_RULE_MAIN': {
3451                     d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
3452                         'm 0,8 l 20,0 ' +
3453                         'm -13,-4 l 0,8'
3454                 },
3455                 'MESSAGE_FLOW_MARKER': {
3456                     d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
3457                 }
3458             };
3459
3460             this.getRawPath = function getRawPath(pathId) {
3461                 return this.pathMap[pathId].d;
3462             };
3463
3464             /**
3465              * Scales the path to the given height and width.
3466              * <h1>Use case</h1>
3467              * <p>
3468              * Use case is to scale the content of elements (event, gateways) based on
3469              * the element bounding box's size.
3470              * </p>
3471              * <h1>Why not transform</h1>
3472              * <p>
3473              * Scaling a path with transform() will also scale the stroke and IE does
3474              * not support the option 'non-scaling-stroke' to prevent this. Also there
3475              * are use cases where only some parts of a path should be scaled.
3476              * </p>
3477              * 
3478              * @param {String}
3479              *            pathId The ID of the path.
3480              * @param {Object}
3481              *            param
3482              *            <p>
3483              *            Example param object scales the path to 60% size of the
3484              *            container (data.width, data.height).
3485              * 
3486              * <pre>
3487              * {
3488              *  xScaleFactor : 0.6,
3489              *  yScaleFactor : 0.6,
3490              *  containerWidth : data.width,
3491              *  containerHeight : data.height,
3492              *  position : {
3493              *          mx : 0.46,
3494              *          my : 0.2,
3495              *  }
3496              * }
3497              * </pre>
3498              * 
3499              * <ul>
3500              *            <li>targetpathwidth = xScaleFactor * containerWidth</li>
3501              *            <li>targetpathheight = yScaleFactor * containerHeight</li>
3502              *            <li>Position is used to set the starting coordinate of the
3503              *            path. M is computed:
3504              *            <ul>
3505              *            <li>position.x * containerWidth</li>
3506              *            <li>position.y * containerHeight</li>
3507              *            </ul>
3508              *            Center of the container
3509              * 
3510              * <pre>
3511              *  position: {
3512              *       mx: 0.5,
3513              *       my: 0.5,
3514              *     }
3515              * </pre>
3516              * 
3517              * Upper left corner of the container
3518              * 
3519              * <pre>
3520              *  position: {
3521              *       mx: 0.0,
3522              *       my: 0.0,
3523              *     }
3524              * </pre>
3525              * 
3526              * </li>
3527              *            </ul>
3528              *            </p>
3529              * 
3530              */
3531             this.getScaledPath = function getScaledPath(pathId, param) {
3532                 var rawPath = this.pathMap[pathId];
3533
3534                 // positioning
3535                 // compute the start point of the path
3536                 var mx, my;
3537
3538                 if (!!param.abspos) {
3539                     mx = param.abspos.x;
3540                     my = param.abspos.y;
3541                 } else {
3542                     mx = param.containerWidth * param.position.mx;
3543                     my = param.containerHeight * param.position.my;
3544                 }
3545
3546                 var coordinates = {}; // map for the scaled coordinates
3547                 if (param.position) {
3548
3549                     // path
3550                     var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
3551                     var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
3552
3553
3554                     // Apply height ratio
3555                     for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
3556                         coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
3557                     }
3558
3559                     // Apply width ratio
3560                     for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
3561                         coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
3562                     }
3563                 }
3564
3565                 // Apply value to raw path
3566                 var path = Snap.format(
3567                     rawPath.d, {
3568                         mx: mx,
3569                         my: my,
3570                         e: coordinates
3571                     }
3572                 );
3573                 return path;
3574             };
3575         }
3576
3577         module.exports = PathMap;
3578
3579     }, {
3580         "diagram-js/vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
3581     }],
3582     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js": [function(require, module, exports) {
3583         module.exports = {
3584             renderer: ['type', require('./BpmnRenderer')],
3585             pathMap: ['type', require('./PathMap')]
3586         };
3587     }, {
3588         "./BpmnRenderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js",
3589         "./PathMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js"
3590     }],
3591     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js": [function(require, module, exports) {
3592         'use strict';
3593
3594
3595         var assign = require('lodash/object/assign'),
3596             forEach = require('lodash/collection/forEach');
3597
3598
3599         /**
3600          * A provider for BPMN 2.0 elements context pad
3601          */
3602         function ContextPadProvider(contextPad, modeling, elementFactory,
3603             connect, create, bpmnReplace,
3604             canvas) {
3605
3606             contextPad.registerProvider(this);
3607
3608             this._contextPad = contextPad;
3609
3610             this._modeling = modeling;
3611
3612             this._elementFactory = elementFactory;
3613             this._connect = connect;
3614             this._create = create;
3615             this._bpmnReplace = bpmnReplace;
3616             this._canvas = canvas;
3617         }
3618
3619         ContextPadProvider.$inject = [
3620             'contextPad',
3621             'modeling',
3622             'elementFactory',
3623             'connect',
3624             'create',
3625             'bpmnReplace',
3626             'canvas'
3627         ];
3628
3629         ContextPadProvider.prototype.getContextPadEntries = function(element) {
3630
3631             var contextPad = this._contextPad,
3632                 modeling = this._modeling,
3633
3634                 elementFactory = this._elementFactory,
3635                 connect = this._connect,
3636                 create = this._create,
3637                 bpmnReplace = this._bpmnReplace,
3638                 canvas = this._canvas;
3639
3640             var actions = {};
3641
3642             if (element.type === 'label') {
3643                 return actions;
3644             }
3645
3646             var bpmnElement = element.businessObject;
3647
3648             function startConnect(event, element, autoActivate) {
3649                 connect.start(event, element, autoActivate);
3650             }
3651
3652             function removeElement(e) {
3653               console.log(e);
3654                 if (element.waypoints) {
3655                     modeling.removeConnection(element);
3656                 } else {
3657                     modeling.removeShape(element);
3658                   
3659                 }
3660                 if(element.id == selected_decison_element)
3661                         {
3662                         
3663                         invisiblepropertyExplorer();
3664                         }
3665             }
3666
3667             function getReplaceMenuPosition(element) {
3668
3669                 var Y_OFFSET = 5;
3670
3671                 var diagramContainer = canvas.getContainer(),
3672                     pad = contextPad.getPad(element).html;
3673
3674                 var diagramRect = diagramContainer.getBoundingClientRect(),
3675                     padRect = pad.getBoundingClientRect();
3676
3677                 var top = padRect.top - diagramRect.top;
3678                 var left = padRect.left - diagramRect.left;
3679
3680                 var pos = {
3681                     x: left,
3682                     y: top + padRect.height + Y_OFFSET
3683                 };
3684
3685                 return pos;
3686             }
3687
3688            
3689             var change_color = function(par1,par2)
3690             {
3691                 if(isImportSchema == true){
3692
3693                         return par2/*'define-schema'*/;
3694                 }
3695                 else
3696                         {
3697                         return  par1/*'define-modify-schema'*/;
3698                         }
3699             }
3700             function appendAction(type, className, options) {
3701
3702                 function appendListener(event, element) {
3703
3704                     var shape = elementFactory.createShape(assign({
3705                         type: type
3706                     }, options));
3707                     create.start(event, shape, element);
3708                 }
3709
3710                 var shortType = type.replace(/^bpmn\:/, '');
3711
3712                 return {
3713                     group: 'model',
3714                     className: className,
3715                     title: 'Append ' + shortType,
3716                     action: {
3717                         dragstart: appendListener,
3718                         click: appendListener
3719                     }
3720                 };
3721             }
3722
3723
3724             if (bpmnElement.$instanceOf('bpmn:Gateway') || bpmnElement.$instanceOf('bpmn:MultiBranchConnector')) {
3725                 assign(actions, {
3726                     'define-path': {
3727                         group: 'DefinePath',
3728                         className: 'define-path',
3729                         title: 'Define/View Path',
3730                         action: {
3731                             click: function(event) {
3732                                                  
3733                                 if(bpmnElement.name){
3734                                                   var bpmnElementID = bpmnElement.id;
3735                                                 selected_decison_element = bpmnElementID;
3736                                                   var bpmnElementName = bpmnElement.name;
3737                                                 selected_element_name = bpmnElementName;
3738                                                   var pathIdentifiers = [];
3739                                                   
3740                                                   if (bpmnElement.outgoing) {
3741
3742                                                           var check_outgoing_names = true; 
3743                                                   forEach(bpmnElement.outgoing, function(og) {
3744                                                           
3745                                                           if(og.name && og.name.length !=0)
3746                                                                 {
3747                                                                   
3748                                                                                 pathIdentifiers.push(og.name);
3749                                                                 
3750                                                                  }
3751                                                           else
3752                                                                   {
3753                                                                 
3754                                                                                 errorProperty(bpmnElement.name+" out going path name was not entered");
3755                                                                                 check_outgoing_names=false;
3756                                                                   }
3757                                                           
3758                                                   });
3759                                                   if(check_outgoing_names)
3760                                                   {
3761                                                           
3762                                                                                 pathDetails(bpmnElementID,bpmnElementName,pathIdentifiers);
3763                                                   }
3764                                                   
3765                                                   
3766                                                         
3767                                                   }
3768                                                   else
3769                                                   {
3770                                                                         errorProperty(bpmnElement.name+' should atleast one output path was required');
3771                                                   }
3772                                                 
3773                             }
3774                                 else
3775                                         {
3776                                         errorProperty('Enter Valid Decision Name');
3777                                         }
3778                             }
3779                         }
3780                     }
3781                 });
3782             }
3783
3784             
3785
3786             if (bpmnElement.$instanceOf('bpmn:InitiateProcess')) {
3787             }
3788
3789                         if (bpmnElement.$instanceOf('bpmn:StartEvent')) {
3790             }
3791                         if (bpmnElement.$instanceOf('bpmn:Collector')) {
3792                 assign(actions, {
3793                     'Properties': {
3794                         group: 'clds',
3795                         label: 'Edit Properties',
3796                         className: 'clds-edit-properties',
3797                         title: 'Properties',
3798                         action: {
3799                             click: function(event) {
3800                                 lastElementSelected=bpmnElement.id
3801                                 CollectorsWindow(bpmnElement);
3802                             }
3803                         }
3804                     }
3805                 });
3806                                 
3807             }
3808                         if (bpmnElement.$instanceOf('bpmn:StringMatch')) {
3809                 assign(actions, {
3810                     'Properties': {
3811                         group: 'clds',
3812                         label: 'Edit Properties',
3813                         className: 'clds-edit-properties',
3814                         title: 'Properties',
3815                         action: {
3816                             click: function(event) {
3817                                 lastElementSelected=bpmnElement.id
3818                                 StringMatchWindow(bpmnElement);
3819                             }
3820                         }
3821                     }
3822                 });
3823       }
3824             
3825                         if (bpmnElement.$instanceOf('bpmn:TCA')) {
3826                 assign(actions, {
3827                     'Properties': {
3828                         group: 'clds',
3829                         label: 'Edit Properties',
3830                         className: 'clds-edit-properties',
3831                         title: 'Properties',
3832                         action: {
3833                             click: function(event) {
3834                               console.log(event);
3835                                 lastElementSelected=bpmnElement.id
3836                             }
3837                         }
3838                     }
3839                 });
3840             }
3841                         if (bpmnElement.$instanceOf('bpmn:GOC')) {
3842                 assign(actions, {
3843                     'Properties': {
3844                         group: 'clds',
3845                         label: 'Edit Properties',
3846                         className: 'clds-edit-properties',
3847                         title: 'Properties',
3848                         action: {
3849                             click: function(event) {
3850                                 lastElementSelected=bpmnElement.id
3851                                 GOCWindow();
3852                             }
3853                         }
3854                     }
3855                 });
3856             }
3857                         if (bpmnElement.$instanceOf('bpmn:Policy')) {
3858                 assign(actions, {
3859                     'Properties': {
3860                         group: 'clds',
3861                         label: 'Edit Properties',
3862                         className: 'clds-edit-properties',
3863                         title: 'Properties',
3864                         action: {
3865                             click: function(event) {
3866                                 lastElementSelected=bpmnElement.id
3867                                 PolicyWindow(bpmnElement);
3868                             }
3869                         }
3870                     }
3871                 });
3872             }
3873
3874             if (bpmnElement.$instanceOf('bpmn:FlowNode') ||
3875                 bpmnElement.$instanceOf('bpmn:InteractionNode')) {
3876
3877                 assign(actions, {
3878                     'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),
3879
3880                     'connect': {
3881                         group: 'connect',
3882                         className: 'icon-connection',
3883                         title: 'Connector',
3884                         action: {
3885                             click: startConnect,
3886                             dragstart: startConnect
3887                         }
3888                     }
3889                 });
3890             }
3891                         
3892                         // Delete Element Entry
3893             assign(actions, {
3894                 'delete': {
3895                     group: 'edits',
3896                     className: 'icon-trash',
3897                     title: 'Remove',
3898                     action: {
3899                         click: removeElement,
3900                         dragstart: removeElement
3901                     }
3902                 }
3903
3904
3905
3906             });
3907
3908             return actions;
3909         };
3910
3911         function isEventType(eventBo, type, definition) {
3912
3913             var isType = eventBo.$instanceOf(type);
3914             var isDefinition = false;
3915
3916             var definitions = eventBo.eventDefinitions || [];
3917             forEach(definitions, function(def) {
3918                 if (def.$type === definition) {
3919                     isDefinition = true;
3920                 }
3921             });
3922
3923             return isType && isDefinition;
3924         }
3925
3926
3927         module.exports = ContextPadProvider;
3928
3929     }, {
3930         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3931         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3932     }],
3933     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
3934         module.exports = {
3935             __depends__: [
3936                 require('diagram-js-direct-editing'),
3937                 require('diagram-js/lib/features/context-pad'),
3938                 require('diagram-js/lib/features/selection'),
3939                 require('diagram-js/lib/features/connect'),
3940                 require('diagram-js/lib/features/create'),
3941                 require('../replace')
3942             ],
3943             __init__: ['contextPadProvider'],
3944             contextPadProvider: ['type', require('./ContextPadProvider')]
3945         };
3946     }, {
3947         "../replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js",
3948         "./ContextPadProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js",
3949         "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
3950         "diagram-js/lib/features/connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js",
3951         "diagram-js/lib/features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js",
3952         "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
3953         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
3954     }],
3955     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js": [function(require, module, exports) {
3956         'use strict';
3957
3958
3959         function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
3960                 
3961             keyboard.addListener(function(key, modifiers) {
3962                 
3963                 if (keyboard.hasModifier(modifiers)) {
3964                     return;
3965                 }
3966
3967                 // S -> activate space tool
3968                 if (key === 83) {
3969                     spaceTool.activateSelection();
3970
3971                     return true;
3972                 }
3973
3974                 // L -> activate lasso tool
3975                 if (key === 108) {
3976                     lassoTool.activateSelection();
3977
3978                     return true;
3979                 }
3980
3981                 var currentSelection = selection.get();
3982
3983                 // E -> activate direct editing
3984                 if (key === 69) {
3985                     if (currentSelection.length) {
3986                         directEditing.activate(currentSelection[0]);
3987                     }
3988
3989                     return true;
3990                 }
3991             });
3992         }
3993
3994         BpmnKeyBindings.$inject = ['keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection'];
3995
3996         module.exports = BpmnKeyBindings;
3997     }, {}],
3998     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
3999         module.exports = {
4000             __depends__: [
4001                 require('diagram-js/lib/features/keyboard')
4002             ],
4003             __init__: ['bpmnKeyBindings'],
4004             bpmnKeyBindings: ['type', require('./BpmnKeyBindings')]
4005         };
4006     }, {
4007         "./BpmnKeyBindings": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js",
4008         "diagram-js/lib/features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js"
4009     }],
4010     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js": [function(require, module, exports) {
4011         'use strict';
4012
4013         var UpdateLabelHandler = require('./cmd/UpdateLabelHandler');
4014
4015         var LabelUtil = require('./LabelUtil');
4016
4017         var is = require('../../util/ModelUtil').is,
4018             isExpanded = require('../../util/DiUtil').isExpanded;
4019
4020         var daOriginalLabel = '';
4021
4022         var MIN_BOUNDS = {
4023             width: 150,
4024             height: 50
4025         };
4026
4027
4028         function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {
4029
4030             directEditing.registerProvider(this);
4031             commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);
4032
4033             // listen to dblclick on non-root elements
4034             eventBus.on('element.dblclick', function(event) {
4035                 
4036                 directEditing.activate(event.element);
4037             });
4038             
4039
4040             // complete on followup canvas operation
4041             eventBus.on(['element.mousedown', 'drag.activate', 'canvas.viewbox.changed'], function(event) {
4042                 directEditing.complete();
4043             });
4044
4045             // cancel on command stack changes
4046             eventBus.on(['commandStack.changed'], function() {
4047                 directEditing.cancel();
4048             });
4049
4050
4051             // activate direct editing for activities and text annotations
4052
4053
4054             if ('ontouchstart' in document.documentElement) {
4055                 // we deactivate automatic label editing on mobile devices
4056                 // as it breaks the user interaction workflow
4057
4058                 // TODO(nre): we should temporarily focus the edited element here
4059                 // and release the focused viewport after the direct edit operation is
4060                 // finished
4061             } else {
4062                 eventBus.on('create.end', 500, function(e) {
4063
4064                     var element = e.shape,
4065                         canExecute = e.context.canExecute;
4066
4067                     if (!canExecute) {
4068                         return;
4069                     }
4070
4071                     if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||
4072                         (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {
4073
4074                         directEditing.activate(element);
4075                     }
4076                 });
4077             }
4078
4079             this._canvas = canvas;
4080             this._commandStack = commandStack;
4081         }
4082
4083         LabelEditingProvider.$inject = ['eventBus', 'canvas', 'directEditing', 'commandStack', 'injector'];
4084
4085         module.exports = LabelEditingProvider;
4086
4087
4088         LabelEditingProvider.prototype.activate = function(element) {
4089
4090             var text = LabelUtil.getLabel(element);
4091
4092             if (text === undefined) {
4093                 return;
4094             }
4095
4096             daOriginalLabel = text;
4097             
4098             var bbox = this.getEditingBBox(element);
4099
4100             // adjust for expanded pools AND lanes
4101             if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {
4102
4103                 bbox.width = MIN_BOUNDS.width;
4104                 bbox.height = MIN_BOUNDS.height;
4105
4106                 bbox.x = bbox.x + 10 - bbox.width / 2;
4107                 bbox.y = bbox.mid.y - bbox.height / 2;
4108             }
4109
4110             // adjust for expanded sub processes
4111             if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {
4112
4113                 bbox.height = MIN_BOUNDS.height;
4114
4115                 bbox.x = bbox.mid.x - bbox.width / 2;
4116                 bbox.y = bbox.y + 10 - bbox.height / 2;
4117             }
4118
4119             return {
4120                 bounds: bbox,
4121                 text: text
4122             };
4123         };
4124
4125
4126         LabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {
4127
4128             var target = element.label || element;
4129
4130             var bbox = this._canvas.getAbsoluteBBox(target);
4131
4132             var mid = {
4133                 x: bbox.x + bbox.width / 2,
4134                 y: bbox.y + bbox.height / 2
4135             };
4136
4137             // external label
4138             if (target.labelTarget) {
4139                 bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);
4140                 bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);
4141
4142                 bbox.x = mid.x - bbox.width / 2;
4143             }
4144
4145             bbox.mid = mid;
4146
4147             return bbox;
4148         };
4149
4150
4151         LabelEditingProvider.prototype.update = function(element, newLabel) {
4152                 //update conditional node
4153                 if (is(element, 'bpmn:ExclusiveGateway') || is(element, 'bpmn:MultiBranchConnector')){
4154                         updateDecisionLabel(daOriginalLabel, newLabel);
4155                 }
4156                 
4157                 this._commandStack.execute('element.updateLabel', {
4158                 element: element,
4159                 newLabel: newLabel
4160             });
4161         };
4162     }, {
4163         "../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
4164         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4165         "./LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js",
4166         "./cmd/UpdateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js"
4167     }],
4168     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js": [function(require, module, exports) {
4169         'use strict';
4170
4171         function getLabelAttr(semantic) {
4172             if (semantic.$instanceOf('bpmn:FlowElement') ||
4173                 semantic.$instanceOf('bpmn:Participant') ||
4174                 semantic.$instanceOf('bpmn:Lane') ||
4175                 semantic.$instanceOf('bpmn:SequenceFlow') ||
4176                 semantic.$instanceOf('bpmn:MessageFlow')) {
4177                 return 'name';
4178             }
4179
4180             if (semantic.$instanceOf('bpmn:TextAnnotation')) {
4181                 return 'text';
4182             }
4183         }
4184
4185         module.exports.getLabel = function(element) {
4186             var semantic = element.businessObject,
4187                 attr = getLabelAttr(semantic);
4188
4189             if (attr) {
4190                 return semantic[attr] || '';
4191             }
4192         };
4193
4194
4195         module.exports.setLabel = function(element, text) {
4196             var semantic = element.businessObject,
4197                 attr = getLabelAttr(semantic);
4198
4199             if (attr) {
4200                 semantic[attr] = text;
4201             }
4202
4203             var label = element.label || element;
4204
4205             // show label
4206             label.hidden = false;
4207
4208             return label;
4209         };
4210     }, {}],
4211     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js": [function(require, module, exports) {
4212         'use strict';
4213
4214         var LabelUtil = require('../LabelUtil');
4215
4216
4217         /**
4218          * A handler that updates the text of a BPMN element.
4219          * 
4220          * @param {EventBus}
4221          *            eventBus
4222          */
4223         function UpdateTextHandler(eventBus) {
4224
4225             function setText(element, text) {
4226                 var label = LabelUtil.setLabel(element, text);
4227
4228                 eventBus.fire('element.changed', {
4229                     element: label
4230                 });
4231             }
4232
4233             function execute(ctx) {
4234                 ctx.oldLabel = LabelUtil.getLabel(ctx.element);
4235                 return setText(ctx.element, ctx.newLabel);
4236             }
4237
4238             function revert(ctx) {
4239                 return setText(ctx.element, ctx.oldLabel);
4240             }
4241
4242
4243             function canExecute(ctx) {
4244                 return true;
4245             }
4246
4247             // API
4248
4249             this.execute = execute;
4250             this.revert = revert;
4251
4252             this.canExecute = canExecute;
4253         }
4254
4255
4256         UpdateTextHandler.$inject = ['eventBus'];
4257
4258         module.exports = UpdateTextHandler;
4259     }, {
4260         "../LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js"
4261     }],
4262     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js": [function(require, module, exports) {
4263         module.exports = {
4264             __depends__: [
4265                 require('diagram-js/lib/command'),
4266                 require('diagram-js/lib/features/change-support'),
4267                 require('diagram-js-direct-editing')
4268             ],
4269             __init__: ['labelEditingProvider'],
4270             labelEditingProvider: ['type', require('./LabelEditingProvider')]
4271         };
4272     }, {
4273         "./LabelEditingProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js",
4274         "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4275         "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
4276         "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js"
4277     }],
4278     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js": [function(require, module, exports) {
4279         'use strict';
4280
4281         var map = require('lodash/collection/map'),
4282             assign = require('lodash/object/assign'),
4283             pick = require('lodash/object/pick');
4284
4285
4286         function BpmnFactory(moddle) {
4287             this._model = moddle;
4288         }
4289
4290         BpmnFactory.$inject = ['moddle'];
4291
4292
4293         BpmnFactory.prototype._needsId = function(element) {
4294             return element.$instanceOf('bpmn:RootElement') ||
4295                 element.$instanceOf('bpmn:FlowElement') ||
4296                 element.$instanceOf('bpmn:MessageFlow') ||
4297                 element.$instanceOf('bpmn:Artifact') ||
4298                 element.$instanceOf('bpmn:Participant') ||
4299                 element.$instanceOf('bpmn:Process') ||
4300                 element.$instanceOf('bpmn:Collaboration') ||
4301                 element.$instanceOf('bpmndi:BPMNShape') ||
4302                 element.$instanceOf('bpmndi:BPMNEdge') ||
4303                 element.$instanceOf('bpmndi:BPMNDiagram') ||
4304                 element.$instanceOf('bpmndi:BPMNPlane');
4305         };
4306
4307         BpmnFactory.prototype._ensureId = function(element) {
4308
4309             // generate semantic ids for elements
4310             // bpmn:SequenceFlow -> SequenceFlow_ID
4311             var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';
4312
4313             if (!element.id && this._needsId(element)) {
4314                 element.id = this._model.ids.nextPrefixed(prefix, element);
4315             }
4316         };
4317
4318
4319         BpmnFactory.prototype.create = function(type, attrs) {
4320             var element = this._model.create(type, attrs || {});
4321
4322             this._ensureId(element);
4323
4324             return element;
4325         };
4326
4327
4328         BpmnFactory.prototype.createDiLabel = function() {
4329             return this.create('bpmndi:BPMNLabel', {
4330                 bounds: this.createDiBounds()
4331             });
4332         };
4333
4334
4335         BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
4336
4337             return this.create('bpmndi:BPMNShape', assign({
4338                 bpmnElement: semantic,
4339                 bounds: this.createDiBounds(bounds)
4340             }, attrs));
4341         };
4342
4343
4344         BpmnFactory.prototype.createDiBounds = function(bounds) {
4345             return this.create('dc:Bounds', bounds);
4346         };
4347
4348
4349         BpmnFactory.prototype.createDiWaypoints = function(waypoints) {
4350             return map(waypoints, function(pos) {
4351                 return this.createDiWaypoint(pos);
4352             }, this);
4353         };
4354
4355         BpmnFactory.prototype.createDiWaypoint = function(point) {
4356             return this.create('dc:Point', pick(point, ['x', 'y']));
4357         };
4358
4359
4360         BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
4361             return this.create('bpmndi:BPMNEdge', assign({
4362                 bpmnElement: semantic
4363             }, attrs));
4364         };
4365
4366         BpmnFactory.prototype.createDiPlane = function(semantic) {
4367             return this.create('bpmndi:BPMNPlane', {
4368                 bpmnElement: semantic
4369             });
4370         };
4371
4372         module.exports = BpmnFactory;
4373
4374     }, {
4375         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
4376         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
4377         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
4378     }],
4379     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js": [function(require, module, exports) {
4380         'use strict';
4381
4382         var inherits = require('inherits');
4383
4384         var assign = require('lodash/object/assign');
4385
4386         var BaseLayouter = require('diagram-js/lib/layout/BaseLayouter'),
4387             LayoutUtil = require('diagram-js/lib/layout/LayoutUtil'),
4388             ManhattanLayout = require('diagram-js/lib/layout/ManhattanLayout');
4389
4390         var is = require('../../util/ModelUtil').is;
4391
4392
4393         function BpmnLayouter() {}
4394
4395         inherits(BpmnLayouter, BaseLayouter);
4396
4397         module.exports = BpmnLayouter;
4398
4399
4400         function getAttachment(waypoints, idx, shape) {
4401             var point = waypoints && waypoints[idx];
4402
4403             return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);
4404         }
4405
4406
4407         BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
4408             var source = connection.source,
4409                 target = connection.target,
4410                 waypoints = connection.waypoints,
4411                 start,
4412                 end;
4413
4414             var layoutManhattan,
4415                 updatedWaypoints;
4416
4417             start = getAttachment(waypoints, 0, source);
4418             end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);
4419
4420             // manhattan layout sequence / message flows
4421             if (is(connection, 'bpmn:MessageFlow')) {
4422                 layoutManhattan = {
4423                     preferStraight: true,
4424                     preferVertical: true
4425                 };
4426             }
4427
4428             if (is(connection, 'bpmn:SequenceFlow')) {
4429                 layoutManhattan = {};
4430             }
4431
4432             if (layoutManhattan) {
4433
4434                 layoutManhattan = assign(layoutManhattan, hints);
4435
4436                 updatedWaypoints =
4437                     ManhattanLayout.repairConnection(
4438                         source, target, start, end,
4439                         waypoints,
4440                         layoutManhattan);
4441             }
4442
4443             return updatedWaypoints || [start, end];
4444         };
4445     }, {
4446         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4447         "diagram-js/lib/layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
4448         "diagram-js/lib/layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
4449         "diagram-js/lib/layout/ManhattanLayout": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js",
4450         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4451         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4452     }],
4453     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js": [function(require, module, exports) {
4454         'use strict';
4455
4456         var assign = require('lodash/object/assign'),
4457             forEach = require('lodash/collection/forEach'),
4458             inherits = require('inherits');
4459
4460         var Collections = require('diagram-js/lib/util/Collections'),
4461             Model = require('diagram-js/lib/model');
4462
4463         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
4464
4465
4466         /**
4467          * A handler responsible for updating the underlying BPMN 2.0 XML + DI once
4468          * changes on the diagram happen
4469          */
4470         function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
4471
4472             CommandInterceptor.call(this, eventBus);
4473
4474             this._bpmnFactory = bpmnFactory;
4475
4476             var self = this;
4477
4478
4479
4480             // //// connection cropping /////////////////////////
4481
4482             // crop connection ends during create/update
4483             function cropConnection(e) {
4484                 var context = e.context,
4485                     connection;
4486
4487                 if (!context.cropped) {
4488                     connection = context.connection;
4489                     connection.waypoints = connectionDocking.getCroppedWaypoints(connection);
4490                     context.cropped = true;
4491                 }
4492             }
4493
4494             this.executed([
4495                 'connection.layout',
4496                 'connection.create',
4497                 'connection.reconnectEnd',
4498                 'connection.reconnectStart'
4499             ], cropConnection);
4500
4501             this.reverted(['connection.layout'], function(e) {
4502                 delete e.context.cropped;
4503             });
4504
4505
4506
4507             // //// BPMN + DI update /////////////////////////
4508
4509
4510             // update parent
4511             function updateParent(e) {
4512                 self.updateParent(e.context.shape || e.context.connection);
4513             }
4514
4515             this.executed(['shape.move',
4516                 'shape.create',
4517                 'shape.delete',
4518                 'connection.create',
4519                 'connection.move',
4520                 'connection.delete'
4521             ], updateParent);
4522             this.reverted(['shape.move',
4523                 'shape.create',
4524                 'shape.delete',
4525                 'connection.create',
4526                 'connection.move',
4527                 'connection.delete'
4528             ], updateParent);
4529
4530             /*
4531              * ## Updating Parent
4532              * 
4533              * When morphing a Process into a Collaboration or vice-versa, make sure
4534              * that both the *semantic* and *di* parent of each element is updated.
4535              * 
4536              */
4537             function updateRoot(event) {
4538                 var context = event.context,
4539                     oldRoot = context.oldRoot,
4540                     children = oldRoot.children;
4541
4542                 forEach(children, function(child) {
4543                     self.updateParent(child);
4544                 });
4545             }
4546
4547             this.executed(['canvas.updateRoot'], updateRoot);
4548             this.reverted(['canvas.updateRoot'], updateRoot);
4549
4550
4551             // update bounds
4552             function updateBounds(e) {
4553                 self.updateBounds(e.context.shape);
4554             }
4555
4556             this.executed(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4557             this.reverted(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4558
4559
4560             // attach / detach connection
4561             function updateConnection(e) {
4562                 self.updateConnection(e.context.connection);
4563             }
4564
4565             this.executed([
4566                 'connection.create',
4567                 'connection.move',
4568                 'connection.delete',
4569                 'connection.reconnectEnd',
4570                 'connection.reconnectStart'
4571             ], updateConnection);
4572
4573             this.reverted([
4574                 'connection.create',
4575                 'connection.move',
4576                 'connection.delete',
4577                 'connection.reconnectEnd',
4578                 'connection.reconnectStart'
4579             ], updateConnection);
4580
4581
4582             // update waypoints
4583             function updateConnectionWaypoints(e) {
4584                 self.updateConnectionWaypoints(e.context.connection);
4585             }
4586
4587             this.executed([
4588                 'connection.layout',
4589                 'connection.move',
4590                 'connection.updateWaypoints',
4591                 'connection.reconnectEnd',
4592                 'connection.reconnectStart'
4593             ], updateConnectionWaypoints);
4594
4595             this.reverted([
4596                 'connection.layout',
4597                 'connection.move',
4598                 'connection.updateWaypoints',
4599                 'connection.reconnectEnd',
4600                 'connection.reconnectStart'
4601             ], updateConnectionWaypoints);
4602         }
4603
4604         inherits(BpmnUpdater, CommandInterceptor);
4605
4606         module.exports = BpmnUpdater;
4607
4608         BpmnUpdater.$inject = ['eventBus', 'bpmnFactory', 'connectionDocking'];
4609
4610
4611         // ///// implementation //////////////////////////////////
4612
4613
4614         BpmnUpdater.prototype.updateParent = function(element) {
4615
4616             // do not update BPMN 2.0 label parent
4617             if (element instanceof Model.Label) {
4618                 return;
4619             }
4620
4621             var parentShape = element.parent;
4622
4623             var businessObject = element.businessObject,
4624                 parentBusinessObject = parentShape && parentShape.businessObject,
4625                 parentDi = parentBusinessObject && parentBusinessObject.di;
4626
4627             this.updateSemanticParent(businessObject, parentBusinessObject);
4628
4629             this.updateDiParent(businessObject.di, parentDi);
4630         };
4631
4632
4633         BpmnUpdater.prototype.updateBounds = function(shape) {
4634
4635             var di = shape.businessObject.di;
4636
4637             var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;
4638
4639             assign(bounds, {
4640                 x: shape.x,
4641                 y: shape.y,
4642                 width: shape.width,
4643                 height: shape.height
4644             });
4645         };
4646
4647
4648         BpmnUpdater.prototype.updateDiParent = function(di, parentDi) {
4649
4650             if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {
4651                 parentDi = parentDi.$parent;
4652             }
4653
4654             if (di.$parent === parentDi) {
4655                 return;
4656             }
4657
4658             var planeElements = (parentDi || di.$parent).get('planeElement');
4659
4660             if (parentDi) {
4661                 planeElements.push(di);
4662                 di.$parent = parentDi;
4663             } else {
4664                 Collections.remove(planeElements, di);
4665                 di.$parent = null;
4666             }
4667         };
4668
4669         function getDefinitions(element) {
4670             while (element && !element.$instanceOf('bpmn:Definitions')) {
4671                 element = element.$parent;
4672             }
4673
4674             return element;
4675         }
4676
4677         BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {
4678
4679             var containment;
4680
4681             if (businessObject.$parent === newParent) {
4682                 return;
4683             }
4684
4685             if (businessObject.$instanceOf('bpmn:FlowElement')) {
4686
4687                 if (newParent && newParent.$instanceOf('bpmn:Participant')) {
4688                     newParent = newParent.processRef;
4689                 }
4690
4691                 containment = 'flowElements';
4692
4693             } else
4694
4695             if (businessObject.$instanceOf('bpmn:Artifact')) {
4696
4697                 while (newParent &&
4698                     !newParent.$instanceOf('bpmn:Process') &&
4699                     !newParent.$instanceOf('bpmn:SubProcess') &&
4700                     !newParent.$instanceOf('bpmn:Collaboration')) {
4701
4702                     if (newParent.$instanceOf('bpmn:Participant')) {
4703                         newParent = newParent.processRef;
4704                         break;
4705                     } else {
4706                         newParent = newParent.$parent;
4707                     }
4708                 }
4709
4710                 containment = 'artifacts';
4711             } else
4712
4713             if (businessObject.$instanceOf('bpmn:MessageFlow')) {
4714                 containment = 'messageFlows';
4715
4716             } else
4717
4718             if (businessObject.$instanceOf('bpmn:Participant')) {
4719                 containment = 'participants';
4720
4721                 // make sure the participants process is properly attached / detached
4722                 // from the XML document
4723
4724                 var process = businessObject.processRef,
4725                     definitions;
4726
4727                 if (process) {
4728                     definitions = getDefinitions(businessObject.$parent || newParent);
4729
4730                     if (businessObject.$parent) {
4731                         Collections.remove(definitions.get('rootElements'), process);
4732                         process.$parent = null;
4733                     }
4734
4735                     if (newParent) {
4736                         Collections.add(definitions.get('rootElements'), process);
4737                         process.$parent = definitions;
4738                     }
4739                 }
4740             }
4741
4742             if (!containment) {
4743                 throw new Error('no parent for ', businessObject, newParent);
4744             }
4745
4746             var children;
4747
4748             if (businessObject.$parent) {
4749                 // remove from old parent
4750                 children = businessObject.$parent.get(containment);
4751                 Collections.remove(children, businessObject);
4752             }
4753
4754             if (!newParent) {
4755                 businessObject.$parent = null;
4756             } else {
4757                 // add to new parent
4758                 children = newParent.get(containment);
4759                 children.push(businessObject);
4760                 businessObject.$parent = newParent;
4761             }
4762         };
4763
4764
4765         BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {
4766
4767             connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4768         };
4769
4770
4771         BpmnUpdater.prototype.updateConnection = function(connection) {
4772
4773             var businessObject = connection.businessObject,
4774                 newSource = connection.source && connection.source.businessObject,
4775                 newTarget = connection.target && connection.target.businessObject;
4776
4777             var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');
4778
4779             if (businessObject.sourceRef !== newSource) {
4780                 if (inverseSet) {
4781                     Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);
4782
4783                     if (newSource) {
4784                         newSource.get('outgoing').push(businessObject);
4785                     }
4786                 }
4787
4788                 businessObject.sourceRef = newSource;
4789             }
4790             if (businessObject.targetRef !== newTarget) {
4791                 if (inverseSet) {
4792                     Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);
4793
4794                     if (newTarget) {
4795                         newTarget.get('incoming').push(businessObject);
4796                     }
4797                 }
4798
4799                 businessObject.targetRef = newTarget;
4800             }
4801
4802             businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4803         };
4804
4805
4806         // ///// helpers /////////////////////////////////////////
4807
4808         BpmnUpdater.prototype._getLabel = function(di) {
4809             if (!di.label) {
4810                 di.label = this._bpmnFactory.createDiLabel();
4811             }
4812
4813             return di.label;
4814         };
4815     }, {
4816         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
4817         "diagram-js/lib/model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
4818         "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
4819         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4820         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
4821         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4822     }],
4823     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js": [function(require, module, exports) {
4824         'use strict';
4825
4826         var assign = require('lodash/object/assign'),
4827             inherits = require('inherits');
4828
4829         var BaseElementFactory = require('diagram-js/lib/core/ElementFactory'),
4830             LabelUtil = require('../../util/LabelUtil');
4831
4832
4833         /**
4834          * A bpmn-aware factory for diagram-js shapes
4835          */
4836         function ElementFactory(bpmnFactory, moddle) {
4837             BaseElementFactory.call(this);
4838
4839             this._bpmnFactory = bpmnFactory;
4840             this._moddle = moddle;
4841         }
4842
4843         inherits(ElementFactory, BaseElementFactory);
4844
4845
4846         ElementFactory.$inject = ['bpmnFactory', 'moddle'];
4847
4848         module.exports = ElementFactory;
4849
4850         ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;
4851
4852         ElementFactory.prototype.create = function(elementType, attrs) {
4853
4854             // no special magic for labels,
4855             // we assume their businessObjects have already been created
4856             // and wired via attrs
4857             if (elementType === 'label') {
4858                 return this.baseCreate(elementType, assign({
4859                     type: 'label'
4860                 }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
4861             }
4862
4863             attrs = attrs || {};
4864
4865             var businessObject = attrs.businessObject,
4866                 size;
4867
4868             if (!businessObject) {
4869                 if (!attrs.type) {
4870                     throw new Error('no shape type specified');
4871                 }
4872
4873                 businessObject = this._bpmnFactory.create(attrs.type);
4874             }
4875
4876             if (!businessObject.di) {
4877                 if (elementType === 'root') {
4878                     businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
4879                         id: businessObject.id + '_di'
4880                     });
4881                 } else
4882                 if (elementType === 'connection') {
4883                     businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
4884                         id: businessObject.id + '_di'
4885                     });
4886                 } else {
4887                     businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {
4888                         id: businessObject.id + '_di'
4889                     });
4890                 }
4891             }
4892
4893             if (!!attrs.isExpanded) {
4894                 businessObject.di.isExpanded = attrs.isExpanded;
4895             }
4896
4897             /*
4898              * if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {
4899              * businessObject.di.isMarkerVisible = true; }
4900              */
4901
4902             if (attrs._eventDefinitionType) {
4903                 var eventDefinitions = businessObject.get('eventDefinitions') || [],
4904                     newEventDefinition = this._moddle.create(attrs._eventDefinitionType);
4905
4906                 eventDefinitions.push(newEventDefinition);
4907                 businessObject.eventDefinitions = eventDefinitions;
4908             }
4909
4910             size = this._getDefaultSize(businessObject);
4911
4912             attrs = assign({
4913                 businessObject: businessObject,
4914                 id: businessObject.id
4915             }, size, attrs);
4916
4917             return this.baseCreate(elementType, attrs);
4918         };
4919
4920
4921         ElementFactory.prototype._getDefaultSize = function(semantic) {
4922
4923             if (semantic.$instanceOf('bpmn:SubProcess')) {
4924                 var isExpanded = semantic.di.isExpanded === true;
4925
4926                 if (isExpanded) {
4927                     return {
4928                         width: 350,
4929                         height: 200
4930                     };
4931                 } else {
4932                     return {
4933                         width: 100,
4934                         height: 80
4935                     };
4936                 }
4937             }
4938
4939             if (semantic.$instanceOf('bpmn:InitiateProcess')) {
4940                 return {
4941                     width: 120,
4942                     height: 80
4943                 };
4944             }
4945             if (semantic.$instanceOf('bpmn:Collector')) {
4946                 return {
4947                     width: 120,
4948                     height: 80
4949                 };
4950             }
4951         
4952                         if (semantic.$instanceOf('bpmn:StringMatch')) {
4953                 return {
4954                     width: 120,
4955                     height: 80
4956                 };
4957       }
4958                         if (semantic.$instanceOf('bpmn:VesCollector')) {
4959                 return {
4960                     width: 120,
4961                     height: 80
4962                 };
4963             }
4964             
4965                         
4966                         if (semantic.$instanceOf('bpmn:TCA')) {
4967                 return {
4968                     width: 120,
4969                     height: 80
4970                 };
4971             }
4972                         
4973                         if (semantic.$instanceOf('bpmn:Policy')) {
4974                 return {
4975                     width: 120,
4976                     height: 80
4977                 };
4978             }
4979                         
4980                         if (semantic.$instanceOf('bpmn:GOC')) {
4981                 return {
4982                     width: 120,
4983                     height: 80
4984                 };
4985             }
4986             if (semantic.$instanceOf('bpmn:ParentReturn')) {
4987                 return {
4988                     width: 100,
4989                     height: 80
4990                 };
4991             }
4992             if (semantic.$instanceOf('bpmn:SubProcessCall')) {
4993                 return {
4994                     width: 100,
4995                     height: 80
4996                 };
4997             }
4998
4999             if (semantic.$instanceOf('bpmn:ExclusiveGateway')) {
5000                 return {
5001                     width: 100,
5002                     height: 80
5003                 };
5004             }
5005
5006             if (semantic.$instanceOf('bpmn:Task')) {
5007                 return {
5008                     width: 100,
5009                     height: 80
5010                 };
5011             }
5012
5013             if (semantic.$instanceOf('bpmn:Gateway')) {
5014                 return {
5015                     width: 100,
5016                     height: 100
5017                 };
5018             }
5019
5020             if (semantic.$instanceOf('bpmn:Event')) {
5021                 return {
5022                     width: 36,
5023                     height: 36
5024                 };
5025             }
5026
5027             if (semantic.$instanceOf('bpmn:Participant')) {
5028                 return {
5029                     width: 100,
5030                     height: 80
5031                 };
5032             }
5033
5034             return {
5035                 width: 100,
5036                 height: 80
5037             };
5038         };
5039
5040
5041         ElementFactory.prototype.createParticipantShape = function(collapsed) {
5042             // alert("entering createParticipantShape");
5043             var participantShape = this.createShape({
5044                 type: 'bpmn:Participant'
5045             });
5046
5047             if (!collapsed) {
5048                 participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
5049             }
5050
5051             return participantShape;
5052         };
5053     }, {
5054         "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5055         "diagram-js/lib/core/ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
5056         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5057         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5058     }],
5059     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js": [function(require, module, exports) {
5060         'use strict';
5061
5062         var assign = require('lodash/object/assign'),
5063             forEach = require('lodash/collection/forEach');
5064
5065         var LabelUtil = require('../../util/LabelUtil');
5066
5067         var hasExternalLabel = LabelUtil.hasExternalLabel,
5068             getExternalLabelMid = LabelUtil.getExternalLabelMid;
5069
5070
5071         function LabelSupport(eventBus, modeling, bpmnFactory) {
5072
5073             // create external labels on shape creation
5074
5075             eventBus.on([
5076                 'commandStack.shape.create.postExecute',
5077                 'commandStack.connection.create.postExecute'
5078             ], function(e) {
5079                 var context = e.context;
5080
5081                 var element = context.shape || context.connection,
5082                     businessObject = element.businessObject;
5083
5084                 var position;
5085
5086                 if (hasExternalLabel(businessObject)) {
5087                     position = getExternalLabelMid(element);
5088                     modeling.createLabel(element, position, {
5089                         id: businessObject.id + '_label',
5090                         businessObject: businessObject
5091                     });
5092                 }
5093             });
5094
5095
5096             //move label when connection/shape is being moved
5097             //if shape is being moved, get connection as element
5098             
5099             eventBus.on(['commandStack.connection.create.postExecute',
5100                          'commandStack.connection.move.postExecute',
5101                          //'commandStack.connection.delete.postExecute',
5102                          'commandStack.connection.reconnectEnd.postExecute',
5103                          'commandStack.connection.reconnectStart.postExecute',
5104                          'commandStack.connection.updateWaypoints.postExecute',
5105                          'shape.move.end'
5106                      ],function(e){
5107                                 
5108                                 var context = e.context;
5109                                 var element;
5110                                 
5111                                 if(context.allDraggedElements != null){
5112                                         if(context.allDraggedElements.length > 0){
5113                                                 element = context.allDraggedElements[1];
5114                                         }
5115                                 }else{
5116                                         element = context.connection;
5117                                 }
5118                                 
5119                                 if(element==null){
5120                                         return;
5121                                 }
5122                 
5123                                 var businessObject = element.businessObject;
5124                                 
5125                                 if(businessObject.$type != 'bpmn:SequenceFlow'){
5126                                         return;
5127                                 }
5128                                 
5129                                 var position;
5130                 
5131                                 if (hasExternalLabel(businessObject)) {
5132                                     position = getExternalLabelMid(element);
5133                                     modeling.removeShape(element.label);
5134                                     modeling.createLabel(element, position, {
5135                                         id: businessObject.id + '_label',
5136                                         businessObject: businessObject
5137                                     });
5138                                 }
5139                 
5140             });
5141             
5142             
5143             // indicate label is dragged during move
5144
5145             // we need to add labels to the list of selected
5146             // shapes before the visuals get drawn.
5147             //
5148             // Hence this awesome magic number.
5149             //
5150             eventBus.on('shape.move.start', function(e) {
5151
5152                 var context = e.context,
5153                     shapes = context.shapes;
5154
5155                 var labels = [];
5156
5157                 forEach(shapes, function(element) {
5158                     var label = element.label;
5159
5160                     if (label && !label.hidden && context.shapes.indexOf(label) === -1) {
5161                         labels.push(label);
5162                     }
5163                 });
5164
5165                 forEach(labels, function(label) {
5166                     shapes.push(label);
5167                 });
5168             });
5169
5170
5171             // move labels with shapes
5172
5173             eventBus.on([
5174                 'commandStack.shapes.move.postExecute'
5175             ], function(e) {
5176
5177                 var context = e.context,
5178                     closure = context.closure,
5179                     enclosedElements = closure.enclosedElements;
5180
5181                 // ensure we move all labels with their respective elements
5182                 // if they have not been moved already
5183
5184                 forEach(enclosedElements, function(e) {
5185                     if (e.label && !enclosedElements[e.label.id]) {
5186                         modeling.moveShape(e.label, context.delta, e.parent);
5187                     }
5188                 });
5189             });
5190
5191
5192             // update di information on label movement and creation
5193
5194             eventBus.on([
5195                 'commandStack.label.create.executed',
5196                 'commandStack.shape.moved.executed'
5197             ], function(e) {
5198
5199                 var element = e.context.shape,
5200                     businessObject = element.businessObject,
5201                     di = businessObject.di;
5202
5203                 // we want to trigger on real labels only
5204                 if (!element.labelTarget) {
5205                     return;
5206                 }
5207
5208                 if (!di.label) {
5209                     di.label = bpmnFactory.create('bpmndi:BPMNLabel', {
5210                         bounds: bpmnFactory.create('dc:Bounds')
5211                     });
5212                 }
5213
5214                 assign(di.label.bounds, {
5215                     x: element.x,
5216                     y: element.y,
5217                     width: element.width,
5218                     height: element.height
5219                 });
5220             });
5221         }
5222
5223         LabelSupport.$inject = ['eventBus', 'modeling', 'bpmnFactory'];
5224
5225         module.exports = LabelSupport;
5226
5227     }, {
5228         "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5229         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
5230         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5231     }],
5232     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
5233         'use strict';
5234
5235         var inherits = require('inherits');
5236
5237         var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
5238
5239         var UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler'),
5240             UpdateCanvasRootHandler = require('./cmd/UpdateCanvasRootHandler');
5241
5242
5243         /**
5244          * BPMN 2.0 modeling features activator
5245          * 
5246          * @param {EventBus}
5247          *            eventBus
5248          * @param {ElementFactory}
5249          *            elementFactory
5250          * @param {CommandStack}
5251          *            commandStack
5252          * @param {BpmnRules}
5253          *            bpmnRules
5254          */
5255         function Modeling(eventBus, elementFactory, commandStack, bpmnRules) {
5256             BaseModeling.call(this, eventBus, elementFactory, commandStack);
5257
5258             this._bpmnRules = bpmnRules;
5259         }
5260
5261         inherits(Modeling, BaseModeling);
5262
5263         Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack', 'bpmnRules'];
5264
5265         module.exports = Modeling;
5266
5267
5268         Modeling.prototype.getHandlers = function() {
5269             var handlers = BaseModeling.prototype.getHandlers.call(this);
5270
5271             handlers['element.updateProperties'] = UpdatePropertiesHandler;
5272             handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;
5273
5274             return handlers;
5275         };
5276
5277
5278         Modeling.prototype.updateLabel = function(element, newLabel) {
5279             this._commandStack.execute('element.updateLabel', {
5280                 element: element,
5281                 newLabel: newLabel
5282             });
5283         };
5284
5285
5286         var getSharedParent = require('./ModelingUtil').getSharedParent;
5287
5288         Modeling.prototype.connect = function(source, target, attrs) {
5289
5290             var bpmnRules = this._bpmnRules;
5291
5292             if (!attrs) {
5293                 if (bpmnRules.canConnectMessageFlow(source, target)) {
5294                     attrs = {
5295                         type: 'bpmn:MessageFlow'
5296                     };
5297                 } else
5298                 if (bpmnRules.canConnectSequenceFlow(source, target)) {
5299                     attrs = {
5300                         type: 'bpmn:SequenceFlow'
5301                     };
5302                 } else {
5303                     attrs = {
5304                         type: 'bpmn:Association'
5305                     };
5306                 }
5307             }
5308
5309             return this.createConnection(source, target, attrs, getSharedParent(source, target));
5310         };
5311
5312
5313         Modeling.prototype.updateProperties = function(element, properties) {
5314             this._commandStack.execute('element.updateProperties', {
5315                 element: element,
5316                 properties: properties
5317             });
5318         };
5319
5320
5321         /**
5322          * Transform the current diagram into a collaboration.
5323          * 
5324          * @return {djs.model.Root} the new root element
5325          */
5326         Modeling.prototype.makeCollaboration = function() {
5327
5328             var collaborationElement = this._create('root', {
5329                 type: 'bpmn:Collaboration'
5330             });
5331
5332             var context = {
5333                 newRoot: collaborationElement
5334             };
5335
5336             this._commandStack.execute('canvas.updateRoot', context);
5337
5338             return collaborationElement;
5339         };
5340
5341         /**
5342          * Transform the current diagram into a process.
5343          * 
5344          * @return {djs.model.Root} the new root element
5345          */
5346         Modeling.prototype.makeProcess = function() {
5347
5348             var processElement = this._create('root', {
5349                 type: 'bpmn:Process'
5350             });
5351
5352             var context = {
5353                 newRoot: processElement
5354             };
5355
5356             this._commandStack.execute('canvas.updateRoot', context);
5357         };
5358     }, {
5359         "./ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5360         "./cmd/UpdateCanvasRootHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js",
5361         "./cmd/UpdatePropertiesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js",
5362         "diagram-js/lib/features/modeling/Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js",
5363         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5364     }],
5365     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js": [function(require, module, exports) {
5366         'use strict';
5367
5368         var find = require('lodash/collection/find');
5369
5370
5371         function getParents(element) {
5372
5373             var parents = [];
5374
5375             while (element) {
5376                 element = element.parent;
5377
5378                 if (element) {
5379                     parents.push(element);
5380                 }
5381             }
5382
5383             return parents;
5384         }
5385
5386         module.exports.getParents = getParents;
5387
5388
5389         function getSharedParent(a, b) {
5390
5391             var parentsA = getParents(a),
5392                 parentsB = getParents(b);
5393
5394             return find(parentsA, function(parent) {
5395                 return parentsB.indexOf(parent) !== -1;
5396             });
5397         }
5398
5399         module.exports.getSharedParent = getSharedParent;
5400     }, {
5401         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js"
5402     }],
5403     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js": [function(require, module, exports) {
5404         'use strict';
5405
5406         var inherits = require('inherits');
5407
5408         var is = require('../../../util/ModelUtil').is;
5409
5410         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5411
5412
5413         function AppendBehavior(eventBus, elementFactory, bpmnRules) {
5414
5415             CommandInterceptor.call(this, eventBus);
5416
5417             // assign correct shape position unless already set
5418
5419             this.preExecute('shape.append', function(context) {
5420
5421                 var source = context.source,
5422                     shape = context.shape;
5423
5424                 if (!context.position) {
5425
5426                     if (is(shape, 'bpmn:TextAnnotation')) {
5427                         context.position = {
5428                             x: source.x + source.width / 2 + 75,
5429                             y: source.y - (50) - shape.height / 2
5430                         };
5431                     } else {
5432                         context.position = {
5433                             x: source.x + source.width + 80 + shape.width / 2,
5434                             y: source.y + source.height / 2
5435                         };
5436                     }
5437                 }
5438             }, true);
5439         }
5440
5441
5442         AppendBehavior.$inject = ['eventBus', 'elementFactory', 'bpmnRules'];
5443
5444         inherits(AppendBehavior, CommandInterceptor);
5445
5446         module.exports = AppendBehavior;
5447     }, {
5448         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5449         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5450         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5451     }],
5452     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js": [function(require, module, exports) {
5453         'use strict';
5454
5455         var inherits = require('inherits');
5456
5457         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5458
5459         var is = require('../../../util/ModelUtil').is;
5460
5461         /**
5462          * BPMN specific create behavior
5463          */
5464         function CreateBehavior(eventBus, modeling) {
5465
5466             CommandInterceptor.call(this, eventBus);
5467
5468
5469             /**
5470              * morph process into collaboration before adding participant onto
5471              * collaboration
5472              */
5473
5474             this.preExecute('shape.create', function(context) {
5475
5476                 var parent = context.parent,
5477                     shape = context.shape,
5478                     position = context.position;
5479
5480                 if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {
5481
5482                     // this is going to detach the process root
5483                     // and set the returned collaboration element
5484                     // as the new root element
5485                     var collaborationElement = modeling.makeCollaboration();
5486
5487                     // monkey patch the create context
5488                     // so that the participant is being dropped
5489                     // onto the new collaboration root instead
5490                     context.position = position;
5491                     context.parent = collaborationElement;
5492
5493                     context.processRoot = parent;
5494                 }
5495             }, true);
5496
5497             this.execute('shape.create', function(context) {
5498
5499                 var processRoot = context.processRoot,
5500                     shape = context.shape;
5501
5502                 if (processRoot) {
5503                     context.oldProcessRef = shape.businessObject.processRef;
5504
5505                     // assign the participant processRef
5506                     shape.businessObject.processRef = processRoot.businessObject;
5507                 }
5508             }, true);
5509
5510             this.revert('shape.create', function(context) {
5511                 var processRoot = context.processRoot,
5512                     shape = context.shape;
5513
5514                 if (processRoot) {
5515                     // assign the participant processRef
5516                     shape.businessObject.processRef = context.oldProcessRef;
5517                 }
5518             }, true);
5519
5520             this.postExecute('shape.create', function(context) {
5521                                 
5522                 var processRoot = context.processRoot,
5523                     shape = context.shape;
5524
5525                 if (processRoot) {
5526                     // process root is already detached at this point
5527                     var processChildren = processRoot.children.slice();
5528                     modeling.moveShapes(processChildren, {
5529                         x: 0,
5530                         y: 0
5531                     }, shape);
5532                 }
5533                                 //console.log(context.shape.id);
5534                                 //newElementProcessor(context.shape.id);
5535                                 //console.log(context)
5536             }, true);
5537                         
5538         }
5539
5540         CreateBehavior.$inject = ['eventBus', 'modeling'];
5541
5542         inherits(CreateBehavior, CommandInterceptor);
5543
5544         module.exports = CreateBehavior;
5545     }, {
5546         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5547         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5548         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5549     }],
5550     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js": [function(require, module, exports) {
5551         'use strict';
5552
5553         var forEach = require('lodash/collection/forEach'),
5554             inherits = require('inherits');
5555
5556         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5557
5558         var is = require('../../../util/ModelUtil').is,
5559             getSharedParent = require('../ModelingUtil').getSharedParent;
5560
5561
5562         function DropBehavior(eventBus, modeling, bpmnRules) {
5563
5564             CommandInterceptor.call(this, eventBus);
5565
5566             // remove sequence flows that should not be allowed
5567             // after a move operation
5568
5569             this.postExecute('shapes.move', function(context) {
5570
5571                 var closure = context.closure,
5572                     allConnections = closure.allConnections;
5573
5574                 forEach(allConnections, function(c) {
5575
5576                     var source = c.source,
5577                         target = c.target;
5578
5579                     var replacementType,
5580                         remove;
5581
5582                     /**
5583                      * Check if incoming or outgoing connections can stay or could be
5584                      * substituted with an appropriate replacement.
5585                      * 
5586                      * This holds true for SequenceFlow <> MessageFlow.
5587                      */
5588
5589                     if (is(c, 'bpmn:SequenceFlow')) {
5590                         if (!bpmnRules.canConnectSequenceFlow(source, target)) {
5591                             remove = true;
5592                         }
5593
5594                         if (bpmnRules.canConnectMessageFlow(source, target)) {
5595                             replacementType = 'bpmn:MessageFlow';
5596                         }
5597                     }
5598
5599                     // transform message flows into sequence flows, if possible
5600
5601                     if (is(c, 'bpmn:MessageFlow')) {
5602
5603                         if (!bpmnRules.canConnectMessageFlow(source, target)) {
5604                             remove = true;
5605                         }
5606
5607                         if (bpmnRules.canConnectSequenceFlow(source, target)) {
5608                             replacementType = 'bpmn:SequenceFlow';
5609                         }
5610                     }
5611
5612                     if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
5613                         remove = true;
5614                     }
5615
5616
5617                     // remove invalid connection
5618                     if (remove) {
5619                         modeling.removeConnection(c);
5620                     }
5621
5622                     // replace SequenceFlow <> MessageFlow
5623
5624                     if (replacementType) {
5625                         modeling.createConnection(source, target, {
5626                             type: replacementType,
5627                             waypoints: c.waypoints.slice()
5628                         }, getSharedParent(source, target));
5629                     }
5630                 });
5631             }, true);
5632         }
5633
5634         inherits(DropBehavior, CommandInterceptor);
5635
5636         DropBehavior.$inject = ['eventBus', 'modeling', 'bpmnRules'];
5637
5638         module.exports = DropBehavior;
5639     }, {
5640         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5641         "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5642         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5643         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5644         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
5645     }],
5646     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js": [function(require, module, exports) {
5647         'use strict';
5648
5649         var is = require('../../../util/ModelUtil').is;
5650
5651
5652         function ModelingFeedback(eventBus, tooltips) {
5653
5654             function showError(position, message) {
5655                 tooltips.add({
5656                     position: {
5657                         x: position.x + 5,
5658                         y: position.y + 5
5659                     },
5660                     type: 'error',
5661                     timeout: 2000,
5662                     html: '<div>' + message + '</div>'
5663                 });
5664             }
5665
5666             eventBus.on(['shape.move.rejected', 'create.rejected'], function(event) {
5667
5668                 var context = event.context,
5669                     shape = context.shape,
5670                     target = context.target;
5671
5672                 if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {
5673                     showError(event, 'flow elements must be children of pools/participants');
5674                 }
5675             });
5676
5677         }
5678
5679
5680         ModelingFeedback.$inject = ['eventBus', 'tooltips'];
5681
5682         module.exports = ModelingFeedback;
5683     }, {
5684         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
5685     }],
5686     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js": [function(require, module, exports) {
5687         'use strict';
5688
5689         var inherits = require('inherits');
5690
5691         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5692
5693         var is = require('../../../util/ModelUtil').is;
5694
5695
5696         /**
5697          * BPMN specific remove behavior
5698          */
5699         function RemoveBehavior(eventBus, modeling) {
5700
5701             CommandInterceptor.call(this, eventBus);
5702
5703
5704             /**
5705              * morph collaboration diagram into process diagram after the last
5706              * participant has been removed
5707              */
5708
5709             this.preExecute('shape.delete', function(context) {
5710                                 //delete elementMap[context.shape.id];
5711                                 //console.log(context.shape.id);
5712                 var shape = context.shape,
5713                     parent = shape.parent;
5714
5715                 // activate the behavior if the shape to be removed
5716                 // is a participant
5717                 if (is(shape, 'bpmn:Participant')) {
5718                     context.collaborationRoot = parent;
5719                 }
5720             }, true);
5721
5722             this.postExecute('shape.delete', function(context) {
5723
5724                 var collaborationRoot = context.collaborationRoot;
5725
5726                 if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
5727                     // replace empty collaboration with process diagram
5728                     modeling.makeProcess();
5729                 }
5730             }, true);
5731
5732         }
5733
5734         RemoveBehavior.$inject = ['eventBus', 'modeling'];
5735
5736         inherits(RemoveBehavior, CommandInterceptor);
5737
5738         module.exports = RemoveBehavior;
5739     }, {
5740         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5741         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5742         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5743     }],
5744     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js": [function(require, module, exports) {
5745         module.exports = {
5746             __init__: [
5747                 'appendBehavior',
5748                 'createBehavior',
5749                 'dropBehavior',
5750                 'removeBehavior',
5751                 'modelingFeedback'
5752             ],
5753             appendBehavior: ['type', require('./AppendBehavior')],
5754             dropBehavior: ['type', require('./DropBehavior')],
5755             createBehavior: ['type', require('./CreateBehavior')],
5756             removeBehavior: ['type', require('./RemoveBehavior')],
5757             modelingFeedback: ['type', require('./ModelingFeedback')]
5758         };
5759     }, {
5760         "./AppendBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js",
5761         "./CreateBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js",
5762         "./DropBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js",
5763         "./ModelingFeedback": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js",
5764         "./RemoveBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js"
5765     }],
5766     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js": [function(require, module, exports) {
5767         'use strict';
5768
5769         var Collections = require('diagram-js/lib/util/Collections');
5770
5771
5772         function UpdateCanvasRootHandler(canvas, modeling) {
5773             this._canvas = canvas;
5774             this._modeling = modeling;
5775         }
5776
5777         UpdateCanvasRootHandler.$inject = ['canvas', 'modeling'];
5778
5779         module.exports = UpdateCanvasRootHandler;
5780
5781
5782         UpdateCanvasRootHandler.prototype.execute = function(context) {
5783
5784             var canvas = this._canvas;
5785
5786             var newRoot = context.newRoot,
5787                 newRootBusinessObject = newRoot.businessObject,
5788                 oldRoot = canvas.getRootElement(),
5789                 oldRootBusinessObject = oldRoot.businessObject,
5790                 bpmnDefinitions = oldRootBusinessObject.$parent,
5791                 diPlane = oldRootBusinessObject.di;
5792
5793             // (1) replace process old <> new root
5794             canvas.setRootElement(newRoot, true);
5795
5796             // (2) update root elements
5797             Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);
5798             newRootBusinessObject.$parent = bpmnDefinitions;
5799
5800             Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);
5801             oldRootBusinessObject.$parent = null;
5802
5803             // (3) wire di
5804             oldRootBusinessObject.di = null;
5805
5806             diPlane.bpmnElement = newRootBusinessObject;
5807             newRootBusinessObject.di = diPlane;
5808
5809             context.oldRoot = oldRoot;
5810         };
5811
5812
5813         UpdateCanvasRootHandler.prototype.revert = function(context) {
5814
5815             var canvas = this._canvas;
5816
5817             var newRoot = context.newRoot,
5818                 newRootBusinessObject = newRoot.businessObject,
5819                 oldRoot = context.oldRoot,
5820                 oldRootBusinessObject = oldRoot.businessObject,
5821                 bpmnDefinitions = newRootBusinessObject.$parent,
5822                 diPlane = newRootBusinessObject.di;
5823
5824             // (1) replace process old <> new root
5825             canvas.setRootElement(oldRoot, true);
5826
5827             // (2) update root elements
5828             Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);
5829             newRootBusinessObject.$parent = null;
5830
5831             Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);
5832             oldRootBusinessObject.$parent = bpmnDefinitions;
5833
5834             // (3) wire di
5835             newRootBusinessObject.di = null;
5836
5837             diPlane.bpmnElement = oldRootBusinessObject;
5838             oldRootBusinessObject.di = diPlane;
5839         };
5840     }, {
5841         "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
5842     }],
5843     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js": [function(require, module, exports) {
5844         'use strict';
5845
5846         var assign = require('lodash/object/assign'),
5847             pick = require('lodash/object/pick'),
5848             keys = require('lodash/object/keys');
5849
5850         var DEFAULT_FLOW = 'default',
5851             NAME = 'name',
5852             ID = 'id';
5853
5854
5855         /**
5856          * A handler that implements a BPMN 2.0 property update.
5857          * 
5858          * This should be used to set simple properties on elements with an underlying
5859          * BPMN business object.
5860          * 
5861          * Use respective diagram-js provided handlers if you would like to perform
5862          * automated modeling.
5863          */
5864         function UpdatePropertiesHandler(elementRegistry) {
5865             this._elementRegistry = elementRegistry;
5866         }
5867
5868         UpdatePropertiesHandler.$inject = ['elementRegistry'];
5869
5870         module.exports = UpdatePropertiesHandler;
5871
5872
5873         // //// api /////////////////////////////////////////////
5874
5875         /**
5876          * Updates a BPMN element with a list of new properties
5877          * 
5878          * @param {Object}
5879          *            context
5880          * @param {djs.model.Base}
5881          *            context.element the element to update
5882          * @param {Object}
5883          *            context.properties a list of properties to set on the element's
5884          *            businessObject (the BPMN model element)
5885          * 
5886          * @return {Array<djs.mode.Base>} the updated element
5887          */
5888         UpdatePropertiesHandler.prototype.execute = function(context) {
5889
5890             var element = context.element,
5891                 changed = [element];
5892
5893             if (!element) {
5894                 throw new Error('element required');
5895             }
5896
5897             var elementRegistry = this._elementRegistry;
5898
5899             var businessObject = element.businessObject,
5900                 properties = context.properties,
5901                 oldProperties = context.oldProperties || pick(businessObject, keys(properties));
5902
5903             if (ID in properties) {
5904                 elementRegistry.updateId(element, properties[ID]);
5905             }
5906
5907             // correctly indicate visual changes on default flow updates
5908             if (DEFAULT_FLOW in properties) {
5909
5910                 if (properties[DEFAULT_FLOW]) {
5911                     changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));
5912                 }
5913
5914                 if (businessObject[DEFAULT_FLOW]) {
5915                     changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));
5916                 }
5917             }
5918
5919             if (NAME in properties && element.label) {
5920                 changed.push(element.label);
5921             }
5922
5923             // update properties
5924             assign(businessObject, properties);
5925
5926
5927             // store old values
5928             context.oldProperties = oldProperties;
5929             context.changed = changed;
5930
5931             // indicate changed on objects affected by the update
5932             return changed;
5933         };
5934
5935         /**
5936          * Reverts the update on a BPMN elements properties.
5937          * 
5938          * @param {Object}
5939          *            context
5940          * 
5941          * @return {djs.mode.Base} the updated element
5942          */
5943         UpdatePropertiesHandler.prototype.revert = function(context) {
5944
5945             var element = context.element,
5946                 oldProperties = context.oldProperties,
5947                 businessObject = element.businessObject,
5948                 elementRegistry = this._elementRegistry;
5949
5950             assign(businessObject, context.oldProperties);
5951
5952             if (ID in oldProperties) {
5953                 elementRegistry.updateId(element, oldProperties[ID]);
5954             }
5955
5956             return context.changed;
5957         };
5958     }, {
5959         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
5960         "lodash/object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
5961         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
5962     }],
5963     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
5964         module.exports = {
5965             __init__: ['modeling', 'bpmnUpdater', 'labelSupport'],
5966             __depends__: [
5967                 require('../label-editing'),
5968                 require('./rules'),
5969                 require('./behavior'),
5970                 require('diagram-js/lib/command'),
5971                 require('diagram-js/lib/features/tooltips'),
5972                 require('diagram-js/lib/features/change-support')
5973             ],
5974             bpmnFactory: ['type', require('./BpmnFactory')],
5975             bpmnUpdater: ['type', require('./BpmnUpdater')],
5976             elementFactory: ['type', require('./ElementFactory')],
5977             modeling: ['type', require('./Modeling')],
5978             labelSupport: ['type', require('./LabelSupport')],
5979             layouter: ['type', require('./BpmnLayouter')],
5980             connectionDocking: ['type', require('diagram-js/lib/layout/CroppingConnectionDocking')]
5981         };
5982
5983     }, {
5984         "../label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
5985         "./BpmnFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js",
5986         "./BpmnLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js",
5987         "./BpmnUpdater": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js",
5988         "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js",
5989         "./LabelSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js",
5990         "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js",
5991         "./behavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js",
5992         "./rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js",
5993         "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
5994         "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
5995         "diagram-js/lib/features/tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js",
5996         "diagram-js/lib/layout/CroppingConnectionDocking": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js"
5997     }],
5998     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js": [function(require, module, exports) {
5999         'use strict';
6000
6001         var groupBy = require('lodash/collection/groupBy'),
6002             size = require('lodash/collection/size'),
6003             find = require('lodash/collection/find'),
6004             inherits = require('inherits');
6005
6006         var getParents = require('../ModelingUtil').getParents,
6007             is = require('../../../util/ModelUtil').is,
6008             getBusinessObject = require('../../../util/ModelUtil').getBusinessObject,
6009             isExpanded = require('../../../util/DiUtil').isExpanded;
6010
6011
6012         var RuleProvider = require('diagram-js/lib/features/rules/RuleProvider');
6013
6014         /**
6015          * BPMN specific modeling rule
6016          */
6017         function BpmnRules(eventBus) {
6018             RuleProvider.call(this, eventBus);
6019         }
6020
6021         inherits(BpmnRules, RuleProvider);
6022
6023         BpmnRules.$inject = ['eventBus'];
6024
6025         module.exports = BpmnRules;
6026
6027         BpmnRules.prototype.init = function() {
6028
6029             this.addRule('connection.create', function(context) {
6030                 var source = context.source,
6031                     target = context.target;
6032
6033                 return canConnect(source, target);
6034             });
6035
6036             this.addRule('connection.reconnectStart', function(context) {
6037
6038                 var connection = context.connection,
6039                     source = context.hover || context.source,
6040                     target = connection.target;
6041
6042                 return canConnect(source, target, connection);
6043             });
6044
6045             this.addRule('connection.reconnectEnd', function(context) {
6046
6047                 var connection = context.connection,
6048                     source = connection.source,
6049                     target = context.hover || context.target;
6050
6051                 return canConnect(source, target, connection);
6052             });
6053
6054             this.addRule('connection.updateWaypoints', function(context) {
6055                 // OK! but visually ignore
6056                 return null;
6057             });
6058
6059             this.addRule('shape.resize', function(context) {
6060
6061                 var shape = context.shape,
6062                     newBounds = context.newBounds;
6063
6064                 return canResize(shape, newBounds);
6065             });
6066
6067             this.addRule('shapes.move', function(context) {
6068
6069                 var target = context.newParent,
6070                     shapes = context.shapes;
6071
6072                 return canMove(shapes, target);
6073             });
6074
6075             this.addRule(['shape.create', 'shape.append'], function(context) {
6076                 var target = context.parent,
6077                     shape = context.shape,
6078                     source = context.source;
6079
6080                 return canCreate(shape, target, source);
6081             });
6082
6083         };
6084
6085         BpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;
6086
6087         BpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;
6088
6089         BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
6090
6091         BpmnRules.prototype.canMove = canMove;
6092
6093         BpmnRules.prototype.canDrop = canDrop;
6094
6095         BpmnRules.prototype.canCreate = canCreate;
6096
6097         BpmnRules.prototype.canConnect = canConnect;
6098
6099         BpmnRules.prototype.canResize = canResize;
6100
6101         /**
6102          * Utility functions for rule checking
6103          */
6104
6105         function nonExistantOrLabel(element) {
6106             return !element || isLabel(element);
6107         }
6108
6109         function isSame(a, b) {
6110             return a === b;
6111         }
6112
6113         function getOrganizationalParent(element) {
6114
6115             var bo = getBusinessObject(element);
6116
6117             while (bo && !is(bo, 'bpmn:Process')) {
6118                 if (is(bo, 'bpmn:Participant')) {
6119                     return bo.processRef || bo;
6120                 }
6121
6122                 bo = bo.$parent;
6123             }
6124
6125             return bo;
6126         }
6127
6128         function isSameOrganization(a, b) {
6129             var parentA = getOrganizationalParent(a),
6130                 parentB = getOrganizationalParent(b);
6131
6132             return parentA === parentB;
6133         }
6134
6135         function isMessageFlowSource(element) {
6136             return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6137                 is(element, 'bpmn:ThrowEvent') &&
6138                 hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6139             ));
6140         }
6141
6142         function isMessageFlowTarget(element) {
6143             return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6144                 is(element, 'bpmn:CatchEvent') &&
6145                 hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6146             ));
6147         }
6148
6149         function getScopeParent(element) {
6150
6151             var bo = getBusinessObject(element);
6152
6153             if (is(bo, 'bpmn:Participant')) {
6154                 return null;
6155             }
6156
6157             while (bo) {
6158                 bo = bo.$parent;
6159
6160                 if (is(bo, 'bpmn:FlowElementsContainer')) {
6161                     return bo;
6162                 }
6163             }
6164
6165             return bo;
6166         }
6167
6168         function isSameScope(a, b) {
6169             var scopeParentA = getScopeParent(a),
6170                 scopeParentB = getScopeParent(b);
6171
6172             return scopeParentA && (scopeParentA === scopeParentB);
6173         }
6174
6175         function hasEventDefinition(element, eventDefinition) {
6176             var bo = getBusinessObject(element);
6177
6178             return !!find(bo.eventDefinitions || [], function(definition) {
6179                 return is(definition, eventDefinition);
6180             });
6181         }
6182
6183         function hasEventDefinitionOrNone(element, eventDefinition) {
6184             var bo = getBusinessObject(element);
6185
6186             return (bo.eventDefinitions || []).every(function(definition) {
6187                 return is(definition, eventDefinition);
6188             });
6189         }
6190
6191         function isSequenceFlowSource(element) {
6192             return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(
6193                 is(element, 'bpmn:IntermediateThrowEvent') &&
6194                 hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6195             );
6196         }
6197
6198         function isSequenceFlowTarget(element) {
6199             return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(
6200                 is(element, 'bpmn:IntermediateCatchEvent') &&
6201                 hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6202             );
6203         }
6204
6205         function isEventBasedTarget(element) {
6206             return is(element, 'bpmn:ReceiveTask') || (
6207                 is(element, 'bpmn:IntermediateCatchEvent') && (
6208                     hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
6209                     hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
6210                     hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
6211                     hasEventDefinition(element, 'bpmn:SignalEventDefinition')
6212                 )
6213             );
6214         }
6215
6216         function isLabel(element) {
6217             return element.labelTarget;
6218         }
6219
6220         function isConnection(element) {
6221             return element.waypoints;
6222         }
6223
6224         function isParent(possibleParent, element) {
6225             var allParents = getParents(element);
6226             return allParents.indexOf(possibleParent) !== -1;
6227         }
6228
6229         function canConnect(source, target, connection) {
6230
6231             if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {
6232                 return null;
6233             }
6234
6235             // See https://github.com/bpmn-io/bpmn-js/issues/178
6236             // as a workround we disallow connections with same
6237             // target and source element.
6238             // This rule must be removed if a auto layout for this
6239             // connections is implemented.
6240             if (isSame(source, target)) {
6241                 return false;
6242             }
6243
6244             if (canConnectMessageFlow(source, target) ||
6245                 canConnectSequenceFlow(source, target)) {
6246
6247                 return true;
6248             }
6249
6250             if (is(connection, 'bpmn:Association')) {
6251                 return canConnectAssociation(source, target);
6252             }
6253
6254             return false;
6255         }
6256
6257         /**
6258          * Can an element be dropped into the target element
6259          * 
6260          * @return {Boolean}
6261          */
6262         function canDrop(element, target) {
6263
6264             // can move labels everywhere
6265             if (isLabel(element) && !isConnection(target)) {
6266                 return true;
6267             }
6268
6269             // allow to create new participants on
6270             // on existing collaboration and process diagrams
6271             if (is(element, 'bpmn:Participant')) {
6272                 return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
6273             }
6274
6275             // drop flow elements onto flow element containers
6276             // and participants
6277             if (is(element, 'bpmn:FlowElement')) {
6278                 if (is(target, 'bpmn:FlowElementsContainer')) {
6279                     return isExpanded(target) !== false;
6280                 }
6281
6282                 return is(target, 'bpmn:Participant');
6283             }
6284
6285             if (is(element, 'bpmn:Artifact')) {
6286                 return is(target, 'bpmn:Collaboration') ||
6287                     is(target, 'bpmn:Participant') ||
6288                     is(target, 'bpmn:Process');
6289             }
6290
6291             if (is(element, 'bpmn:MessageFlow')) {
6292                 return is(target, 'bpmn:Collaboration');
6293             }
6294
6295             return false;
6296         }
6297
6298         function canMove(elements, target) {
6299
6300             // only move if they have the same parent
6301             var sameParent = size(groupBy(elements, function(s) {
6302                 return s.parent && s.parent.id;
6303             })) === 1;
6304
6305             if (!sameParent) {
6306                 return false;
6307             }
6308
6309             if (!target) {
6310                 return true;
6311             }
6312
6313             return elements.every(function(element) {
6314                 return canDrop(element, target);
6315             });
6316         }
6317
6318         function canCreate(shape, target, source) {
6319
6320             if (!target) {
6321                 return false;
6322             }
6323
6324             if (isLabel(target)) {
6325                 return null;
6326             }
6327
6328             if (isSame(source, target)) {
6329                 return false;
6330             }
6331
6332             // ensure we do not drop the element
6333             // into source
6334             if (source && isParent(source, target)) {
6335                 return false;
6336             }
6337
6338             return canDrop(shape, target);
6339         }
6340
6341         function canResize(shape, newBounds) {
6342             if (is(shape, 'bpmn:SubProcess')) {
6343                 return isExpanded(shape) && (!newBounds || (newBounds.width >= 100 && newBounds.height >= 80));
6344             }
6345
6346             if (is(shape, 'bpmn:Participant')) {
6347                 return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);
6348             }
6349
6350             if (is(shape, 'bpmn:TextAnnotation')) {
6351                 return true;
6352             }
6353             if (is(shape, 'bpmn:MultiBranchConnector')) {
6354                 return false;
6355             }
6356
6357             return true;
6358         }
6359
6360         function canConnectAssociation(source, target) {
6361
6362             // do not connect connections
6363             if (isConnection(source) || isConnection(target)) {
6364                 return false;
6365             }
6366
6367             // connect if different parent
6368             return !isParent(target, source) &&
6369                 !isParent(source, target);
6370         }
6371
6372         function canConnectMessageFlow(source, target) {
6373
6374             return isMessageFlowSource(source) &&
6375                 isMessageFlowTarget(target) &&
6376                 !isSameOrganization(source, target);
6377         }
6378
6379         function canConnectSequenceFlow(source, target) {
6380
6381             return isSequenceFlowSource(source) &&
6382                 isSequenceFlowTarget(target) &&
6383                 isSameScope(source, target) &&
6384                 !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
6385         }
6386     }, {
6387         "../../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
6388         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
6389         "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
6390         "diagram-js/lib/features/rules/RuleProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js",
6391         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
6392         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
6393         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
6394         "lodash/collection/size": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js"
6395     }],
6396     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js": [function(require, module, exports) {
6397         module.exports = {
6398             __depends__: [
6399                 require('diagram-js/lib/features/rules')
6400             ],
6401             __init__: ['bpmnRules'],
6402             bpmnRules: ['type', require('./BpmnRules')]
6403         };
6404
6405     }, {
6406         "./BpmnRules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js",
6407         "diagram-js/lib/features/rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js"
6408     }],
6409     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js": [function(require, module, exports) {
6410         'use strict';
6411
6412         var assign = require('lodash/object/assign');
6413
6414         /**
6415          * A palette provider for BPMN 2.0 elements.
6416          */
6417         function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
6418
6419             this._create = create;
6420             this._elementFactory = elementFactory;
6421             this._spaceTool = spaceTool;
6422             this._lassoTool = lassoTool;
6423
6424             palette.registerProvider(this);
6425         }
6426
6427         module.exports = PaletteProvider;
6428
6429         PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool'];
6430
6431
6432         PaletteProvider.prototype.getPaletteEntries = function(element) {
6433
6434             var actions = {},
6435                 create = this._create,
6436                 elementFactory = this._elementFactory,
6437                 spaceTool = this._spaceTool,
6438                 lassoTool = this._lassoTool;
6439
6440
6441             function createAction(type, group, className, title, options) {
6442                 function createListener(event) {
6443                     var shape = elementFactory.createShape(assign({
6444                         type: type
6445                     }, options));
6446
6447                     if (options) {
6448                         shape.businessObject.di.isExpanded = options.isExpanded;
6449                     }
6450
6451                     create.start(event, shape);
6452                 }
6453
6454                 var shortType = type.replace(/^bpmn\:/, '');
6455
6456                 return {
6457                     group: group,
6458                     className: className,
6459                     title: title || 'Create ' + shortType,
6460                     action: {
6461                         dragstart: createListener,
6462                         click: createListener
6463                     }
6464                 };
6465             }
6466
6467             function createParticipant(event, collapsed) {
6468                 create.start(event, elementFactory.createParticipantShape(collapsed));
6469             }
6470
6471             assign(actions, {
6472                 'create.start-event': createAction(
6473                     'bpmn:StartEvent', 'event', 'icon-start-event-none', "Start"
6474                 ),
6475                 'create.collector': createAction(
6476                         'bpmn:Collector', 'event', 'icon-collector-node', 'Collector'
6477                     ),
6478                                         'create.String-Match': createAction(
6479                         'bpmn:StringMatch', 'event', 'icon-stringmatch-node', 'String Match'
6480           ),
6481                                         'create.ves-collector': createAction(
6482                         'bpmn:VesCollector', 'event', 'icon-ves-collector-node', 'Ves Collector'
6483                     ),
6484                 
6485                     'create.TCA': createAction(
6486                         'bpmn:TCA', 'event', 'icon-tca-node', 'TCA'
6487                     ),
6488                                         'create.Aand-AI': createAction(
6489                         'bpmn:Policy', 'event', 'icon-policy-node', 'Policy'
6490                     ),
6491                 'create.end-event': createAction(
6492                     'bpmn:EndEvent', 'event', 'icon-end-event-none', "End"
6493                 )
6494             });
6495
6496             return actions;
6497         };
6498
6499     }, {
6500         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
6501     }],
6502     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
6503         module.exports = {
6504             __depends__: [
6505                 require('diagram-js/lib/features/palette'),
6506                 require('diagram-js/lib/features/create')
6507             ],
6508             __init__: ['paletteProvider'],
6509             paletteProvider: ['type', require('./PaletteProvider')]
6510         };
6511
6512     }, {
6513         "./PaletteProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js",
6514         "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
6515         "diagram-js/lib/features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js"
6516     }],
6517     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js": [function(require, module, exports) {
6518         'use strict';
6519
6520         var forEach = require('lodash/collection/forEach'),
6521             filter = require('lodash/collection/filter');
6522
6523         var REPLACE_OPTIONS = require('./ReplaceOptions');
6524
6525         var startEventReplace = REPLACE_OPTIONS.START_EVENT,
6526             intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,
6527             endEventReplace = REPLACE_OPTIONS.END_EVENT,
6528             gatewayReplace = REPLACE_OPTIONS.GATEWAY,
6529             taskReplace = REPLACE_OPTIONS.TASK;
6530
6531
6532         /**
6533          * A replace menu provider that gives users the controls to choose and replace
6534          * BPMN elements with each other.
6535          * 
6536          * @param {BpmnFactory}
6537          *            bpmnFactory
6538          * @param {Moddle}
6539          *            moddle
6540          * @param {PopupMenu}
6541          *            popupMenu
6542          * @param {Replace}
6543          *            replace
6544          */
6545         function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {
6546
6547             /**
6548              * Prepares a new business object for the replacement element and triggers
6549              * the replace operation.
6550              * 
6551              * @param {djs.model.Base}
6552              *            element
6553              * @param {Object}
6554              *            target
6555              * @return {djs.model.Base} the newly created element
6556              */
6557             function replaceElement(element, target) {
6558
6559                 var type = target.type,
6560                     oldBusinessObject = element.businessObject,
6561                     businessObject = bpmnFactory.create(type);
6562
6563                 var newElement = {
6564                     type: type,
6565                     businessObject: businessObject
6566                 };
6567
6568                 // initialize custom BPMN extensions
6569
6570                 if (target.eventDefinition) {
6571                     var eventDefinitions = businessObject.get('eventDefinitions'),
6572                         eventDefinition = moddle.create(target.eventDefinition);
6573
6574                     eventDefinitions.push(eventDefinition);
6575                 }
6576
6577                 if (target.instantiate !== undefined) {
6578                     businessObject.instantiate = target.instantiate;
6579                 }
6580
6581                 if (target.eventGatewayType !== undefined) {
6582                     businessObject.eventGatewayType = target.eventGatewayType;
6583                 }
6584
6585                 // copy size (for activities only)
6586                 if (oldBusinessObject.$instanceOf('bpmn:Activity')) {
6587
6588                     // TODO: need also to respect min/max Size
6589
6590                     newElement.width = element.width;
6591                     newElement.height = element.height;
6592                 }
6593
6594                 // TODO: copy other elligable properties from old business object
6595                 businessObject.name = oldBusinessObject.name;
6596
6597                 newElement = replace.replaceElement(element, newElement);
6598
6599                 selection.select(newElement);
6600
6601                 return newElement;
6602             }
6603
6604
6605             function getReplaceOptions(element) {
6606
6607                 var menuEntries = [];
6608                 var businessObject = element.businessObject;
6609
6610                 if (businessObject.$instanceOf('bpmn:StartEvent')) {
6611                     addEntries(startEventReplace, filterEvents);
6612                 } else
6613
6614                 if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||
6615                     businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {
6616
6617                     addEntries(intermediateEventReplace, filterEvents);
6618                 } else
6619
6620                 if (businessObject.$instanceOf('bpmn:EndEvent')) {
6621
6622                     addEntries(endEventReplace, filterEvents);
6623                 } else
6624
6625                 if (businessObject.$instanceOf('bpmn:Gateway')) {
6626
6627                     addEntries(gatewayReplace, function(entry) {
6628
6629                         return entry.target.type !== businessObject.$type;
6630                     });
6631                 } else
6632
6633                 if (businessObject.$instanceOf('bpmn:FlowNode')) {
6634                     addEntries(taskReplace, function(entry) {
6635                         return entry.target.type !== businessObject.$type;
6636                     });
6637                 }
6638
6639                 function filterEvents(entry) {
6640
6641                     var target = entry.target;
6642
6643                     var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;
6644                     var isEventDefinitionEqual = target.eventDefinition == eventDefinition;
6645                     var isEventTypeEqual = businessObject.$type == target.type;
6646
6647                     return ((!isEventDefinitionEqual && isEventTypeEqual) ||
6648                             !isEventTypeEqual) ||
6649                         !(isEventDefinitionEqual && isEventTypeEqual);
6650                 }
6651
6652                 function addEntries(entries, filterFun) {
6653                     // Filter selected type from the array
6654                     var filteredEntries = filter(entries, filterFun);
6655
6656                     // Add entries to replace menu
6657                     forEach(filteredEntries, function(definition) {
6658
6659                         var entry = addMenuEntry(definition);
6660                         menuEntries.push(entry);
6661                     });
6662                 }
6663
6664                 function addMenuEntry(definition) {
6665
6666                     return {
6667                         label: definition.label,
6668                         className: definition.className,
6669                         action: {
6670                             name: definition.actionName,
6671                             handler: function() {
6672                                 replaceElement(element, definition.target);
6673                             }
6674                         }
6675                     };
6676                 }
6677
6678                 return menuEntries;
6679             }
6680
6681
6682             // API
6683
6684             this.openChooser = function(position, element) {
6685                 var entries = this.getReplaceOptions(element);
6686
6687                 popupMenu.open('replace-menu', position, entries);
6688             };
6689
6690             this.getReplaceOptions = getReplaceOptions;
6691
6692             this.replaceElement = replaceElement;
6693         }
6694
6695         BpmnReplace.$inject = ['bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection'];
6696
6697         module.exports = BpmnReplace;
6698     }, {
6699         "./ReplaceOptions": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js",
6700         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
6701         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
6702     }],
6703     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js": [function(require, module, exports) {
6704         'use strict';
6705
6706         module.exports.START_EVENT = [{
6707             label: 'Start Event',
6708             actionName: 'replace-with-none-start',
6709             className: 'icon-start-event-none',
6710             target: {
6711                 type: 'bpmn:StartEvent'
6712             }
6713         }, {
6714             label: 'Intermediate Throw Event',
6715             actionName: 'replace-with-intermediate-throwing',
6716             className: 'icon-intermediate-event-none',
6717             target: {
6718                 type: 'bpmn:IntermediateThrowEvent'
6719             }
6720         }, {
6721             label: 'End Event',
6722             actionName: 'replace-with-message-end',
6723             className: 'icon-end-event-none',
6724             target: {
6725                 type: 'bpmn:EndEvent'
6726             }
6727         }, {
6728             label: 'Message Start Event',
6729             actionName: 'replace-with-message-start',
6730             className: 'icon-start-event-message',
6731             target: {
6732                 type: 'bpmn:StartEvent',
6733                 eventDefinition: 'bpmn:MessageEventDefinition'
6734             }
6735         }, {
6736             label: 'Timer Start Event',
6737             actionName: 'replace-with-timer-start',
6738             className: 'icon-start-event-timer',
6739             target: {
6740                 type: 'bpmn:StartEvent',
6741                 eventDefinition: 'bpmn:TimerEventDefinition'
6742             }
6743         }, {
6744             label: 'Conditional Start Event',
6745             actionName: 'replace-with-conditional-start',
6746             className: 'icon-start-event-condition',
6747             target: {
6748                 type: 'bpmn:StartEvent',
6749                 eventDefinition: 'bpmn:ConditionalEventDefinition'
6750             }
6751         }, {
6752             label: 'Signal Start Event',
6753             actionName: 'replace-with-signal-start',
6754             className: 'icon-start-event-signal',
6755             target: {
6756                 type: 'bpmn:StartEvent',
6757                 eventDefinition: 'bpmn:SignalEventDefinition'
6758             }
6759         }];
6760
6761         module.exports.INTERMEDIATE_EVENT = [{
6762             label: 'Start Event',
6763             actionName: 'replace-with-none-start',
6764             className: 'icon-start-event-none',
6765             target: {
6766                 type: 'bpmn:StartEvent'
6767             }
6768         }, {
6769             label: 'Intermediate Throw Event',
6770             actionName: 'replace-with-message-intermediate-throw',
6771             className: 'icon-intermediate-event-none',
6772             target: {
6773                 type: 'bpmn:IntermediateThrowEvent'
6774             }
6775         }, {
6776             label: 'End Event',
6777             actionName: 'replace-with-message-end',
6778             className: 'icon-end-event-none',
6779             target: {
6780                 type: 'bpmn:EndEvent'
6781             }
6782         }, {
6783             label: 'Message Intermediate Catch Event',
6784             actionName: 'replace-with-intermediate-catch',
6785             className: 'icon-intermediate-event-catch-message',
6786             target: {
6787                 type: 'bpmn:IntermediateCatchEvent',
6788                 eventDefinition: 'bpmn:MessageEventDefinition'
6789             }
6790         }, {
6791             label: 'Message Intermediate Throw Event',
6792             actionName: 'replace-with-intermediate-throw',
6793             className: 'icon-intermediate-event-throw-message',
6794             target: {
6795                 type: 'bpmn:IntermediateThrowEvent',
6796                 eventDefinition: 'bpmn:MessageEventDefinition'
6797             }
6798         }, {
6799             label: 'Timer Intermediate Catch Event',
6800             actionName: 'replace-with-timer-intermediate-catch',
6801             className: 'icon-intermediate-event-catch-timer',
6802             target: {
6803                 type: 'bpmn:IntermediateCatchEvent',
6804                 eventDefinition: 'bpmn:TimerEventDefinition'
6805             }
6806         }, {
6807             label: 'Escalation Intermediate Catch Event',
6808             actionName: 'replace-with-escalation-catch',
6809             className: 'icon-intermediate-event-catch-escalation',
6810             target: {
6811                 type: 'bpmn:IntermediateCatchEvent',
6812                 eventDefinition: 'bpmn:EscalationEventDefinition'
6813             }
6814         }, {
6815             label: 'Conditional Intermediate Catch Event',
6816             actionName: 'replace-with-conditional-intermediate-catch',
6817             className: 'icon-intermediate-event-catch-condition',
6818             target: {
6819                 type: 'bpmn:IntermediateCatchEvent',
6820                 eventDefinition: 'bpmn:ConditionalEventDefinition'
6821             }
6822         }, {
6823             label: 'Link Intermediate Catch Event',
6824             actionName: 'replace-with-link-intermediate-catch',
6825             className: 'icon-intermediate-event-catch-link',
6826             target: {
6827                 type: 'bpmn:IntermediateCatchEvent',
6828                 eventDefinition: 'bpmn:LinkEventDefinition'
6829             }
6830         }, {
6831             label: 'Link Intermediate Throw Event',
6832             actionName: 'replace-with-link-intermediate-throw',
6833             className: 'icon-intermediate-event-throw-link',
6834             target: {
6835                 type: 'bpmn:IntermediateThrowEvent',
6836                 eventDefinition: 'bpmn:LinkEventDefinition'
6837             }
6838         }, {
6839             label: 'Compensation Intermediate Throw Event',
6840             actionName: 'replace-with-compensation-intermediate-throw',
6841             className: 'icon-intermediate-event-throw-compensation',
6842             target: {
6843                 type: 'bpmn:IntermediateThrowEvent',
6844                 eventDefinition: 'bpmn:CompensateEventDefinition'
6845             }
6846         }, {
6847             label: 'Signal Throw Catch Event',
6848             actionName: 'replace-with-throw-intermediate-catch',
6849             className: 'icon-intermediate-event-catch-signal',
6850             target: {
6851                 type: 'bpmn:IntermediateCatchEvent',
6852                 eventDefinition: 'bpmn:SignalEventDefinition'
6853             }
6854         }, {
6855             label: 'Signal Intermediate Throw Event',
6856             actionName: 'replace-with-signal-intermediate-throw',
6857             className: 'icon-intermediate-event-throw-signal',
6858             target: {
6859                 type: 'bpmn:IntermediateThrowEvent',
6860                 eventDefinition: 'bpmn:SignalEventDefinition'
6861             }
6862         }];
6863
6864         module.exports.END_EVENT = [{
6865             label: 'Start Event',
6866             actionName: 'replace-with-none-start',
6867             className: 'icon-start-event-none',
6868             target: {
6869                 type: 'bpmn:StartEvent'
6870             }
6871         }, {
6872             label: 'Intermediate Throw Event',
6873             actionName: 'replace-with-message-intermediate-throw',
6874             className: 'icon-intermediate-event-none',
6875             target: {
6876                 type: 'bpmn:IntermediateThrowEvent'
6877             }
6878         }, {
6879             label: 'End Event',
6880             actionName: 'replace-with-none-end',
6881             className: 'icon-end-event-none',
6882             target: {
6883                 type: 'bpmn:EndEvent'
6884             }
6885         }, {
6886             label: 'Message End Event',
6887             actionName: 'replace-with-message-end',
6888             className: 'icon-end-event-message',
6889             target: {
6890                 type: 'bpmn:EndEvent',
6891                 eventDefinition: 'bpmn:MessageEventDefinition'
6892             }
6893         }, {
6894             label: 'Escalation End Event',
6895             actionName: 'replace-with-escalation-end',
6896             className: 'icon-end-event-escalation',
6897             target: {
6898                 type: 'bpmn:EndEvent',
6899                 eventDefinition: 'bpmn:EscalationEventDefinition'
6900             }
6901         }, {
6902             label: 'Error End Event',
6903             actionName: 'replace-with-error-end',
6904             className: 'icon-end-event-error',
6905             target: {
6906                 type: 'bpmn:EndEvent',
6907                 eventDefinition: 'bpmn:ErrorEventDefinition'
6908             }
6909         }, {
6910             label: 'Cancel End Event',
6911             actionName: 'replace-with-cancel-end',
6912             className: 'icon-end-event-cancel',
6913             target: {
6914                 type: 'bpmn:EndEvent',
6915                 eventDefinition: 'bpmn:CancelEventDefinition'
6916             }
6917         }, {
6918             label: 'Compensation End Event',
6919             actionName: 'replace-with-compensation-end',
6920             className: 'icon-end-event-compensation',
6921             target: {
6922                 type: 'bpmn:EndEvent',
6923                 eventDefinition: 'bpmn:CompensateEventDefinition'
6924             }
6925         }, {
6926             label: 'Signal End Event',
6927             actionName: 'replace-with-signal-end',
6928             className: 'icon-end-event-signal',
6929             target: {
6930                 type: 'bpmn:EndEvent',
6931                 eventDefinition: 'bpmn:SignalEventDefinition'
6932             }
6933         }, {
6934             label: 'Terminate End Event',
6935             actionName: 'replace-with-terminate-end',
6936             className: 'icon-end-event-terminate',
6937             target: {
6938                 type: 'bpmn:EndEvent',
6939                 eventDefinition: 'bpmn:TerminateEventDefinition'
6940             }
6941         }];
6942
6943         module.exports.GATEWAY = [{
6944                 label: 'Exclusive Gateway',
6945                 actionName: 'replace-with-exclusive-gateway',
6946                 className: 'icon-gateway-xor',
6947                 target: {
6948                     type: 'bpmn:ExclusiveGateway'
6949                 }
6950             }, {
6951                 label: 'Parallel Gateway',
6952                 actionName: 'replace-with-parallel-gateway',
6953                 className: 'icon-gateway-parallel',
6954                 target: {
6955                     type: 'bpmn:ParallelGateway'
6956                 }
6957             }, {
6958                 label: 'Inclusive Gateway',
6959                 actionName: 'replace-with-inclusive-gateway',
6960                 className: 'icon-gateway-or',
6961                 target: {
6962                     type: 'bpmn:InclusiveGateway'
6963                 }
6964             }, {
6965                 label: 'Complex Gateway',
6966                 actionName: 'replace-with-complex-gateway',
6967                 className: 'icon-gateway-complex',
6968                 target: {
6969                     type: 'bpmn:ComplexGateway'
6970                 }
6971             }, {
6972                 label: 'Event based Gateway',
6973                 actionName: 'replace-with-event-based-gateway',
6974                 className: 'icon-gateway-eventbased',
6975                 target: {
6976                     type: 'bpmn:EventBasedGateway',
6977                     instantiate: false,
6978                     eventGatewayType: 'Exclusive'
6979                 }
6980             }
6981             // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
6982             // {
6983             // label: 'Event based instantiating Gateway',
6984             // actionName: 'replace-with-exclusive-event-based-gateway',
6985             // className: 'icon-exclusive-event-based',
6986             // target: {
6987             // type: 'bpmn:EventBasedGateway'
6988             // },
6989             // options: {
6990             // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }
6991             // }
6992             // },
6993             // {
6994             // label: 'Parallel Event based instantiating Gateway',
6995             // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
6996             // className: 'icon-parallel-event-based-instantiate-gateway',
6997             // target: {
6998             // type: 'bpmn:EventBasedGateway'
6999             // },
7000             // options: {
7001             // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }
7002             // }
7003             // }
7004         ];
7005
7006
7007         module.exports.TASK = [{
7008             label: 'Task',
7009             actionName: 'replace-with-task',
7010             className: 'icon-task',
7011             target: {
7012                 type: 'bpmn:Task'
7013             }
7014         }, {
7015             label: 'Send Task',
7016             actionName: 'replace-with-send-task',
7017             className: 'icon-send',
7018             target: {
7019                 type: 'bpmn:SendTask'
7020             }
7021         }, {
7022             label: 'Receive Task',
7023             actionName: 'replace-with-receive-task',
7024             className: 'icon-receive',
7025             target: {
7026                 type: 'bpmn:ReceiveTask'
7027             }
7028         }, {
7029             label: 'User Task',
7030             actionName: 'replace-with-user-task',
7031             className: 'icon-user',
7032             target: {
7033                 type: 'bpmn:UserTask'
7034             }
7035         }, {
7036             label: 'Manual Task',
7037             actionName: 'replace-with-manual-task',
7038             className: 'icon-manual',
7039             target: {
7040                 type: 'bpmn:ManualTask'
7041             }
7042         }, {
7043             label: 'Business Rule Task',
7044             actionName: 'replace-with-rule-task',
7045             className: 'icon-business-rule',
7046             target: {
7047                 type: 'bpmn:BusinessRuleTask'
7048             }
7049         }, {
7050             label: 'Service Task',
7051             actionName: 'replace-with-service-task',
7052             className: 'icon-service',
7053             target: {
7054                 type: 'bpmn:ServiceTask'
7055             }
7056         }, {
7057             label: 'Script Task',
7058             actionName: 'replace-with-script-task',
7059             className: 'icon-script',
7060             target: {
7061                 type: 'bpmn:ScriptTask'
7062             }
7063         }];
7064     }, {}],
7065     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
7066         module.exports = {
7067             __depends__: [
7068                 require('diagram-js/lib/features/popup-menu'),
7069                 require('diagram-js/lib/features/replace'),
7070                 require('diagram-js/lib/features/selection')
7071             ],
7072             bpmnReplace: ['type', require('./BpmnReplace')]
7073         };
7074     }, {
7075         "./BpmnReplace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js",
7076         "diagram-js/lib/features/popup-menu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js",
7077         "diagram-js/lib/features/replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js",
7078         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
7079     }],
7080     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js": [function(require, module, exports) {
7081         'use strict';
7082
7083         var inherits = require('inherits');
7084
7085         var forEach = require('lodash/collection/forEach');
7086
7087         var getBoundingBox = require('diagram-js/lib/util/Elements').getBBox;
7088         var is = require('../modeling/ModelingUtil').is;
7089
7090         var Snapping = require('diagram-js/lib/features/snapping/Snapping'),
7091             SnapUtil = require('diagram-js/lib/features/snapping/SnapUtil');
7092
7093         var is = require('../../util/ModelUtil').is;
7094
7095         var mid = SnapUtil.mid,
7096             topLeft = SnapUtil.topLeft,
7097             bottomRight = SnapUtil.bottomRight;
7098
7099         var round = Math.round;
7100
7101
7102         /**
7103          * BPMN specific snapping functionality
7104          *  * snap on process elements if a pool is created inside a process diagram
7105          * 
7106          * @param {EventBus}
7107          *            eventBus
7108          * @param {Canvas}
7109          *            canvas
7110          */
7111         function BpmnSnapping(eventBus, canvas) {
7112
7113             // instantiate super
7114             Snapping.call(this, eventBus, canvas);
7115
7116
7117             /**
7118              * Drop participant on process <> process elements snapping
7119              */
7120
7121             function initParticipantSnapping(context, shape, elements) {
7122
7123                 if (!elements.length) {
7124                     return;
7125                 }
7126
7127                 var snapBox = getBoundingBox(elements.filter(function(e) {
7128                     return !e.labelTarget && !e.waypoints;
7129                 }));
7130
7131                 snapBox.x -= 50;
7132                 snapBox.y -= 20;
7133                 snapBox.width += 70;
7134                 snapBox.height += 40;
7135
7136                 // adjust shape height to include bounding box
7137                 shape.width = Math.max(shape.width, snapBox.width);
7138                 shape.height = Math.max(shape.height, snapBox.height);
7139
7140                 context.participantSnapBox = snapBox;
7141             }
7142
7143             function snapParticipant(snapBox, shape, event) {
7144
7145                 var shapeHalfWidth = shape.width / 2 - 30,
7146                     shapeHalfHeight = shape.height / 2;
7147
7148                 var currentTopLeft = {
7149                     x: event.x - shapeHalfWidth - 30,
7150                     y: event.y - shapeHalfHeight
7151                 };
7152
7153                 var currentBottomRight = {
7154                     x: event.x + shapeHalfWidth + 30,
7155                     y: event.y + shapeHalfHeight
7156                 };
7157
7158                 var snapTopLeft = snapBox,
7159                     snapBottomRight = bottomRight(snapBox);
7160
7161                 if (currentTopLeft.x >= snapTopLeft.x) {
7162                     event.x = snapTopLeft.x + 30 + shapeHalfWidth;
7163                     event.snapped = true;
7164                 } else
7165                 if (currentBottomRight.x <= snapBottomRight.x) {
7166                     event.x = snapBottomRight.x - 30 - shapeHalfWidth;
7167                     event.snapped = true;
7168                 }
7169
7170                 if (currentTopLeft.y >= snapTopLeft.y) {
7171                     event.y = snapTopLeft.y + shapeHalfHeight;
7172                     event.snapped = true;
7173                 } else
7174                 if (currentBottomRight.y <= snapBottomRight.y) {
7175                     event.y = snapBottomRight.y - shapeHalfHeight;
7176                     event.snapped = true;
7177                 }
7178             }
7179
7180             eventBus.on('create.start', function(event) {
7181
7182                 var context = event.context,
7183                     shape = context.shape,
7184                     rootElement = canvas.getRootElement();
7185
7186                 // snap participant around existing elements (if any)
7187                 if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {
7188
7189                     initParticipantSnapping(context, shape, rootElement.children);
7190                 }
7191             });
7192
7193             eventBus.on(['create.move', 'create.end'], 1500, function(event) {
7194
7195                 var context = event.context,
7196                     shape = context.shape,
7197                     participantSnapBox = context.participantSnapBox;
7198
7199                 if (!event.snapped && participantSnapBox) {
7200                     snapParticipant(participantSnapBox, shape, event);
7201                 }
7202             });
7203
7204             eventBus.on('resize.start', 1500, function(event) {
7205                 var context = event.context,
7206                     shape = context.shape;
7207
7208                 if (is(shape, 'bpmn:SubProcess')) {
7209                     context.minDimensions = {
7210                         width: 140,
7211                         height: 120
7212                     };
7213                 }
7214
7215                 if (is(shape, 'bpmn:Participant')) {
7216                     context.minDimensions = {
7217                         width: 400,
7218                         height: 200
7219                     };
7220                 }
7221
7222                 if (is(shape, 'bpmn:TextAnnotation')) {
7223                     context.minDimensions = {
7224                         width: 50,
7225                         height: 50
7226                     };
7227                 }
7228             });
7229
7230         }
7231
7232         inherits(BpmnSnapping, Snapping);
7233
7234         BpmnSnapping.$inject = ['eventBus', 'canvas'];
7235
7236         module.exports = BpmnSnapping;
7237
7238
7239         BpmnSnapping.prototype.initSnap = function(event) {
7240
7241             var context = event.context,
7242                 shape = context.shape,
7243                 shapeMid,
7244                 shapeBounds,
7245                 shapeTopLeft,
7246                 shapeBottomRight,
7247                 snapContext;
7248
7249
7250             snapContext = Snapping.prototype.initSnap.call(this, event);
7251
7252             if (is(shape, 'bpmn:Participant')) {
7253                 // assign higher priority for outer snaps on participants
7254                 snapContext.setSnapLocations(['top-left', 'bottom-right', 'mid']);
7255             }
7256
7257
7258             if (shape) {
7259
7260                 shapeMid = mid(shape, event);
7261
7262                 shapeBounds = {
7263                     width: shape.width,
7264                     height: shape.height,
7265                     x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,
7266                     y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,
7267                 };
7268
7269                 shapeTopLeft = topLeft(shapeBounds);
7270                 shapeBottomRight = bottomRight(shapeBounds);
7271
7272                 snapContext.setSnapOrigin('top-left', {
7273                     x: shapeTopLeft.x - event.x,
7274                     y: shapeTopLeft.y - event.y
7275                 });
7276
7277                 snapContext.setSnapOrigin('bottom-right', {
7278                     x: shapeBottomRight.x - event.x,
7279                     y: shapeBottomRight.y - event.y
7280                 });
7281
7282
7283                 forEach(shape.outgoing, function(c) {
7284                     var docking = c.waypoints[0];
7285
7286                     docking = docking.original || docking;
7287
7288                     snapContext.setSnapOrigin(c.id + '-docking', {
7289                         x: docking.x - event.x,
7290                         y: docking.y - event.y
7291                     });
7292                 });
7293
7294                 forEach(shape.incoming, function(c) {
7295                     var docking = c.waypoints[c.waypoints.length - 1];
7296
7297                     docking = docking.original || docking;
7298
7299                     snapContext.setSnapOrigin(c.id + '-docking', {
7300                         x: docking.x - event.x,
7301                         y: docking.y - event.y
7302                     });
7303                 });
7304
7305             }
7306
7307             var source = context.source;
7308
7309             if (source) {
7310                 snapContext.addDefaultSnap('mid', mid(source));
7311             }
7312         };
7313
7314
7315         BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
7316
7317             var siblings = this.getSiblings(shape, target);
7318
7319
7320             forEach(siblings, function(s) {
7321                 snapPoints.add('mid', mid(s));
7322
7323                 if (is(s, 'bpmn:Participant')) {
7324                     snapPoints.add('top-left', topLeft(s));
7325                     snapPoints.add('bottom-right', bottomRight(s));
7326                 }
7327             });
7328
7329             forEach(shape.incoming, function(c) {
7330
7331                 if (siblings.indexOf(c.source) === -1) {
7332                     snapPoints.add('mid', mid(c.source));
7333
7334                     var docking = c.waypoints[0];
7335                     snapPoints.add(c.id + '-docking', docking.original || docking);
7336                 }
7337             });
7338
7339
7340             forEach(shape.outgoing, function(c) {
7341
7342                 if (siblings.indexOf(c.target) === -1) {
7343                     snapPoints.add('mid', mid(c.target));
7344
7345                     var docking = c.waypoints[c.waypoints.length - 1];
7346                     snapPoints.add(c.id + '-docking', docking.original || docking);
7347                 }
7348             });
7349
7350         };
7351     }, {
7352         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
7353         "../modeling/ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
7354         "diagram-js/lib/features/snapping/SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
7355         "diagram-js/lib/features/snapping/Snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js",
7356         "diagram-js/lib/util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
7357         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
7358         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
7359     }],
7360     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js": [function(require, module, exports) {
7361         module.exports = {
7362             __init__: ['snapping'],
7363             snapping: ['type', require('./BpmnSnapping')]
7364         };
7365     }, {
7366         "./BpmnSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js"
7367     }],
7368     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js": [function(require, module, exports) {
7369         'use strict';
7370
7371         var assign = require('lodash/object/assign'),
7372             map = require('lodash/collection/map');
7373
7374         var LabelUtil = require('../util/LabelUtil');
7375
7376         var hasExternalLabel = LabelUtil.hasExternalLabel,
7377             getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
7378             isExpanded = require('../util/DiUtil').isExpanded,
7379             elementToString = require('./Util').elementToString;
7380
7381
7382         function elementData(semantic, attrs) {
7383             return assign({
7384                 id: semantic.id,
7385                 type: semantic.$type,
7386                 businessObject: semantic
7387             }, attrs);
7388         }
7389
7390         function collectWaypoints(waypoints) {
7391             return map(waypoints, function(p) {
7392                 return {
7393                     x: p.x,
7394                     y: p.y
7395                 };
7396             });
7397         }
7398
7399
7400         /**
7401          * An importer that adds bpmn elements to the canvas
7402          * 
7403          * @param {EventBus}
7404          *            eventBus
7405          * @param {Canvas}
7406          *            canvas
7407          * @param {ElementFactory}
7408          *            elementFactory
7409          * @param {ElementRegistry}
7410          *            elementRegistry
7411          */
7412         function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
7413             this._eventBus = eventBus;
7414             this._canvas = canvas;
7415
7416             this._elementFactory = elementFactory;
7417             this._elementRegistry = elementRegistry;
7418         }
7419
7420         BpmnImporter.$inject = ['eventBus', 'canvas', 'elementFactory', 'elementRegistry'];
7421
7422         module.exports = BpmnImporter;
7423
7424
7425         /**
7426          * Add bpmn element (semantic) to the canvas onto the specified parent shape.
7427          */
7428         BpmnImporter.prototype.add = function(semantic, parentElement) {
7429
7430             var di = semantic.di,
7431                 element;
7432
7433             // ROOT ELEMENT
7434             // handle the special case that we deal with a
7435             // invisible root element (process or collaboration)
7436             if (di.$instanceOf('bpmndi:BPMNPlane')) {
7437
7438                 // add a virtual element (not being drawn)
7439                 element = this._elementFactory.createRoot(elementData(semantic));
7440
7441                 this._canvas.setRootElement(element);
7442             }
7443
7444             // SHAPE
7445             else if (di.$instanceOf('bpmndi:BPMNShape')) {
7446
7447                 var collapsed = !isExpanded(semantic);
7448                 var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
7449
7450                 var bounds = semantic.di.bounds;
7451
7452                 element = this._elementFactory.createShape(elementData(semantic, {
7453                     collapsed: collapsed,
7454                     hidden: hidden,
7455                     x: Math.round(bounds.x),
7456                     y: Math.round(bounds.y),
7457                     width: Math.round(bounds.width),
7458                     height: Math.round(bounds.height)
7459                 }));
7460
7461                 this._canvas.addShape(element, parentElement);
7462             }
7463
7464             // CONNECTION
7465             else if (di.$instanceOf('bpmndi:BPMNEdge')) {
7466
7467                 var source = this._getSource(semantic),
7468                     target = this._getTarget(semantic);
7469
7470                 element = this._elementFactory.createConnection(elementData(semantic, {
7471                     source: source,
7472                     target: target,
7473                     waypoints: collectWaypoints(semantic.di.waypoint)
7474                 }));
7475
7476                 this._canvas.addConnection(element, parentElement);
7477             } else {
7478                 throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
7479             }
7480
7481             // (optional) LABEL
7482             if (hasExternalLabel(semantic)) {
7483                 this.addLabel(semantic, element);
7484             }
7485
7486
7487             this._eventBus.fire('bpmnElement.added', {
7488                 element: element
7489             });
7490
7491             return element;
7492         };
7493
7494
7495         /**
7496          * add label for an element
7497          */
7498         BpmnImporter.prototype.addLabel = function(semantic, element) {
7499             var bounds = getExternalLabelBounds(semantic, element);
7500
7501             var label = this._elementFactory.createLabel(elementData(semantic, {
7502                 id: semantic.id + '_label',
7503                 labelTarget: element,
7504                 type: 'label',
7505                 hidden: element.hidden,
7506                 x: Math.round(bounds.x),
7507                 y: Math.round(bounds.y),
7508                 width: Math.round(bounds.width),
7509                 height: Math.round(bounds.height)
7510             }));
7511
7512             return this._canvas.addShape(label, element.parent);
7513         };
7514
7515         /**
7516          * Return the drawn connection end based on the given side.
7517          * 
7518          * @throws {Error}
7519          *             if the end is not yet drawn
7520          */
7521         BpmnImporter.prototype._getEnd = function(semantic, side) {
7522
7523             var element,
7524                 refSemantic,
7525                 type = semantic.$type;
7526
7527             refSemantic = semantic[side + 'Ref'];
7528
7529             // handle mysterious isMany DataAssociation#sourceRef
7530             if (side === 'source' && type === 'bpmn:DataInputAssociation') {
7531                 refSemantic = refSemantic && refSemantic[0];
7532             }
7533
7534             // fix source / target for DataInputAssociation / DataOutputAssociation
7535             if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
7536                 side === 'target' && type === 'bpmn:DataInputAssociation') {
7537
7538                 refSemantic = semantic.$parent;
7539             }
7540
7541             element = refSemantic && this._getElement(refSemantic);
7542
7543             if (element) {
7544                 return element;
7545             }
7546
7547             if (refSemantic) {
7548                 throw new Error(
7549                     'element ' + elementToString(refSemantic) + ' referenced by ' +
7550                     elementToString(semantic) + '#' + side + 'Ref not yet drawn');
7551             } else {
7552                 throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
7553             }
7554         };
7555
7556         BpmnImporter.prototype._getSource = function(semantic) {
7557             return this._getEnd(semantic, 'source');
7558         };
7559
7560         BpmnImporter.prototype._getTarget = function(semantic) {
7561             return this._getEnd(semantic, 'target');
7562         };
7563
7564
7565         BpmnImporter.prototype._getElement = function(semantic) {
7566             return this._elementRegistry.get(semantic.id);
7567         };
7568
7569     }, {
7570         "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
7571         "../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
7572         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7573         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
7574         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
7575     }],
7576     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js": [function(require, module, exports) {
7577         'use strict';
7578
7579         var filter = require('lodash/collection/filter'),
7580             find = require('lodash/collection/find'),
7581             forEach = require('lodash/collection/forEach');
7582
7583         var Refs = require('object-refs');
7584
7585         var elementToString = require('./Util').elementToString;
7586
7587         var diRefs = new Refs({
7588             name: 'bpmnElement',
7589             enumerable: true
7590         }, {
7591             name: 'di'
7592         });
7593
7594         /**
7595          * Returns true if an element has the given meta-model type
7596          * 
7597          * @param {ModdleElement}
7598          *            element
7599          * @param {String}
7600          *            type
7601          * 
7602          * @return {Boolean}
7603          */
7604         function is(element, type) {
7605             return element.$instanceOf(type);
7606         }
7607
7608
7609         /**
7610          * Find a suitable display candidate for definitions where the DI does not
7611          * correctly specify one.
7612          */
7613         function findDisplayCandidate(definitions) {
7614             return find(definitions.rootElements, function(e) {
7615                 return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
7616             });
7617         }
7618
7619
7620         function BpmnTreeWalker(handler) {
7621
7622             // list of containers already walked
7623             var handledProcesses = [];
7624
7625             // list of elements to handle deferred to ensure
7626             // prerequisites are drawn
7627             var deferred = [];
7628
7629             // /// Helpers /////////////////////////////////
7630
7631             function contextual(fn, ctx) {
7632                 return function(e) {
7633                     fn(e, ctx);
7634                 };
7635             }
7636
7637             function visit(element, ctx) {
7638
7639                 var gfx = element.gfx;
7640
7641                 // avoid multiple rendering of elements
7642                 if (gfx) {
7643                     throw new Error('already rendered ' + elementToString(element));
7644                 }
7645
7646                 // call handler
7647                 return handler.element(element, ctx);
7648             }
7649
7650             function visitRoot(element, diagram) {
7651                 return handler.root(element, diagram);
7652             }
7653
7654             function visitIfDi(element, ctx) {
7655                 try {
7656                     return element.di && visit(element, ctx);
7657                 } catch (e) {
7658                     logError(e.message, {
7659                         element: element,
7660                         error: e
7661                     });
7662
7663                     console.error('failed to import ' + elementToString(element));
7664                     console.error(e);
7665                 }
7666             }
7667
7668             function logError(message, context) {
7669                 handler.error(message, context);
7670             }
7671
7672             // //// DI handling ////////////////////////////
7673
7674             function registerDi(di) {
7675                 var bpmnElement = di.bpmnElement;
7676
7677                 if (bpmnElement) {
7678                     if (bpmnElement.di) {
7679                         logError('multiple DI elements defined for ' + elementToString(bpmnElement), {
7680                             element: bpmnElement
7681                         });
7682                     } else {
7683                         diRefs.bind(bpmnElement, 'di');
7684                         bpmnElement.di = di;
7685                     }
7686                 } else {
7687                     logError('no bpmnElement referenced in ' + elementToString(di), {
7688                         element: di
7689                     });
7690                 }
7691             }
7692
7693             function handleDiagram(diagram) {
7694                 handlePlane(diagram.plane);
7695             }
7696
7697             function handlePlane(plane) {
7698                 registerDi(plane);
7699
7700                 forEach(plane.planeElement, handlePlaneElement);
7701             }
7702
7703             function handlePlaneElement(planeElement) {
7704                 registerDi(planeElement);
7705             }
7706
7707
7708             // //// Semantic handling //////////////////////
7709
7710             function handleDefinitions(definitions, diagram) {
7711                 // make sure we walk the correct bpmnElement
7712
7713                 var diagrams = definitions.diagrams;
7714
7715                 if (diagram && diagrams.indexOf(diagram) === -1) {
7716                     throw new Error('diagram not part of bpmn:Definitions');
7717                 }
7718
7719                 if (!diagram && diagrams && diagrams.length) {
7720                     diagram = diagrams[0];
7721                 }
7722
7723                 // no diagram -> nothing to import
7724                 if (!diagram) {
7725                     return;
7726                 }
7727
7728                 // load DI from selected diagram only
7729                 handleDiagram(diagram);
7730
7731
7732                 var plane = diagram.plane;
7733
7734                 if (!plane) {
7735                     throw new Error('no plane for ' + elementToString(diagram));
7736                 }
7737
7738
7739                 var rootElement = plane.bpmnElement;
7740
7741                 // ensure we default to a suitable display candidate (process or
7742                 // collaboration),
7743                 // even if non is specified in DI
7744                 if (!rootElement) {
7745                     rootElement = findDisplayCandidate(definitions);
7746
7747                     if (!rootElement) {
7748                         return logError('no process or collaboration present to display');
7749                     } else {
7750
7751                         logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
7752
7753                         // correct DI on the fly
7754                         plane.bpmnElement = rootElement;
7755                         registerDi(plane);
7756                     }
7757                 }
7758
7759
7760                 var ctx = visitRoot(rootElement, plane);
7761
7762                 if (is(rootElement, 'bpmn:Process')) {
7763                     handleProcess(rootElement, ctx);
7764                 } else if (is(rootElement, 'bpmn:Collaboration')) {
7765                     handleCollaboration(rootElement, ctx);
7766
7767                     // force drawing of everything not yet drawn that is part of the target
7768                     // DI
7769                     handleUnhandledProcesses(definitions.rootElements, ctx);
7770                 } else {
7771                     throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
7772                 }
7773
7774                 // handle all deferred elements
7775                 handleDeferred(deferred);
7776             }
7777
7778             function handleDeferred(deferred) {
7779                 forEach(deferred, function(d) {
7780                     d();
7781                 });
7782             }
7783
7784             function handleProcess(process, context) {
7785                 handleFlowElementsContainer(process, context);
7786                 handleIoSpecification(process.ioSpecification, context);
7787
7788                 handleArtifacts(process.artifacts, context);
7789
7790                 // log process handled
7791                 handledProcesses.push(process);
7792             }
7793
7794             function handleUnhandledProcesses(rootElements) {
7795
7796                 // walk through all processes that have not yet been drawn and draw them
7797                 // if they contain lanes with DI information.
7798                 // we do this to pass the free-floating lane test cases in the MIWG test
7799                 // suite
7800                 var processes = filter(rootElements, function(e) {
7801                     return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
7802                 });
7803
7804                 processes.forEach(contextual(handleProcess));
7805             }
7806
7807             function handleMessageFlow(messageFlow, context) {
7808                 visitIfDi(messageFlow, context);
7809             }
7810
7811             function handleMessageFlows(messageFlows, context) {
7812                 forEach(messageFlows, contextual(handleMessageFlow, context));
7813             }
7814
7815             function handleDataAssociation(association, context) {
7816                 visitIfDi(association, context);
7817             }
7818
7819             function handleDataInput(dataInput, context) {
7820                 visitIfDi(dataInput, context);
7821             }
7822
7823             function handleDataOutput(dataOutput, context) {
7824                 visitIfDi(dataOutput, context);
7825             }
7826
7827             function handleArtifact(artifact, context) {
7828
7829                 // bpmn:TextAnnotation
7830                 // bpmn:Group
7831                 // bpmn:Association
7832
7833                 visitIfDi(artifact, context);
7834             }
7835
7836             function handleArtifacts(artifacts, context) {
7837
7838                 forEach(artifacts, function(e) {
7839                     if (is(e, 'bpmn:Association')) {
7840                         deferred.push(function() {
7841                             handleArtifact(e, context);
7842                         });
7843                     } else {
7844                         handleArtifact(e, context);
7845                     }
7846                 });
7847             }
7848
7849             function handleIoSpecification(ioSpecification, context) {
7850
7851                 if (!ioSpecification) {
7852                     return;
7853                 }
7854
7855                 forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
7856                 forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
7857             }
7858
7859             function handleSubProcess(subProcess, context) {
7860                 handleFlowElementsContainer(subProcess, context);
7861                 handleArtifacts(subProcess.artifacts, context);
7862             }
7863
7864             function handleFlowNode(flowNode, context) {
7865                 var childCtx = visitIfDi(flowNode, context);
7866
7867                 if (is(flowNode, 'bpmn:SubProcess')) {
7868                     handleSubProcess(flowNode, childCtx || context);
7869                 }
7870             }
7871
7872             function handleSequenceFlow(sequenceFlow, context) {
7873                 visitIfDi(sequenceFlow, context);
7874             }
7875
7876             function handleDataElement(dataObject, context) {
7877                 visitIfDi(dataObject, context);
7878             }
7879
7880             function handleBoundaryEvent(dataObject, context) {
7881                 visitIfDi(dataObject, context);
7882             }
7883
7884             function handleLane(lane, context) {
7885                 var newContext = visitIfDi(lane, context);
7886
7887                 if (lane.childLaneSet) {
7888                     handleLaneSet(lane.childLaneSet, newContext || context);
7889                 } else {
7890                     var filterList = filter(lane.flowNodeRef, function(e) {
7891                         return e.$type !== 'bpmn:BoundaryEvent';
7892                     });
7893                     handleFlowElements(filterList, newContext || context);
7894                 }
7895             }
7896
7897             function handleLaneSet(laneSet, context) {
7898                 forEach(laneSet.lanes, contextual(handleLane, context));
7899             }
7900
7901             function handleLaneSets(laneSets, context) {
7902                 forEach(laneSets, contextual(handleLaneSet, context));
7903             }
7904
7905             function handleFlowElementsContainer(container, context) {
7906
7907                 if (container.laneSets) {
7908                     handleLaneSets(container.laneSets, context);
7909                     handleNonFlowNodes(container.flowElements);
7910                 } else {
7911                     handleFlowElements(container.flowElements, context);
7912                 }
7913             }
7914
7915             function handleNonFlowNodes(flowElements, context) {
7916                 forEach(flowElements, function(e) {
7917                     if (is(e, 'bpmn:SequenceFlow')) {
7918                         deferred.push(function() {
7919                             handleSequenceFlow(e, context);
7920                         });
7921                     } else if (is(e, 'bpmn:BoundaryEvent')) {
7922                         deferred.unshift(function() {
7923                             handleBoundaryEvent(e, context);
7924                         });
7925                     } else if (is(e, 'bpmn:DataObject')) {
7926                         // SKIP (assume correct referencing via DataObjectReference)
7927                     } else if (is(e, 'bpmn:DataStoreReference')) {
7928                         handleDataElement(e, context);
7929                     } else if (is(e, 'bpmn:DataObjectReference')) {
7930                         handleDataElement(e, context);
7931                     }
7932                 });
7933             }
7934
7935             function handleFlowElements(flowElements, context) {
7936                 forEach(flowElements, function(e) {
7937                     if (is(e, 'bpmn:SequenceFlow')) {
7938                         deferred.push(function() {
7939                             handleSequenceFlow(e, context);
7940                         });
7941                     } else if (is(e, 'bpmn:BoundaryEvent')) {
7942                         deferred.unshift(function() {
7943                             handleBoundaryEvent(e, context);
7944                         });
7945                     } else if (is(e, 'bpmn:FlowNode')) {
7946                         handleFlowNode(e, context);
7947
7948                         if (is(e, 'bpmn:Activity')) {
7949
7950                             handleIoSpecification(e.ioSpecification, context);
7951
7952                             // defer handling of associations
7953                             deferred.push(function() {
7954                                 forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
7955                                 forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
7956                             });
7957                         }
7958                     } else if (is(e, 'bpmn:DataObject')) {
7959                         // SKIP (assume correct referencing via DataObjectReference)
7960                     } else if (is(e, 'bpmn:DataStoreReference')) {
7961                         handleDataElement(e, context);
7962                     } else if (is(e, 'bpmn:DataObjectReference')) {
7963                         handleDataElement(e, context);
7964                     } else {
7965                         logError(
7966                             'unrecognized flowElement ' + elementToString(e) + ' in context ' +
7967                             (context ? elementToString(context.businessObject) : null), {
7968                                 element: e,
7969                                 context: context
7970                             });
7971                     }
7972                 });
7973             }
7974
7975             function handleParticipant(participant, context) {
7976                 var newCtx = visitIfDi(participant, context);
7977
7978                 var process = participant.processRef;
7979                 if (process) {
7980                     handleProcess(process, newCtx || context);
7981                 }
7982             }
7983
7984             function handleCollaboration(collaboration) {
7985
7986                 forEach(collaboration.participants, contextual(handleParticipant));
7987
7988                 handleArtifacts(collaboration.artifacts);
7989
7990                 // handle message flows latest in the process
7991                 deferred.push(function() {
7992                     handleMessageFlows(collaboration.messageFlows);
7993                 });
7994             }
7995
7996
7997             // /// API ////////////////////////////////
7998
7999             return {
8000                 handleDefinitions: handleDefinitions
8001             };
8002         }
8003
8004         module.exports = BpmnTreeWalker;
8005     }, {
8006         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
8007         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
8008         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
8009         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
8010         "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"
8011     }],
8012     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js": [function(require, module, exports) {
8013         'use strict';
8014
8015         var BpmnTreeWalker = require('./BpmnTreeWalker');
8016
8017
8018         /**
8019          * Import the definitions into a diagram.
8020          * 
8021          * Errors and warnings are reported through the specified callback.
8022          * 
8023          * @param {Diagram}
8024          *            diagram
8025          * @param {ModdleElement}
8026          *            definitions
8027          * @param {Function}
8028          *            done the callback, invoked with (err, [ warning ]) once the import
8029          *            is done
8030          */
8031         function importBpmnDiagram(diagram, definitions, done) {
8032
8033             var importer = diagram.get('bpmnImporter'),
8034                 eventBus = diagram.get('eventBus');
8035
8036             var error,
8037                 warnings = [];
8038
8039             function parse(definitions) {
8040
8041                 var visitor = {
8042
8043                     root: function(element) {
8044                         return importer.add(element);
8045                     },
8046
8047                     element: function(element, parentShape) {
8048                         return importer.add(element, parentShape);
8049                     },
8050
8051                     error: function(message, context) {
8052                         warnings.push({
8053                             message: message,
8054                             context: context
8055                         });
8056                     }
8057                 };
8058
8059                 var walker = new BpmnTreeWalker(visitor);
8060
8061                 // import
8062                 walker.handleDefinitions(definitions);
8063             }
8064
8065             eventBus.fire('import.start');
8066
8067             try {
8068                 parse(definitions);
8069             } catch (e) {
8070                 error = e;
8071             }
8072
8073             eventBus.fire(error ? 'import.error' : 'import.success', {
8074                 error: error,
8075                 warnings: warnings
8076             });
8077             done(error, warnings);
8078         }
8079
8080         module.exports.importBpmnDiagram = importBpmnDiagram;
8081     }, {
8082         "./BpmnTreeWalker": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js"
8083     }],
8084     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js": [function(require, module, exports) {
8085         'use strict';
8086
8087         module.exports.elementToString = function(e) {
8088             if (!e) {
8089                 return '<null>';
8090             }
8091
8092             return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
8093         };
8094     }, {}],
8095     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js": [function(require, module, exports) {
8096         module.exports = {
8097             bpmnImporter: ['type', require('./BpmnImporter')]
8098         };
8099     }, {
8100         "./BpmnImporter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js"
8101     }],
8102     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js": [function(require, module, exports) {
8103         'use strict';
8104
8105         var is = require('./ModelUtil').is,
8106             getBusinessObject = require('./ModelUtil').getBusinessObject;
8107
8108         module.exports.isExpanded = function(element) {
8109
8110             if (is(element, 'bpmn:CallActivity')) {
8111                 return false;
8112             }
8113
8114             if (is(element, 'bpmn:SubProcess')) {
8115                 return getBusinessObject(element).di.isExpanded;
8116             }
8117
8118             if (is(element, 'bpmn:Participant')) {
8119                 return !!getBusinessObject(element).processRef;
8120             }
8121
8122             return true;
8123         };
8124
8125     }, {
8126         "./ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
8127     }],
8128     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js": [function(require, module, exports) {
8129         'use strict';
8130
8131         var assign = require('lodash/object/assign');
8132
8133
8134         var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
8135             width: 90,
8136             height: 20
8137         };
8138
8139
8140         /**
8141          * Returns true if the given semantic has an external label
8142          * 
8143          * @param {BpmnElement}
8144          *            semantic
8145          * @return {Boolean} true if has label
8146          */
8147         module.exports.hasExternalLabel = function(semantic) {
8148
8149             return semantic.$instanceOf('bpmn:Event') ||
8150                 // semantic.$instanceOf('bpmn:Gateway') ||
8151                 semantic.$instanceOf('bpmn:DataStoreReference') ||
8152                 semantic.$instanceOf('bpmn:DataObjectReference') ||
8153                 semantic.$instanceOf('bpmn:SequenceFlow') ||
8154                 semantic.$instanceOf('bpmn:MessageFlow');
8155         };
8156
8157
8158         /**
8159          * Get the middle of a number of waypoints
8160          * 
8161          * @param {Array
8162          *            <Point>} waypoints
8163          * @return {Point} the mid point
8164          */
8165         var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
8166
8167             var mid = waypoints.length / 2 - 1;
8168
8169             var first = waypoints[Math.floor(mid)];
8170             var second = waypoints[Math.ceil(mid + 0.01)];
8171
8172             return {
8173                 x: first.x + (second.x - first.x) / 2,
8174                 y: first.y + (second.y - first.y) / 2
8175             };
8176         };
8177
8178
8179         var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
8180
8181             if (element.waypoints) {
8182                 return getWaypointsMid(element.waypoints);
8183             } else {
8184                 return {
8185                     x: element.x + element.width / 2,
8186                     y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
8187                 };
8188             }
8189         };
8190
8191         /**
8192          * Returns the bounds of an elements label, parsed from the elements DI or
8193          * generated from its bounds.
8194          * 
8195          * @param {BpmnElement}
8196          *            semantic
8197          * @param {djs.model.Base}
8198          *            element
8199          */
8200         module.exports.getExternalLabelBounds = function(semantic, element) {
8201
8202             var mid,
8203                 size,
8204                 bounds,
8205                 di = semantic.di,
8206                 label = di.label;
8207
8208             if (label && label.bounds) {
8209                 bounds = label.bounds;
8210
8211                 size = {
8212                     width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
8213                     height: bounds.height
8214                 };
8215
8216                 mid = {
8217                     x: bounds.x + bounds.width / 2,
8218                     y: bounds.y + bounds.height / 2
8219                 };
8220             } else {
8221
8222                 mid = getExternalLabelMid(element);
8223
8224                 size = DEFAULT_LABEL_SIZE;
8225             }
8226
8227             return assign({
8228                 x: mid.x - size.width / 2,
8229                 y: mid.y - size.height / 2
8230             }, size);
8231         };
8232     }, {
8233         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8234     }],
8235     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js": [function(require, module, exports) {
8236         'use strict';
8237
8238         /**
8239          * Is an element of the given BPMN type?
8240          * 
8241          * @param {djs.model.Base|ModdleElement}
8242          *            element
8243          * @param {String}
8244          *            type
8245          * 
8246          * @return {Boolean}
8247          */
8248         function is(element, type) {
8249             var bo = getBusinessObject(element);
8250
8251             return bo && bo.$instanceOf(type);
8252         }
8253
8254         module.exports.is = is;
8255
8256
8257         /**
8258          * Return the business object for a given element.
8259          * 
8260          * @param {djs.model.Base|ModdleElement}
8261          *            element
8262          * 
8263          * @return {ModdleElement}
8264          */
8265         function getBusinessObject(element) {
8266             return (element && element.businessObject) || element;
8267         }
8268
8269         module.exports.getBusinessObject = getBusinessObject;
8270
8271     }, {}],
8272     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js": [function(require, module, exports) {
8273         module.exports = require('./lib/simple');
8274     }, {
8275         "./lib/simple": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js"
8276     }],
8277     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js": [function(require, module, exports) {
8278         'use strict';
8279
8280         var isString = require('lodash/lang/isString'),
8281             isFunction = require('lodash/lang/isFunction'),
8282             assign = require('lodash/object/assign');
8283
8284         var Moddle = require('moddle'),
8285             XmlReader = require('moddle-xml/lib/reader'),
8286             XmlWriter = require('moddle-xml/lib/writer');
8287
8288         /**
8289          * A sub class of {@link Moddle} with support for import and export of BPMN 2.0
8290          * xml files.
8291          * 
8292          * @class BpmnModdle
8293          * @extends Moddle
8294          * 
8295          * @param {Object|Array}
8296          *            packages to use for instantiating the model
8297          * @param {Object}
8298          *            [options] additional options to pass over
8299          */
8300         function BpmnModdle(packages, options) {
8301             Moddle.call(this, packages, options);
8302         }
8303
8304         BpmnModdle.prototype = Object.create(Moddle.prototype);
8305
8306         module.exports = BpmnModdle;
8307
8308
8309         /**
8310          * Instantiates a BPMN model tree from a given xml string.
8311          * 
8312          * @param {String}
8313          *            xmlStr
8314          * @param {String}
8315          *            [typeName='bpmn:Definitions'] name of the root element
8316          * @param {Object}
8317          *            [options] options to pass to the underlying reader
8318          * @param {Function}
8319          *            done callback that is invoked with (err, result, parseContext)
8320          *            once the import completes
8321          */
8322         BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
8323
8324             if (!isString(typeName)) {
8325                 done = options;
8326                 options = typeName;
8327                 typeName = 'bpmn:Definitions';
8328             }
8329
8330             if (isFunction(options)) {
8331                 done = options;
8332                 options = {};
8333             }
8334
8335             var reader = new XmlReader(assign({
8336                 model: this,
8337                 lax: true
8338             }, options));
8339             var rootHandler = reader.handler(typeName);
8340
8341             reader.fromXML(xmlStr, rootHandler, done);
8342         };
8343
8344
8345         /**
8346          * Serializes a BPMN 2.0 object tree to XML.
8347          * 
8348          * @param {String}
8349          *            element the root element, typically an instance of
8350          *            `bpmn:Definitions`
8351          * @param {Object}
8352          *            [options] to pass to the underlying writer
8353          * @param {Function}
8354          *            done callback invoked with (err, xmlStr) once the import completes
8355          */
8356         
8357       
8358         
8359         
8360         BpmnModdle.prototype.toXML = function(element, options, done) {
8361
8362             if (isFunction(options)) {
8363                 done = options;
8364                 options = {};
8365             }
8366
8367             var writer = new XmlWriter(options);
8368             try {
8369                 var result = writer.toXML(element);
8370                 modelXML = result;
8371                 list_models[selected_model]=result;
8372                 done(null, result);
8373             } catch (e) {
8374                 done(e);
8375             }
8376         };
8377
8378     }, {
8379         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
8380         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
8381         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
8382         "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
8383         "moddle-xml/lib/reader": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js",
8384         "moddle-xml/lib/writer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js"
8385     }],
8386     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js": [function(require, module, exports) {
8387         'use strict';
8388
8389         var ID_PATTERN = /^(.*:)?id$/;
8390
8391         /**
8392          * Extends the bpmn instance with id support.
8393          * 
8394          * @example
8395          * 
8396          * var moddle, ids;
8397          * 
8398          * require('id-support').extend(moddle, ids);
8399          * 
8400          * moddle.ids.next(); // create a next id moddle.ids; // ids instance
8401          *  // claims id as used moddle.create('foo:Bar', { id: 'fooobar1' });
8402          * 
8403          * 
8404          * @param {Moddle}
8405          *            model
8406          * @param {Ids}
8407          *            ids
8408          * 
8409          * @return {Moddle} the extended moddle instance
8410          */
8411         module.exports.extend = function(model, ids) {
8412
8413             var set = model.properties.set;
8414
8415             // do not reinitialize setter
8416             // unless it is already initialized
8417             if (!model.ids) {
8418
8419                 model.properties.set = function(target, property, value) {
8420
8421                     // ensure we log used ids once they are assigned
8422                     // to model elements
8423                     if (ID_PATTERN.test(property)) {
8424
8425                         var assigned = model.ids.assigned(value);
8426                         if (assigned && assigned !== target) {
8427                             throw new Error('id <' + value + '> already used');
8428                         }
8429
8430                         model.ids.claim(value, target);
8431                     }
8432
8433                     set.call(this, target, property, value);
8434                 };
8435             }
8436
8437             model.ids = ids;
8438
8439             return model;
8440         };
8441     }, {}],
8442     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js": [function(require, module, exports) {
8443         'use strict';
8444
8445         var assign = require('lodash/object/assign');
8446
8447         var BpmnModdle = require('./bpmn-moddle');
8448
8449         var packages = {
8450             bpmn: require('../resources/bpmn/json/bpmn.json'),
8451             bpmndi: require('../resources/bpmn/json/bpmndi.json'),
8452             dc: require('../resources/bpmn/json/dc.json'),
8453             di: require('../resources/bpmn/json/di.json')
8454         };
8455
8456         module.exports = function(additionalPackages, options) {
8457             return new BpmnModdle(assign({}, packages, additionalPackages), options);
8458         };
8459     }, {
8460         "../resources/bpmn/json/bpmn.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json",
8461         "../resources/bpmn/json/bpmndi.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json",
8462         "../resources/bpmn/json/dc.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json",
8463         "../resources/bpmn/json/di.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json",
8464         "./bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js",
8465         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8466     }],
8467     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js": [function(require, module, exports) {
8468         'use strict';
8469
8470         function capitalize(string) {
8471             return string.charAt(0).toUpperCase() + string.slice(1);
8472         }
8473
8474         function lower(string) {
8475             return string.charAt(0).toLowerCase() + string.slice(1);
8476         }
8477
8478         function hasLowerCaseAlias(pkg) {
8479             return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
8480         }
8481
8482
8483         module.exports.aliasToName = function(alias, pkg) {
8484             if (hasLowerCaseAlias(pkg)) {
8485                 return capitalize(alias);
8486             } else {
8487                 return alias;
8488             }
8489         };
8490
8491         module.exports.nameToAlias = function(name, pkg) {
8492             if (hasLowerCaseAlias(pkg)) {
8493                 return lower(name);
8494             } else {
8495                 return name;
8496             }
8497         };
8498
8499         module.exports.DEFAULT_NS_MAP = {
8500             'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
8501         };
8502
8503         module.exports.XSI_TYPE = 'xsi:type';
8504     }, {}],
8505     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js": [function(require, module, exports) {
8506         'use strict';
8507
8508         var reduce = require('lodash/collection/reduce'),
8509             forEach = require('lodash/collection/forEach'),
8510             find = require('lodash/collection/find'),
8511             assign = require('lodash/object/assign'),
8512             defer = require('lodash/function/defer');
8513
8514         var Stack = require('tiny-stack'),
8515             SaxParser = require('sax').parser,
8516             Moddle = require('moddle'),
8517             parseNameNs = require('moddle/lib/ns').parseName,
8518             Types = require('moddle/lib/types'),
8519             coerceType = Types.coerceType,
8520             isSimpleType = Types.isSimple,
8521             common = require('./common'),
8522             XSI_TYPE = common.XSI_TYPE,
8523             XSI_URI = common.DEFAULT_NS_MAP.xsi,
8524             aliasToName = common.aliasToName;
8525
8526         function parseNodeAttributes(node) {
8527             var nodeAttrs = node.attributes;
8528
8529             return reduce(nodeAttrs, function(result, v, k) {
8530                 var name, ns;
8531
8532                 if (!v.local) {
8533                     name = v.prefix;
8534                 } else {
8535                     ns = parseNameNs(v.name, v.prefix);
8536                     name = ns.name;
8537                 }
8538
8539                 result[name] = v.value;
8540                 return result;
8541             }, {});
8542         }
8543
8544         function normalizeType(node, attr, model) {
8545             var nameNs = parseNameNs(attr.value);
8546
8547             var uri = node.ns[nameNs.prefix || ''],
8548                 localName = nameNs.localName,
8549                 pkg = uri && model.getPackage(uri),
8550                 typePrefix;
8551
8552             if (pkg) {
8553                 typePrefix = pkg.xml && pkg.xml.typePrefix;
8554
8555                 if (typePrefix && localName.indexOf(typePrefix) === 0) {
8556                     localName = localName.slice(typePrefix.length);
8557                 }
8558
8559                 attr.value = pkg.prefix + ':' + localName;
8560             }
8561         }
8562
8563         /**
8564          * Normalizes namespaces for a node given an optional default namespace and a
8565          * number of mappings from uris to default prefixes.
8566          * 
8567          * @param {XmlNode}
8568          *            node
8569          * @param {Model}
8570          *            model the model containing all registered namespaces
8571          * @param {Uri}
8572          *            defaultNsUri
8573          */
8574         function normalizeNamespaces(node, model, defaultNsUri) {
8575             var uri, prefix;
8576
8577             uri = node.uri || defaultNsUri;
8578
8579             if (uri) {
8580                 var pkg = model.getPackage(uri);
8581
8582                 if (pkg) {
8583                     prefix = pkg.prefix;
8584                 } else {
8585                     prefix = node.prefix;
8586                 }
8587
8588                 node.prefix = prefix;
8589                 node.uri = uri;
8590             }
8591
8592             forEach(node.attributes, function(attr) {
8593
8594                 // normalize xsi:type attributes because the
8595                 // assigned type may or may not be namespace prefixed
8596                 if (attr.uri === XSI_URI && attr.local === 'type') {
8597                     normalizeType(node, attr, model);
8598                 }
8599
8600                 normalizeNamespaces(attr, model, null);
8601             });
8602         }
8603
8604
8605         /**
8606          * A parse context.
8607          * 
8608          * @class
8609          * 
8610          * @param {Object}
8611          *            options
8612          * @param {ElementHandler}
8613          *            options.parseRoot the root handler for parsing a document
8614          * @param {boolean}
8615          *            [options.lax=false] whether or not to ignore invalid elements
8616          */
8617         function Context(options) {
8618
8619             /**
8620              * @property {ElementHandler} parseRoot
8621              */
8622
8623             /**
8624              * @property {Boolean} lax
8625              */
8626
8627             assign(this, options);
8628
8629             var elementsById = this.elementsById = {};
8630             var references = this.references = [];
8631             var warnings = this.warnings = [];
8632
8633             this.addReference = function(reference) {
8634                 references.push(reference);
8635             };
8636
8637             this.addElement = function(id, element) {
8638
8639                 if (!id || !element) {
8640                     throw new Error('[xml-reader] id or ctx must not be null');
8641                 }
8642
8643                 elementsById[id] = element;
8644             };
8645
8646             this.addWarning = function(w) {
8647                 warnings.push(w);
8648             };
8649         }
8650
8651         function BaseHandler() {}
8652
8653         BaseHandler.prototype.handleEnd = function() {};
8654         BaseHandler.prototype.handleText = function() {};
8655         BaseHandler.prototype.handleNode = function() {};
8656
8657
8658         /**
8659          * A simple pass through handler that does nothing except for ignoring all input
8660          * it receives.
8661          * 
8662          * This is used to ignore unknown elements and attributes.
8663          */
8664         function NoopHandler() {}
8665
8666         NoopHandler.prototype = new BaseHandler();
8667
8668         NoopHandler.prototype.handleNode = function() {
8669             return this;
8670         };
8671
8672         function BodyHandler() {}
8673
8674         BodyHandler.prototype = new BaseHandler();
8675
8676         BodyHandler.prototype.handleText = function(text) {
8677             this.body = (this.body || '') + text;
8678         };
8679
8680         function ReferenceHandler(property, context) {
8681             this.property = property;
8682             this.context = context;
8683         }
8684
8685         ReferenceHandler.prototype = new BodyHandler();
8686
8687         ReferenceHandler.prototype.handleNode = function(node) {
8688
8689             if (this.element) {
8690                 throw new Error('expected no sub nodes');
8691             } else {
8692                 this.element = this.createReference(node);
8693             }
8694
8695             return this;
8696         };
8697
8698         ReferenceHandler.prototype.handleEnd = function() {
8699             this.element.id = this.body;
8700         };
8701
8702         ReferenceHandler.prototype.createReference = function() {
8703             return {
8704                 property: this.property.ns.name,
8705                 id: ''
8706             };
8707         };
8708
8709         function ValueHandler(propertyDesc, element) {
8710             this.element = element;
8711             this.propertyDesc = propertyDesc;
8712         }
8713
8714         ValueHandler.prototype = new BodyHandler();
8715
8716         ValueHandler.prototype.handleEnd = function() {
8717
8718             var value = this.body,
8719                 element = this.element,
8720                 propertyDesc = this.propertyDesc;
8721
8722             value = coerceType(propertyDesc.type, value);
8723
8724             if (propertyDesc.isMany) {
8725                 element.get(propertyDesc.name).push(value);
8726             } else {
8727                 element.set(propertyDesc.name, value);
8728             }
8729         };
8730
8731
8732         function BaseElementHandler() {}
8733
8734         BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
8735
8736         BaseElementHandler.prototype.handleNode = function(node) {
8737             var parser = this,
8738                 element = this.element,
8739                 id;
8740
8741             if (!element) {
8742                 element = this.element = this.createElement(node);
8743                 id = element.id;
8744
8745                 if (id) {
8746                     this.context.addElement(id, element);
8747                 }
8748             } else {
8749                 parser = this.handleChild(node);
8750             }
8751
8752             return parser;
8753         };
8754
8755         /**
8756          * @class XMLReader.ElementHandler
8757          * 
8758          */
8759         function ElementHandler(model, type, context) {
8760             this.model = model;
8761             this.type = model.getType(type);
8762             this.context = context;
8763         }
8764
8765         ElementHandler.prototype = new BaseElementHandler();
8766
8767         ElementHandler.prototype.addReference = function(reference) {
8768             this.context.addReference(reference);
8769         };
8770
8771         ElementHandler.prototype.handleEnd = function() {
8772
8773             var value = this.body,
8774                 element = this.element,
8775                 descriptor = element.$descriptor,
8776                 bodyProperty = descriptor.bodyProperty;
8777
8778             if (bodyProperty && value !== undefined) {
8779                 value = coerceType(bodyProperty.type, value);
8780                 element.set(bodyProperty.name, value);
8781             }
8782         };
8783
8784         /**
8785          * Create an instance of the model from the given node.
8786          * 
8787          * @param {Element}
8788          *            node the xml node
8789          */
8790         ElementHandler.prototype.createElement = function(node) {
8791             var attributes = parseNodeAttributes(node),
8792                 Type = this.type,
8793                 descriptor = Type.$descriptor,
8794                 context = this.context,
8795                 instance = new Type({});
8796
8797             forEach(attributes, function(value, name) {
8798
8799                 var prop = descriptor.propertiesByName[name];
8800
8801                 if (prop && prop.isReference) {
8802                     context.addReference({
8803                         element: instance,
8804                         property: prop.ns.name,
8805                         id: value
8806                     });
8807                 } else {
8808                     if (prop) {
8809                         value = coerceType(prop.type, value);
8810                     }
8811
8812                     instance.set(name, value);
8813                 }
8814             });
8815
8816             return instance;
8817         };
8818
8819         ElementHandler.prototype.getPropertyForNode = function(node) {
8820
8821             var nameNs = parseNameNs(node.local, node.prefix);
8822
8823             var type = this.type,
8824                 model = this.model,
8825                 descriptor = type.$descriptor;
8826
8827             var propertyName = nameNs.name,
8828                 property = descriptor.propertiesByName[propertyName],
8829                 elementTypeName,
8830                 elementType,
8831                 typeAnnotation;
8832
8833             // search for properties by name first
8834
8835             if (property) {
8836
8837                 if (property.serialize === XSI_TYPE) {
8838                     typeAnnotation = node.attributes[XSI_TYPE];
8839
8840                     // xsi type is optional, if it does not exists the
8841                     // default type is assumed
8842                     if (typeAnnotation) {
8843
8844                         elementTypeName = typeAnnotation.value;
8845
8846                         // TODO: extract real name from attribute
8847                         elementType = model.getType(elementTypeName);
8848
8849                         return assign({}, property, {
8850                             effectiveType: elementType.$descriptor.name
8851                         });
8852                     }
8853                 }
8854
8855                 // search for properties by name first
8856                 return property;
8857             }
8858
8859
8860             var pkg = model.getPackage(nameNs.prefix);
8861
8862             if (pkg) {
8863                 elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
8864                 elementType = model.getType(elementTypeName);
8865
8866                 // search for collection members later
8867                 property = find(descriptor.properties, function(p) {
8868                     return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
8869                 });
8870
8871                 if (property) {
8872                     return assign({}, property, {
8873                         effectiveType: elementType.$descriptor.name
8874                     });
8875                 }
8876             } else {
8877                 // parse unknown element (maybe extension)
8878                 property = find(descriptor.properties, function(p) {
8879                     return !p.isReference && !p.isAttribute && p.type === 'Element';
8880                 });
8881
8882                 if (property) {
8883                     return property;
8884                 }
8885             }
8886
8887             throw new Error('unrecognized element <' + nameNs.name + '>');
8888         };
8889
8890         ElementHandler.prototype.toString = function() {
8891             return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
8892         };
8893
8894         ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
8895             return new ValueHandler(propertyDesc, element);
8896         };
8897
8898         ElementHandler.prototype.referenceHandler = function(propertyDesc) {
8899             return new ReferenceHandler(propertyDesc, this.context);
8900         };
8901
8902         ElementHandler.prototype.handler = function(type) {
8903             if (type === 'Element') {
8904                 return new GenericElementHandler(this.model, type, this.context);
8905             } else {
8906                 return new ElementHandler(this.model, type, this.context);
8907             }
8908         };
8909
8910         /**
8911          * Handle the child element parsing
8912          * 
8913          * @param {Element}
8914          *            node the xml node
8915          */
8916         ElementHandler.prototype.handleChild = function(node) {
8917             var propertyDesc, type, element, childHandler;
8918
8919             propertyDesc = this.getPropertyForNode(node);
8920             element = this.element;
8921
8922             type = propertyDesc.effectiveType || propertyDesc.type;
8923
8924             if (isSimpleType(type)) {
8925                 return this.valueHandler(propertyDesc, element);
8926             }
8927
8928             if (propertyDesc.isReference) {
8929                 childHandler = this.referenceHandler(propertyDesc).handleNode(node);
8930             } else {
8931                 childHandler = this.handler(type).handleNode(node);
8932             }
8933
8934             var newElement = childHandler.element;
8935
8936             // child handles may decide to skip elements
8937             // by not returning anything
8938             if (newElement !== undefined) {
8939
8940                 if (propertyDesc.isMany) {
8941                     element.get(propertyDesc.name).push(newElement);
8942                 } else {
8943                     element.set(propertyDesc.name, newElement);
8944                 }
8945
8946                 if (propertyDesc.isReference) {
8947                     assign(newElement, {
8948                         element: element
8949                     });
8950
8951                     this.context.addReference(newElement);
8952                 } else {
8953                     // establish child -> parent relationship
8954                     newElement.$parent = element;
8955                 }
8956             }
8957
8958             return childHandler;
8959         };
8960
8961
8962         function GenericElementHandler(model, type, context) {
8963             this.model = model;
8964             this.context = context;
8965         }
8966
8967         GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
8968
8969         GenericElementHandler.prototype.createElement = function(node) {
8970
8971             var name = node.name,
8972                 prefix = node.prefix,
8973                 uri = node.ns[prefix],
8974                 attributes = node.attributes;
8975
8976             return this.model.createAny(name, uri, attributes);
8977         };
8978
8979         GenericElementHandler.prototype.handleChild = function(node) {
8980
8981             var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
8982                 element = this.element;
8983
8984             var newElement = handler.element,
8985                 children;
8986
8987             if (newElement !== undefined) {
8988                 children = element.$children = element.$children || [];
8989                 children.push(newElement);
8990
8991                 // establish child -> parent relationship
8992                 newElement.$parent = element;
8993             }
8994
8995             return handler;
8996         };
8997
8998         GenericElementHandler.prototype.handleText = function(text) {
8999             this.body = this.body || '' + text;
9000         };
9001
9002         GenericElementHandler.prototype.handleEnd = function() {
9003             if (this.body) {
9004                 this.element.$body = this.body;
9005             }
9006         };
9007
9008         /**
9009          * A reader for a meta-model
9010          * 
9011          * @param {Object}
9012          *            options
9013          * @param {Model}
9014          *            options.model used to read xml files
9015          * @param {Boolean}
9016          *            options.lax whether to make parse errors warnings
9017          */
9018         function XMLReader(options) {
9019
9020             if (options instanceof Moddle) {
9021                 options = {
9022                     model: options
9023                 };
9024             }
9025
9026             assign(this, {
9027                 lax: false
9028             }, options);
9029         }
9030
9031
9032         XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
9033
9034             var model = this.model,
9035                 lax = this.lax,
9036                 context = new Context({
9037                     parseRoot: rootHandler
9038                 });
9039
9040             var parser = new SaxParser(true, {
9041                     xmlns: true,
9042                     trim: true
9043                 }),
9044                 stack = new Stack();
9045
9046             rootHandler.context = context;
9047
9048             // push root handler
9049             stack.push(rootHandler);
9050
9051
9052             function resolveReferences() {
9053
9054                 var elementsById = context.elementsById;
9055                 var references = context.references;
9056
9057                 var i, r;
9058
9059                 for (i = 0; !!(r = references[i]); i++) {
9060                     var element = r.element;
9061                     var reference = elementsById[r.id];
9062                     var property = element.$descriptor.propertiesByName[r.property];
9063
9064                     if (!reference) {
9065                         context.addWarning({
9066                             message: 'unresolved reference <' + r.id + '>',
9067                             element: r.element,
9068                             property: r.property,
9069                             value: r.id
9070                         });
9071                     }
9072
9073                     if (property.isMany) {
9074                         var collection = element.get(property.name),
9075                             idx = collection.indexOf(r);
9076
9077                         if (!reference) {
9078                             // remove unresolvable reference
9079                             collection.splice(idx, 1);
9080                         } else {
9081                             // update reference
9082                             collection[idx] = reference;
9083                         }
9084                     } else {
9085                         element.set(property.name, reference);
9086                     }
9087                 }
9088             }
9089
9090             function handleClose(tagName) {
9091                 stack.pop().handleEnd();
9092             }
9093
9094             function handleOpen(node) {
9095                 var handler = stack.peek();
9096
9097                 normalizeNamespaces(node, model);
9098
9099                 try {
9100                     stack.push(handler.handleNode(node));
9101                 } catch (e) {
9102
9103                     var line = this.line,
9104                         column = this.column;
9105
9106                     var message =
9107                         'unparsable content <' + node.name + '> detected\n\t' +
9108                         'line: ' + line + '\n\t' +
9109                         'column: ' + column + '\n\t' +
9110                         'nested error: ' + e.message;
9111
9112                     if (lax) {
9113                         context.addWarning({
9114                             message: message,
9115                             error: e
9116                         });
9117
9118                         console.warn('could not parse node');
9119                         console.warn(e);
9120
9121                         stack.push(new NoopHandler());
9122                     } else {
9123                         console.error('could not parse document');
9124                         console.error(e);
9125
9126                         throw new Error(message);
9127                     }
9128                 }
9129             }
9130
9131             function handleText(text) {
9132                 stack.peek().handleText(text);
9133             }
9134
9135             parser.onopentag = handleOpen;
9136             parser.oncdata = parser.ontext = handleText;
9137             parser.onclosetag = handleClose;
9138             parser.onend = resolveReferences;
9139
9140             // deferred parse XML to make loading really ascnchronous
9141             // this ensures the execution environment (node or browser)
9142             // is kept responsive and that certain optimization strategies
9143             // can kick in
9144             defer(function() {
9145                 var error;
9146
9147                 try {
9148                     parser.write(xml).close();
9149                 } catch (e) {
9150                     error = e;
9151                 }
9152
9153                 done(error, error ? undefined : rootHandler.element, context);
9154             });
9155         };
9156
9157         XMLReader.prototype.handler = function(name) {
9158             return new ElementHandler(this.model, name);
9159         };
9160
9161         module.exports = XMLReader;
9162         module.exports.ElementHandler = ElementHandler;
9163     }, {
9164         "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9165         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
9166         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9167         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
9168         "lodash/function/defer": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js",
9169         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9170         "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
9171         "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9172         "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
9173         "sax": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js",
9174         "tiny-stack": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\tiny-stack\\lib\\tiny-stack.js"
9175     }],
9176     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js": [function(require, module, exports) {
9177         'use strict';
9178
9179         var map = require('lodash/collection/map'),
9180             forEach = require('lodash/collection/forEach'),
9181             isString = require('lodash/lang/isString'),
9182             filter = require('lodash/collection/filter'),
9183             assign = require('lodash/object/assign');
9184
9185         var Types = require('moddle/lib/types'),
9186             parseNameNs = require('moddle/lib/ns').parseName,
9187             common = require('./common'),
9188             nameToAlias = common.nameToAlias;
9189
9190         var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
9191             ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
9192             DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
9193             XSI_TYPE = common.XSI_TYPE;
9194
9195
9196         function nsName(ns) {
9197             if (isString(ns)) {
9198                 return ns;
9199             } else {
9200                 return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
9201             }
9202         }
9203
9204         function getElementNs(ns, descriptor) {
9205             if (descriptor.isGeneric) {
9206                 return descriptor.name;
9207             } else {
9208                 return assign({
9209                     localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg)
9210                 }, ns);
9211             }
9212         }
9213
9214         function getPropertyNs(ns, descriptor) {
9215             return assign({
9216                 localName: descriptor.ns.localName
9217             }, ns);
9218         }
9219
9220         function getSerializableProperties(element) {
9221             var descriptor = element.$descriptor;
9222
9223             return filter(descriptor.properties, function(p) {
9224                 var name = p.name;
9225
9226                 // do not serialize defaults
9227                 if (!element.hasOwnProperty(name)) {
9228                     return false;
9229                 }
9230
9231                 var value = element[name];
9232
9233                 // do not serialize default equals
9234                 if (value === p.default) {
9235                     return false;
9236                 }
9237
9238                 return p.isMany ? value.length : true;
9239             });
9240         }
9241
9242         var ESCAPE_MAP = {
9243             '\n': '10',
9244             '\n\r': '10',
9245             '"': '34',
9246             '\'': '39',
9247             '<': '60',
9248             '>': '62',
9249             '&': '38'
9250         };
9251
9252         /**
9253          * Escape a string attribute to not contain any bad values (line breaks, '"',
9254          * ...)
9255          * 
9256          * @param {String}
9257          *            str the string to escape
9258          * @return {String} the escaped string
9259          */
9260         function escapeAttr(str) {
9261
9262             // ensure we are handling strings here
9263             str = isString(str) ? str : '' + str;
9264
9265             return str.replace(ESCAPE_CHARS, function(str) {
9266                 return '&#' + ESCAPE_MAP[str] + ';';
9267             });
9268         }
9269
9270         function filterAttributes(props) {
9271             return filter(props, function(p) {
9272                 return p.isAttr;
9273             });
9274         }
9275
9276         function filterContained(props) {
9277             return filter(props, function(p) {
9278                 return !p.isAttr;
9279             });
9280         }
9281
9282
9283         function ReferenceSerializer(parent, ns) {
9284             this.ns = ns;
9285         }
9286
9287         ReferenceSerializer.prototype.build = function(element) {
9288             this.element = element;
9289             return this;
9290         };
9291
9292         ReferenceSerializer.prototype.serializeTo = function(writer) {
9293             writer
9294                 .appendIndent()
9295                 .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
9296                 .appendNewLine();
9297         };
9298
9299         function BodySerializer() {}
9300
9301         BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
9302             var escape = this.escape;
9303
9304             if (escape) {
9305                 writer.append('<![CDATA[');
9306             }
9307
9308             writer.append(this.value);
9309
9310             if (escape) {
9311                 writer.append(']]>');
9312             }
9313         };
9314
9315         BodySerializer.prototype.build = function(prop, value) {
9316             this.value = value;
9317
9318             if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
9319                 this.escape = true;
9320             }
9321
9322             return this;
9323         };
9324
9325         function ValueSerializer(ns) {
9326             this.ns = ns;
9327         }
9328
9329         ValueSerializer.prototype = new BodySerializer();
9330
9331         ValueSerializer.prototype.serializeTo = function(writer) {
9332
9333             writer
9334                 .appendIndent()
9335                 .append('<' + nsName(this.ns) + '>');
9336
9337             this.serializeValue(writer);
9338
9339             writer
9340                 .append('</' + nsName(this.ns) + '>')
9341                 .appendNewLine();
9342         };
9343
9344         function ElementSerializer(parent, ns) {
9345             this.body = [];
9346             this.attrs = [];
9347
9348             this.parent = parent;
9349             this.ns = ns;
9350         }
9351
9352         ElementSerializer.prototype.build = function(element) {
9353             this.element = element;
9354
9355             var otherAttrs = this.parseNsAttributes(element);
9356
9357             if (!this.ns) {
9358                 this.ns = this.nsTagName(element.$descriptor);
9359             }
9360
9361             if (element.$descriptor.isGeneric) {
9362                 this.parseGeneric(element);
9363             } else {
9364                 var properties = getSerializableProperties(element);
9365
9366                 this.parseAttributes(filterAttributes(properties));
9367                 this.parseContainments(filterContained(properties));
9368
9369                 this.parseGenericAttributes(element, otherAttrs);
9370             }
9371
9372             return this;
9373         };
9374
9375         ElementSerializer.prototype.nsTagName = function(descriptor) {
9376             var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9377             return getElementNs(effectiveNs, descriptor);
9378         };
9379
9380         ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
9381             var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9382             return getPropertyNs(effectiveNs, descriptor);
9383         };
9384
9385         ElementSerializer.prototype.isLocalNs = function(ns) {
9386             return ns.uri === this.ns.uri;
9387         };
9388
9389         ElementSerializer.prototype.nsAttributeName = function(element) {
9390
9391             var ns;
9392
9393             if (isString(element)) {
9394                 ns = parseNameNs(element);
9395             } else
9396             if (element.ns) {
9397                 ns = element.ns;
9398             }
9399
9400             var effectiveNs = this.logNamespaceUsed(ns);
9401
9402             // strip prefix if same namespace like parent
9403             if (this.isLocalNs(effectiveNs)) {
9404                 return {
9405                     localName: ns.localName
9406                 };
9407             } else {
9408                 return assign({
9409                     localName: ns.localName
9410                 }, effectiveNs);
9411             }
9412         };
9413
9414         ElementSerializer.prototype.parseGeneric = function(element) {
9415
9416             var self = this,
9417                 body = this.body,
9418                 attrs = this.attrs;
9419
9420             forEach(element, function(val, key) {
9421
9422                 if (key === '$body') {
9423                     body.push(new BodySerializer().build({
9424                         type: 'String'
9425                     }, val));
9426                 } else
9427                 if (key === '$children') {
9428                     forEach(val, function(child) {
9429                         body.push(new ElementSerializer(self).build(child));
9430                     });
9431                 } else
9432                 if (key.indexOf('$') !== 0) {
9433                     attrs.push({
9434                         name: key,
9435                         value: escapeAttr(val)
9436                     });
9437                 }
9438             });
9439         };
9440
9441         /**
9442          * Parse namespaces and return a list of left over generic attributes
9443          * 
9444          * @param {Object}
9445          *            element
9446          * @return {Array<Object>}
9447          */
9448         ElementSerializer.prototype.parseNsAttributes = function(element) {
9449             var self = this;
9450
9451             var genericAttrs = element.$attrs;
9452
9453             var attributes = [];
9454
9455             // parse namespace attributes first
9456             // and log them. push non namespace attributes to a list
9457             // and process them later
9458             forEach(genericAttrs, function(value, name) {
9459                 var nameNs = parseNameNs(name);
9460
9461                 if (nameNs.prefix === 'xmlns') {
9462                     self.logNamespace({
9463                         prefix: nameNs.localName,
9464                         uri: value
9465                     });
9466                 } else
9467                 if (!nameNs.prefix && nameNs.localName === 'xmlns') {
9468                     self.logNamespace({
9469                         uri: value
9470                     });
9471                 } else {
9472                     attributes.push({
9473                         name: name,
9474                         value: value
9475                     });
9476                 }
9477             });
9478
9479             return attributes;
9480         };
9481
9482         ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
9483
9484             var self = this;
9485
9486             forEach(attributes, function(attr) {
9487
9488                 // do not serialize xsi:type attribute
9489                 // it is set manually based on the actual implementation type
9490                 if (attr.name === XSI_TYPE) {
9491                     return;
9492                 }
9493
9494                 try {
9495                     self.addAttribute(self.nsAttributeName(attr.name), attr.value);
9496                 } catch (e) {
9497                     console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
9498                 }
9499             });
9500         };
9501
9502         ElementSerializer.prototype.parseContainments = function(properties) {
9503
9504             var self = this,
9505                 body = this.body,
9506                 element = this.element;
9507
9508             forEach(properties, function(p) {
9509                 var value = element.get(p.name),
9510                     isReference = p.isReference,
9511                     isMany = p.isMany;
9512
9513                 var ns = self.nsPropertyTagName(p);
9514
9515                 if (!isMany) {
9516                     value = [value];
9517                 }
9518
9519                 if (p.isBody) {
9520                     body.push(new BodySerializer().build(p, value[0]));
9521                 } else
9522                 if (Types.isSimple(p.type)) {
9523                     forEach(value, function(v) {
9524                         body.push(new ValueSerializer(ns).build(p, v));
9525                     });
9526                 } else
9527                 if (isReference) {
9528                     forEach(value, function(v) {
9529                         body.push(new ReferenceSerializer(self, ns).build(v));
9530                     });
9531                 } else {
9532                     // allow serialization via type
9533                     // rather than element name
9534                     var asType = p.serialize === XSI_TYPE;
9535
9536                     forEach(value, function(v) {
9537                         var serializer;
9538
9539                         if (asType) {
9540                             serializer = new TypeSerializer(self, ns);
9541                         } else {
9542                             serializer = new ElementSerializer(self);
9543                         }
9544
9545                         body.push(serializer.build(v));
9546                     });
9547                 }
9548             });
9549         };
9550
9551         ElementSerializer.prototype.getNamespaces = function() {
9552             if (!this.parent) {
9553                 if (!this.namespaces) {
9554                     this.namespaces = {
9555                         prefixMap: {},
9556                         uriMap: {},
9557                         used: {}
9558                     };
9559                 }
9560             } else {
9561                 this.namespaces = this.parent.getNamespaces();
9562             }
9563
9564             return this.namespaces;
9565         };
9566
9567         ElementSerializer.prototype.logNamespace = function(ns) {
9568             var namespaces = this.getNamespaces();
9569
9570             var existing = namespaces.uriMap[ns.uri];
9571
9572             if (!existing) {
9573                 namespaces.uriMap[ns.uri] = ns;
9574             }
9575
9576             namespaces.prefixMap[ns.prefix] = ns.uri;
9577
9578             return ns;
9579         };
9580
9581         ElementSerializer.prototype.logNamespaceUsed = function(ns) {
9582             var element = this.element,
9583                 model = element.$model,
9584                 namespaces = this.getNamespaces();
9585
9586             // ns may be
9587             //
9588             // * prefix only
9589             // * prefix:uri
9590
9591             var prefix = ns.prefix;
9592             var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
9593                 namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
9594
9595             if (!uri) {
9596                 throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
9597             }
9598
9599             ns = namespaces.uriMap[uri];
9600
9601             if (!ns) {
9602                 ns = this.logNamespace({
9603                     prefix: prefix,
9604                     uri: uri
9605                 });
9606             }
9607
9608             if (!namespaces.used[ns.uri]) {
9609                 namespaces.used[ns.uri] = ns;
9610             }
9611
9612             return ns;
9613         };
9614
9615         ElementSerializer.prototype.parseAttributes = function(properties) {
9616             var self = this,
9617                 element = this.element;
9618
9619             forEach(properties, function(p) {
9620                 self.logNamespaceUsed(p.ns);
9621
9622                 var value = element.get(p.name);
9623
9624                 if (p.isReference) {
9625                     value = value.id;
9626                 }
9627
9628                 self.addAttribute(self.nsAttributeName(p), value);
9629             });
9630         };
9631
9632         ElementSerializer.prototype.addAttribute = function(name, value) {
9633             var attrs = this.attrs;
9634
9635             if (isString(value)) {
9636                 value = escapeAttr(value);
9637             }
9638
9639             attrs.push({
9640                 name: name,
9641                 value: value
9642             });
9643         };
9644
9645         ElementSerializer.prototype.serializeAttributes = function(writer) {
9646             var attrs = this.attrs,
9647                 root = !this.parent,
9648                 namespaces = this.namespaces;
9649
9650             function collectNsAttrs() {
9651                 return map(namespaces.used, function(ns) {
9652                     var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
9653                     return {
9654                         name: name,
9655                         value: ns.uri
9656                     };
9657                 });
9658             }
9659
9660             if (root) {
9661                 attrs = collectNsAttrs().concat(attrs);
9662             }
9663
9664             forEach(attrs, function(a) {
9665                 writer
9666                     .append(' ')
9667                     .append(nsName(a.name)).append('="').append(a.value).append('"');
9668             });
9669         };
9670
9671         ElementSerializer.prototype.serializeTo = function(writer) {
9672             var hasBody = this.body.length,
9673                 indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
9674
9675             writer
9676                 .appendIndent()
9677                 .append('<' + nsName(this.ns));
9678
9679             this.serializeAttributes(writer);
9680
9681             writer.append(hasBody ? '>' : ' />');
9682
9683             if (hasBody) {
9684
9685                 if (indent) {
9686                     writer
9687                         .appendNewLine()
9688                         .indent();
9689                 }
9690
9691                 forEach(this.body, function(b) {
9692                     b.serializeTo(writer);
9693                 });
9694
9695                 if (indent) {
9696                     writer
9697                         .unindent()
9698                         .appendIndent();
9699                 }
9700
9701                 writer.append('</' + nsName(this.ns) + '>');
9702             }
9703
9704             writer.appendNewLine();
9705         };
9706
9707         /**
9708          * A serializer for types that handles serialization of data types
9709          */
9710         function TypeSerializer(parent, ns) {
9711             ElementSerializer.call(this, parent, ns);
9712         }
9713
9714         TypeSerializer.prototype = new ElementSerializer();
9715
9716         TypeSerializer.prototype.build = function(element) {
9717             var descriptor = element.$descriptor;
9718
9719             this.element = element;
9720
9721             this.typeNs = this.nsTagName(descriptor);
9722
9723             // add xsi:type attribute to represent the elements
9724             // actual type
9725
9726             var typeNs = this.typeNs,
9727                 pkg = element.$model.getPackage(typeNs.uri),
9728                 typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
9729
9730             this.addAttribute(this.nsAttributeName(XSI_TYPE), (typeNs.prefix ? typeNs.prefix + ':' : '') +
9731                 typePrefix + descriptor.ns.localName);
9732
9733             // do the usual stuff
9734             return ElementSerializer.prototype.build.call(this, element);
9735         };
9736
9737         TypeSerializer.prototype.isLocalNs = function(ns) {
9738             return ns.uri === this.typeNs.uri;
9739         };
9740
9741         function SavingWriter() {
9742             this.value = '';
9743
9744             this.write = function(str) {
9745                 this.value += str;
9746             };
9747         }
9748
9749         function FormatingWriter(out, format) {
9750
9751             var indent = [''];
9752
9753             this.append = function(str) {
9754                 out.write(str);
9755
9756                 return this;
9757             };
9758
9759             this.appendNewLine = function() {
9760                 if (format) {
9761                     out.write('\n');
9762                 }
9763
9764                 return this;
9765             };
9766
9767             this.appendIndent = function() {
9768                 if (format) {
9769                     out.write(indent.join('  '));
9770                 }
9771
9772                 return this;
9773             };
9774
9775             this.indent = function() {
9776                 indent.push('');
9777                 return this;
9778             };
9779
9780             this.unindent = function() {
9781                 indent.pop();
9782                 return this;
9783             };
9784         }
9785
9786         /**
9787          * A writer for meta-model backed document trees
9788          * 
9789          * @param {Object}
9790          *            options output options to pass into the writer
9791          */
9792         function XMLWriter(options) {
9793
9794             options = assign({
9795                 format: false,
9796                 preamble: true
9797             }, options || {});
9798
9799             function toXML(tree, writer) {
9800                 var internalWriter = writer || new SavingWriter();
9801                 var formatingWriter = new FormatingWriter(internalWriter, options.format);
9802
9803                 if (options.preamble) {
9804                     formatingWriter.append(XML_PREAMBLE);
9805                 }
9806
9807                 new ElementSerializer().build(tree).serializeTo(formatingWriter);
9808
9809                 if (!writer) {
9810                     return internalWriter.value;
9811                 }
9812             }
9813
9814             return {
9815                 toXML: toXML
9816             };
9817         }
9818
9819         module.exports = XMLWriter;
9820     }, {
9821         "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9822         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
9823         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9824         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
9825         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
9826         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9827         "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9828         "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js"
9829     }],
9830     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js": [function(require, module, exports) {
9831         (function(Buffer) {
9832             // wrapper for non-node envs
9833             ;
9834             (function(sax) {
9835
9836                 sax.parser = function(strict, opt) {
9837                     return new SAXParser(strict, opt)
9838                 }
9839                 sax.SAXParser = SAXParser
9840                 sax.SAXStream = SAXStream
9841                 sax.createStream = createStream
9842
9843                 // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer
9844                 // overruns.
9845                 // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer
9846                 // lengths)),
9847                 // since that's the earliest that a buffer overrun could occur. This way, checks
9848                 // are
9849                 // as rare as required, but as often as necessary to ensure never crossing this
9850                 // bound.
9851                 // Furthermore, buffers are only tested at most once per write(), so passing a
9852                 // very
9853                 // large string into write() might have undesirable effects, but this is
9854                 // manageable by
9855                 // the caller, so it is assumed to be safe. Thus, a call to write() may, in the
9856                 // extreme
9857                 // edge case, result in creating at most one complete copy of the string passed
9858                 // in.
9859                 // Set to Infinity to have unlimited buffers.
9860                 sax.MAX_BUFFER_LENGTH = 64 * 1024
9861
9862                 var buffers = [
9863                     "comment", "sgmlDecl", "textNode", "tagName", "doctype",
9864                     "procInstName", "procInstBody", "entity", "attribName",
9865                     "attribValue", "cdata", "script"
9866                 ]
9867
9868                 sax.EVENTS = // for discoverability.
9869                     ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"]
9870
9871                 function SAXParser(strict, opt) {
9872                     if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
9873
9874                     var parser = this
9875                     clearBuffers(parser)
9876                     parser.q = parser.c = ""
9877                     parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
9878                     parser.opt = opt || {}
9879                     parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
9880                     parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
9881                     parser.tags = []
9882                     parser.closed = parser.closedRoot = parser.sawRoot = false
9883                     parser.tag = parser.error = null
9884                     parser.strict = !!strict
9885                     parser.noscript = !!(strict || parser.opt.noscript)
9886                     parser.state = S.BEGIN
9887                     parser.ENTITIES = Object.create(sax.ENTITIES)
9888                     parser.attribList = []
9889
9890                     // namespaces form a prototype chain.
9891                     // it always points at the current tag,
9892                     // which protos to its parent tag.
9893                     if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
9894
9895                     // mostly just for error reporting
9896                     parser.trackPosition = parser.opt.position !== false
9897                     if (parser.trackPosition) {
9898                         parser.position = parser.line = parser.column = 0
9899                     }
9900                     emit(parser, "onready")
9901                 }
9902
9903                 if (!Object.create) Object.create = function(o) {
9904                     function f() {
9905                         this.__proto__ = o
9906                     }
9907                     f.prototype = o
9908                     return new f
9909                 }
9910
9911                 if (!Object.getPrototypeOf) Object.getPrototypeOf = function(o) {
9912                     return o.__proto__
9913                 }
9914
9915                 if (!Object.keys) Object.keys = function(o) {
9916                     var a = []
9917                     for (var i in o)
9918                         if (o.hasOwnProperty(i)) a.push(i)
9919                     return a
9920                 }
9921
9922                 function checkBufferLength(parser) {
9923                     var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10),
9924                         maxActual = 0
9925                     for (var i = 0, l = buffers.length; i < l; i++) {
9926                         var len = parser[buffers[i]].length
9927                         if (len > maxAllowed) {
9928                             // Text/cdata nodes can get big, and since they're buffered,
9929                             // we can get here under normal conditions.
9930                             // Avoid issues by emitting the text node now,
9931                             // so at least it won't get any bigger.
9932                             switch (buffers[i]) {
9933                                 case "textNode":
9934                                     closeText(parser)
9935                                     break
9936
9937                                 case "cdata":
9938                                     emitNode(parser, "oncdata", parser.cdata)
9939                                     parser.cdata = ""
9940                                     break
9941
9942                                 case "script":
9943                                     emitNode(parser, "onscript", parser.script)
9944                                     parser.script = ""
9945                                     break
9946
9947                                 default:
9948                                     error(parser, "Max buffer length exceeded: " + buffers[i])
9949                             }
9950                         }
9951                         maxActual = Math.max(maxActual, len)
9952                     }
9953                     // schedule the next check for the earliest possible buffer overrun.
9954                     parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + parser.position
9955                 }
9956
9957                 function clearBuffers(parser) {
9958                     for (var i = 0, l = buffers.length; i < l; i++) {
9959                         parser[buffers[i]] = ""
9960                     }
9961                 }
9962
9963                 function flushBuffers(parser) {
9964                     closeText(parser)
9965                     if (parser.cdata !== "") {
9966                         emitNode(parser, "oncdata", parser.cdata)
9967                         parser.cdata = ""
9968                     }
9969                     if (parser.script !== "") {
9970                         emitNode(parser, "onscript", parser.script)
9971                         parser.script = ""
9972                     }
9973                 }
9974
9975                 SAXParser.prototype = {
9976                     end: function() {
9977                         end(this)
9978                     },
9979                     write: write,
9980                     resume: function() {
9981                         this.error = null;
9982                         return this
9983                     },
9984                     close: function() {
9985                         return this.write(null)
9986                     },
9987                     flush: function() {
9988                         flushBuffers(this)
9989                     }
9990                 }
9991
9992                 try {
9993                     var Stream = require("stream").Stream
9994                 } catch (ex) {
9995                     var Stream = function() {}
9996                 }
9997
9998
9999                 var streamWraps = sax.EVENTS.filter(function(ev) {
10000                     return ev !== "error" && ev !== "end"
10001                 })
10002
10003                 function createStream(strict, opt) {
10004                     return new SAXStream(strict, opt)
10005                 }
10006
10007                 function SAXStream(strict, opt) {
10008                     if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
10009
10010                     Stream.apply(this)
10011
10012                     this._parser = new SAXParser(strict, opt)
10013                     this.writable = true
10014                     this.readable = true
10015
10016
10017                     var me = this
10018
10019                     this._parser.onend = function() {
10020                         me.emit("end")
10021                     }
10022
10023                     this._parser.onerror = function(er) {
10024                         me.emit("error", er)
10025
10026                         // if didn't throw, then means error was handled.
10027                         // go ahead and clear error, so we can write again.
10028                         me._parser.error = null
10029                     }
10030
10031                     this._decoder = null;
10032
10033                     streamWraps.forEach(function(ev) {
10034                         Object.defineProperty(me, "on" + ev, {
10035                             get: function() {
10036                                 return me._parser["on" + ev]
10037                             },
10038                             set: function(h) {
10039                                 if (!h) {
10040                                     me.removeAllListeners(ev)
10041                                     return me._parser["on" + ev] = h
10042                                 }
10043                                 me.on(ev, h)
10044                             },
10045                             enumerable: true,
10046                             configurable: false
10047                         })
10048                     })
10049                 }
10050
10051                 SAXStream.prototype = Object.create(Stream.prototype, {
10052                     constructor: {
10053                         value: SAXStream
10054                     }
10055                 })
10056
10057                 SAXStream.prototype.write = function(data) {
10058                     if (typeof Buffer === 'function' &&
10059                         typeof Buffer.isBuffer === 'function' &&
10060                         Buffer.isBuffer(data)) {
10061                         if (!this._decoder) {
10062                             var SD = require('string_decoder').StringDecoder
10063                             this._decoder = new SD('utf8')
10064                         }
10065                         data = this._decoder.write(data);
10066                     }
10067
10068                     this._parser.write(data.toString())
10069                     this.emit("data", data)
10070                     return true
10071                 }
10072
10073                 SAXStream.prototype.end = function(chunk) {
10074                     if (chunk && chunk.length) this.write(chunk)
10075                     this._parser.end()
10076                     return true
10077                 }
10078
10079                 SAXStream.prototype.on = function(ev, handler) {
10080                     var me = this
10081                     if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
10082                         me._parser["on" + ev] = function() {
10083                             var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
10084                             args.splice(0, 0, ev)
10085                             me.emit.apply(me, args)
10086                         }
10087                     }
10088
10089                     return Stream.prototype.on.call(me, ev, handler)
10090                 }
10091
10092
10093
10094                 // character classes and tokens
10095                 var whitespace = "\r\n\t "
10096                     // this really needs to be replaced with character classes.
10097                     // XML allows all manner of ridiculous numbers and digits.
10098                     ,
10099                     number = "0124356789",
10100                     letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
10101                     // (Letter | "_" | ":")
10102                     ,
10103                     quote = "'\"",
10104                     entity = number + letter + "#",
10105                     attribEnd = whitespace + ">",
10106                     CDATA = "[CDATA[",
10107                     DOCTYPE = "DOCTYPE",
10108                     XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace",
10109                     XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/",
10110                     rootNS = {
10111                         xml: XML_NAMESPACE,
10112                         xmlns: XMLNS_NAMESPACE
10113                     }
10114
10115                 // turn all the string character sets into character class objects.
10116                 whitespace = charClass(whitespace)
10117                 number = charClass(number)
10118                 letter = charClass(letter)
10119
10120                 // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
10121                 // This implementation works on strings, a single character at a time
10122                 // as such, it cannot ever support astral-plane characters (10000-EFFFF)
10123                 // without a significant breaking change to either this parser, or the
10124                 // JavaScript language. Implementation of an emoji-capable xml parser
10125                 // is left as an exercise for the reader.
10126                 var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
10127
10128                 var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
10129
10130                 quote = charClass(quote)
10131                 entity = charClass(entity)
10132                 attribEnd = charClass(attribEnd)
10133
10134                 function charClass(str) {
10135                     return str.split("").reduce(function(s, c) {
10136                         s[c] = true
10137                         return s
10138                     }, {})
10139                 }
10140
10141                 function isRegExp(c) {
10142                     return Object.prototype.toString.call(c) === '[object RegExp]'
10143                 }
10144
10145                 function is(charclass, c) {
10146                     return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
10147                 }
10148
10149                 function not(charclass, c) {
10150                     return !is(charclass, c)
10151                 }
10152
10153                 var S = 0
10154                 sax.STATE = {
10155                     BEGIN: S++,
10156                     TEXT: S++ // general stuff
10157                         ,
10158                     TEXT_ENTITY: S++ // &amp and such.
10159                         ,
10160                     OPEN_WAKA: S++ // <
10161                         ,
10162                     SGML_DECL: S++ // <!BLARG
10163                         ,
10164                     SGML_DECL_QUOTED: S++ // <!BLARG foo "bar
10165                         ,
10166                     DOCTYPE: S++ // <!DOCTYPE
10167                         ,
10168                     DOCTYPE_QUOTED: S++ // <!DOCTYPE "//blah
10169                         ,
10170                     DOCTYPE_DTD: S++ // <!DOCTYPE "//blah" [ ...
10171                         ,
10172                     DOCTYPE_DTD_QUOTED: S++ // <!DOCTYPE "//blah" [ "foo
10173                         ,
10174                     COMMENT_STARTING: S++ // <!-
10175                         ,
10176                     COMMENT: S++ // <!--
10177                         ,
10178                     COMMENT_ENDING: S++ // <!-- blah -
10179                         ,
10180                     COMMENT_ENDED: S++ // <!-- blah --
10181                         ,
10182                     CDATA: S++ // <![CDATA[ something
10183                         ,
10184                     CDATA_ENDING: S++ // ]
10185                         ,
10186                     CDATA_ENDING_2: S++ // ]]
10187                         ,
10188                     PROC_INST: S++ // <?hi
10189                         ,
10190                     PROC_INST_BODY: S++ // <?hi there
10191                         ,
10192                     PROC_INST_ENDING: S++ // <?hi "there" ?
10193                         ,
10194                     OPEN_TAG: S++ // <strong
10195                         ,
10196                     OPEN_TAG_SLASH: S++ // <strong /
10197                         ,
10198                     ATTRIB: S++ // <a
10199                         ,
10200                     ATTRIB_NAME: S++ // <a foo
10201                         ,
10202                     ATTRIB_NAME_SAW_WHITE: S++ // <a foo _
10203                         ,
10204                     ATTRIB_VALUE: S++ // <a foo=
10205                         ,
10206                     ATTRIB_VALUE_QUOTED: S++ // <a foo="bar
10207                         ,
10208                     ATTRIB_VALUE_CLOSED: S++ // <a foo="bar"
10209                         ,
10210                     ATTRIB_VALUE_UNQUOTED: S++ // <a foo=bar
10211                         ,
10212                     ATTRIB_VALUE_ENTITY_Q: S++ // <foo bar="&quot;"
10213                         ,
10214                     ATTRIB_VALUE_ENTITY_U: S++ // <foo bar=&quot;
10215                         ,
10216                     CLOSE_TAG: S++ // </a
10217                         ,
10218                     CLOSE_TAG_SAW_WHITE: S++ // </a >
10219                         ,
10220                     SCRIPT: S++ // <script> ...
10221                         ,
10222                     SCRIPT_ENDING: S++ // <script> ... <
10223                 }
10224
10225                 sax.ENTITIES = {
10226                     "amp": "&",
10227                     "gt": ">",
10228                     "lt": "<",
10229                     "quot": "\"",
10230                     "apos": "'",
10231                     "AElig": 198,
10232                     "Aacute": 193,
10233                     "Acirc": 194,
10234                     "Agrave": 192,
10235                     "Aring": 197,
10236                     "Atilde": 195,
10237                     "Auml": 196,
10238                     "Ccedil": 199,
10239                     "ETH": 208,
10240                     "Eacute": 201,
10241                     "Ecirc": 202,
10242                     "Egrave": 200,
10243                     "Euml": 203,
10244                     "Iacute": 205,
10245                     "Icirc": 206,
10246                     "Igrave": 204,
10247                     "Iuml": 207,
10248                     "Ntilde": 209,
10249                     "Oacute": 211,
10250                     "Ocirc": 212,
10251                     "Ograve": 210,
10252                     "Oslash": 216,
10253                     "Otilde": 213,
10254                     "Ouml": 214,
10255                     "THORN": 222,
10256                     "Uacute": 218,
10257                     "Ucirc": 219,
10258                     "Ugrave": 217,
10259                     "Uuml": 220,
10260                     "Yacute": 221,
10261                     "aacute": 225,
10262                     "acirc": 226,
10263                     "aelig": 230,
10264                     "agrave": 224,
10265                     "aring": 229,
10266                     "atilde": 227,
10267                     "auml": 228,
10268                     "ccedil": 231,
10269                     "eacute": 233,
10270                     "ecirc": 234,
10271                     "egrave": 232,
10272                     "eth": 240,
10273                     "euml": 235,
10274                     "iacute": 237,
10275                     "icirc": 238,
10276                     "igrave": 236,
10277                     "iuml": 239,
10278                     "ntilde": 241,
10279                     "oacute": 243,
10280                     "ocirc": 244,
10281                     "ograve": 242,
10282                     "oslash": 248,
10283                     "otilde": 245,
10284                     "ouml": 246,
10285                     "szlig": 223,
10286                     "thorn": 254,
10287                     "uacute": 250,
10288                     "ucirc": 251,
10289                     "ugrave": 249,
10290                     "uuml": 252,
10291                     "yacute": 253,
10292                     "yuml": 255,
10293                     "copy": 169,
10294                     "reg": 174,
10295                     "nbsp": 160,
10296                     "iexcl": 161,
10297                     "cent": 162,
10298                     "pound": 163,
10299                     "curren": 164,
10300                     "yen": 165,
10301                     "brvbar": 166,
10302                     "sect": 167,
10303                     "uml": 168,
10304                     "ordf": 170,
10305                     "laquo": 171,
10306                     "not": 172,
10307                     "shy": 173,
10308                     "macr": 175,
10309                     "deg": 176,
10310                     "plusmn": 177,
10311                     "sup1": 185,
10312                     "sup2": 178,
10313                     "sup3": 179,
10314                     "acute": 180,
10315                     "micro": 181,
10316                     "para": 182,
10317                     "middot": 183,
10318                     "cedil": 184,
10319                     "ordm": 186,
10320                     "raquo": 187,
10321                     "frac14": 188,
10322                     "frac12": 189,
10323                     "frac34": 190,
10324                     "iquest": 191,
10325                     "times": 215,
10326                     "divide": 247,
10327                     "OElig": 338,
10328                     "oelig": 339,
10329                     "Scaron": 352,
10330                     "scaron": 353,
10331                     "Yuml": 376,
10332                     "fnof": 402,
10333                     "circ": 710,
10334                     "tilde": 732,
10335                     "Alpha": 913,
10336                     "Beta": 914,
10337                     "Gamma": 915,
10338                     "Delta": 916,
10339                     "Epsilon": 917,
10340                     "Zeta": 918,
10341                     "Eta": 919,
10342                     "Theta": 920,
10343                     "Iota": 921,
10344                     "Kappa": 922,
10345                     "Lambda": 923,
10346                     "Mu": 924,
10347                     "Nu": 925,
10348                     "Xi": 926,
10349                     "Omicron": 927,
10350                     "Pi": 928,
10351                     "Rho": 929,
10352                     "Sigma": 931,
10353                     "Tau": 932,
10354                     "Upsilon": 933,
10355                     "Phi": 934,
10356                     "Chi": 935,
10357                     "Psi": 936,
10358                     "Omega": 937,
10359                     "alpha": 945,
10360                     "beta": 946,
10361                     "gamma": 947,
10362                     "delta": 948,
10363                     "epsilon": 949,
10364                     "zeta": 950,
10365                     "eta": 951,
10366                     "theta": 952,
10367                     "iota": 953,
10368                     "kappa": 954,
10369                     "lambda": 955,
10370                     "mu": 956,
10371                     "nu": 957,
10372                     "xi": 958,
10373                     "omicron": 959,
10374                     "pi": 960,
10375                     "rho": 961,
10376                     "sigmaf": 962,
10377                     "sigma": 963,
10378                     "tau": 964,
10379                     "upsilon": 965,
10380                     "phi": 966,
10381                     "chi": 967,
10382                     "psi": 968,
10383                     "omega": 969,
10384                     "thetasym": 977,
10385                     "upsih": 978,
10386                     "piv": 982,
10387                     "ensp": 8194,
10388                     "emsp": 8195,
10389                     "thinsp": 8201,
10390                     "zwnj": 8204,
10391                     "zwj": 8205,
10392                     "lrm": 8206,
10393                     "rlm": 8207,
10394                     "ndash": 8211,
10395                     "mdash": 8212,
10396                     "lsquo": 8216,
10397                     "rsquo": 8217,
10398                     "sbquo": 8218,
10399                     "ldquo": 8220,
10400                     "rdquo": 8221,
10401                     "bdquo": 8222,
10402                     "dagger": 8224,
10403                     "Dagger": 8225,
10404                     "bull": 8226,
10405                     "hellip": 8230,
10406                     "permil": 8240,
10407                     "prime": 8242,
10408                     "Prime": 8243,
10409                     "lsaquo": 8249,
10410                     "rsaquo": 8250,
10411                     "oline": 8254,
10412                     "frasl": 8260,
10413                     "euro": 8364,
10414                     "image": 8465,
10415                     "weierp": 8472,
10416                     "real": 8476,
10417                     "trade": 8482,
10418                     "alefsym": 8501,
10419                     "larr": 8592,
10420                     "uarr": 8593,
10421                     "rarr": 8594,
10422                     "darr": 8595,
10423                     "harr": 8596,
10424                     "crarr": 8629,
10425                     "lArr": 8656,
10426                     "uArr": 8657,
10427                     "rArr": 8658,
10428                     "dArr": 8659,
10429                     "hArr": 8660,
10430                     "forall": 8704,
10431                     "part": 8706,
10432                     "exist": 8707,
10433                     "empty": 8709,
10434                     "nabla": 8711,
10435                     "isin": 8712,
10436                     "notin": 8713,
10437                     "ni": 8715,
10438                     "prod": 8719,
10439                     "sum": 8721,
10440                     "minus": 8722,
10441                     "lowast": 8727,
10442                     "radic": 8730,
10443                     "prop": 8733,
10444                     "infin": 8734,
10445                     "ang": 8736,
10446                     "and": 8743,
10447                     "or": 8744,
10448                     "cap": 8745,
10449                     "cup": 8746,
10450                     "int": 8747,
10451                     "there4": 8756,
10452                     "sim": 8764,
10453                     "cong": 8773,
10454                     "asymp": 8776,
10455                     "ne": 8800,
10456                     "equiv": 8801,
10457                     "le": 8804,
10458                     "ge": 8805,
10459                     "sub": 8834,
10460                     "sup": 8835,
10461                     "nsub": 8836,
10462                     "sube": 8838,
10463                     "supe": 8839,
10464                     "oplus": 8853,
10465                     "otimes": 8855,
10466                     "perp": 8869,
10467                     "sdot": 8901,
10468                     "lceil": 8968,
10469                     "rceil": 8969,
10470                     "lfloor": 8970,
10471                     "rfloor": 8971,
10472                     "lang": 9001,
10473                     "rang": 9002,
10474                     "loz": 9674,
10475                     "spades": 9824,
10476                     "clubs": 9827,
10477                     "hearts": 9829,
10478                     "diams": 9830
10479                 }
10480
10481                 Object.keys(sax.ENTITIES).forEach(function(key) {
10482                     var e = sax.ENTITIES[key]
10483                     var s = typeof e === 'number' ? String.fromCharCode(e) : e
10484                     sax.ENTITIES[key] = s
10485                 })
10486
10487                 for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
10488
10489                 // shorthand
10490                 S = sax.STATE
10491
10492                 function emit(parser, event, data) {
10493                     parser[event] && parser[event](data)
10494                 }
10495
10496                 function emitNode(parser, nodeType, data) {
10497                     if (parser.textNode) closeText(parser)
10498                     emit(parser, nodeType, data)
10499                 }
10500
10501                 function closeText(parser) {
10502                     parser.textNode = textopts(parser.opt, parser.textNode)
10503                     if (parser.textNode) emit(parser, "ontext", parser.textNode)
10504                     parser.textNode = ""
10505                 }
10506
10507                 function textopts(opt, text) {
10508                     if (opt.trim) text = text.trim()
10509                     if (opt.normalize) text = text.replace(/\s+/g, " ")
10510                     return text
10511                 }
10512
10513                 function error(parser, er) {
10514                     closeText(parser)
10515                     if (parser.trackPosition) {
10516                         er += "\nLine: " + parser.line +
10517                             "\nColumn: " + parser.column +
10518                             "\nChar: " + parser.c
10519                     }
10520                     er = new Error(er)
10521                     parser.error = er
10522                     emit(parser, "onerror", er)
10523                     return parser
10524                 }
10525
10526                 function end(parser) {
10527                     if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
10528                     if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
10529                     closeText(parser)
10530                     parser.c = ""
10531                     parser.closed = true
10532                     emit(parser, "onend")
10533                     SAXParser.call(parser, parser.strict, parser.opt)
10534                     return parser
10535                 }
10536
10537                 function strictFail(parser, message) {
10538                     if (typeof parser !== 'object' || !(parser instanceof SAXParser))
10539                         throw new Error('bad call to strictFail');
10540                     if (parser.strict) error(parser, message)
10541                 }
10542
10543                 function newTag(parser) {
10544                     if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
10545                     var parent = parser.tags[parser.tags.length - 1] || parser,
10546                         tag = parser.tag = {
10547                             name: parser.tagName,
10548                             attributes: {}
10549                         }
10550
10551                     // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
10552                     if (parser.opt.xmlns) tag.ns = parent.ns
10553                     parser.attribList.length = 0
10554                 }
10555
10556                 function qname(name, attribute) {
10557                     var i = name.indexOf(":"),
10558                         qualName = i < 0 ? ["", name] : name.split(":"),
10559                         prefix = qualName[0],
10560                         local = qualName[1]
10561
10562                     // <x "xmlns"="http://foo">
10563                     if (attribute && name === "xmlns") {
10564                         prefix = "xmlns"
10565                         local = ""
10566                     }
10567
10568                     return {
10569                         prefix: prefix,
10570                         local: local
10571                     }
10572                 }
10573
10574                 function attrib(parser) {
10575                     if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
10576
10577                     if (parser.attribList.indexOf(parser.attribName) !== -1 ||
10578                         parser.tag.attributes.hasOwnProperty(parser.attribName)) {
10579                         return parser.attribName = parser.attribValue = ""
10580                     }
10581
10582                     if (parser.opt.xmlns) {
10583                         var qn = qname(parser.attribName, true),
10584                             prefix = qn.prefix,
10585                             local = qn.local
10586
10587                         if (prefix === "xmlns") {
10588                             // namespace binding attribute; push the binding into scope
10589                             if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
10590                                 strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10591                             } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
10592                                 strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10593                             } else {
10594                                 var tag = parser.tag,
10595                                     parent = parser.tags[parser.tags.length - 1] || parser
10596                                 if (tag.ns === parent.ns) {
10597                                     tag.ns = Object.create(parent.ns)
10598                                 }
10599                                 tag.ns[local] = parser.attribValue
10600                             }
10601                         }
10602
10603                         // defer onattribute events until all attributes have been seen
10604                         // so any new bindings can take effect; preserve attribute order
10605                         // so deferred events can be emitted in document order
10606                         parser.attribList.push([parser.attribName, parser.attribValue])
10607                     } else {
10608                         // in non-xmlns mode, we can emit the event right away
10609                         parser.tag.attributes[parser.attribName] = parser.attribValue
10610                         emitNode(parser, "onattribute", {
10611                             name: parser.attribName,
10612                             value: parser.attribValue
10613                         })
10614                     }
10615
10616                     parser.attribName = parser.attribValue = ""
10617                 }
10618
10619                 function openTag(parser, selfClosing) {
10620                     if (parser.opt.xmlns) {
10621                         // emit namespace binding events
10622                         var tag = parser.tag
10623
10624                         // add namespace info to tag
10625                         var qn = qname(parser.tagName)
10626                         tag.prefix = qn.prefix
10627                         tag.local = qn.local
10628                         tag.uri = tag.ns[qn.prefix] || ""
10629
10630                         if (tag.prefix && !tag.uri) {
10631                             strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName))
10632                             tag.uri = qn.prefix
10633                         }
10634
10635                         var parent = parser.tags[parser.tags.length - 1] || parser
10636                         if (tag.ns && parent.ns !== tag.ns) {
10637                             Object.keys(tag.ns).forEach(function(p) {
10638                                 emitNode(parser, "onopennamespace", {
10639                                     prefix: p,
10640                                     uri: tag.ns[p]
10641                                 })
10642                             })
10643                         }
10644
10645                         // handle deferred onattribute events
10646                         // Note: do not apply default ns to attributes:
10647                         // http://www.w3.org/TR/REC-xml-names/#defaulting
10648                         for (var i = 0, l = parser.attribList.length; i < l; i++) {
10649                             var nv = parser.attribList[i]
10650                             var name = nv[0],
10651                                 value = nv[1],
10652                                 qualName = qname(name, true),
10653                                 prefix = qualName.prefix,
10654                                 local = qualName.local,
10655                                 uri = prefix == "" ? "" : (tag.ns[prefix] || ""),
10656                                 a = {
10657                                     name: name,
10658                                     value: value,
10659                                     prefix: prefix,
10660                                     local: local,
10661                                     uri: uri
10662                                 }
10663
10664                             // if there's any attributes with an undefined namespace,
10665                             // then fail on them now.
10666                             if (prefix && prefix != "xmlns" && !uri) {
10667                                 strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix))
10668                                 a.uri = prefix
10669                             }
10670                             parser.tag.attributes[name] = a
10671                             emitNode(parser, "onattribute", a)
10672                         }
10673                         parser.attribList.length = 0
10674                     }
10675
10676                     parser.tag.isSelfClosing = !!selfClosing
10677
10678                     // process the tag
10679                     parser.sawRoot = true
10680                     parser.tags.push(parser.tag)
10681                     emitNode(parser, "onopentag", parser.tag)
10682                     if (!selfClosing) {
10683                         // special case for <script> in non-strict mode.
10684                         if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
10685                             parser.state = S.SCRIPT
10686                         } else {
10687                             parser.state = S.TEXT
10688                         }
10689                         parser.tag = null
10690                         parser.tagName = ""
10691                     }
10692                     parser.attribName = parser.attribValue = ""
10693                     parser.attribList.length = 0
10694                 }
10695
10696                 function closeTag(parser) {
10697                     if (!parser.tagName) {
10698                         strictFail(parser, "Weird empty close tag.")
10699                         parser.textNode += "</>"
10700                         parser.state = S.TEXT
10701                         return
10702                     }
10703
10704                     if (parser.script) {
10705                         if (parser.tagName !== "script") {
10706                             parser.script += "</" + parser.tagName + ">"
10707                             parser.tagName = ""
10708                             parser.state = S.SCRIPT
10709                             return
10710                         }
10711                         emitNode(parser, "onscript", parser.script)
10712                         parser.script = ""
10713                     }
10714
10715                     // first make sure that the closing tag actually exists.
10716                     // <a><b></c></b></a> will close everything, otherwise.
10717                     var t = parser.tags.length
10718                     var tagName = parser.tagName
10719                     if (!parser.strict) tagName = tagName[parser.looseCase]()
10720                     var closeTo = tagName
10721                     while (t--) {
10722                         var close = parser.tags[t]
10723                         if (close.name !== closeTo) {
10724                             // fail the first time in strict mode
10725                             strictFail(parser, "Unexpected close tag")
10726                         } else break
10727                     }
10728
10729                     // didn't find it. we already failed for strict, so just abort.
10730                     if (t < 0) {
10731                         strictFail(parser, "Unmatched closing tag: " + parser.tagName)
10732                         parser.textNode += "</" + parser.tagName + ">"
10733                         parser.state = S.TEXT
10734                         return
10735                     }
10736                     parser.tagName = tagName
10737                     var s = parser.tags.length
10738                     while (s-- > t) {
10739                         var tag = parser.tag = parser.tags.pop()
10740                         parser.tagName = parser.tag.name
10741                         emitNode(parser, "onclosetag", parser.tagName)
10742
10743                         var x = {}
10744                         for (var i in tag.ns) x[i] = tag.ns[i]
10745
10746                         var parent = parser.tags[parser.tags.length - 1] || parser
10747                         if (parser.opt.xmlns && tag.ns !== parent.ns) {
10748                             // remove namespace bindings introduced by tag
10749                             Object.keys(tag.ns).forEach(function(p) {
10750                                 var n = tag.ns[p]
10751                                 emitNode(parser, "onclosenamespace", {
10752                                     prefix: p,
10753                                     uri: n
10754                                 })
10755                             })
10756                         }
10757                     }
10758                     if (t === 0) parser.closedRoot = true
10759                     parser.tagName = parser.attribValue = parser.attribName = ""
10760                     parser.attribList.length = 0
10761                     parser.state = S.TEXT
10762                 }
10763
10764                 function parseEntity(parser) {
10765                     var entity = parser.entity,
10766                         entityLC = entity.toLowerCase(),
10767                         num, numStr = ""
10768                     if (parser.ENTITIES[entity])
10769                         return parser.ENTITIES[entity]
10770                     if (parser.ENTITIES[entityLC])
10771                         return parser.ENTITIES[entityLC]
10772                     entity = entityLC
10773                     if (entity.charAt(0) === "#") {
10774                         if (entity.charAt(1) === "x") {
10775                             entity = entity.slice(2)
10776                             num = parseInt(entity, 16)
10777                             numStr = num.toString(16)
10778                         } else {
10779                             entity = entity.slice(1)
10780                             num = parseInt(entity, 10)
10781                             numStr = num.toString(10)
10782                         }
10783                     }
10784                     entity = entity.replace(/^0+/, "")
10785                     if (numStr.toLowerCase() !== entity) {
10786                         strictFail(parser, "Invalid character entity")
10787                         return "&" + parser.entity + ";"
10788                     }
10789
10790                     return String.fromCodePoint(num)
10791                 }
10792
10793                 function write(chunk) {
10794                     var parser = this
10795                     if (this.error) throw this.error
10796                     if (parser.closed) return error(parser,
10797                         "Cannot write after close. Assign an onready handler.")
10798                     if (chunk === null) return end(parser)
10799                     var i = 0,
10800                         c = ""
10801                     while (parser.c = c = chunk.charAt(i++)) {
10802                         if (parser.trackPosition) {
10803                             parser.position++
10804                                 if (c === "\n") {
10805                                     parser.line++
10806                                         parser.column = 0
10807                                 } else parser.column++
10808                         }
10809                         switch (parser.state) {
10810
10811                             case S.BEGIN:
10812                                 if (c === "<") {
10813                                     parser.state = S.OPEN_WAKA
10814                                     parser.startTagPosition = parser.position
10815                                 } else if (not(whitespace, c)) {
10816                                     // have to process this as a text node.
10817                                     // weird, but happens.
10818                                     strictFail(parser, "Non-whitespace before first tag.")
10819                                     parser.textNode = c
10820                                     parser.state = S.TEXT
10821                                 }
10822                                 continue
10823
10824                             case S.TEXT:
10825                                 if (parser.sawRoot && !parser.closedRoot) {
10826                                     var starti = i - 1
10827                                     while (c && c !== "<" && c !== "&") {
10828                                         c = chunk.charAt(i++)
10829                                         if (c && parser.trackPosition) {
10830                                             parser.position++
10831                                                 if (c === "\n") {
10832                                                     parser.line++
10833                                                         parser.column = 0
10834                                                 } else parser.column++
10835                                         }
10836                                     }
10837                                     parser.textNode += chunk.substring(starti, i - 1)
10838                                 }
10839                                 if (c === "<") {
10840                                     parser.state = S.OPEN_WAKA
10841                                     parser.startTagPosition = parser.position
10842                                 } else {
10843                                     if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
10844                                         strictFail(parser, "Text data outside of root node.")
10845                                     if (c === "&") parser.state = S.TEXT_ENTITY
10846                                     else parser.textNode += c
10847                                 }
10848                                 continue
10849
10850                             case S.SCRIPT:
10851                                 // only non-strict
10852                                 if (c === "<") {
10853                                     parser.state = S.SCRIPT_ENDING
10854                                 } else parser.script += c
10855                                 continue
10856
10857                             case S.SCRIPT_ENDING:
10858                                 if (c === "/") {
10859                                     parser.state = S.CLOSE_TAG
10860                                 } else {
10861                                     parser.script += "<" + c
10862                                     parser.state = S.SCRIPT
10863                                 }
10864                                 continue
10865
10866                             case S.OPEN_WAKA:
10867                                 // either a /, ?, !, or text is coming next.
10868                                 if (c === "!") {
10869                                     parser.state = S.SGML_DECL
10870                                     parser.sgmlDecl = ""
10871                                 } else if (is(whitespace, c)) {
10872                                     // wait for it...
10873                                 } else if (is(nameStart, c)) {
10874                                     parser.state = S.OPEN_TAG
10875                                     parser.tagName = c
10876                                 } else if (c === "/") {
10877                                     parser.state = S.CLOSE_TAG
10878                                     parser.tagName = ""
10879                                 } else if (c === "?") {
10880                                     parser.state = S.PROC_INST
10881                                     parser.procInstName = parser.procInstBody = ""
10882                                 } else {
10883                                     strictFail(parser, "Unencoded <")
10884                                         // if there was some whitespace, then add that in.
10885                                     if (parser.startTagPosition + 1 < parser.position) {
10886                                         var pad = parser.position - parser.startTagPosition
10887                                         c = new Array(pad).join(" ") + c
10888                                     }
10889                                     parser.textNode += "<" + c
10890                                     parser.state = S.TEXT
10891                                 }
10892                                 continue
10893
10894                             case S.SGML_DECL:
10895                                 if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
10896                                     emitNode(parser, "onopencdata")
10897                                     parser.state = S.CDATA
10898                                     parser.sgmlDecl = ""
10899                                     parser.cdata = ""
10900                                 } else if (parser.sgmlDecl + c === "--") {
10901                                     parser.state = S.COMMENT
10902                                     parser.comment = ""
10903                                     parser.sgmlDecl = ""
10904                                 } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
10905                                     parser.state = S.DOCTYPE
10906                                     if (parser.doctype || parser.sawRoot) strictFail(parser,
10907                                         "Inappropriately located doctype declaration")
10908                                     parser.doctype = ""
10909                                     parser.sgmlDecl = ""
10910                                 } else if (c === ">") {
10911                                     emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
10912                                     parser.sgmlDecl = ""
10913                                     parser.state = S.TEXT
10914                                 } else if (is(quote, c)) {
10915                                     parser.state = S.SGML_DECL_QUOTED
10916                                     parser.sgmlDecl += c
10917                                 } else parser.sgmlDecl += c
10918                                 continue
10919
10920                             case S.SGML_DECL_QUOTED:
10921                                 if (c === parser.q) {
10922                                     parser.state = S.SGML_DECL
10923                                     parser.q = ""
10924                                 }
10925                                 parser.sgmlDecl += c
10926                                 continue
10927
10928                             case S.DOCTYPE:
10929                                 if (c === ">") {
10930                                     parser.state = S.TEXT
10931                                     emitNode(parser, "ondoctype", parser.doctype)
10932                                     parser.doctype = true // just remember that we saw it.
10933                                 } else {
10934                                     parser.doctype += c
10935                                     if (c === "[") parser.state = S.DOCTYPE_DTD
10936                                     else if (is(quote, c)) {
10937                                         parser.state = S.DOCTYPE_QUOTED
10938                                         parser.q = c
10939                                     }
10940                                 }
10941                                 continue
10942
10943                             case S.DOCTYPE_QUOTED:
10944                                 parser.doctype += c
10945                                 if (c === parser.q) {
10946                                     parser.q = ""
10947                                     parser.state = S.DOCTYPE
10948                                 }
10949                                 continue
10950
10951                             case S.DOCTYPE_DTD:
10952                                 parser.doctype += c
10953                                 if (c === "]") parser.state = S.DOCTYPE
10954                                 else if (is(quote, c)) {
10955                                     parser.state = S.DOCTYPE_DTD_QUOTED
10956                                     parser.q = c
10957                                 }
10958                                 continue
10959
10960                             case S.DOCTYPE_DTD_QUOTED:
10961                                 parser.doctype += c
10962                                 if (c === parser.q) {
10963                                     parser.state = S.DOCTYPE_DTD
10964                                     parser.q = ""
10965                                 }
10966                                 continue
10967
10968                             case S.COMMENT:
10969                                 if (c === "-") parser.state = S.COMMENT_ENDING
10970                                 else parser.comment += c
10971                                 continue
10972
10973                             case S.COMMENT_ENDING:
10974                                 if (c === "-") {
10975                                     parser.state = S.COMMENT_ENDED
10976                                     parser.comment = textopts(parser.opt, parser.comment)
10977                                     if (parser.comment) emitNode(parser, "oncomment", parser.comment)
10978                                     parser.comment = ""
10979                                 } else {
10980                                     parser.comment += "-" + c
10981                                     parser.state = S.COMMENT
10982                                 }
10983                                 continue
10984
10985                             case S.COMMENT_ENDED:
10986                                 if (c !== ">") {
10987                                     strictFail(parser, "Malformed comment")
10988                                         // allow <!-- blah -- bloo --> in non-strict mode,
10989                                         // which is a comment of " blah -- bloo "
10990                                     parser.comment += "--" + c
10991                                     parser.state = S.COMMENT
10992                                 } else parser.state = S.TEXT
10993                                 continue
10994
10995                             case S.CDATA:
10996                                 if (c === "]") parser.state = S.CDATA_ENDING
10997                                 else parser.cdata += c
10998                                 continue
10999
11000                             case S.CDATA_ENDING:
11001                                 if (c === "]") parser.state = S.CDATA_ENDING_2
11002                                 else {
11003                                     parser.cdata += "]" + c
11004                                     parser.state = S.CDATA
11005                                 }
11006                                 continue
11007
11008                             case S.CDATA_ENDING_2:
11009                                 if (c === ">") {
11010                                     if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
11011                                     emitNode(parser, "onclosecdata")
11012                                     parser.cdata = ""
11013                                     parser.state = S.TEXT
11014                                 } else if (c === "]") {
11015                                     parser.cdata += "]"
11016                                 } else {
11017                                     parser.cdata += "]]" + c
11018                                     parser.state = S.CDATA
11019                                 }
11020                                 continue
11021
11022                             case S.PROC_INST:
11023                                 if (c === "?") parser.state = S.PROC_INST_ENDING
11024                                 else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
11025                                 else parser.procInstName += c
11026                                 continue
11027
11028                             case S.PROC_INST_BODY:
11029                                 if (!parser.procInstBody && is(whitespace, c)) continue
11030                                 else if (c === "?") parser.state = S.PROC_INST_ENDING
11031                                 else parser.procInstBody += c
11032                                 continue
11033
11034                             case S.PROC_INST_ENDING:
11035                                 if (c === ">") {
11036                                     emitNode(parser, "onprocessinginstruction", {
11037                                         name: parser.procInstName,
11038                                         body: parser.procInstBody
11039                                     })
11040                                     parser.procInstName = parser.procInstBody = ""
11041                                     parser.state = S.TEXT
11042                                 } else {
11043                                     parser.procInstBody += "?" + c
11044                                     parser.state = S.PROC_INST_BODY
11045                                 }
11046                                 continue
11047
11048                             case S.OPEN_TAG:
11049                                 if (is(nameBody, c)) parser.tagName += c
11050                                 else {
11051                                     newTag(parser)
11052                                     if (c === ">") openTag(parser)
11053                                     else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11054                                     else {
11055                                         if (not(whitespace, c)) strictFail(
11056                                             parser, "Invalid character in tag name")
11057                                         parser.state = S.ATTRIB
11058                                     }
11059                                 }
11060                                 continue
11061
11062                             case S.OPEN_TAG_SLASH:
11063                                 if (c === ">") {
11064                                     openTag(parser, true)
11065                                     closeTag(parser)
11066                                 } else {
11067                                     strictFail(parser, "Forward-slash in opening tag not followed by >")
11068                                     parser.state = S.ATTRIB
11069                                 }
11070                                 continue
11071
11072                             case S.ATTRIB:
11073                                 // haven't read the attribute name yet.
11074                                 if (is(whitespace, c)) continue
11075                                 else if (c === ">") openTag(parser)
11076                                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11077                                 else if (is(nameStart, c)) {
11078                                     parser.attribName = c
11079                                     parser.attribValue = ""
11080                                     parser.state = S.ATTRIB_NAME
11081                                 } else strictFail(parser, "Invalid attribute name")
11082                                 continue
11083
11084                             case S.ATTRIB_NAME:
11085                                 if (c === "=") parser.state = S.ATTRIB_VALUE
11086                                 else if (c === ">") {
11087                                     strictFail(parser, "Attribute without value")
11088                                     parser.attribValue = parser.attribName
11089                                     attrib(parser)
11090                                     openTag(parser)
11091                                 } else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
11092                                 else if (is(nameBody, c)) parser.attribName += c
11093                                 else strictFail(parser, "Invalid attribute name")
11094                                 continue
11095
11096                             case S.ATTRIB_NAME_SAW_WHITE:
11097                                 if (c === "=") parser.state = S.ATTRIB_VALUE
11098                                 else if (is(whitespace, c)) continue
11099                                 else {
11100                                     strictFail(parser, "Attribute without value")
11101                                     parser.tag.attributes[parser.attribName] = ""
11102                                     parser.attribValue = ""
11103                                     emitNode(parser, "onattribute", {
11104                                         name: parser.attribName,
11105                                         value: ""
11106                                     })
11107                                     parser.attribName = ""
11108                                     if (c === ">") openTag(parser)
11109                                     else if (is(nameStart, c)) {
11110                                         parser.attribName = c
11111                                         parser.state = S.ATTRIB_NAME
11112                                     } else {
11113                                         strictFail(parser, "Invalid attribute name")
11114                                         parser.state = S.ATTRIB
11115                                     }
11116                                 }
11117                                 continue
11118
11119                             case S.ATTRIB_VALUE:
11120                                 if (is(whitespace, c)) continue
11121                                 else if (is(quote, c)) {
11122                                     parser.q = c
11123                                     parser.state = S.ATTRIB_VALUE_QUOTED
11124                                 } else {
11125                                     strictFail(parser, "Unquoted attribute value")
11126                                     parser.state = S.ATTRIB_VALUE_UNQUOTED
11127                                     parser.attribValue = c
11128                                 }
11129                                 continue
11130
11131                             case S.ATTRIB_VALUE_QUOTED:
11132                                 if (c !== parser.q) {
11133                                     if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
11134                                     else parser.attribValue += c
11135                                     continue
11136                                 }
11137                                 attrib(parser)
11138                                 parser.q = ""
11139                                 parser.state = S.ATTRIB_VALUE_CLOSED
11140                                 continue
11141
11142                             case S.ATTRIB_VALUE_CLOSED:
11143                                 if (is(whitespace, c)) {
11144                                     parser.state = S.ATTRIB
11145                                 } else if (c === ">") openTag(parser)
11146                                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11147                                 else if (is(nameStart, c)) {
11148                                     strictFail(parser, "No whitespace between attributes")
11149                                     parser.attribName = c
11150                                     parser.attribValue = ""
11151                                     parser.state = S.ATTRIB_NAME
11152                                 } else strictFail(parser, "Invalid attribute name")
11153                                 continue
11154
11155                             case S.ATTRIB_VALUE_UNQUOTED:
11156                                 if (not(attribEnd, c)) {
11157                                     if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
11158                                     else parser.attribValue += c
11159                                     continue
11160                                 }
11161                                 attrib(parser)
11162                                 if (c === ">") openTag(parser)
11163                                 else parser.state = S.ATTRIB
11164                                 continue
11165
11166                             case S.CLOSE_TAG:
11167                                 if (!parser.tagName) {
11168                                     if (is(whitespace, c)) continue
11169                                     else if (not(nameStart, c)) {
11170                                         if (parser.script) {
11171                                             parser.script += "</" + c
11172                                             parser.state = S.SCRIPT
11173                                         } else {
11174                                             strictFail(parser, "Invalid tagname in closing tag.")
11175                                         }
11176                                     } else parser.tagName = c
11177                                 } else if (c === ">") closeTag(parser)
11178                                 else if (is(nameBody, c)) parser.tagName += c
11179                                 else if (parser.script) {
11180                                     parser.script += "</" + parser.tagName
11181                                     parser.tagName = ""
11182                                     parser.state = S.SCRIPT
11183                                 } else {
11184                                     if (not(whitespace, c)) strictFail(parser,
11185                                         "Invalid tagname in closing tag")
11186                                     parser.state = S.CLOSE_TAG_SAW_WHITE
11187                                 }
11188                                 continue
11189
11190                             case S.CLOSE_TAG_SAW_WHITE:
11191                                 if (is(whitespace, c)) continue
11192                                 if (c === ">") closeTag(parser)
11193                                 else strictFail(parser, "Invalid characters in closing tag")
11194                                 continue
11195
11196                             case S.TEXT_ENTITY:
11197                             case S.ATTRIB_VALUE_ENTITY_Q:
11198                             case S.ATTRIB_VALUE_ENTITY_U:
11199                                 switch (parser.state) {
11200                                     case S.TEXT_ENTITY:
11201                                         var returnState = S.TEXT,
11202                                             buffer = "textNode"
11203                                         break
11204
11205                                     case S.ATTRIB_VALUE_ENTITY_Q:
11206                                         var returnState = S.ATTRIB_VALUE_QUOTED,
11207                                             buffer = "attribValue"
11208                                         break
11209
11210                                     case S.ATTRIB_VALUE_ENTITY_U:
11211                                         var returnState = S.ATTRIB_VALUE_UNQUOTED,
11212                                             buffer = "attribValue"
11213                                         break
11214                                 }
11215                                 if (c === ";") {
11216                                     parser[buffer] += parseEntity(parser)
11217                                     parser.entity = ""
11218                                     parser.state = returnState
11219                                 } else if (is(entity, c)) parser.entity += c
11220                                 else {
11221                                     strictFail(parser, "Invalid character entity")
11222                                     parser[buffer] += "&" + parser.entity + c
11223                                     parser.entity = ""
11224                                     parser.state = returnState
11225                                 }
11226                                 continue
11227
11228                             default:
11229                                 throw new Error(parser, "Unknown state: " + parser.state)
11230                         }
11231                     } // while
11232                     // cdata blocks can get very big under normal conditions. emit and move on.
11233                     // if (parser.state === S.CDATA && parser.cdata) {
11234                     // emitNode(parser, "oncdata", parser.cdata)
11235                     // parser.cdata = ""
11236                     // }
11237                     if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
11238                     return parser
11239                 }
11240
11241                 /* ! http://mths.be/fromcodepoint v0.1.0 by @mathias */
11242                 if (!String.fromCodePoint) {
11243                     (function() {
11244                         var stringFromCharCode = String.fromCharCode;
11245                         var floor = Math.floor;
11246                         var fromCodePoint = function() {
11247                             var MAX_SIZE = 0x4000;
11248                             var codeUnits = [];
11249                             var highSurrogate;
11250                             var lowSurrogate;
11251                             var index = -1;
11252                             var length = arguments.length;
11253                             if (!length) {
11254                                 return '';
11255                             }
11256                             var result = '';
11257                             while (++index < length) {
11258                                 var codePoint = Number(arguments[index]);
11259                                 if (!isFinite(codePoint) || // `NaN`,
11260                                     // `+Infinity`,
11261                                     // or
11262                                     // `-Infinity`
11263                                     codePoint < 0 || // not a valid
11264                                     // Unicode code
11265                                     // point
11266                                     codePoint > 0x10FFFF || // not a valid
11267                                     // Unicode code
11268                                     // point
11269                                     floor(codePoint) != codePoint // not
11270                                     // an
11271                                     // integer
11272                                 ) {
11273                                     throw RangeError('Invalid code point: ' + codePoint);
11274                                 }
11275                                 if (codePoint <= 0xFFFF) { // BMP code point
11276                                     codeUnits.push(codePoint);
11277                                 } else { // Astral code point; split in
11278                                     // surrogate halves
11279                                     // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
11280                                     codePoint -= 0x10000;
11281                                     highSurrogate = (codePoint >> 10) + 0xD800;
11282                                     lowSurrogate = (codePoint % 0x400) + 0xDC00;
11283                                     codeUnits.push(highSurrogate, lowSurrogate);
11284                                 }
11285                                 if (index + 1 == length || codeUnits.length > MAX_SIZE) {
11286                                     result += stringFromCharCode.apply(null, codeUnits);
11287                                     codeUnits.length = 0;
11288                                 }
11289                             }
11290                             return result;
11291                         };
11292                         if (Object.defineProperty) {
11293                             Object.defineProperty(String, 'fromCodePoint', {
11294                                 'value': fromCodePoint,
11295                                 'configurable': true,
11296                                 'writable': true
11297                             });
11298                         } else {
11299                             String.fromCodePoint = fromCodePoint;
11300                         }
11301                     }());
11302                 }
11303
11304             })(typeof exports === "undefined" ? sax = {} : exports);
11305
11306         }).call(this, undefined)
11307     }, {
11308         "stream": false,
11309         "string_decoder": false
11310     }],
11311     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\tiny-stack\\lib\\tiny-stack.js": [function(require, module, exports) {
11312         /**
11313          * Tiny stack for browser or server
11314          * 
11315          * @author Jason Mulligan <jason.mulligan@avoidwork.com>
11316          * @copyright 2014 Jason Mulligan
11317          * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
11318          * @link http://avoidwork.github.io/tiny-stack
11319          * @module tiny-stack
11320          * @version 0.1.0
11321          */
11322
11323         (function(global) {
11324
11325             "use strict";
11326
11327             /**
11328              * TinyStack
11329              * 
11330              * @constructor
11331              */
11332             function TinyStack() {
11333                 this.data = [null];
11334                 this.top = 0;
11335             }
11336
11337             /**
11338              * Clears the stack
11339              * 
11340              * @method clear
11341              * @memberOf TinyStack
11342              * @return {Object} {@link TinyStack}
11343              */
11344             TinyStack.prototype.clear = function clear() {
11345                 this.data = [null];
11346                 this.top = 0;
11347
11348                 return this;
11349             };
11350
11351             /**
11352              * Gets the size of the stack
11353              * 
11354              * @method length
11355              * @memberOf TinyStack
11356              * @return {Number} Size of stack
11357              */
11358             TinyStack.prototype.length = function length() {
11359                 return this.top;
11360             };
11361
11362             /**
11363              * Gets the item at the top of the stack
11364              * 
11365              * @method peek
11366              * @memberOf TinyStack
11367              * @return {Mixed} Item at the top of the stack
11368              */
11369             TinyStack.prototype.peek = function peek() {
11370                 return this.data[this.top];
11371             };
11372
11373             /**
11374              * Gets & removes the item at the top of the stack
11375              * 
11376              * @method pop
11377              * @memberOf TinyStack
11378              * @return {Mixed} Item at the top of the stack
11379              */
11380             TinyStack.prototype.pop = function pop() {
11381                 if (this.top > 0) {
11382                     this.top--;
11383
11384                     return this.data.pop();
11385                 } else {
11386                     return undefined;
11387                 }
11388             };
11389
11390             /**
11391              * Pushes an item onto the stack
11392              * 
11393              * @method push
11394              * @memberOf TinyStack
11395              * @return {Object} {@link TinyStack}
11396              */
11397             TinyStack.prototype.push = function push(arg) {
11398                 this.data[++this.top] = arg;
11399
11400                 return this;
11401             };
11402
11403             /**
11404              * TinyStack factory
11405              * 
11406              * @method factory
11407              * @return {Object} {@link TinyStack}
11408              */
11409             function factory() {
11410                 return new TinyStack();
11411             }
11412
11413             // Node, AMD & window supported
11414             if (typeof exports != "undefined") {
11415                 module.exports = factory;
11416             } else if (typeof define == "function") {
11417                 define(function() {
11418                     return factory;
11419                 });
11420             } else {
11421                 global.stack = factory;
11422             }
11423         })(this);
11424
11425     }, {}],
11426     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js": [function(require, module, exports) {
11427         module.exports = require('./lib/moddle');
11428     }, {
11429         "./lib/moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js"
11430     }],
11431     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js": [function(require, module, exports) {
11432         'use strict';
11433
11434         function Base() {}
11435
11436         Base.prototype.get = function(name) {
11437             return this.$model.properties.get(this, name);
11438         };
11439
11440         Base.prototype.set = function(name, value) {
11441             this.$model.properties.set(this, name, value);
11442         };
11443
11444
11445         module.exports = Base;
11446     }, {}],
11447     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js": [function(require, module, exports) {
11448         'use strict';
11449
11450         var pick = require('lodash/object/pick'),
11451             assign = require('lodash/object/assign'),
11452             forEach = require('lodash/collection/forEach');
11453
11454         var parseNameNs = require('./ns').parseName;
11455
11456
11457         function DescriptorBuilder(nameNs) {
11458             this.ns = nameNs;
11459             this.name = nameNs.name;
11460             this.allTypes = [];
11461             this.properties = [];
11462             this.propertiesByName = {};
11463         }
11464
11465         module.exports = DescriptorBuilder;
11466
11467
11468         DescriptorBuilder.prototype.build = function() {
11469             return pick(this, ['ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty']);
11470         };
11471
11472         DescriptorBuilder.prototype.addProperty = function(p, idx) {
11473             this.addNamedProperty(p, true);
11474
11475             var properties = this.properties;
11476
11477             if (idx !== undefined) {
11478                 properties.splice(idx, 0, p);
11479             } else {
11480                 properties.push(p);
11481             }
11482         };
11483
11484
11485         DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
11486             var oldNameNs = oldProperty.ns;
11487
11488             var props = this.properties,
11489                 propertiesByName = this.propertiesByName,
11490                 rename = oldProperty.name !== newProperty.name;
11491
11492             if (oldProperty.isBody) {
11493
11494                 if (!newProperty.isBody) {
11495                     throw new Error(
11496                         'property <' + newProperty.ns.name + '> must be body property ' +
11497                         'to refine <' + oldProperty.ns.name + '>');
11498                 }
11499
11500                 // TODO: Check compatibility
11501                 this.setBodyProperty(newProperty, false);
11502             }
11503
11504             // replacing the named property is intentional
11505             // thus, validate only if this is a "rename" operation
11506             this.addNamedProperty(newProperty, rename);
11507
11508             // replace old property at index with new one
11509             var idx = props.indexOf(oldProperty);
11510             if (idx === -1) {
11511                 throw new Error('property <' + oldNameNs.name + '> not found in property list');
11512             }
11513
11514             props[idx] = newProperty;
11515
11516             // replace propertiesByName entry with new property
11517             propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
11518         };
11519
11520
11521         DescriptorBuilder.prototype.redefineProperty = function(p) {
11522
11523             var nsPrefix = p.ns.prefix;
11524             var parts = p.redefines.split('#');
11525
11526             var name = parseNameNs(parts[0], nsPrefix);
11527             var attrName = parseNameNs(parts[1], name.prefix).name;
11528
11529             var redefinedProperty = this.propertiesByName[attrName];
11530             if (!redefinedProperty) {
11531                 throw new Error('refined property <' + attrName + '> not found');
11532             } else {
11533                 this.replaceProperty(redefinedProperty, p);
11534             }
11535
11536             delete p.redefines;
11537         };
11538
11539         DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
11540             var ns = p.ns,
11541                 propsByName = this.propertiesByName;
11542
11543             if (validate) {
11544                 this.assertNotDefined(p, ns.name);
11545                 this.assertNotDefined(p, ns.localName);
11546             }
11547
11548             propsByName[ns.name] = propsByName[ns.localName] = p;
11549         };
11550
11551         DescriptorBuilder.prototype.removeNamedProperty = function(p) {
11552             var ns = p.ns,
11553                 propsByName = this.propertiesByName;
11554
11555             delete propsByName[ns.name];
11556             delete propsByName[ns.localName];
11557         };
11558
11559         DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
11560
11561             if (validate && this.bodyProperty) {
11562                 throw new Error(
11563                     'body property defined multiple times ' +
11564                     '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
11565             }
11566
11567             this.bodyProperty = p;
11568         };
11569
11570         DescriptorBuilder.prototype.addIdProperty = function(name) {
11571             var nameNs = parseNameNs(name, this.ns.prefix);
11572
11573             var p = {
11574                 name: nameNs.localName,
11575                 type: 'String',
11576                 isAttr: true,
11577                 ns: nameNs
11578             };
11579
11580             // ensure that id is always the first attribute (if present)
11581             this.addProperty(p, 0);
11582         };
11583
11584         DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
11585             var propertyName = p.name,
11586                 definedProperty = this.propertiesByName[propertyName];
11587
11588             if (definedProperty) {
11589                 throw new Error(
11590                     'property <' + propertyName + '> already defined; ' +
11591                     'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
11592                     '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
11593             }
11594         };
11595
11596         DescriptorBuilder.prototype.hasProperty = function(name) {
11597             return this.propertiesByName[name];
11598         };
11599
11600         DescriptorBuilder.prototype.addTrait = function(t) {
11601
11602             var allTypes = this.allTypes;
11603
11604             if (allTypes.indexOf(t) !== -1) {
11605                 return;
11606             }
11607
11608             forEach(t.properties, function(p) {
11609
11610                 // clone property to allow extensions
11611                 p = assign({}, p, {
11612                     name: p.ns.localName
11613                 });
11614
11615                 Object.defineProperty(p, 'definedBy', {
11616                     value: t
11617                 });
11618
11619                 // add redefine support
11620                 if (p.redefines) {
11621                     this.redefineProperty(p);
11622                 } else {
11623                     if (p.isBody) {
11624                         this.setBodyProperty(p);
11625                     }
11626                     this.addProperty(p);
11627                 }
11628             }, this);
11629
11630             allTypes.push(t);
11631         };
11632
11633     }, {
11634         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11635         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11636         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
11637         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
11638     }],
11639     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js": [function(require, module, exports) {
11640         'use strict';
11641
11642         var forEach = require('lodash/collection/forEach');
11643
11644         var Base = require('./base');
11645
11646
11647         function Factory(model, properties) {
11648             this.model = model;
11649             this.properties = properties;
11650         }
11651
11652         module.exports = Factory;
11653
11654
11655         Factory.prototype.createType = function(descriptor) {
11656
11657             var model = this.model;
11658
11659             var props = this.properties,
11660                 prototype = Object.create(Base.prototype);
11661
11662             // initialize default values
11663             forEach(descriptor.properties, function(p) {
11664                 if (!p.isMany && p.default !== undefined) {
11665                     prototype[p.name] = p.default;
11666                 }
11667             });
11668
11669             props.defineModel(prototype, model);
11670             props.defineDescriptor(prototype, descriptor);
11671
11672             var name = descriptor.ns.name;
11673
11674             /**
11675              * The new type constructor
11676              */
11677             function ModdleElement(attrs) {
11678                 props.define(this, '$type', {
11679                     value: name,
11680                     enumerable: true
11681                 });
11682                 props.define(this, '$attrs', {
11683                     value: {}
11684                 });
11685                 props.define(this, '$parent', {
11686                     writable: true
11687                 });
11688
11689                 forEach(attrs, function(val, key) {
11690                     this.set(key, val);
11691                 }, this);
11692             }
11693
11694             ModdleElement.prototype = prototype;
11695
11696             ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
11697
11698             // static links
11699             props.defineModel(ModdleElement, model);
11700             props.defineDescriptor(ModdleElement, descriptor);
11701
11702             return ModdleElement;
11703         };
11704     }, {
11705         "./base": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js",
11706         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
11707     }],
11708     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js": [function(require, module, exports) {
11709         'use strict';
11710
11711         var isString = require('lodash/lang/isString'),
11712             isObject = require('lodash/lang/isObject'),
11713             forEach = require('lodash/collection/forEach'),
11714             find = require('lodash/collection/find');
11715
11716
11717         var Factory = require('./factory'),
11718             Registry = require('./registry'),
11719             Properties = require('./properties');
11720
11721         var parseNameNs = require('./ns').parseName;
11722
11723
11724         // // Moddle implementation /////////////////////////////////////////////////
11725
11726         /**
11727          * @class Moddle
11728          * 
11729          * A model that can be used to create elements of a specific type.
11730          * 
11731          * @example
11732          * 
11733          * var Moddle = require('moddle');
11734          * 
11735          * var pkg = { name: 'mypackage', prefix: 'my', types: [ { name: 'Root' } ] };
11736          * 
11737          * var moddle = new Moddle([pkg]);
11738          * 
11739          * @param {Array
11740          *            <Package>} packages the packages to contain
11741          * @param {Object}
11742          *            options additional options to pass to the model
11743          */
11744         function Moddle(packages, options) {
11745
11746             options = options || {};
11747
11748             this.properties = new Properties(this);
11749
11750             this.factory = new Factory(this, this.properties);
11751             this.registry = new Registry(packages, this.properties, options);
11752
11753             this.typeCache = {};
11754         }
11755
11756         module.exports = Moddle;
11757
11758
11759         /**
11760          * Create an instance of the specified type.
11761          * 
11762          * @method Moddle#create
11763          * 
11764          * @example
11765          * 
11766          * var foo = moddle.create('my:Foo'); var bar = moddle.create('my:Bar', { id:
11767          * 'BAR_1' });
11768          * 
11769          * @param {String|Object}
11770          *            descriptor the type descriptor or name know to the model
11771          * @param {Object}
11772          *            attrs a number of attributes to initialize the model instance with
11773          * @return {Object} model instance
11774          */
11775         Moddle.prototype.create = function(descriptor, attrs) {
11776             var Type = this.getType(descriptor);
11777
11778             if (!Type) {
11779                 throw new Error('unknown type <' + descriptor + '>');
11780             }
11781
11782             return new Type(attrs);
11783         };
11784
11785
11786         /**
11787          * Returns the type representing a given descriptor
11788          * 
11789          * @method Moddle#getType
11790          * 
11791          * @example
11792          * 
11793          * var Foo = moddle.getType('my:Foo'); var foo = new Foo({ 'id' : 'FOO_1' });
11794          * 
11795          * @param {String|Object}
11796          *            descriptor the type descriptor or name know to the model
11797          * @return {Object} the type representing the descriptor
11798          */
11799         Moddle.prototype.getType = function(descriptor) {
11800
11801             var cache = this.typeCache;
11802
11803             var name = isString(descriptor) ? descriptor : descriptor.ns.name;
11804
11805             var type = cache[name];
11806
11807             if (!type) {
11808                 descriptor = this.registry.getEffectiveDescriptor(name);
11809                 type = cache[name] = this.factory.createType(descriptor);
11810             }
11811
11812             return type;
11813         };
11814
11815
11816         /**
11817          * Creates an any-element type to be used within model instances.
11818          * 
11819          * This can be used to create custom elements that lie outside the meta-model.
11820          * The created element contains all the meta-data required to serialize it as
11821          * part of meta-model elements.
11822          * 
11823          * @method Moddle#createAny
11824          * 
11825          * @example
11826          * 
11827          * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { value: 'bar' });
11828          * 
11829          * var container = moddle.create('my:Container', 'http://my', { any: [ foo ] });
11830          *  // go ahead and serialize the stuff
11831          * 
11832          * 
11833          * @param {String}
11834          *            name the name of the element
11835          * @param {String}
11836          *            nsUri the namespace uri of the element
11837          * @param {Object}
11838          *            [properties] a map of properties to initialize the instance with
11839          * @return {Object} the any type instance
11840          */
11841         Moddle.prototype.createAny = function(name, nsUri, properties) {
11842
11843             var nameNs = parseNameNs(name);
11844
11845             var element = {
11846                 $type: name
11847             };
11848
11849             var descriptor = {
11850                 name: name,
11851                 isGeneric: true,
11852                 ns: {
11853                     prefix: nameNs.prefix,
11854                     localName: nameNs.localName,
11855                     uri: nsUri
11856                 }
11857             };
11858
11859             this.properties.defineDescriptor(element, descriptor);
11860             this.properties.defineModel(element, this);
11861             this.properties.define(element, '$parent', {
11862                 enumerable: false,
11863                 writable: true
11864             });
11865
11866             forEach(properties, function(a, key) {
11867                 if (isObject(a) && a.value !== undefined) {
11868                     element[a.name] = a.value;
11869                 } else {
11870                     element[key] = a;
11871                 }
11872             });
11873
11874             return element;
11875         };
11876
11877         /**
11878          * Returns a registered package by uri or prefix
11879          * 
11880          * @return {Object} the package
11881          */
11882         Moddle.prototype.getPackage = function(uriOrPrefix) {
11883             return this.registry.getPackage(uriOrPrefix);
11884         };
11885
11886         /**
11887          * Returns a snapshot of all known packages
11888          * 
11889          * @return {Object} the package
11890          */
11891         Moddle.prototype.getPackages = function() {
11892             return this.registry.getPackages();
11893         };
11894
11895         /**
11896          * Returns the descriptor for an element
11897          */
11898         Moddle.prototype.getElementDescriptor = function(element) {
11899             return element.$descriptor;
11900         };
11901
11902         /**
11903          * Returns true if the given descriptor or instance represents the given type.
11904          * 
11905          * May be applied to this, if element is omitted.
11906          */
11907         Moddle.prototype.hasType = function(element, type) {
11908             if (type === undefined) {
11909                 type = element;
11910                 element = this;
11911             }
11912
11913             var descriptor = element.$model.getElementDescriptor(element);
11914
11915             return !!find(descriptor.allTypes, function(t) {
11916                 return t.name === type;
11917             });
11918         };
11919
11920
11921         /**
11922          * Returns the descriptor of an elements named property
11923          */
11924         Moddle.prototype.getPropertyDescriptor = function(element, property) {
11925             return this.getElementDescriptor(element).propertiesByName[property];
11926         };
11927
11928     }, {
11929         "./factory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js",
11930         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11931         "./properties": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js",
11932         "./registry": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js",
11933         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
11934         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11935         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
11936         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js"
11937     }],
11938     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js": [function(require, module, exports) {
11939         'use strict';
11940
11941         /**
11942          * Parses a namespaced attribute name of the form (ns:)localName to an object,
11943          * given a default prefix to assume in case no explicit namespace is given.
11944          * 
11945          * @param {String}
11946          *            name
11947          * @param {String}
11948          *            [defaultPrefix] the default prefix to take, if none is present.
11949          * 
11950          * @return {Object} the parsed name
11951          */
11952         module.exports.parseName = function(name, defaultPrefix) {
11953             var parts = name.split(/:/),
11954                 localName, prefix;
11955
11956             // no prefix (i.e. only local name)
11957             if (parts.length === 1) {
11958                 localName = name;
11959                 prefix = defaultPrefix;
11960             } else
11961             // prefix + local name
11962             if (parts.length === 2) {
11963                 localName = parts[1];
11964                 prefix = parts[0];
11965             } else {
11966                 throw new Error('expected <prefix:localName> or <localName>, got ' + name);
11967             }
11968
11969             name = (prefix ? prefix + ':' : '') + localName;
11970
11971             return {
11972                 name: name,
11973                 prefix: prefix,
11974                 localName: localName
11975             };
11976         };
11977     }, {}],
11978     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js": [function(require, module, exports) {
11979         'use strict';
11980
11981
11982         /**
11983          * A utility that gets and sets properties of model elements.
11984          * 
11985          * @param {Model}
11986          *            model
11987          */
11988         function Properties(model) {
11989             this.model = model;
11990         }
11991
11992         module.exports = Properties;
11993
11994
11995         /**
11996          * Sets a named property on the target element
11997          * 
11998          * @param {Object}
11999          *            target
12000          * @param {String}
12001          *            name
12002          * @param {Object}
12003          *            value
12004          */
12005         Properties.prototype.set = function(target, name, value) {
12006
12007             var property = this.model.getPropertyDescriptor(target, name);
12008
12009             if (!property) {
12010                 target.$attrs[name] = value;
12011             } else {
12012                 Object.defineProperty(target, property.name, {
12013                     enumerable: !property.isReference,
12014                     writable: true,
12015                     value: value
12016                 });
12017             }
12018         };
12019
12020         /**
12021          * Returns the named property of the given element
12022          * 
12023          * @param {Object}
12024          *            target
12025          * @param {String}
12026          *            name
12027          * 
12028          * @return {Object}
12029          */
12030         Properties.prototype.get = function(target, name) {
12031
12032             var property = this.model.getPropertyDescriptor(target, name);
12033
12034             if (!property) {
12035                 return target.$attrs[name];
12036             }
12037
12038             var propertyName = property.name;
12039
12040             // check if access to collection property and lazily initialize it
12041             if (!target[propertyName] && property.isMany) {
12042                 Object.defineProperty(target, propertyName, {
12043                     enumerable: !property.isReference,
12044                     writable: true,
12045                     value: []
12046                 });
12047             }
12048
12049             return target[propertyName];
12050         };
12051
12052
12053         /**
12054          * Define a property on the target element
12055          * 
12056          * @param {Object}
12057          *            target
12058          * @param {String}
12059          *            name
12060          * @param {Object}
12061          *            options
12062          */
12063         Properties.prototype.define = function(target, name, options) {
12064             Object.defineProperty(target, name, options);
12065         };
12066
12067
12068         /**
12069          * Define the descriptor for an element
12070          */
12071         Properties.prototype.defineDescriptor = function(target, descriptor) {
12072             this.define(target, '$descriptor', {
12073                 value: descriptor
12074             });
12075         };
12076
12077         /**
12078          * Define the model for an element
12079          */
12080         Properties.prototype.defineModel = function(target, model) {
12081             this.define(target, '$model', {
12082                 value: model
12083             });
12084         };
12085     }, {}],
12086     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js": [function(require, module, exports) {
12087         'use strict';
12088
12089         var assign = require('lodash/object/assign'),
12090             forEach = require('lodash/collection/forEach');
12091
12092         var Types = require('./types'),
12093             DescriptorBuilder = require('./descriptor-builder');
12094
12095         var parseNameNs = require('./ns').parseName,
12096             isBuiltInType = Types.isBuiltIn;
12097
12098
12099         function Registry(packages, properties, options) {
12100
12101             this.options = assign({
12102                 generateId: 'id'
12103             }, options || {});
12104
12105             this.packageMap = {};
12106             this.typeMap = {};
12107
12108             this.packages = [];
12109
12110             this.properties = properties;
12111
12112             forEach(packages, this.registerPackage, this);
12113         }
12114
12115         module.exports = Registry;
12116
12117
12118         Registry.prototype.getPackage = function(uriOrPrefix) {
12119             return this.packageMap[uriOrPrefix];
12120         };
12121
12122         Registry.prototype.getPackages = function() {
12123             return this.packages;
12124         };
12125
12126
12127         Registry.prototype.registerPackage = function(pkg) {
12128             // alert("pkg :: " + pkg);
12129             // copy package
12130             pkg = assign({}, pkg);
12131
12132             // register types
12133             forEach(pkg.types, function(descriptor) {
12134                 this.registerType(descriptor, pkg);
12135             }, this);
12136
12137             this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
12138             this.packages.push(pkg);
12139         };
12140
12141
12142         /**
12143          * Register a type from a specific package with us
12144          */
12145         Registry.prototype.registerType = function(type, pkg) {
12146
12147             type = assign({}, type, {
12148                 superClass: (type.superClass || []).slice(),
12149                 extends: (type.extends || []).slice(),
12150                 properties: (type.properties || []).slice()
12151             });
12152
12153             var ns = parseNameNs(type.name, pkg.prefix),
12154                 name = ns.name,
12155                 propertiesByName = {};
12156
12157             // parse properties
12158             forEach(type.properties, function(p) {
12159
12160                 // namespace property names
12161                 var propertyNs = parseNameNs(p.name, ns.prefix),
12162                     propertyName = propertyNs.name;
12163
12164                 // namespace property types
12165                 if (!isBuiltInType(p.type)) {
12166                     p.type = parseNameNs(p.type, propertyNs.prefix).name;
12167                 }
12168
12169                 assign(p, {
12170                     ns: propertyNs,
12171                     name: propertyName
12172                 });
12173
12174                 propertiesByName[propertyName] = p;
12175             });
12176
12177             // update ns + name
12178             assign(type, {
12179                 ns: ns,
12180                 name: name,
12181                 propertiesByName: propertiesByName
12182             });
12183
12184             forEach(type.extends, function(extendsName) {
12185                 var extended = this.typeMap[extendsName];
12186
12187                 extended.traits = extended.traits || [];
12188                 extended.traits.push(name);
12189             }, this);
12190
12191             // link to package
12192             this.definePackage(type, pkg);
12193
12194             // register
12195             this.typeMap[name] = type;
12196         };
12197
12198
12199         /**
12200          * Traverse the type hierarchy from bottom to top.
12201          */
12202         Registry.prototype.mapTypes = function(nsName, iterator) {
12203
12204             // alert("nsName :: " + nsName.name);
12205             var type = isBuiltInType(nsName.name) ? {
12206                 name: nsName.name
12207             } : this.typeMap[nsName.name];
12208             // alert("Type :: " + type);
12209
12210             var self = this;
12211
12212             /**
12213              * Traverse the selected super type or trait
12214              * 
12215              * @param {String}
12216              *            cls
12217              */
12218             function traverseSuper(cls) {
12219                 var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
12220                 self.mapTypes(parentNs, iterator);
12221             }
12222
12223             if (!type) {
12224                 throw new Error('unknown type <' + nsName.name + '>');
12225             }
12226
12227             forEach(type.superClass, traverseSuper);
12228
12229             iterator(type);
12230
12231             forEach(type.traits, traverseSuper);
12232         };
12233
12234
12235         /**
12236          * Returns the effective descriptor for a type.
12237          * 
12238          * @param {String}
12239          *            type the namespaced name (ns:localName) of the type
12240          * 
12241          * @return {Descriptor} the resulting effective descriptor
12242          */
12243         Registry.prototype.getEffectiveDescriptor = function(name) {
12244
12245             var nsName = parseNameNs(name);
12246
12247             var builder = new DescriptorBuilder(nsName);
12248
12249             this.mapTypes(nsName, function(type) {
12250                 builder.addTrait(type);
12251             });
12252
12253             // check we have an id assigned
12254             var id = this.options.generateId;
12255             if (id && !builder.hasProperty(id)) {
12256                 builder.addIdProperty(id);
12257             }
12258
12259             var descriptor = builder.build();
12260
12261             // define package link
12262             this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
12263
12264             return descriptor;
12265         };
12266
12267
12268         Registry.prototype.definePackage = function(target, pkg) {
12269             this.properties.define(target, '$pkg', {
12270                 value: pkg
12271             });
12272         };
12273     }, {
12274         "./descriptor-builder": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js",
12275         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
12276         "./types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
12277         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
12278         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
12279     }],
12280     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js": [function(require, module, exports) {
12281         'use strict';
12282
12283         /**
12284          * Built-in moddle types
12285          */
12286         var BUILTINS = {
12287             String: true,
12288             Boolean: true,
12289             Integer: true,
12290             Real: true,
12291             Element: true
12292         };
12293
12294         /**
12295          * Converters for built in types from string representations
12296          */
12297         var TYPE_CONVERTERS = {
12298             String: function(s) {
12299                 return s;
12300             },
12301             Boolean: function(s) {
12302                 return s === 'true';
12303             },
12304             Integer: function(s) {
12305                 return parseInt(s, 10);
12306             },
12307             Real: function(s) {
12308                 return parseFloat(s, 10);
12309             }
12310         };
12311
12312         /**
12313          * Convert a type to its real representation
12314          */
12315         module.exports.coerceType = function(type, value) {
12316
12317             var converter = TYPE_CONVERTERS[type];
12318
12319             if (converter) {
12320                 return converter(value);
12321             } else {
12322                 return value;
12323             }
12324         };
12325
12326         /**
12327          * Return whether the given type is built-in
12328          */
12329         module.exports.isBuiltIn = function(type) {
12330             return !!BUILTINS[type];
12331         };
12332
12333         /**
12334          * Return whether the given type is simple
12335          */
12336         module.exports.isSimple = function(type) {
12337             return !!TYPE_CONVERTERS[type];
12338         };
12339     }, {}],
12340     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json": [function(require, module, exports) {
12341         module.exports = {
12342             "name": "BPMN20",
12343             "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
12344             "associations": [],
12345             "types": [{
12346                 "name": "Interface",
12347                 "superClass": [
12348                     "RootElement"
12349                 ],
12350                 "properties": [{
12351                     "name": "name",
12352                     "isAttr": true,
12353                     "type": "String"
12354                 }, {
12355                     "name": "operations",
12356                     "type": "Operation",
12357                     "isMany": true
12358                 }, {
12359                     "name": "implementationRef",
12360                     "type": "String",
12361                     "isAttr": true
12362                 }]
12363             }, {
12364                 "name": "Operation",
12365                 "superClass": [
12366                     "BaseElement"
12367                 ],
12368                 "properties": [{
12369                     "name": "name",
12370                     "isAttr": true,
12371                     "type": "String"
12372                 }, {
12373                     "name": "inMessageRef",
12374                     "type": "Message",
12375                     "isAttr": true,
12376                     "isReference": true
12377                 }, {
12378                     "name": "outMessageRef",
12379                     "type": "Message",
12380                     "isAttr": true,
12381                     "isReference": true
12382                 }, {
12383                     "name": "errorRefs",
12384                     "type": "Error",
12385                     "isMany": true,
12386                     "isReference": true
12387                 }, {
12388                     "name": "implementationRef",
12389                     "type": "String",
12390                     "isAttr": true
12391                 }]
12392             }, {
12393                 "name": "EndPoint",
12394                 "superClass": [
12395                     "RootElement"
12396                 ]
12397             }, {
12398                 "name": "Auditing",
12399                 "superClass": [
12400                     "BaseElement"
12401                 ]
12402             }, {
12403                 "name": "GlobalTask",
12404                 "superClass": [
12405                     "CallableElement"
12406                 ],
12407                 "properties": [{
12408                     "name": "resources",
12409                     "type": "ResourceRole",
12410                     "isMany": true
12411                 }]
12412             }, {
12413                 "name": "Monitoring",
12414                 "superClass": [
12415                     "BaseElement"
12416                 ]
12417             }, {
12418                 "name": "Performer",
12419                 "superClass": [
12420                     "ResourceRole"
12421                 ]
12422             }, {
12423                 "name": "Process",
12424                 "superClass": [
12425                     "FlowElementsContainer",
12426                     "CallableElement"
12427                 ],
12428                 "properties": [{
12429                     "name": "processType",
12430                     "type": "ProcessType",
12431                     "isAttr": true
12432                 }, {
12433                     "name": "isClosed",
12434                     "isAttr": true,
12435                     "type": "Boolean"
12436                 }, {
12437                     "name": "auditing",
12438                     "type": "Auditing"
12439                 }, {
12440                     "name": "monitoring",
12441                     "type": "Monitoring"
12442                 }, {
12443                     "name": "properties",
12444                     "type": "Property",
12445                     "isMany": true
12446                 }, {
12447                     "name": "supports",
12448                     "type": "Process",
12449                     "isMany": true,
12450                     "isReference": true
12451                 }, {
12452                     "name": "definitionalCollaborationRef",
12453                     "type": "Collaboration",
12454                     "isAttr": true,
12455                     "isReference": true
12456                 }, {
12457                     "name": "isExecutable",
12458                     "isAttr": true,
12459                     "type": "Boolean"
12460                 }, {
12461                     "name": "resources",
12462                     "type": "ResourceRole",
12463                     "isMany": true
12464                 }, {
12465                     "name": "artifacts",
12466                     "type": "Artifact",
12467                     "isMany": true
12468                 }, {
12469                     "name": "correlationSubscriptions",
12470                     "type": "CorrelationSubscription",
12471                     "isMany": true
12472                 }]
12473             }, {
12474                 "name": "LaneSet",
12475                 "superClass": [
12476                     "BaseElement"
12477                 ],
12478                 "properties": [{
12479                     "name": "lanes",
12480                     "type": "Lane",
12481                     "isMany": true
12482                 }, {
12483                     "name": "name",
12484                     "isAttr": true,
12485                     "type": "String"
12486                 }]
12487             }, {
12488                 "name": "Lane",
12489                 "superClass": [
12490                     "BaseElement"
12491                 ],
12492                 "properties": [{
12493                     "name": "name",
12494                     "isAttr": true,
12495                     "type": "String"
12496                 }, {
12497                     "name": "childLaneSet",
12498                     "type": "LaneSet",
12499                     "serialize": "xsi:type"
12500                 }, {
12501                     "name": "partitionElementRef",
12502                     "type": "BaseElement",
12503                     "isAttr": true,
12504                     "isReference": true
12505                 }, {
12506                     "name": "flowNodeRef",
12507                     "type": "FlowNode",
12508                     "isMany": true,
12509                     "isReference": true
12510                 }, {
12511                     "name": "partitionElement",
12512                     "type": "BaseElement"
12513                 }]
12514             }, {
12515                 "name": "GlobalManualTask",
12516                 "superClass": [
12517                     "GlobalTask"
12518                 ]
12519             }, {
12520                 "name": "ManualTask",
12521                 "superClass": [
12522                     "Task"
12523                 ]
12524             }, {
12525                 "name": "UserTask",
12526                 "superClass": [
12527                     "Task"
12528                 ],
12529                 "properties": [{
12530                     "name": "renderings",
12531                     "type": "Rendering",
12532                     "isMany": true
12533                 }, {
12534                     "name": "implementation",
12535                     "isAttr": true,
12536                     "type": "String"
12537                 }]
12538             }, {
12539                 "name": "Rendering",
12540                 "superClass": [
12541                     "BaseElement"
12542                 ]
12543             }, {
12544                 "name": "HumanPerformer",
12545                 "superClass": [
12546                     "Performer"
12547                 ]
12548             }, {
12549                 "name": "PotentialOwner",
12550                 "superClass": [
12551                     "HumanPerformer"
12552                 ]
12553             }, {
12554                 "name": "GlobalUserTask",
12555                 "superClass": [
12556                     "GlobalTask"
12557                 ],
12558                 "properties": [{
12559                     "name": "implementation",
12560                     "isAttr": true,
12561                     "type": "String"
12562                 }, {
12563                     "name": "renderings",
12564                     "type": "Rendering",
12565                     "isMany": true
12566                 }]
12567             }, {
12568                 "name": "Gateway",
12569                 "isAbstract": true,
12570                 "superClass": [
12571                     "FlowNode"
12572                 ],
12573                 "properties": [{
12574                     "name": "gatewayDirection",
12575                     "type": "GatewayDirection",
12576                     "default": "Unspecified",
12577                     "isAttr": true
12578                 }]
12579             }, {
12580                 "name": "EventBasedGateway",
12581                 "superClass": [
12582                     "Gateway"
12583                 ],
12584                 "properties": [{
12585                     "name": "instantiate",
12586                     "default": false,
12587                     "isAttr": true,
12588                     "type": "Boolean"
12589                 }, {
12590                     "name": "eventGatewayType",
12591                     "type": "EventBasedGatewayType",
12592                     "isAttr": true,
12593                     "default": "Exclusive"
12594                 }]
12595             }, {
12596                 "name": "ComplexGateway",
12597                 "superClass": [
12598                     "Gateway"
12599                 ],
12600                 "properties": [{
12601                     "name": "activationCondition",
12602                     "type": "Expression",
12603                     "serialize": "xsi:type"
12604                 }, {
12605                     "name": "default",
12606                     "type": "SequenceFlow",
12607                     "isAttr": true,
12608                     "isReference": true
12609                 }]
12610             }, {
12611                 "name": "ExclusiveGateway",
12612                 "superClass": [
12613                     "Gateway"
12614                 ],
12615                 "properties": [{
12616                     "name": "default",
12617                     "type": "SequenceFlow",
12618                     "isAttr": true,
12619                     "isReference": true
12620                 }]
12621             }, {
12622                 "name": "InclusiveGateway",
12623                 "superClass": [
12624                     "Gateway"
12625                 ],
12626                 "properties": [{
12627                     "name": "default",
12628                     "type": "SequenceFlow",
12629                     "isAttr": true,
12630                     "isReference": true
12631                 }]
12632             }, {
12633                 "name": "ParallelGateway",
12634                 "superClass": [
12635                     "Gateway"
12636                 ]
12637             }, {
12638                 "name": "RootElement",
12639                 "isAbstract": true,
12640                 "superClass": [
12641                     "BaseElement"
12642                 ]
12643             }, {
12644                 "name": "Relationship",
12645                 "superClass": [
12646                     "BaseElement"
12647                 ],
12648                 "properties": [{
12649                     "name": "type",
12650                     "isAttr": true,
12651                     "type": "String"
12652                 }, {
12653                     "name": "direction",
12654                     "type": "RelationshipDirection",
12655                     "isAttr": true
12656                 }, {
12657                     "name": "source",
12658                     "isMany": true,
12659                     "isReference": true,
12660                     "type": "Element"
12661                 }, {
12662                     "name": "target",
12663                     "isMany": true,
12664                     "isReference": true,
12665                     "type": "Element"
12666                 }]
12667             }, {
12668                 "name": "BaseElement",
12669                 "isAbstract": true,
12670                 "properties": [{
12671                     "name": "id",
12672                     "isAttr": true,
12673                     "type": "String"
12674                 }, {
12675                     "name": "documentation",
12676                     "type": "Documentation",
12677                     "isMany": true
12678                 }, {
12679                     "name": "extensionDefinitions",
12680                     "type": "ExtensionDefinition",
12681                     "isMany": true,
12682                     "isReference": true
12683                 }, {
12684                     "name": "extensionElements",
12685                     "type": "ExtensionElements"
12686                 }]
12687             }, {
12688                 "name": "Extension",
12689                 "properties": [{
12690                     "name": "mustUnderstand",
12691                     "default": false,
12692                     "isAttr": true,
12693                     "type": "Boolean"
12694                 }, {
12695                     "name": "definition",
12696                     "type": "ExtensionDefinition"
12697                 }]
12698             }, {
12699                 "name": "ExtensionDefinition",
12700                 "properties": [{
12701                     "name": "name",
12702                     "isAttr": true,
12703                     "type": "String"
12704                 }, {
12705                     "name": "extensionAttributeDefinitions",
12706                     "type": "ExtensionAttributeDefinition",
12707                     "isMany": true
12708                 }]
12709             }, {
12710                 "name": "ExtensionAttributeDefinition",
12711                 "properties": [{
12712                     "name": "name",
12713                     "isAttr": true,
12714                     "type": "String"
12715                 }, {
12716                     "name": "type",
12717                     "isAttr": true,
12718                     "type": "String"
12719                 }, {
12720                     "name": "isReference",
12721                     "default": false,
12722                     "isAttr": true,
12723                     "type": "Boolean"
12724                 }, {
12725                     "name": "extensionDefinition",
12726                     "type": "ExtensionDefinition",
12727                     "isAttr": true,
12728                     "isReference": true
12729                 }]
12730             }, {
12731                 "name": "ExtensionElements",
12732                 "properties": [{
12733                     "name": "valueRef",
12734                     "isAttr": true,
12735                     "isReference": true,
12736                     "type": "Element"
12737                 }, {
12738                     "name": "values",
12739                     "type": "Element",
12740                     "isMany": true
12741                 }, {
12742                     "name": "extensionAttributeDefinition",
12743                     "type": "ExtensionAttributeDefinition",
12744                     "isAttr": true,
12745                     "isReference": true
12746                 }]
12747             }, {
12748                 "name": "Documentation",
12749                 "superClass": [
12750                     "BaseElement"
12751                 ],
12752                 "properties": [{
12753                     "name": "text",
12754                     "type": "String",
12755                     "isBody": true
12756                 }, {
12757                     "name": "textFormat",
12758                     "default": "text/plain",
12759                     "isAttr": true,
12760                     "type": "String"
12761                 }]
12762             }, {
12763                 "name": "Event",
12764                 "isAbstract": true,
12765                 "superClass": [
12766                     "FlowNode",
12767                     "InteractionNode"
12768                 ],
12769                 "properties": [{
12770                     "name": "properties",
12771                     "type": "Property",
12772                     "isMany": true
12773                 }]
12774             }, {
12775                 "name": "IntermediateCatchEvent",
12776                 "superClass": [
12777                     "CatchEvent"
12778                 ]
12779             }, {
12780                 "name": "IntermediateThrowEvent",
12781                 "superClass": [
12782                     "ThrowEvent"
12783                 ]
12784             }, {
12785                 "name": "EndEvent",
12786                 "superClass": [
12787                     "ThrowEvent"
12788                 ]
12789             }, {
12790                 "name": "StartEvent",
12791                 "superClass": [
12792                     "CatchEvent"
12793                 ],
12794                 "properties": [{
12795                     "name": "isInterrupting",
12796                     "default": true,
12797                     "isAttr": true,
12798                     "type": "Boolean"
12799                 }]
12800             }, {
12801                 "name": "MultiBranchConnector",
12802                 "superClass": [
12803                     "CatchEvent"
12804                 ],
12805                 "properties": [{
12806                     "name": "isInterrupting",
12807                     "default": true,
12808                     "isAttr": true,
12809                     "type": "Boolean"
12810                 }]
12811             }, {
12812                 "name": "ParentReturn",
12813                 "superClass": [
12814                     "Activity",
12815                     "InteractionNode"
12816                 ]
12817             }, {
12818                 "name": "SubProcessCall",
12819                 "superClass": [
12820                     "Activity",
12821                     "InteractionNode"
12822                 ]
12823             }, {
12824                 "name": "ThrowEvent",
12825                 "isAbstract": true,
12826                 "superClass": [
12827                     "Event"
12828                 ],
12829                 "properties": [{
12830                     "name": "inputSet",
12831                     "type": "InputSet"
12832                 }, {
12833                     "name": "eventDefinitionRefs",
12834                     "type": "EventDefinition",
12835                     "isMany": true,
12836                     "isReference": true
12837                 }, {
12838                     "name": "dataInputAssociation",
12839                     "type": "DataInputAssociation",
12840                     "isMany": true
12841                 }, {
12842                     "name": "dataInputs",
12843                     "type": "DataInput",
12844                     "isMany": true
12845                 }, {
12846                     "name": "eventDefinitions",
12847                     "type": "EventDefinition",
12848                     "isMany": true
12849                 }]
12850             }, {
12851                 "name": "CatchEvent",
12852                 "isAbstract": true,
12853                 "superClass": [
12854                     "Event"
12855                 ],
12856                 "properties": [{
12857                     "name": "parallelMultiple",
12858                     "isAttr": true,
12859                     "type": "Boolean",
12860                     "default": false
12861                 }, {
12862                     "name": "outputSet",
12863                     "type": "OutputSet"
12864                 }, {
12865                     "name": "eventDefinitionRefs",
12866                     "type": "EventDefinition",
12867                     "isMany": true,
12868                     "isReference": true
12869                 }, {
12870                     "name": "dataOutputAssociation",
12871                     "type": "DataOutputAssociation",
12872                     "isMany": true
12873                 }, {
12874                     "name": "dataOutputs",
12875                     "type": "DataOutput",
12876                     "isMany": true
12877                 }, {
12878                     "name": "eventDefinitions",
12879                     "type": "EventDefinition",
12880                     "isMany": true
12881                 }]
12882             }, {
12883                 "name": "BoundaryEvent",
12884                 "superClass": [
12885                     "CatchEvent"
12886                 ],
12887                 "properties": [{
12888                     "name": "cancelActivity",
12889                     "default": true,
12890                     "isAttr": true,
12891                     "type": "Boolean"
12892                 }, {
12893                     "name": "attachedToRef",
12894                     "type": "Activity",
12895                     "isAttr": true,
12896                     "isReference": true
12897                 }]
12898             }, {
12899                 "name": "EventDefinition",
12900                 "isAbstract": true,
12901                 "superClass": [
12902                     "RootElement"
12903                 ]
12904             }, {
12905                 "name": "CancelEventDefinition",
12906                 "superClass": [
12907                     "EventDefinition"
12908                 ]
12909             }, {
12910                 "name": "ErrorEventDefinition",
12911                 "superClass": [
12912                     "EventDefinition"
12913                 ],
12914                 "properties": [{
12915                     "name": "errorRef",
12916                     "type": "Error",
12917                     "isAttr": true,
12918                     "isReference": true
12919                 }]
12920             }, {
12921                 "name": "TerminateEventDefinition",
12922                 "superClass": [
12923                     "EventDefinition"
12924                 ]
12925             }, {
12926                 "name": "EscalationEventDefinition",
12927                 "superClass": [
12928                     "EventDefinition"
12929                 ],
12930                 "properties": [{
12931                     "name": "escalationRef",
12932                     "type": "Escalation",
12933                     "isAttr": true,
12934                     "isReference": true
12935                 }]
12936             }, {
12937                 "name": "Escalation",
12938                 "properties": [{
12939                     "name": "structureRef",
12940                     "type": "ItemDefinition",
12941                     "isAttr": true,
12942                     "isReference": true
12943                 }, {
12944                     "name": "name",
12945                     "isAttr": true,
12946                     "type": "String"
12947                 }, {
12948                     "name": "escalationCode",
12949                     "isAttr": true,
12950                     "type": "String"
12951                 }],
12952                 "superClass": [
12953                     "RootElement"
12954                 ]
12955             }, {
12956                 "name": "CompensateEventDefinition",
12957                 "superClass": [
12958                     "EventDefinition"
12959                 ],
12960                 "properties": [{
12961                     "name": "waitForCompletion",
12962                     "isAttr": true,
12963                     "type": "Boolean"
12964                 }, {
12965                     "name": "activityRef",
12966                     "type": "Activity",
12967                     "isAttr": true,
12968                     "isReference": true
12969                 }]
12970             }, {
12971                 "name": "TimerEventDefinition",
12972                 "superClass": [
12973                     "EventDefinition"
12974                 ],
12975                 "properties": [{
12976                     "name": "timeDate",
12977                     "type": "Expression",
12978                     "serialize": "xsi:type"
12979                 }, {
12980                     "name": "timeCycle",
12981                     "type": "Expression",
12982                     "serialize": "xsi:type"
12983                 }, {
12984                     "name": "timeDuration",
12985                     "type": "Expression",
12986                     "serialize": "xsi:type"
12987                 }]
12988             }, {
12989                 "name": "LinkEventDefinition",
12990                 "superClass": [
12991                     "EventDefinition"
12992                 ],
12993                 "properties": [{
12994                     "name": "name",
12995                     "isAttr": true,
12996                     "type": "String"
12997                 }, {
12998                     "name": "target",
12999                     "type": "LinkEventDefinition",
13000                     "isAttr": true,
13001                     "isReference": true
13002                 }, {
13003                     "name": "source",
13004                     "type": "LinkEventDefinition",
13005                     "isMany": true,
13006                     "isReference": true
13007                 }]
13008             }, {
13009                 "name": "MessageEventDefinition",
13010                 "superClass": [
13011                     "EventDefinition"
13012                 ],
13013                 "properties": [{
13014                     "name": "messageRef",
13015                     "type": "Message",
13016                     "isAttr": true,
13017                     "isReference": true
13018                 }, {
13019                     "name": "operationRef",
13020                     "type": "Operation",
13021                     "isAttr": true,
13022                     "isReference": true
13023                 }]
13024             }, {
13025                 "name": "ConditionalEventDefinition",
13026                 "superClass": [
13027                     "EventDefinition"
13028                 ],
13029                 "properties": [{
13030                     "name": "condition",
13031                     "type": "Expression",
13032                     "serialize": "xsi:type"
13033                 }]
13034             }, {
13035                 "name": "SignalEventDefinition",
13036                 "superClass": [
13037                     "EventDefinition"
13038                 ],
13039                 "properties": [{
13040                     "name": "signalRef",
13041                     "type": "Signal",
13042                     "isAttr": true,
13043                     "isReference": true
13044                 }]
13045             }, {
13046                 "name": "Signal",
13047                 "superClass": [
13048                     "RootElement"
13049                 ],
13050                 "properties": [{
13051                     "name": "structureRef",
13052                     "type": "ItemDefinition",
13053                     "isAttr": true,
13054                     "isReference": true
13055                 }, {
13056                     "name": "name",
13057                     "isAttr": true,
13058                     "type": "String"
13059                 }]
13060             }, {
13061                 "name": "ImplicitThrowEvent",
13062                 "superClass": [
13063                     "ThrowEvent"
13064                 ]
13065             }, {
13066                 "name": "DataState",
13067                 "superClass": [
13068                     "BaseElement"
13069                 ],
13070                 "properties": [{
13071                     "name": "name",
13072                     "isAttr": true,
13073                     "type": "String"
13074                 }]
13075             }, {
13076                 "name": "ItemAwareElement",
13077                 "superClass": [
13078                     "BaseElement"
13079                 ],
13080                 "properties": [{
13081                     "name": "itemSubjectRef",
13082                     "type": "ItemDefinition",
13083                     "isAttr": true,
13084                     "isReference": true
13085                 }, {
13086                     "name": "dataState",
13087                     "type": "DataState"
13088                 }]
13089             }, {
13090                 "name": "DataAssociation",
13091                 "superClass": [
13092                     "BaseElement"
13093                 ],
13094                 "properties": [{
13095                     "name": "transformation",
13096                     "type": "FormalExpression"
13097                 }, {
13098                     "name": "assignment",
13099                     "type": "Assignment",
13100                     "isMany": true
13101                 }, {
13102                     "name": "sourceRef",
13103                     "type": "ItemAwareElement",
13104                     "isMany": true,
13105                     "isReference": true
13106                 }, {
13107                     "name": "targetRef",
13108                     "type": "ItemAwareElement",
13109                     "isReference": true
13110                 }]
13111             }, {
13112                 "name": "DataInput",
13113                 "superClass": [
13114                     "ItemAwareElement"
13115                 ],
13116                 "properties": [{
13117                     "name": "name",
13118                     "isAttr": true,
13119                     "type": "String"
13120                 }, {
13121                     "name": "isCollection",
13122                     "default": false,
13123                     "isAttr": true,
13124                     "type": "Boolean"
13125                 }, {
13126                     "name": "inputSetRefs",
13127                     "type": "InputSet",
13128                     "isVirtual": true,
13129                     "isMany": true,
13130                     "isReference": true
13131                 }, {
13132                     "name": "inputSetWithOptional",
13133                     "type": "InputSet",
13134                     "isVirtual": true,
13135                     "isMany": true,
13136                     "isReference": true
13137                 }, {
13138                     "name": "inputSetWithWhileExecuting",
13139                     "type": "InputSet",
13140                     "isVirtual": true,
13141                     "isMany": true,
13142                     "isReference": true
13143                 }]
13144             }, {
13145                 "name": "DataOutput",
13146                 "superClass": [
13147                     "ItemAwareElement"
13148                 ],
13149                 "properties": [{
13150                     "name": "name",
13151                     "isAttr": true,
13152                     "type": "String"
13153                 }, {
13154                     "name": "isCollection",
13155                     "default": false,
13156                     "isAttr": true,
13157                     "type": "Boolean"
13158                 }, {
13159                     "name": "outputSetRefs",
13160                     "type": "OutputSet",
13161                     "isVirtual": true,
13162                     "isMany": true,
13163                     "isReference": true
13164                 }, {
13165                     "name": "outputSetWithOptional",
13166                     "type": "OutputSet",
13167                     "isVirtual": true,
13168                     "isMany": true,
13169                     "isReference": true
13170                 }, {
13171                     "name": "outputSetWithWhileExecuting",
13172                     "type": "OutputSet",
13173                     "isVirtual": true,
13174                     "isMany": true,
13175                     "isReference": true
13176                 }]
13177             }, {
13178                 "name": "InputSet",
13179                 "superClass": [
13180                     "BaseElement"
13181                 ],
13182                 "properties": [{
13183                     "name": "name",
13184                     "isAttr": true,
13185                     "type": "String"
13186                 }, {
13187                     "name": "dataInputRefs",
13188                     "type": "DataInput",
13189                     "isMany": true,
13190                     "isReference": true
13191                 }, {
13192                     "name": "optionalInputRefs",
13193                     "type": "DataInput",
13194                     "isMany": true,
13195                     "isReference": true
13196                 }, {
13197                     "name": "whileExecutingInputRefs",
13198                     "type": "DataInput",
13199                     "isMany": true,
13200                     "isReference": true
13201                 }, {
13202                     "name": "outputSetRefs",
13203                     "type": "OutputSet",
13204                     "isMany": true,
13205                     "isReference": true
13206                 }]
13207             }, {
13208                 "name": "OutputSet",
13209                 "superClass": [
13210                     "BaseElement"
13211                 ],
13212                 "properties": [{
13213                     "name": "dataOutputRefs",
13214                     "type": "DataOutput",
13215                     "isMany": true,
13216                     "isReference": true
13217                 }, {
13218                     "name": "name",
13219                     "isAttr": true,
13220                     "type": "String"
13221                 }, {
13222                     "name": "inputSetRefs",
13223                     "type": "InputSet",
13224                     "isMany": true,
13225                     "isReference": true
13226                 }, {
13227                     "name": "optionalOutputRefs",
13228                     "type": "DataOutput",
13229                     "isMany": true,
13230                     "isReference": true
13231                 }, {
13232                     "name": "whileExecutingOutputRefs",
13233                     "type": "DataOutput",
13234                     "isMany": true,
13235                     "isReference": true
13236                 }]
13237             }, {
13238                 "name": "Property",
13239                 "superClass": [
13240                     "ItemAwareElement"
13241                 ],
13242                 "properties": [{
13243                     "name": "name",
13244                     "isAttr": true,
13245                     "type": "String"
13246                 }]
13247             }, {
13248                 "name": "DataInputAssociation",
13249                 "superClass": [
13250                     "DataAssociation"
13251                 ]
13252             }, {
13253                 "name": "DataOutputAssociation",
13254                 "superClass": [
13255                     "DataAssociation"
13256                 ]
13257             }, {
13258                 "name": "InputOutputSpecification",
13259                 "superClass": [
13260                     "BaseElement"
13261                 ],
13262                 "properties": [{
13263                     "name": "inputSets",
13264                     "type": "InputSet",
13265                     "isMany": true
13266                 }, {
13267                     "name": "outputSets",
13268                     "type": "OutputSet",
13269                     "isMany": true
13270                 }, {
13271                     "name": "dataInputs",
13272                     "type": "DataInput",
13273                     "isMany": true
13274                 }, {
13275                     "name": "dataOutputs",
13276                     "type": "DataOutput",
13277                     "isMany": true
13278                 }]
13279             }, {
13280                 "name": "DataObject",
13281                 "superClass": [
13282                     "FlowElement",
13283                     "ItemAwareElement"
13284                 ],
13285                 "properties": [{
13286                     "name": "isCollection",
13287                     "default": false,
13288                     "isAttr": true,
13289                     "type": "Boolean"
13290                 }]
13291             }, {
13292                 "name": "InputOutputBinding",
13293                 "properties": [{
13294                     "name": "inputDataRef",
13295                     "type": "InputSet",
13296                     "isAttr": true,
13297                     "isReference": true
13298                 }, {
13299                     "name": "outputDataRef",
13300                     "type": "OutputSet",
13301                     "isAttr": true,
13302                     "isReference": true
13303                 }, {
13304                     "name": "operationRef",
13305                     "type": "Operation",
13306                     "isAttr": true,
13307                     "isReference": true
13308                 }]
13309             }, {
13310                 "name": "Assignment",
13311                 "superClass": [
13312                     "BaseElement"
13313                 ],
13314                 "properties": [{
13315                     "name": "from",
13316                     "type": "Expression",
13317                     "serialize": "xsi:type"
13318                 }, {
13319                     "name": "to",
13320                     "type": "Expression",
13321                     "serialize": "xsi:type"
13322                 }]
13323             }, {
13324                 "name": "DataStore",
13325                 "superClass": [
13326                     "RootElement",
13327                     "ItemAwareElement"
13328                 ],
13329                 "properties": [{
13330                     "name": "name",
13331                     "isAttr": true,
13332                     "type": "String"
13333                 }, {
13334                     "name": "capacity",
13335                     "isAttr": true,
13336                     "type": "Integer"
13337                 }, {
13338                     "name": "isUnlimited",
13339                     "default": true,
13340                     "isAttr": true,
13341                     "type": "Boolean"
13342                 }]
13343             }, {
13344                 "name": "DataStoreReference",
13345                 "superClass": [
13346                     "ItemAwareElement",
13347                     "FlowElement"
13348                 ],
13349                 "properties": [{
13350                     "name": "dataStoreRef",
13351                     "type": "DataStore",
13352                     "isAttr": true,
13353                     "isReference": true
13354                 }]
13355             }, {
13356                 "name": "DataObjectReference",
13357                 "superClass": [
13358                     "ItemAwareElement",
13359                     "FlowElement"
13360                 ],
13361                 "properties": [{
13362                     "name": "dataObjectRef",
13363                     "type": "DataObject",
13364                     "isAttr": true,
13365                     "isReference": true
13366                 }]
13367             }, {
13368                 "name": "ConversationLink",
13369                 "superClass": [
13370                     "BaseElement"
13371                 ],
13372                 "properties": [{
13373                     "name": "sourceRef",
13374                     "type": "InteractionNode",
13375                     "isAttr": true,
13376                     "isReference": true
13377                 }, {
13378                     "name": "targetRef",
13379                     "type": "InteractionNode",
13380                     "isAttr": true,
13381                     "isReference": true
13382                 }, {
13383                     "name": "name",
13384                     "isAttr": true,
13385                     "type": "String"
13386                 }]
13387             }, {
13388                 "name": "ConversationAssociation",
13389                 "superClass": [
13390                     "BaseElement"
13391                 ],
13392                 "properties": [{
13393                     "name": "innerConversationNodeRef",
13394                     "type": "ConversationNode",
13395                     "isAttr": true,
13396                     "isReference": true
13397                 }, {
13398                     "name": "outerConversationNodeRef",
13399                     "type": "ConversationNode",
13400                     "isAttr": true,
13401                     "isReference": true
13402                 }]
13403             }, {
13404                 "name": "CallConversation",
13405                 "superClass": [
13406                     "ConversationNode"
13407                 ],
13408                 "properties": [{
13409                     "name": "calledCollaborationRef",
13410                     "type": "Collaboration",
13411                     "isAttr": true,
13412                     "isReference": true
13413                 }, {
13414                     "name": "participantAssociations",
13415                     "type": "ParticipantAssociation",
13416                     "isMany": true
13417                 }]
13418             }, {
13419                 "name": "Conversation",
13420                 "superClass": [
13421                     "ConversationNode"
13422                 ]
13423             }, {
13424                 "name": "SubConversation",
13425                 "superClass": [
13426                     "ConversationNode"
13427                 ],
13428                 "properties": [{
13429                     "name": "conversationNodes",
13430                     "type": "ConversationNode",
13431                     "isMany": true
13432                 }]
13433             }, {
13434                 "name": "ConversationNode",
13435                 "isAbstract": true,
13436                 "superClass": [
13437                     "InteractionNode",
13438                     "BaseElement"
13439                 ],
13440                 "properties": [{
13441                     "name": "name",
13442                     "isAttr": true,
13443                     "type": "String"
13444                 }, {
13445                     "name": "participantRefs",
13446                     "type": "Participant",
13447                     "isMany": true,
13448                     "isReference": true
13449                 }, {
13450                     "name": "messageFlowRefs",
13451                     "type": "MessageFlow",
13452                     "isMany": true,
13453                     "isReference": true
13454                 }, {
13455                     "name": "correlationKeys",
13456                     "type": "CorrelationKey",
13457                     "isMany": true
13458                 }]
13459             }, {
13460                 "name": "GlobalConversation",
13461                 "superClass": [
13462                     "Collaboration"
13463                 ]
13464             }, {
13465                 "name": "PartnerEntity",
13466                 "superClass": [
13467                     "RootElement"
13468                 ],
13469                 "properties": [{
13470                     "name": "name",
13471                     "isAttr": true,
13472                     "type": "String"
13473                 }, {
13474                     "name": "participantRef",
13475                     "type": "Participant",
13476                     "isMany": true,
13477                     "isReference": true
13478                 }]
13479             }, {
13480                 "name": "PartnerRole",
13481                 "superClass": [
13482                     "RootElement"
13483                 ],
13484                 "properties": [{
13485                     "name": "name",
13486                     "isAttr": true,
13487                     "type": "String"
13488                 }, {
13489                     "name": "participantRef",
13490                     "type": "Participant",
13491                     "isMany": true,
13492                     "isReference": true
13493                 }]
13494             }, {
13495                 "name": "CorrelationProperty",
13496                 "superClass": [
13497                     "RootElement"
13498                 ],
13499                 "properties": [{
13500                     "name": "correlationPropertyRetrievalExpression",
13501                     "type": "CorrelationPropertyRetrievalExpression",
13502                     "isMany": true
13503                 }, {
13504                     "name": "name",
13505                     "isAttr": true,
13506                     "type": "String"
13507                 }, {
13508                     "name": "type",
13509                     "type": "ItemDefinition",
13510                     "isAttr": true,
13511                     "isReference": true
13512                 }]
13513             }, {
13514                 "name": "Error",
13515                 "superClass": [
13516                     "RootElement"
13517                 ],
13518                 "properties": [{
13519                     "name": "structureRef",
13520                     "type": "ItemDefinition",
13521                     "isAttr": true,
13522                     "isReference": true
13523                 }, {
13524                     "name": "name",
13525                     "isAttr": true,
13526                     "type": "String"
13527                 }, {
13528                     "name": "errorCode",
13529                     "isAttr": true,
13530                     "type": "String"
13531                 }]
13532             }, {
13533                 "name": "CorrelationKey",
13534                 "superClass": [
13535                     "BaseElement"
13536                 ],
13537                 "properties": [{
13538                     "name": "correlationPropertyRef",
13539                     "type": "CorrelationProperty",
13540                     "isMany": true,
13541                     "isReference": true
13542                 }, {
13543                     "name": "name",
13544                     "isAttr": true,
13545                     "type": "String"
13546                 }]
13547             }, {
13548                 "name": "Expression",
13549                 "superClass": [
13550                     "BaseElement"
13551                 ],
13552                 "isAbstract": true
13553             }, {
13554                 "name": "FormalExpression",
13555                 "superClass": [
13556                     "Expression"
13557                 ],
13558                 "properties": [{
13559                     "name": "language",
13560                     "isAttr": true,
13561                     "type": "String"
13562                 }, {
13563                     "name": "body",
13564                     "type": "String",
13565                     "isBody": true
13566                 }, {
13567                     "name": "evaluatesToTypeRef",
13568                     "type": "ItemDefinition",
13569                     "isAttr": true,
13570                     "isReference": true
13571                 }]
13572             }, {
13573                 "name": "Message",
13574                 "superClass": [
13575                     "RootElement"
13576                 ],
13577                 "properties": [{
13578                     "name": "name",
13579                     "isAttr": true,
13580                     "type": "String"
13581                 }, {
13582                     "name": "itemRef",
13583                     "type": "ItemDefinition",
13584                     "isAttr": true,
13585                     "isReference": true
13586                 }]
13587             }, {
13588                 "name": "ItemDefinition",
13589                 "superClass": [
13590                     "RootElement"
13591                 ],
13592                 "properties": [{
13593                     "name": "itemKind",
13594                     "type": "ItemKind",
13595                     "isAttr": true
13596                 }, {
13597                     "name": "structureRef",
13598                     "type": "String",
13599                     "isAttr": true
13600                 }, {
13601                     "name": "isCollection",
13602                     "default": false,
13603                     "isAttr": true,
13604                     "type": "Boolean"
13605                 }, {
13606                     "name": "import",
13607                     "type": "Import",
13608                     "isAttr": true,
13609                     "isReference": true
13610                 }]
13611             }, {
13612                 "name": "FlowElement",
13613                 "isAbstract": true,
13614                 "superClass": [
13615                     "BaseElement"
13616                 ],
13617                 "properties": [{
13618                     "name": "name",
13619                     "isAttr": true,
13620                     "type": "String"
13621                 }, {
13622                     "name": "auditing",
13623                     "type": "Auditing"
13624                 }, {
13625                     "name": "monitoring",
13626                     "type": "Monitoring"
13627                 }, {
13628                     "name": "categoryValueRef",
13629                     "type": "CategoryValue",
13630                     "isMany": true,
13631                     "isReference": true
13632                 }]
13633             }, {
13634                 "name": "SequenceFlow",
13635                 "superClass": [
13636                     "FlowElement"
13637                 ],
13638                 "properties": [{
13639                     "name": "isImmediate",
13640                     "isAttr": true,
13641                     "type": "Boolean"
13642                 }, {
13643                     "name": "conditionExpression",
13644                     "type": "Expression",
13645                     "serialize": "xsi:type"
13646                 }, {
13647                     "name": "sourceRef",
13648                     "type": "FlowNode",
13649                     "isAttr": true,
13650                     "isReference": true
13651                 }, {
13652                     "name": "targetRef",
13653                     "type": "FlowNode",
13654                     "isAttr": true,
13655                     "isReference": true
13656                 }]
13657             }, {
13658                 "name": "FlowElementsContainer",
13659                 "isAbstract": true,
13660                 "superClass": [
13661                     "BaseElement"
13662                 ],
13663                 "properties": [{
13664                     "name": "laneSets",
13665                     "type": "LaneSet",
13666                     "isMany": true
13667                 }, {
13668                     "name": "flowElements",
13669                     "type": "FlowElement",
13670                     "isMany": true
13671                 }]
13672             }, {
13673                 "name": "CallableElement",
13674                 "isAbstract": true,
13675                 "superClass": [
13676                     "RootElement"
13677                 ],
13678                 "properties": [{
13679                     "name": "name",
13680                     "isAttr": true,
13681                     "type": "String"
13682                 }, {
13683                     "name": "ioSpecification",
13684                     "type": "InputOutputSpecification"
13685                 }, {
13686                     "name": "supportedInterfaceRefs",
13687                     "type": "Interface",
13688                     "isMany": true,
13689                     "isReference": true
13690                 }, {
13691                     "name": "ioBinding",
13692                     "type": "InputOutputBinding",
13693                     "isMany": true
13694                 }]
13695             }, {
13696                 "name": "FlowNode",
13697                 "isAbstract": true,
13698                 "superClass": [
13699                     "FlowElement"
13700                 ],
13701                 "properties": [{
13702                     "name": "incoming",
13703                     "type": "SequenceFlow",
13704                     "isMany": true,
13705                     "isReference": true
13706                 }, {
13707                     "name": "outgoing",
13708                     "type": "SequenceFlow",
13709                     "isMany": true,
13710                     "isReference": true
13711                 }, {
13712                     "name": "lanes",
13713                     "type": "Lane",
13714                     "isVirtual": true,
13715                     "isMany": true,
13716                     "isReference": true
13717                 }]
13718             }, {
13719                 "name": "CorrelationPropertyRetrievalExpression",
13720                 "superClass": [
13721                     "BaseElement"
13722                 ],
13723                 "properties": [{
13724                     "name": "messagePath",
13725                     "type": "FormalExpression"
13726                 }, {
13727                     "name": "messageRef",
13728                     "type": "Message",
13729                     "isAttr": true,
13730                     "isReference": true
13731                 }]
13732             }, {
13733                 "name": "CorrelationPropertyBinding",
13734                 "superClass": [
13735                     "BaseElement"
13736                 ],
13737                 "properties": [{
13738                     "name": "dataPath",
13739                     "type": "FormalExpression"
13740                 }, {
13741                     "name": "correlationPropertyRef",
13742                     "type": "CorrelationProperty",
13743                     "isAttr": true,
13744                     "isReference": true
13745                 }]
13746             }, {
13747                 "name": "Resource",
13748                 "superClass": [
13749                     "RootElement"
13750                 ],
13751                 "properties": [{
13752                     "name": "name",
13753                     "isAttr": true,
13754                     "type": "String"
13755                 }, {
13756                     "name": "resourceParameters",
13757                     "type": "ResourceParameter",
13758                     "isMany": true
13759                 }]
13760             }, {
13761                 "name": "ResourceParameter",
13762                 "superClass": [
13763                     "BaseElement"
13764                 ],
13765                 "properties": [{
13766                     "name": "name",
13767                     "isAttr": true,
13768                     "type": "String"
13769                 }, {
13770                     "name": "isRequired",
13771                     "isAttr": true,
13772                     "type": "Boolean"
13773                 }, {
13774                     "name": "type",
13775                     "type": "ItemDefinition",
13776                     "isAttr": true,
13777                     "isReference": true
13778                 }]
13779             }, {
13780                 "name": "CorrelationSubscription",
13781                 "superClass": [
13782                     "BaseElement"
13783                 ],
13784                 "properties": [{
13785                     "name": "correlationKeyRef",
13786                     "type": "CorrelationKey",
13787                     "isAttr": true,
13788                     "isReference": true
13789                 }, {
13790                     "name": "correlationPropertyBinding",
13791                     "type": "CorrelationPropertyBinding",
13792                     "isMany": true
13793                 }]
13794             }, {
13795                 "name": "MessageFlow",
13796                 "superClass": [
13797                     "BaseElement"
13798                 ],
13799                 "properties": [{
13800                     "name": "name",
13801                     "isAttr": true,
13802                     "type": "String"
13803                 }, {
13804                     "name": "sourceRef",
13805                     "type": "InteractionNode",
13806                     "isAttr": true,
13807                     "isReference": true
13808                 }, {
13809                     "name": "targetRef",
13810                     "type": "InteractionNode",
13811                     "isAttr": true,
13812                     "isReference": true
13813                 }, {
13814                     "name": "messageRef",
13815                     "type": "Message",
13816                     "isAttr": true,
13817                     "isReference": true
13818                 }]
13819             }, {
13820                 "name": "MessageFlowAssociation",
13821                 "superClass": [
13822                     "BaseElement"
13823                 ],
13824                 "properties": [{
13825                     "name": "innerMessageFlowRef",
13826                     "type": "MessageFlow",
13827                     "isAttr": true,
13828                     "isReference": true
13829                 }, {
13830                     "name": "outerMessageFlowRef",
13831                     "type": "MessageFlow",
13832                     "isAttr": true,
13833                     "isReference": true
13834                 }]
13835             }, {
13836                 "name": "InteractionNode",
13837                 "isAbstract": true,
13838                 "properties": [{
13839                     "name": "incomingConversationLinks",
13840                     "type": "ConversationLink",
13841                     "isVirtual": true,
13842                     "isMany": true,
13843                     "isReference": true
13844                 }, {
13845                     "name": "outgoingConversationLinks",
13846                     "type": "ConversationLink",
13847                     "isVirtual": true,
13848                     "isMany": true,
13849                     "isReference": true
13850                 }]
13851             }, {
13852                 "name": "Participant",
13853                 "superClass": [
13854                     "InteractionNode",
13855                     "BaseElement"
13856                 ],
13857                 "properties": [{
13858                     "name": "name",
13859                     "isAttr": true,
13860                     "type": "String"
13861                 }, {
13862                     "name": "interfaceRefs",
13863                     "type": "Interface",
13864                     "isMany": true,
13865                     "isReference": true
13866                 }, {
13867                     "name": "participantMultiplicity",
13868                     "type": "ParticipantMultiplicity"
13869                 }, {
13870                     "name": "endPointRefs",
13871                     "type": "EndPoint",
13872                     "isMany": true,
13873                     "isReference": true
13874                 }, {
13875                     "name": "processRef",
13876                     "type": "Process",
13877                     "isAttr": true,
13878                     "isReference": true
13879                 }]
13880             }, {
13881                 "name": "ParticipantAssociation",
13882                 "superClass": [
13883                     "BaseElement"
13884                 ],
13885                 "properties": [{
13886                     "name": "innerParticipantRef",
13887                     "type": "Participant",
13888                     "isAttr": true,
13889                     "isReference": true
13890                 }, {
13891                     "name": "outerParticipantRef",
13892                     "type": "Participant",
13893                     "isAttr": true,
13894                     "isReference": true
13895                 }]
13896             }, {
13897                 "name": "ParticipantMultiplicity",
13898                 "properties": [{
13899                     "name": "minimum",
13900                     "default": 0,
13901                     "isAttr": true,
13902                     "type": "Integer"
13903                 }, {
13904                     "name": "maximum",
13905                     "default": 1,
13906                     "isAttr": true,
13907                     "type": "Integer"
13908                 }]
13909             }, {
13910                 "name": "Collaboration",
13911                 "superClass": [
13912                     "RootElement"
13913                 ],
13914                 "properties": [{
13915                     "name": "name",
13916                     "isAttr": true,
13917                     "type": "String"
13918                 }, {
13919                     "name": "isClosed",
13920                     "isAttr": true,
13921                     "type": "Boolean"
13922                 }, {
13923                     "name": "choreographyRef",
13924                     "type": "Choreography",
13925                     "isMany": true,
13926                     "isReference": true
13927                 }, {
13928                     "name": "artifacts",
13929                     "type": "Artifact",
13930                     "isMany": true
13931                 }, {
13932                     "name": "participantAssociations",
13933                     "type": "ParticipantAssociation",
13934                     "isMany": true
13935                 }, {
13936                     "name": "messageFlowAssociations",
13937                     "type": "MessageFlowAssociation",
13938                     "isMany": true
13939                 }, {
13940                     "name": "conversationAssociations",
13941                     "type": "ConversationAssociation"
13942                 }, {
13943                     "name": "participants",
13944                     "type": "Participant",
13945                     "isMany": true
13946                 }, {
13947                     "name": "messageFlows",
13948                     "type": "MessageFlow",
13949                     "isMany": true
13950                 }, {
13951                     "name": "correlationKeys",
13952                     "type": "CorrelationKey",
13953                     "isMany": true
13954                 }, {
13955                     "name": "conversations",
13956                     "type": "ConversationNode",
13957                     "isMany": true
13958                 }, {
13959                     "name": "conversationLinks",
13960                     "type": "ConversationLink",
13961                     "isMany": true
13962                 }]
13963             }, {
13964                 "name": "ChoreographyActivity",
13965                 "isAbstract": true,
13966                 "superClass": [
13967                     "FlowNode"
13968                 ],
13969                 "properties": [{
13970                     "name": "participantRefs",
13971                     "type": "Participant",
13972                     "isMany": true,
13973                     "isReference": true
13974                 }, {
13975                     "name": "initiatingParticipantRef",
13976                     "type": "Participant",
13977                     "isAttr": true,
13978                     "isReference": true
13979                 }, {
13980                     "name": "correlationKeys",
13981                     "type": "CorrelationKey",
13982                     "isMany": true
13983                 }, {
13984                     "name": "loopType",
13985                     "type": "ChoreographyLoopType",
13986                     "default": "None",
13987                     "isAttr": true
13988                 }]
13989             }, {
13990                 "name": "CallChoreography",
13991                 "superClass": [
13992                     "ChoreographyActivity"
13993                 ],
13994                 "properties": [{
13995                     "name": "calledChoreographyRef",
13996                     "type": "Choreography",
13997                     "isAttr": true,
13998                     "isReference": true
13999                 }, {
14000                     "name": "participantAssociations",
14001                     "type": "ParticipantAssociation",
14002                     "isMany": true
14003                 }]
14004             }, {
14005                 "name": "SubChoreography",
14006                 "superClass": [
14007                     "ChoreographyActivity",
14008                     "FlowElementsContainer"
14009                 ],
14010                 "properties": [{
14011                     "name": "artifacts",
14012                     "type": "Artifact",
14013                     "isMany": true
14014                 }]
14015             }, {
14016                 "name": "ChoreographyTask",
14017                 "superClass": [
14018                     "ChoreographyActivity"
14019                 ],
14020                 "properties": [{
14021                     "name": "messageFlowRef",
14022                     "type": "MessageFlow",
14023                     "isMany": true,
14024                     "isReference": true
14025                 }]
14026             }, {
14027                 "name": "Choreography",
14028                 "superClass": [
14029                     "FlowElementsContainer",
14030                     "Collaboration"
14031                 ]
14032             }, {
14033                 "name": "GlobalChoreographyTask",
14034                 "superClass": [
14035                     "Choreography"
14036                 ],
14037                 "properties": [{
14038                     "name": "initiatingParticipantRef",
14039                     "type": "Participant",
14040                     "isAttr": true,
14041                     "isReference": true
14042                 }]
14043             }, {
14044                 "name": "TextAnnotation",
14045                 "superClass": [
14046                     "Artifact"
14047                 ],
14048                 "properties": [{
14049                     "name": "text",
14050                     "type": "String"
14051                 }, {
14052                     "name": "textFormat",
14053                     "default": "text/plain",
14054                     "isAttr": true,
14055                     "type": "String"
14056                 }]
14057             }, {
14058                 "name": "Group",
14059                 "superClass": [
14060                     "Artifact"
14061                 ],
14062                 "properties": [{
14063                     "name": "categoryValueRef",
14064                     "type": "CategoryValue",
14065                     "isAttr": true,
14066                     "isReference": true
14067                 }]
14068             }, {
14069                 "name": "Association",
14070                 "superClass": [
14071                     "Artifact"
14072                 ],
14073                 "properties": [{
14074                     "name": "associationDirection",
14075                     "type": "AssociationDirection",
14076                     "isAttr": true
14077                 }, {
14078                     "name": "sourceRef",
14079                     "type": "BaseElement",
14080                     "isAttr": true,
14081                     "isReference": true
14082                 }, {
14083                     "name": "targetRef",
14084                     "type": "BaseElement",
14085                     "isAttr": true,
14086                     "isReference": true
14087                 }]
14088             }, {
14089                 "name": "Category",
14090                 "superClass": [
14091                     "RootElement"
14092                 ],
14093                 "properties": [{
14094                     "name": "categoryValue",
14095                     "type": "CategoryValue",
14096                     "isMany": true
14097                 }, {
14098                     "name": "name",
14099                     "isAttr": true,
14100                     "type": "String"
14101                 }]
14102             }, {
14103                 "name": "Artifact",
14104                 "isAbstract": true,
14105                 "superClass": [
14106                     "BaseElement"
14107                 ]
14108             }, {
14109                 "name": "CategoryValue",
14110                 "superClass": [
14111                     "BaseElement"
14112                 ],
14113                 "properties": [{
14114                     "name": "categorizedFlowElements",
14115                     "type": "FlowElement",
14116                     "isVirtual": true,
14117                     "isMany": true,
14118                     "isReference": true
14119                 }, {
14120                     "name": "value",
14121                     "isAttr": true,
14122                     "type": "String"
14123                 }]
14124             }, {
14125                 "name": "Activity",
14126                 "isAbstract": true,
14127                 "superClass": [
14128                     "FlowNode"
14129                 ],
14130                 "properties": [{
14131                     "name": "isForCompensation",
14132                     "default": false,
14133                     "isAttr": true,
14134                     "type": "Boolean"
14135                 }, {
14136                     "name": "loopCharacteristics",
14137                     "type": "LoopCharacteristics"
14138                 }, {
14139                     "name": "resources",
14140                     "type": "ResourceRole",
14141                     "isMany": true
14142                 }, {
14143                     "name": "default",
14144                     "type": "SequenceFlow",
14145                     "isAttr": true,
14146                     "isReference": true
14147                 }, {
14148                     "name": "properties",
14149                     "type": "Property",
14150                     "isMany": true
14151                 }, {
14152                     "name": "ioSpecification",
14153                     "type": "InputOutputSpecification"
14154                 }, {
14155                     "name": "boundaryEventRefs",
14156                     "type": "BoundaryEvent",
14157                     "isMany": true,
14158                     "isReference": true
14159                 }, {
14160                     "name": "dataInputAssociations",
14161                     "type": "DataInputAssociation",
14162                     "isMany": true
14163                 }, {
14164                     "name": "dataOutputAssociations",
14165                     "type": "DataOutputAssociation",
14166                     "isMany": true
14167                 }, {
14168                     "name": "startQuantity",
14169                     "default": 1,
14170                     "isAttr": true,
14171                     "type": "Integer"
14172                 }, {
14173                     "name": "completionQuantity",
14174                     "default": 1,
14175                     "isAttr": true,
14176                     "type": "Integer"
14177                 }]
14178             }, {
14179                 "name": "ServiceTask",
14180                 "superClass": [
14181                     "Task"
14182                 ],
14183                 "properties": [{
14184                     "name": "implementation",
14185                     "isAttr": true,
14186                     "type": "String"
14187                 }, {
14188                     "name": "operationRef",
14189                     "type": "Operation",
14190                     "isAttr": true,
14191                     "isReference": true
14192                 }]
14193             }, {
14194                 "name": "SubProcess",
14195                 "superClass": [
14196                     "Activity",
14197                     "FlowElementsContainer",
14198                     "InteractionNode"
14199                 ],
14200                 "properties": [{
14201                     "name": "triggeredByEvent",
14202                     "default": false,
14203                     "isAttr": true,
14204                     "type": "Boolean"
14205                 }, {
14206                     "name": "artifacts",
14207                     "type": "Artifact",
14208                     "isMany": true
14209                 }]
14210             }, {
14211                 "name": "LoopCharacteristics",
14212                 "isAbstract": true,
14213                 "superClass": [
14214                     "BaseElement"
14215                 ]
14216             }, {
14217                 "name": "MultiInstanceLoopCharacteristics",
14218                 "superClass": [
14219                     "LoopCharacteristics"
14220                 ],
14221                 "properties": [{
14222                     "name": "isSequential",
14223                     "default": false,
14224                     "isAttr": true,
14225                     "type": "Boolean"
14226                 }, {
14227                     "name": "behavior",
14228                     "type": "MultiInstanceBehavior",
14229                     "default": "All",
14230                     "isAttr": true
14231                 }, {
14232                     "name": "loopCardinality",
14233                     "type": "Expression",
14234                     "serialize": "xsi:type"
14235                 }, {
14236                     "name": "loopDataInputRef",
14237                     "type": "ItemAwareElement",
14238                     "isAttr": true,
14239                     "isReference": true
14240                 }, {
14241                     "name": "loopDataOutputRef",
14242                     "type": "ItemAwareElement",
14243                     "isAttr": true,
14244                     "isReference": true
14245                 }, {
14246                     "name": "inputDataItem",
14247                     "type": "DataInput"
14248                 }, {
14249                     "name": "outputDataItem",
14250                     "type": "DataOutput"
14251                 }, {
14252                     "name": "completionCondition",
14253                     "type": "Expression",
14254                     "serialize": "xsi:type"
14255                 }, {
14256                     "name": "complexBehaviorDefinition",
14257                     "type": "ComplexBehaviorDefinition",
14258                     "isMany": true
14259                 }, {
14260                     "name": "oneBehaviorEventRef",
14261                     "type": "EventDefinition",
14262                     "isAttr": true,
14263                     "isReference": true
14264                 }, {
14265                     "name": "noneBehaviorEventRef",
14266                     "type": "EventDefinition",
14267                     "isAttr": true,
14268                     "isReference": true
14269                 }]
14270             }, {
14271                 "name": "StandardLoopCharacteristics",
14272                 "superClass": [
14273                     "LoopCharacteristics"
14274                 ],
14275                 "properties": [{
14276                     "name": "testBefore",
14277                     "default": false,
14278                     "isAttr": true,
14279                     "type": "Boolean"
14280                 }, {
14281                     "name": "loopCondition",
14282                     "type": "Expression",
14283                     "serialize": "xsi:type"
14284                 }, {
14285                     "name": "loopMaximum",
14286                     "type": "Expression",
14287                     "serialize": "xsi:type"
14288                 }]
14289             }, {
14290                 "name": "CallActivity",
14291                 "superClass": [
14292                     "Activity"
14293                 ],
14294                 "properties": [{
14295                     "name": "calledElement",
14296                     "type": "String",
14297                     "isAttr": true
14298                 }]
14299             }, {
14300                 "name": "Task",
14301                 "superClass": [
14302                     "Activity",
14303                     "InteractionNode"
14304                 ]
14305             }, {
14306                 "name": "InitiateProcess",
14307                 "superClass": [
14308                     "Activity",
14309                     "InteractionNode"
14310                 ]
14311             }, {
14312                 "name": "Collector",
14313                 "superClass": [
14314                     "Activity",
14315                     "InteractionNode"
14316                 ]
14317             },
14318                         {
14319                 "name": "StringMatch",
14320                 "superClass": [
14321                     "Activity",
14322                     "InteractionNode"
14323                 ]
14324       },
14325                         {
14326                 "name": "VesCollector",
14327                 "superClass": [
14328                     "Activity",
14329                     "InteractionNode"
14330                 ]
14331             },
14332                       
14333             {
14334                 "name": "TCA",
14335                 "superClass": [
14336                     "Activity",
14337                     "InteractionNode"
14338                 ]
14339             },
14340                         {
14341                 "name": "GOC",
14342                 "superClass": [
14343                     "Activity",
14344                     "InteractionNode"
14345                 ]
14346             },
14347                         {
14348                 "name": "Policy",
14349                 "superClass": [
14350                     "Activity",
14351                     "InteractionNode"
14352                 ]
14353             },
14354                         {
14355                 "name": "SendTask",
14356                 "superClass": [
14357                     "Task"
14358                 ],
14359                 "properties": [{
14360                     "name": "implementation",
14361                     "isAttr": true,
14362                     "type": "String"
14363                 }, {
14364                     "name": "operationRef",
14365                     "type": "Operation",
14366                     "isAttr": true,
14367                     "isReference": true
14368                 }, {
14369                     "name": "messageRef",
14370                     "type": "Message",
14371                     "isAttr": true,
14372                     "isReference": true
14373                 }]
14374             }, {
14375                 "name": "ReceiveTask",
14376                 "superClass": [
14377                     "Task"
14378                 ],
14379                 "properties": [{
14380                     "name": "implementation",
14381                     "isAttr": true,
14382                     "type": "String"
14383                 }, {
14384                     "name": "instantiate",
14385                     "default": false,
14386                     "isAttr": true,
14387                     "type": "Boolean"
14388                 }, {
14389                     "name": "operationRef",
14390                     "type": "Operation",
14391                     "isAttr": true,
14392                     "isReference": true
14393                 }, {
14394                     "name": "messageRef",
14395                     "type": "Message",
14396                     "isAttr": true,
14397                     "isReference": true
14398                 }]
14399             }, {
14400                 "name": "ScriptTask",
14401                 "superClass": [
14402                     "Task"
14403                 ],
14404                 "properties": [{
14405                     "name": "scriptFormat",
14406                     "isAttr": true,
14407                     "type": "String"
14408                 }, {
14409                     "name": "script",
14410                     "type": "String"
14411                 }]
14412             }, {
14413                 "name": "BusinessRuleTask",
14414                 "superClass": [
14415                     "Task"
14416                 ],
14417                 "properties": [{
14418                     "name": "implementation",
14419                     "isAttr": true,
14420                     "type": "String"
14421                 }]
14422             }, {
14423                 "name": "AdHocSubProcess",
14424                 "superClass": [
14425                     "SubProcess"
14426                 ],
14427                 "properties": [{
14428                     "name": "completionCondition",
14429                     "type": "Expression",
14430                     "serialize": "xsi:type"
14431                 }, {
14432                     "name": "ordering",
14433                     "type": "AdHocOrdering",
14434                     "isAttr": true
14435                 }, {
14436                     "name": "cancelRemainingInstances",
14437                     "default": true,
14438                     "isAttr": true,
14439                     "type": "Boolean"
14440                 }]
14441             }, {
14442                 "name": "Transaction",
14443                 "superClass": [
14444                     "SubProcess"
14445                 ],
14446                 "properties": [{
14447                     "name": "protocol",
14448                     "isAttr": true,
14449                     "type": "String"
14450                 }, {
14451                     "name": "method",
14452                     "isAttr": true,
14453                     "type": "String"
14454                 }]
14455             }, {
14456                 "name": "GlobalScriptTask",
14457                 "superClass": [
14458                     "GlobalTask"
14459                 ],
14460                 "properties": [{
14461                     "name": "scriptLanguage",
14462                     "isAttr": true,
14463                     "type": "String"
14464                 }, {
14465                     "name": "script",
14466                     "isAttr": true,
14467                     "type": "String"
14468                 }]
14469             }, {
14470                 "name": "GlobalBusinessRuleTask",
14471                 "superClass": [
14472                     "GlobalTask"
14473                 ],
14474                 "properties": [{
14475                     "name": "implementation",
14476                     "isAttr": true,
14477                     "type": "String"
14478                 }]
14479             }, {
14480                 "name": "ComplexBehaviorDefinition",
14481                 "superClass": [
14482                     "BaseElement"
14483                 ],
14484                 "properties": [{
14485                     "name": "condition",
14486                     "type": "FormalExpression"
14487                 }, {
14488                     "name": "event",
14489                     "type": "ImplicitThrowEvent"
14490                 }]
14491             }, {
14492                 "name": "ResourceRole",
14493                 "superClass": [
14494                     "BaseElement"
14495                 ],
14496                 "properties": [{
14497                     "name": "resourceRef",
14498                     "type": "Resource",
14499                     "isReference": true
14500                 }, {
14501                     "name": "resourceParameterBindings",
14502                     "type": "ResourceParameterBinding",
14503                     "isMany": true
14504                 }, {
14505                     "name": "resourceAssignmentExpression",
14506                     "type": "ResourceAssignmentExpression"
14507                 }, {
14508                     "name": "name",
14509                     "isAttr": true,
14510                     "type": "String"
14511                 }]
14512             }, {
14513                 "name": "ResourceParameterBinding",
14514                 "properties": [{
14515                     "name": "expression",
14516                     "type": "Expression",
14517                     "serialize": "xsi:type"
14518                 }, {
14519                     "name": "parameterRef",
14520                     "type": "ResourceParameter",
14521                     "isAttr": true,
14522                     "isReference": true
14523                 }]
14524             }, {
14525                 "name": "ResourceAssignmentExpression",
14526                 "properties": [{
14527                     "name": "expression",
14528                     "type": "Expression",
14529                     "serialize": "xsi:type"
14530                 }]
14531             }, {
14532                 "name": "Import",
14533                 "properties": [{
14534                     "name": "importType",
14535                     "isAttr": true,
14536                     "type": "String"
14537                 }, {
14538                     "name": "location",
14539                     "isAttr": true,
14540                     "type": "String"
14541                 }, {
14542                     "name": "namespace",
14543                     "isAttr": true,
14544                     "type": "String"
14545                 }]
14546             }, {
14547                 "name": "Definitions",
14548                 "superClass": [
14549                     "BaseElement"
14550                 ],
14551                 "properties": [{
14552                     "name": "name",
14553                     "isAttr": true,
14554                     "type": "String"
14555                 }, {
14556                     "name": "targetNamespace",
14557                     "isAttr": true,
14558                     "type": "String"
14559                 }, {
14560                     "name": "expressionLanguage",
14561                     "default": "http://www.w3.org/1999/XPath",
14562                     "isAttr": true,
14563                     "type": "String"
14564                 }, {
14565                     "name": "typeLanguage",
14566                     "default": "http://www.w3.org/2001/XMLSchema",
14567                     "isAttr": true,
14568                     "type": "String"
14569                 }, {
14570                     "name": "imports",
14571                     "type": "Import",
14572                     "isMany": true
14573                 }, {
14574                     "name": "extensions",
14575                     "type": "Extension",
14576                     "isMany": true
14577                 }, {
14578                     "name": "rootElements",
14579                     "type": "RootElement",
14580                     "isMany": true
14581                 }, {
14582                     "name": "diagrams",
14583                     "isMany": true,
14584                     "type": "bpmndi:BPMNDiagram"
14585                 }, {
14586                     "name": "exporter",
14587                     "isAttr": true,
14588                     "type": "String"
14589                 }, {
14590                     "name": "relationships",
14591                     "type": "Relationship",
14592                     "isMany": true
14593                 }, {
14594                     "name": "exporterVersion",
14595                     "isAttr": true,
14596                     "type": "String"
14597                 }]
14598             }],
14599             "emumerations": [{
14600                 "name": "ProcessType",
14601                 "literalValues": [{
14602                     "name": "None"
14603                 }, {
14604                     "name": "Public"
14605                 }, {
14606                     "name": "Private"
14607                 }]
14608             }, {
14609                 "name": "GatewayDirection",
14610                 "literalValues": [{
14611                     "name": "Unspecified"
14612                 }, {
14613                     "name": "Converging"
14614                 }, {
14615                     "name": "Diverging"
14616                 }, {
14617                     "name": "Mixed"
14618                 }]
14619             }, {
14620                 "name": "EventBasedGatewayType",
14621                 "literalValues": [{
14622                     "name": "Parallel"
14623                 }, {
14624                     "name": "Exclusive"
14625                 }]
14626             }, {
14627                 "name": "RelationshipDirection",
14628                 "literalValues": [{
14629                     "name": "None"
14630                 }, {
14631                     "name": "Forward"
14632                 }, {
14633                     "name": "Backward"
14634                 }, {
14635                     "name": "Both"
14636                 }]
14637             }, {
14638                 "name": "ItemKind",
14639                 "literalValues": [{
14640                     "name": "Physical"
14641                 }, {
14642                     "name": "Information"
14643                 }]
14644             }, {
14645                 "name": "ChoreographyLoopType",
14646                 "literalValues": [{
14647                     "name": "None"
14648                 }, {
14649                     "name": "Standard"
14650                 }, {
14651                     "name": "MultiInstanceSequential"
14652                 }, {
14653                     "name": "MultiInstanceParallel"
14654                 }]
14655             }, {
14656                 "name": "AssociationDirection",
14657                 "literalValues": [{
14658                     "name": "None"
14659                 }, {
14660                     "name": "One"
14661                 }, {
14662                     "name": "Both"
14663                 }]
14664             }, {
14665                 "name": "MultiInstanceBehavior",
14666                 "literalValues": [{
14667                     "name": "None"
14668                 }, {
14669                     "name": "One"
14670                 }, {
14671                     "name": "All"
14672                 }, {
14673                     "name": "Complex"
14674                 }]
14675             }, {
14676                 "name": "AdHocOrdering",
14677                 "literalValues": [{
14678                     "name": "Parallel"
14679                 }, {
14680                     "name": "Sequential"
14681                 }]
14682             }],
14683             "prefix": "bpmn",
14684             "xml": {
14685                 "tagAlias": "lowerCase",
14686                 "typePrefix": "t"
14687             }
14688         }
14689     }, {}],
14690     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json": [function(require, module, exports) {
14691         module.exports = {
14692             "name": "BPMNDI",
14693             "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
14694             "types": [{
14695                 "name": "BPMNDiagram",
14696                 "properties": [{
14697                     "name": "plane",
14698                     "type": "BPMNPlane",
14699                     "redefines": "di:Diagram#rootElement"
14700                 }, {
14701                     "name": "labelStyle",
14702                     "type": "BPMNLabelStyle",
14703                     "isMany": true
14704                 }],
14705                 "superClass": [
14706                     "di:Diagram"
14707                 ]
14708             }, {
14709                 "name": "BPMNPlane",
14710                 "properties": [{
14711                     "name": "bpmnElement",
14712                     "isAttr": true,
14713                     "isReference": true,
14714                     "type": "bpmn:BaseElement",
14715                     "redefines": "di:DiagramElement#modelElement"
14716                 }],
14717                 "superClass": [
14718                     "di:Plane"
14719                 ]
14720             }, {
14721                 "name": "BPMNShape",
14722                 "properties": [{
14723                     "name": "bpmnElement",
14724                     "isAttr": true,
14725                     "isReference": true,
14726                     "type": "bpmn:BaseElement",
14727                     "redefines": "di:DiagramElement#modelElement"
14728                 }, {
14729                     "name": "isHorizontal",
14730                     "isAttr": true,
14731                     "type": "Boolean"
14732                 }, {
14733                     "name": "isExpanded",
14734                     "isAttr": true,
14735                     "type": "Boolean"
14736                 }, {
14737                     "name": "isMarkerVisible",
14738                     "isAttr": true,
14739                     "type": "Boolean"
14740                 }, {
14741                     "name": "label",
14742                     "type": "BPMNLabel"
14743                 }, {
14744                     "name": "isMessageVisible",
14745                     "isAttr": true,
14746                     "type": "Boolean"
14747                 }, {
14748                     "name": "participantBandKind",
14749                     "type": "ParticipantBandKind",
14750                     "isAttr": true
14751                 }, {
14752                     "name": "choreographyActivityShape",
14753                     "type": "BPMNShape",
14754                     "isAttr": true,
14755                     "isReference": true
14756                 }],
14757                 "superClass": [
14758                     "di:LabeledShape"
14759                 ]
14760             }, {
14761                 "name": "BPMNEdge",
14762                 "properties": [{
14763                     "name": "label",
14764                     "type": "BPMNLabel"
14765                 }, {
14766                     "name": "bpmnElement",
14767                     "isAttr": true,
14768                     "isReference": true,
14769                     "type": "bpmn:BaseElement",
14770                     "redefines": "di:DiagramElement#modelElement"
14771                 }, {
14772                     "name": "sourceElement",
14773                     "isAttr": true,
14774                     "isReference": true,
14775                     "type": "di:DiagramElement",
14776                     "redefines": "di:Edge#source"
14777                 }, {
14778                     "name": "targetElement",
14779                     "isAttr": true,
14780                     "isReference": true,
14781                     "type": "di:DiagramElement",
14782                     "redefines": "di:Edge#target"
14783                 }, {
14784                     "name": "messageVisibleKind",
14785                     "type": "MessageVisibleKind",
14786                     "isAttr": true,
14787                     "default": "initiating"
14788                 }],
14789                 "superClass": [
14790                     "di:LabeledEdge"
14791                 ]
14792             }, {
14793                 "name": "BPMNLabel",
14794                 "properties": [{
14795                     "name": "labelStyle",
14796                     "type": "BPMNLabelStyle",
14797                     "isAttr": true,
14798                     "isReference": true,
14799                     "redefines": "di:DiagramElement#style"
14800                 }],
14801                 "superClass": [
14802                     "di:Label"
14803                 ]
14804             }, {
14805                 "name": "BPMNLabelStyle",
14806                 "properties": [{
14807                     "name": "font",
14808                     "type": "dc:Font"
14809                 }],
14810                 "superClass": [
14811                     "di:Style"
14812                 ]
14813             }],
14814             "emumerations": [{
14815                 "name": "ParticipantBandKind",
14816                 "literalValues": [{
14817                     "name": "top_initiating"
14818                 }, {
14819                     "name": "middle_initiating"
14820                 }, {
14821                     "name": "bottom_initiating"
14822                 }, {
14823                     "name": "top_non_initiating"
14824                 }, {
14825                     "name": "middle_non_initiating"
14826                 }, {
14827                     "name": "bottom_non_initiating"
14828                 }]
14829             }, {
14830                 "name": "MessageVisibleKind",
14831                 "literalValues": [{
14832                     "name": "initiating"
14833                 }, {
14834                     "name": "non_initiating"
14835                 }]
14836             }],
14837             "associations": [],
14838             "prefix": "bpmndi"
14839         }
14840     }, {}],
14841     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json": [function(require, module, exports) {
14842         module.exports = {
14843             "name": "DC",
14844             "uri": "http://www.omg.org/spec/DD/20100524/DC",
14845             "types": [{
14846                 "name": "Boolean"
14847             }, {
14848                 "name": "Integer"
14849             }, {
14850                 "name": "Real"
14851             }, {
14852                 "name": "String"
14853             }, {
14854                 "name": "Font",
14855                 "properties": [{
14856                     "name": "name",
14857                     "type": "String",
14858                     "isAttr": true
14859                 }, {
14860                     "name": "size",
14861                     "type": "Real",
14862                     "isAttr": true
14863                 }, {
14864                     "name": "isBold",
14865                     "type": "Boolean",
14866                     "isAttr": true
14867                 }, {
14868                     "name": "isItalic",
14869                     "type": "Boolean",
14870                     "isAttr": true
14871                 }, {
14872                     "name": "isUnderline",
14873                     "type": "Boolean",
14874                     "isAttr": true
14875                 }, {
14876                     "name": "isStrikeThrough",
14877                     "type": "Boolean",
14878                     "isAttr": true
14879                 }]
14880             }, {
14881                 "name": "Point",
14882                 "properties": [{
14883                     "name": "x",
14884                     "type": "Real",
14885                     "default": "0",
14886                     "isAttr": true
14887                 }, {
14888                     "name": "y",
14889                     "type": "Real",
14890                     "default": "0",
14891                     "isAttr": true
14892                 }]
14893             }, {
14894                 "name": "Bounds",
14895                 "properties": [{
14896                     "name": "x",
14897                     "type": "Real",
14898                     "default": "0",
14899                     "isAttr": true
14900                 }, {
14901                     "name": "y",
14902                     "type": "Real",
14903                     "default": "0",
14904                     "isAttr": true
14905                 }, {
14906                     "name": "width",
14907                     "type": "Real",
14908                     "isAttr": true
14909                 }, {
14910                     "name": "height",
14911                     "type": "Real",
14912                     "isAttr": true
14913                 }]
14914             }],
14915             "prefix": "dc",
14916             "associations": []
14917         }
14918     }, {}],
14919     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json": [function(require, module, exports) {
14920         module.exports = {
14921             "name": "DI",
14922             "uri": "http://www.omg.org/spec/DD/20100524/DI",
14923             "types": [{
14924                 "name": "DiagramElement",
14925                 "isAbstract": true,
14926                 "properties": [{
14927                     "name": "extension",
14928                     "type": "Extension"
14929                 }, {
14930                     "name": "owningDiagram",
14931                     "type": "Diagram",
14932                     "isReadOnly": true,
14933                     "isVirtual": true,
14934                     "isReference": true
14935                 }, {
14936                     "name": "owningElement",
14937                     "type": "DiagramElement",
14938                     "isReadOnly": true,
14939                     "isVirtual": true,
14940                     "isReference": true
14941                 }, {
14942                     "name": "modelElement",
14943                     "isReadOnly": true,
14944                     "isVirtual": true,
14945                     "isReference": true,
14946                     "type": "Element"
14947                 }, {
14948                     "name": "style",
14949                     "type": "Style",
14950                     "isReadOnly": true,
14951                     "isVirtual": true,
14952                     "isReference": true
14953                 }, {
14954                     "name": "ownedElement",
14955                     "type": "DiagramElement",
14956                     "isReadOnly": true,
14957                     "isVirtual": true,
14958                     "isMany": true
14959                 }]
14960             }, {
14961                 "name": "Node",
14962                 "isAbstract": true,
14963                 "superClass": [
14964                     "DiagramElement"
14965                 ]
14966             }, {
14967                 "name": "Edge",
14968                 "isAbstract": true,
14969                 "superClass": [
14970                     "DiagramElement"
14971                 ],
14972                 "properties": [{
14973                     "name": "source",
14974                     "type": "DiagramElement",
14975                     "isReadOnly": true,
14976                     "isVirtual": true,
14977                     "isReference": true
14978                 }, {
14979                     "name": "target",
14980                     "type": "DiagramElement",
14981                     "isReadOnly": true,
14982                     "isVirtual": true,
14983                     "isReference": true
14984                 }, {
14985                     "name": "waypoint",
14986                     "isUnique": false,
14987                     "isMany": true,
14988                     "type": "dc:Point",
14989                     "serialize": "xsi:type"
14990                 }]
14991             }, {
14992                 "name": "Diagram",
14993                 "isAbstract": true,
14994                 "properties": [{
14995                     "name": "rootElement",
14996                     "type": "DiagramElement",
14997                     "isReadOnly": true,
14998                     "isVirtual": true
14999                 }, {
15000                     "name": "name",
15001                     "isAttr": true,
15002                     "type": "String"
15003                 }, {
15004                     "name": "documentation",
15005                     "isAttr": true,
15006                     "type": "String"
15007                 }, {
15008                     "name": "resolution",
15009                     "isAttr": true,
15010                     "type": "Real"
15011                 }, {
15012                     "name": "ownedStyle",
15013                     "type": "Style",
15014                     "isReadOnly": true,
15015                     "isVirtual": true,
15016                     "isMany": true
15017                 }]
15018             }, {
15019                 "name": "Shape",
15020                 "isAbstract": true,
15021                 "superClass": [
15022                     "Node"
15023                 ],
15024                 "properties": [{
15025                     "name": "bounds",
15026                     "type": "dc:Bounds"
15027                 }]
15028             }, {
15029                 "name": "Plane",
15030                 "isAbstract": true,
15031                 "superClass": [
15032                     "Node"
15033                 ],
15034                 "properties": [{
15035                     "name": "planeElement",
15036                     "type": "DiagramElement",
15037                     "subsettedProperty": "DiagramElement-ownedElement",
15038                     "isMany": true
15039                 }]
15040             }, {
15041                 "name": "LabeledEdge",
15042                 "isAbstract": true,
15043                 "superClass": [
15044                     "Edge"
15045                 ],
15046                 "properties": [{
15047                     "name": "ownedLabel",
15048                     "type": "Label",
15049                     "isReadOnly": true,
15050                     "subsettedProperty": "DiagramElement-ownedElement",
15051                     "isVirtual": true,
15052                     "isMany": true
15053                 }]
15054             }, {
15055                 "name": "LabeledShape",
15056                 "isAbstract": true,
15057                 "superClass": [
15058                     "Shape"
15059                 ],
15060                 "properties": [{
15061                     "name": "ownedLabel",
15062                     "type": "Label",
15063                     "isReadOnly": true,
15064                     "subsettedProperty": "DiagramElement-ownedElement",
15065                     "isVirtual": true,
15066                     "isMany": true
15067                 }]
15068             }, {
15069                 "name": "Label",
15070                 "isAbstract": true,
15071                 "superClass": [
15072                     "Node"
15073                 ],
15074                 "properties": [{
15075                     "name": "bounds",
15076                     "type": "dc:Bounds"
15077                 }]
15078             }, {
15079                 "name": "Style",
15080                 "isAbstract": true
15081             }, {
15082                 "name": "Extension",
15083                 "properties": [{
15084                     "name": "values",
15085                     "type": "Element",
15086                     "isMany": true
15087                 }]
15088             }],
15089             "associations": [],
15090             "prefix": "di",
15091             "xml": {
15092                 "tagAlias": "lowerCase"
15093             }
15094         }
15095     }, {}],
15096     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js": [function(require, module, exports) {
15097         module.exports = {
15098             __depends__: [require('diagram-js/lib/features/interaction-events')],
15099             __init__: ['directEditing'],
15100             directEditing: ['type', require('./lib/DirectEditing')]
15101         };
15102     }, {
15103         "./lib/DirectEditing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js",
15104         "diagram-js/lib/features/interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js"
15105     }],
15106     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js": [function(require, module, exports) {
15107         'use strict';
15108
15109         var bind = require('lodash/function/bind'),
15110             find = require('lodash/collection/find');
15111
15112         var TextBox = require('./TextBox');
15113
15114
15115         /**
15116          * A direct editing component that allows users to edit an elements text
15117          * directly in the diagram
15118          * 
15119          * @param {EventBus}
15120          *            eventBus the event bus
15121          */
15122         function DirectEditing(eventBus, canvas) {
15123
15124             this._eventBus = eventBus;
15125
15126             this._providers = [];
15127             this._textbox = new TextBox({
15128                 container: canvas.getContainer(),
15129                 keyHandler: bind(this._handleKey, this)
15130             });
15131         }
15132
15133         DirectEditing.$inject = ['eventBus', 'canvas'];
15134
15135
15136         /**
15137          * Register a direct editing provider
15138          * 
15139          * @param {Object}
15140          *            provider the provider, must expose an #activate(element) method
15141          *            that returns an activation context ({ bounds: {x, y, width, height },
15142          *            text }) if direct editing is available for the given element.
15143          *            Additionally the provider must expose a #update(element, value)
15144          *            method to receive direct editing updates.
15145          */
15146         DirectEditing.prototype.registerProvider = function(provider) {
15147             this._providers.push(provider);
15148         };
15149
15150
15151         /**
15152          * Returns true if direct editing is currently active
15153          * 
15154          * @return {Boolean}
15155          */
15156         DirectEditing.prototype.isActive = function() {
15157             return !!this._active;
15158         };
15159
15160
15161         /**
15162          * Cancel direct editing, if it is currently active
15163          */
15164         DirectEditing.prototype.cancel = function() {
15165             if (!this._active) {
15166                 return;
15167             }
15168
15169             this._fire('cancel');
15170             this.close();
15171         };
15172
15173
15174         DirectEditing.prototype._fire = function(event) {
15175             this._eventBus.fire('directEditing.' + event, {
15176                 active: this._active
15177             });
15178         };
15179
15180         DirectEditing.prototype.close = function() {
15181             this._textbox.destroy();
15182
15183             this._fire('deactivate');
15184
15185             this._active = null;
15186         };
15187
15188
15189         DirectEditing.prototype.complete = function() {
15190
15191             var active = this._active;
15192
15193             if (!active) {
15194                 return;
15195             }
15196
15197             var text = this.getValue();
15198
15199             if (text !== active.context.text) {
15200                 active.provider.update(active.element, text, active.context.text);
15201             }
15202
15203             this._fire('complete');
15204
15205             this.close();
15206         };
15207
15208
15209         DirectEditing.prototype.getValue = function() {
15210             return this._textbox.getValue();
15211         };
15212
15213
15214         DirectEditing.prototype._handleKey = function(e) {
15215
15216             // stop bubble
15217             e.stopPropagation();
15218
15219             var key = e.keyCode || e.charCode;
15220
15221             // ESC
15222             if (key === 27) {
15223                 e.preventDefault();
15224                 return this.cancel();
15225             }
15226
15227             // Enter
15228             if (key === 13 && !e.shiftKey) {
15229                 e.preventDefault();
15230                 return this.complete();
15231             }
15232         };
15233
15234
15235         /**
15236          * Activate direct editing on the given element
15237          * 
15238          * @param {Object}
15239          *            ElementDescriptor the descriptor for a shape or connection
15240          * @return {Boolean} true if the activation was possible
15241          */
15242         DirectEditing.prototype.activate = function(element) {
15243
15244             if (this.isActive()) {
15245                 this.cancel();
15246             }
15247
15248             // the direct editing context
15249             var context;
15250
15251             var provider = find(this._providers, function(p) {
15252                 return !!(context = p.activate(element)) ? p : null;
15253             });
15254
15255             // check if activation took place
15256             if (context) {
15257                 this._textbox.create(context.bounds, context.style, context.text);
15258
15259                 this._active = {
15260                     element: element,
15261                     context: context,
15262                     provider: provider
15263                 };
15264
15265                 this._fire('activate');
15266             }
15267
15268             return !!context;
15269         };
15270
15271
15272         module.exports = DirectEditing;
15273     }, {
15274         "./TextBox": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js",
15275         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
15276         "lodash/function/bind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js"
15277     }],
15278     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js": [function(require, module, exports) {
15279         'use strict';
15280
15281         var assign = require('lodash/object/assign'),
15282             domEvent = require('min-dom/lib/event'),
15283             domRemove = require('min-dom/lib/remove');
15284
15285         function stopPropagation(event) {
15286             event.stopPropagation();
15287         }
15288
15289         function TextBox(options) {
15290
15291             this.container = options.container;
15292             this.textarea = document.createElement('textarea');
15293
15294             this.keyHandler = options.keyHandler || function() {};
15295         }
15296
15297         module.exports = TextBox;
15298
15299
15300         TextBox.prototype.create = function(bounds, style, value) {
15301
15302             var textarea = this.textarea,
15303                 container = this.container;
15304
15305             assign(textarea.style, {
15306                 width: bounds.width + 'px',
15307                 height: bounds.height + 'px',
15308                 left: bounds.x + 'px',
15309                 top: bounds.y + 'px',
15310                 position: 'absolute',
15311                 textAlign: 'center',
15312                 boxSizing: 'border-box'
15313             }, style || {});
15314
15315             textarea.value = value;
15316             textarea.title = 'Press SHIFT+Enter for line feed';
15317
15318             domEvent.bind(textarea, 'keydown', this.keyHandler);
15319             domEvent.bind(textarea, 'mousedown', stopPropagation);
15320
15321             container.appendChild(textarea);
15322
15323             setTimeout(function() {
15324                 if (textarea.parent) {
15325                     textarea.select();
15326                 }
15327                 textarea.focus();
15328             }, 100);
15329         };
15330
15331         TextBox.prototype.destroy = function() {
15332             var textarea = this.textarea;
15333
15334             textarea.value = '';
15335
15336             domEvent.unbind(textarea, 'keydown', this.keyHandler);
15337             domEvent.unbind(textarea, 'mousedown', stopPropagation);
15338
15339             domRemove(textarea);
15340         };
15341
15342         TextBox.prototype.getValue = function() {
15343             return this.textarea.value;
15344         };
15345
15346     }, {
15347         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
15348         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js",
15349         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
15350     }],
15351     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js": [function(require, module, exports) {
15352         'use strict';
15353
15354         var hat = require('hat');
15355
15356
15357         /**
15358          * Create a new id generator / cache instance.
15359          * 
15360          * You may optionally provide a seed that is used internally.
15361          * 
15362          * @param {Seed}
15363          *            seed
15364          */
15365         function Ids(seed) {
15366             seed = seed || [128, 36, 1];
15367             this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;
15368         }
15369
15370         module.exports = Ids;
15371
15372         /**
15373          * Generate a next id.
15374          * 
15375          * @param {Object}
15376          *            [element] element to bind the id to
15377          * 
15378          * @return {String} id
15379          */
15380         Ids.prototype.next = function(element) {
15381             return this._seed(element || true);
15382         };
15383
15384         /**
15385          * Generate a next id with a given prefix.
15386          * 
15387          * @param {Object}
15388          *            [element] element to bind the id to
15389          * 
15390          * @return {String} id
15391          */
15392         Ids.prototype.nextPrefixed = function(prefix, element) {
15393             var id;
15394
15395             do {
15396                 id = prefix + this.next(true);
15397             } while (this.assigned(id));
15398
15399             // claim {prefix}{random}
15400             this.claim(id, element);
15401
15402             // return
15403             return id;
15404         };
15405
15406         /**
15407          * Manually claim an existing id.
15408          * 
15409          * @param {String}
15410          *            id
15411          * @param {String}
15412          *            [element] element the id is claimed by
15413          */
15414         Ids.prototype.claim = function(id, element) {
15415             this._seed.set(id, element || true);
15416         };
15417
15418         /**
15419          * Returns true if the given id has already been assigned.
15420          * 
15421          * @param {String}
15422          *            id
15423          * @return {Boolean}
15424          */
15425         Ids.prototype.assigned = function(id) {
15426             return this._seed.get(id) || false;
15427         };
15428     }, {
15429         "hat": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js"
15430     }],
15431     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js": [function(require, module, exports) {
15432         var hat = module.exports = function(bits, base) {
15433             if (!base) base = 16;
15434             if (bits === undefined) bits = 128;
15435             if (bits <= 0) return '0';
15436
15437             var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
15438             for (var i = 2; digits === Infinity; i *= 2) {
15439                 digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
15440             }
15441
15442             var rem = digits - Math.floor(digits);
15443
15444             var res = '';
15445
15446             for (var i = 0; i < Math.floor(digits); i++) {
15447                 var x = Math.floor(Math.random() * base).toString(base);
15448                 res = x + res;
15449             }
15450
15451             if (rem) {
15452                 var b = Math.pow(base, rem);
15453                 var x = Math.floor(Math.random() * b).toString(base);
15454                 res = x + res;
15455             }
15456
15457             var parsed = parseInt(res, base);
15458             if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
15459                 return hat(bits, base)
15460             } else return res;
15461         };
15462
15463         hat.rack = function(bits, base, expandBy) {
15464             var fn = function(data) {
15465                 var iters = 0;
15466                 do {
15467                     if (iters++ > 10) {
15468                         if (expandBy) bits += expandBy;
15469                         else throw new Error('too many ID collisions, use more bits')
15470                     }
15471
15472                     var id = hat(bits, base);
15473                 } while (Object.hasOwnProperty.call(hats, id));
15474
15475                 hats[id] = data;
15476                 return id;
15477             };
15478             var hats = fn.hats = {};
15479
15480             fn.get = function(id) {
15481                 return fn.hats[id];
15482             };
15483
15484             fn.set = function(id, value) {
15485                 fn.hats[id] = value;
15486                 return fn;
15487             };
15488
15489             fn.bits = bits || 128;
15490             fn.base = base || 16;
15491             return fn;
15492         };
15493
15494     }, {}],
15495     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
15496         if (typeof Object.create === 'function') {
15497             // implementation from standard node.js 'util' module
15498             module.exports = function inherits(ctor, superCtor) {
15499                 ctor.super_ = superCtor
15500                 ctor.prototype = Object.create(superCtor.prototype, {
15501                     constructor: {
15502                         value: ctor,
15503                         enumerable: false,
15504                         writable: true,
15505                         configurable: true
15506                     }
15507                 });
15508             };
15509         } else {
15510             // old school shim for old browsers
15511             module.exports = function inherits(ctor, superCtor) {
15512                 ctor.super_ = superCtor
15513                 var TempCtor = function() {}
15514                 TempCtor.prototype = superCtor.prototype
15515                 ctor.prototype = new TempCtor()
15516                 ctor.prototype.constructor = ctor
15517             }
15518         }
15519
15520     }, {}],
15521     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
15522         module.exports = require('domify');
15523     }, {
15524         "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
15525     }],
15526     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
15527         module.exports = require('component-event');
15528     }, {
15529         "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
15530     }],
15531     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
15532         module.exports = require('component-query');
15533     }, {
15534         "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
15535     }],
15536     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
15537         module.exports = function(el) {
15538             el.parentNode && el.parentNode.removeChild(el);
15539         };
15540     }, {}],
15541     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
15542         var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
15543             unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
15544             prefix = bind !== 'addEventListener' ? 'on' : '';
15545
15546         /**
15547          * Bind `el` event `type` to `fn`.
15548          * 
15549          * @param {Element}
15550          *            el
15551          * @param {String}
15552          *            type
15553          * @param {Function}
15554          *            fn
15555          * @param {Boolean}
15556          *            capture
15557          * @return {Function}
15558          * @api public
15559          */
15560
15561         exports.bind = function(el, type, fn, capture) {
15562             el[bind](prefix + type, fn, capture || false);
15563             return fn;
15564         };
15565
15566         /**
15567          * Unbind `el` event `type`'s callback `fn`.
15568          * 
15569          * @param {Element}
15570          *            el
15571          * @param {String}
15572          *            type
15573          * @param {Function}
15574          *            fn
15575          * @param {Boolean}
15576          *            capture
15577          * @return {Function}
15578          * @api public
15579          */
15580
15581         exports.unbind = function(el, type, fn, capture) {
15582             el[unbind](prefix + type, fn, capture || false);
15583             return fn;
15584         };
15585     }, {}],
15586     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
15587         function one(selector, el) {
15588             return el.querySelector(selector);
15589         }
15590
15591         exports = module.exports = function(selector, el) {
15592             el = el || document;
15593             return one(selector, el);
15594         };
15595
15596         exports.all = function(selector, el) {
15597             el = el || document;
15598             return el.querySelectorAll(selector);
15599         };
15600
15601         exports.engine = function(obj) {
15602             if (!obj.one) throw new Error('.one callback required');
15603             if (!obj.all) throw new Error('.all callback required');
15604             one = obj.one;
15605             exports.all = obj.all;
15606             return exports;
15607         };
15608
15609     }, {}],
15610     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
15611
15612         /**
15613          * Expose `parse`.
15614          */
15615
15616         module.exports = parse;
15617
15618         /**
15619          * Tests for browser support.
15620          */
15621
15622         var div = document.createElement('div');
15623         // Setup
15624         div.innerHTML = '  <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
15625         // Make sure that link elements get serialized correctly by innerHTML
15626         // This requires a wrapper element in IE
15627         var innerHTMLBug = !div.getElementsByTagName('link').length;
15628         div = undefined;
15629
15630         /**
15631          * Wrap map from jquery.
15632          */
15633
15634         var map = {
15635             legend: [1, '<fieldset>', '</fieldset>'],
15636             tr: [2, '<table><tbody>', '</tbody></table>'],
15637             col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
15638             // for script/link/style tags to work in IE6-8, you have to wrap
15639             // in a div with a non-whitespace character in front, ha!
15640             _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
15641         };
15642
15643         map.td =
15644             map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
15645
15646         map.option =
15647             map.optgroup = [1, '<select multiple="multiple">', '</select>'];
15648
15649         map.thead =
15650             map.tbody =
15651             map.colgroup =
15652             map.caption =
15653             map.tfoot = [1, '<table>', '</table>'];
15654
15655         map.polyline =
15656             map.ellipse =
15657             map.polygon =
15658             map.circle =
15659             map.text =
15660             map.line =
15661             map.path =
15662             map.rect =
15663             map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">', '</svg>'];
15664
15665         /**
15666          * Parse `html` and return a DOM Node instance, which could be a TextNode, HTML
15667          * DOM Node of some kind (<div> for example), or a DocumentFragment instance,
15668          * depending on the contents of the `html` string.
15669          * 
15670          * @param {String}
15671          *            html - HTML string to "domify"
15672          * @param {Document}
15673          *            doc - The `document` instance to create the Node for
15674          * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
15675          * @api private
15676          */
15677
15678         function parse(html, doc) {
15679             if ('string' != typeof html) throw new TypeError('String expected');
15680
15681             // default to the global `document` object
15682             if (!doc) doc = document;
15683
15684             // tag name
15685             var m = /<([\w:]+)/.exec(html);
15686             if (!m) return doc.createTextNode(html);
15687
15688             html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing
15689             // whitespace
15690
15691             var tag = m[1];
15692
15693             // body support
15694             if (tag == 'body') {
15695                 var el = doc.createElement('html');
15696                 el.innerHTML = html;
15697                 return el.removeChild(el.lastChild);
15698             }
15699
15700             // wrap map
15701             var wrap = map[tag] || map._default;
15702             var depth = wrap[0];
15703             var prefix = wrap[1];
15704             var suffix = wrap[2];
15705             var el = doc.createElement('div');
15706             el.innerHTML = prefix + html + suffix;
15707             while (depth--) el = el.lastChild;
15708
15709             // one element
15710             if (el.firstChild == el.lastChild) {
15711                 return el.removeChild(el.firstChild);
15712             }
15713
15714             // several elements
15715             var fragment = doc.createDocumentFragment();
15716             while (el.firstChild) {
15717                 fragment.appendChild(el.removeChild(el.firstChild));
15718             }
15719
15720             return fragment;
15721         }
15722
15723     }, {}],
15724     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
15725         module.exports = require('./lib/refs');
15726
15727         module.exports.Collection = require('./lib/collection');
15728     }, {
15729         "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js",
15730         "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"
15731     }],
15732     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
15733         'use strict';
15734
15735         /**
15736          * An empty collection stub. Use {@link RefsCollection.extend} to extend a
15737          * collection with ref semantics.
15738          * 
15739          * @classdesc A change and inverse-reference aware collection with set
15740          *            semantics.
15741          * 
15742          * @class RefsCollection
15743          */
15744         function RefsCollection() {}
15745
15746         /**
15747          * Extends a collection with {@link Refs} aware methods
15748          * 
15749          * @memberof RefsCollection
15750          * @static
15751          * 
15752          * @param {Array
15753          *            <Object>} collection
15754          * @param {Refs}
15755          *            refs instance
15756          * @param {Object}
15757          *            property represented by the collection
15758          * @param {Object}
15759          *            target object the collection is attached to
15760          * 
15761          * @return {RefsCollection<Object>} the extended array
15762          */
15763         function extend(collection, refs, property, target) {
15764
15765             var inverseProperty = property.inverse;
15766
15767             /**
15768              * Removes the given element from the array and returns it.
15769              * 
15770              * @method RefsCollection#remove
15771              * 
15772              * @param {Object}
15773              *            element the element to remove
15774              */
15775             collection.remove = function(element) {
15776                 var idx = this.indexOf(element);
15777                 if (idx !== -1) {
15778                     this.splice(idx, 1);
15779
15780                     // unset inverse
15781                     refs.unset(element, inverseProperty, target);
15782                 }
15783
15784                 return element;
15785             };
15786
15787             /**
15788              * Returns true if the collection contains the given element
15789              * 
15790              * @method RefsCollection#contains
15791              * 
15792              * @param {Object}
15793              *            element the element to check for
15794              */
15795             collection.contains = function(element) {
15796                 return this.indexOf(element) !== -1;
15797             };
15798
15799             /**
15800              * Adds an element to the array, unless it exists already (set semantics).
15801              * 
15802              * @method RefsCollection#add
15803              * 
15804              * @param {Object}
15805              *            element the element to add
15806              */
15807             collection.add = function(element) {
15808
15809                 if (!this.contains(element)) {
15810                     this.push(element);
15811
15812                     // set inverse
15813                     refs.set(element, inverseProperty, target);
15814                 }
15815             };
15816
15817             return collection;
15818         }
15819
15820
15821         module.exports.extend = extend;
15822     }, {}],
15823     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
15824         'use strict';
15825
15826         var Collection = require('./collection');
15827
15828         function hasOwnProperty(e, property) {
15829             return Object.prototype.hasOwnProperty.call(e, property.name || property);
15830         }
15831
15832
15833         function defineCollectionProperty(ref, property, target) {
15834             Object.defineProperty(target, property.name, {
15835                 enumerable: property.enumerable,
15836                 value: Collection.extend(target[property.name] || [], ref, property, target)
15837             });
15838         }
15839
15840
15841         function defineProperty(ref, property, target) {
15842
15843             var inverseProperty = property.inverse;
15844
15845             var _value = target[property.name];
15846
15847             Object.defineProperty(target, property.name, {
15848                 enumerable: property.enumerable,
15849
15850                 get: function() {
15851                     return _value;
15852                 },
15853
15854                 set: function(value) {
15855
15856                     // return if we already performed all changes
15857                     if (value === _value) {
15858                         return;
15859                     }
15860
15861                     var old = _value;
15862
15863                     // temporary set null
15864                     _value = null;
15865
15866                     if (old) {
15867                         ref.unset(old, inverseProperty, target);
15868                     }
15869
15870                     // set new value
15871                     _value = value;
15872
15873                     // set inverse value
15874                     ref.set(_value, inverseProperty, target);
15875                 }
15876             });
15877
15878         }
15879
15880         /**
15881          * Creates a new references object defining two inversly related attribute
15882          * descriptors a and b.
15883          * 
15884          * <p>
15885          * When bound to an object using {@link Refs#bind} the references get activated
15886          * and ensure that add and remove operations are applied reversely, too.
15887          * </p>
15888          * 
15889          * <p>
15890          * For attributes represented as collections {@link Refs} provides the
15891          * {@link RefsCollection#add}, {@link RefsCollection#remove} and
15892          * {@link RefsCollection#contains} extensions that must be used to properly hook
15893          * into the inverse change mechanism.
15894          * </p>
15895          * 
15896          * @class Refs
15897          * 
15898          * @classdesc A bi-directional reference between two attributes.
15899          * 
15900          * @param {Refs.AttributeDescriptor}
15901          *            a property descriptor
15902          * @param {Refs.AttributeDescriptor}
15903          *            b property descriptor
15904          * 
15905          * @example
15906          * 
15907          * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, {
15908          * name: 'car' });
15909          * 
15910          * var car = { name: 'toyota' }; var wheels = [{ pos: 'front-left' }, { pos:
15911          * 'front-right' }];
15912          * 
15913          * refs.bind(car, 'wheels');
15914          * 
15915          * car.wheels // [] car.wheels.add(wheels[0]); car.wheels.add(wheels[1]);
15916          * 
15917          * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
15918          * 
15919          * wheels[0].car // { name: 'toyota' }; car.wheels.remove(wheels[0]);
15920          * 
15921          * wheels[0].car // undefined
15922          */
15923         function Refs(a, b) {
15924
15925             if (!(this instanceof Refs)) {
15926                 return new Refs(a, b);
15927             }
15928
15929             // link
15930             a.inverse = b;
15931             b.inverse = a;
15932
15933             this.props = {};
15934             this.props[a.name] = a;
15935             this.props[b.name] = b;
15936         }
15937
15938         /**
15939          * Binds one side of a bi-directional reference to a target object.
15940          * 
15941          * @memberOf Refs
15942          * 
15943          * @param {Object}
15944          *            target
15945          * @param {String}
15946          *            property
15947          */
15948         Refs.prototype.bind = function(target, property) {
15949             if (typeof property === 'string') {
15950                 if (!this.props[property]) {
15951                     throw new Error('no property <' + property + '> in ref');
15952                 }
15953                 property = this.props[property];
15954             }
15955
15956             if (property.collection) {
15957                 defineCollectionProperty(this, property, target);
15958             } else {
15959                 defineProperty(this, property, target);
15960             }
15961         };
15962
15963         Refs.prototype.ensureBound = function(target, property) {
15964             if (!hasOwnProperty(target, property)) {
15965                 this.bind(target, property);
15966             }
15967         };
15968
15969         Refs.prototype.unset = function(target, property, value) {
15970
15971             if (target) {
15972                 this.ensureBound(target, property);
15973
15974                 if (property.collection) {
15975                     target[property.name].remove(value);
15976                 } else {
15977                     target[property.name] = undefined;
15978                 }
15979             }
15980         };
15981
15982         Refs.prototype.set = function(target, property, value) {
15983
15984             if (target) {
15985                 this.ensureBound(target, property);
15986
15987                 if (property.collection) {
15988                     target[property.name].add(value);
15989                 } else {
15990                     target[property.name] = value;
15991                 }
15992             }
15993         };
15994
15995         module.exports = Refs;
15996
15997
15998         /**
15999          * An attribute descriptor to be used specify an attribute in a {@link Refs}
16000          * instance
16001          * 
16002          * @typedef {Object} Refs.AttributeDescriptor
16003          * @property {String} name
16004          * @property {boolean} [collection=false]
16005          * @property {boolean} [enumerable=false]
16006          */
16007     }, {
16008         "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"
16009     }],
16010     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js": [function(require, module, exports) {
16011         module.exports = require('./lib/Diagram');
16012     }, {
16013         "./lib/Diagram": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js"
16014     }],
16015     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js": [function(require, module, exports) {
16016         'use strict';
16017
16018         var di = require('didi');
16019
16020
16021         /**
16022          * Bootstrap an injector from a list of modules, instantiating a number of
16023          * default components
16024          * 
16025          * @ignore
16026          * @param {Array
16027          *            <didi.Module>} bootstrapModules
16028          * 
16029          * @return {didi.Injector} a injector to use to access the components
16030          */
16031         function bootstrap(bootstrapModules) {
16032
16033             var modules = [],
16034                 components = [];
16035
16036             function hasModule(m) {
16037                 return modules.indexOf(m) >= 0;
16038             }
16039
16040             function addModule(m) {
16041                 modules.push(m);
16042             }
16043
16044             function visit(m) {
16045                 if (hasModule(m)) {
16046                     return;
16047                 }
16048
16049                 (m.__depends__ || []).forEach(visit);
16050
16051                 if (hasModule(m)) {
16052                     return;
16053                 }
16054
16055                 addModule(m);
16056
16057                 (m.__init__ || []).forEach(function(c) {
16058                     components.push(c);
16059                 });
16060             }
16061
16062             bootstrapModules.forEach(visit);
16063
16064             var injector = new di.Injector(modules);
16065
16066             components.forEach(function(c) {
16067
16068                 try {
16069                     // eagerly resolve component (fn or string)
16070                     injector[typeof c === 'string' ? 'get' : 'invoke'](c);
16071                 } catch (e) {
16072                     console.error('Failed to instantiate component');
16073                     console.error(e.stack);
16074
16075                     throw e;
16076                 }
16077             });
16078
16079             return injector;
16080         }
16081
16082         /**
16083          * Creates an injector from passed options.
16084          * 
16085          * @ignore
16086          * @param {Object}
16087          *            options
16088          * @return {didi.Injector}
16089          */
16090         function createInjector(options) {
16091
16092             options = options || {};
16093
16094             var configModule = {
16095                 'config': ['value', options]
16096             };
16097
16098             var coreModule = require('./core');
16099
16100             var modules = [configModule, coreModule].concat(options.modules || []);
16101
16102             return bootstrap(modules);
16103         }
16104
16105
16106         /**
16107          * The main diagram-js entry point that bootstraps the diagram with the given
16108          * configuration.
16109          * 
16110          * To register extensions with the diagram, pass them as Array<didi.Module> to
16111          * the constructor.
16112          * 
16113          * @class djs.Diagram
16114          * @memberOf djs
16115          * @constructor
16116          * 
16117          * @example
16118          * 
16119          * <caption>Creating a plug-in that logs whenever a shape is added to the
16120          * canvas.</caption>
16121          *  // plug-in implemenentation function MyLoggingPlugin(eventBus) {
16122          * eventBus.on('shape.added', function(event) { console.log('shape ',
16123          * event.shape, ' was added to the diagram'); }); }
16124          *  // export as module module.exports = { __init__: [ 'myLoggingPlugin' ],
16125          * myLoggingPlugin: [ 'type', MyLoggingPlugin ] };
16126          * 
16127          *  // instantiate the diagram with the new plug-in
16128          * 
16129          * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ]
16130          * });
16131          * 
16132          * diagram.invoke([ 'canvas', function(canvas) { // add shape to drawing canvas
16133          * canvas.addShape({ x: 10, y: 10 }); });
16134          *  // 'shape ... was added to the diagram' logged to console
16135          * 
16136          * @param {Object}
16137          *            options
16138          * @param {Array
16139          *            <didi.Module>} [options.modules] external modules to instantiate
16140          *            with the diagram
16141          * @param {didi.Injector}
16142          *            [injector] an (optional) injector to bootstrap the diagram with
16143          */
16144         function Diagram(options, injector) {
16145
16146             // create injector unless explicitly specified
16147             this.injector = injector = injector || createInjector(options);
16148
16149             // API
16150
16151             /**
16152              * Resolves a diagram service
16153              * 
16154              * @method Diagram#get
16155              * 
16156              * @param {String}
16157              *            name the name of the diagram service to be retrieved
16158              * @param {Object}
16159              *            [locals] a number of locals to use to resolve certain
16160              *            dependencies
16161              */
16162             this.get = injector.get;
16163
16164             /**
16165              * Executes a function into which diagram services are injected
16166              * 
16167              * @method Diagram#invoke
16168              * 
16169              * @param {Function|Object[]}
16170              *            fn the function to resolve
16171              * @param {Object}
16172              *            locals a number of locals to use to resolve certain
16173              *            dependencies
16174              */
16175             this.invoke = injector.invoke;
16176
16177             // init
16178
16179             // indicate via event
16180
16181
16182             /**
16183              * An event indicating that all plug-ins are loaded.
16184              * 
16185              * Use this event to fire other events to interested plug-ins
16186              * 
16187              * @memberOf Diagram
16188              * 
16189              * @event diagram.init
16190              * 
16191              * @example
16192              * 
16193              * eventBus.on('diagram.init', function() { eventBus.fire('my-custom-event', {
16194              * foo: 'BAR' }); });
16195              * 
16196              * @type {Object}
16197              */
16198             this.get('eventBus').fire('diagram.init');
16199         }
16200
16201         module.exports = Diagram;
16202
16203
16204         /**
16205          * Destroys the diagram
16206          * 
16207          * @method Diagram#destroy
16208          */
16209         Diagram.prototype.destroy = function() {
16210             this.get('eventBus').fire('diagram.destroy');
16211         };
16212     }, {
16213         "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16214         "didi": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js"
16215     }],
16216     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js": [function(require, module, exports) {
16217         'use strict';
16218
16219         var forEach = require('lodash/collection/forEach'),
16220             isFunction = require('lodash/lang/isFunction'),
16221             isArray = require('lodash/lang/isArray');
16222
16223
16224         /**
16225          * A utility that can be used to plug-in into the command execution for
16226          * extension and/or validation.
16227          * 
16228          * @param {EventBus}
16229          *            eventBus
16230          * 
16231          * @example
16232          * 
16233          * var inherits = require('inherits');
16234          * 
16235          * var CommandInterceptor =
16236          * require('diagram-js/lib/command/CommandInterceptor');
16237          * 
16238          * function CommandLogger(eventBus) { CommandInterceptor.call(this, eventBus);
16239          * 
16240          * this.preExecute(function(event) { console.log('command pre-execute', event);
16241          * }); }
16242          * 
16243          * inherits(CommandLogger, CommandInterceptor);
16244          * 
16245          */
16246         function CommandInterceptor(eventBus) {
16247             this._eventBus = eventBus;
16248         }
16249
16250         CommandInterceptor.$inject = ['eventBus'];
16251
16252         module.exports = CommandInterceptor;
16253
16254         function unwrapEvent(fn) {
16255             return function(event) {
16256                 return fn(event.context, event.command, event);
16257             };
16258         }
16259
16260         /**
16261          * Register an interceptor for a command execution
16262          * 
16263          * @param {String|Array
16264          *            <String>} [events] list of commands to register on
16265          * @param {String}
16266          *            [hook] command hook, i.e. preExecute, executed to listen on
16267          * @param {Function}
16268          *            handlerFn interceptor to be invoked with (event)
16269          * @param {Boolean}
16270          *            unwrap if true, unwrap the event and pass (context, command,
16271          *            event) to the listener instead
16272          */
16273         CommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {
16274
16275             if (isFunction(hook)) {
16276                 unwrap = handlerFn;
16277                 handlerFn = hook;
16278                 hook = null;
16279             }
16280
16281             if (!isFunction(handlerFn)) {
16282                 throw new Error('handlerFn must be a function');
16283             }
16284
16285             if (!isArray(events)) {
16286                 events = [events];
16287             }
16288
16289             var eventBus = this._eventBus;
16290
16291             forEach(events, function(event) {
16292                 // concat commandStack(.event)?(.hook)?
16293                 var fullEvent = ['commandStack', event, hook].filter(function(e) {
16294                     return e;
16295                 }).join('.');
16296
16297                 eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);
16298             });
16299         };
16300
16301
16302         var hooks = [
16303             'canExecute',
16304             'preExecute',
16305             'execute',
16306             'executed',
16307             'postExecute',
16308             'revert',
16309             'reverted'
16310         ];
16311
16312         /*
16313          * Install hook shortcuts
16314          * 
16315          * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
16316          * which will in term forward to CommandInterceptor#on.
16317          */
16318         forEach(hooks, function(hook) {
16319             CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {
16320                 if (isFunction(events)) {
16321                     unwrap = fn;
16322                     fn = events;
16323                     events = null;
16324                 }
16325
16326                 this.on(events, hook, fn, unwrap);
16327             };
16328         });
16329     }, {
16330         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
16331         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16332         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
16333     }],
16334     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js": [function(require, module, exports) {
16335         'use strict';
16336
16337         var unique = require('lodash/array/unique'),
16338             isArray = require('lodash/lang/isArray'),
16339             assign = require('lodash/object/assign');
16340
16341         var InternalEvent = require('../core/EventBus').Event;
16342
16343
16344         /**
16345          * A service that offers un- and redoable execution of commands.
16346          * 
16347          * The command stack is responsible for executing modeling actions in a un- and
16348          * redoable manner. To do this it delegates the actual command execution to
16349          * {@link CommandHandler}s.
16350          * 
16351          * Command handlers provide {@link CommandHandler#execute(ctx)} and
16352          * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
16353          * identified by a command context.
16354          * 
16355          *  ## Life-Cycle events
16356          * 
16357          * In the process the command stack fires a number of life-cycle events that
16358          * other components to participate in the command execution.
16359          *  * preExecute * execute * executed * postExecute * revert * reverted
16360          * 
16361          * A special event is used for validating, whether a command can be performed
16362          * prior to its execution.
16363          *  * canExecute
16364          * 
16365          * Each of the events is fired as `commandStack.{eventName}` and
16366          * `commandStack.{commandName}.{eventName}`, respectively. This gives components
16367          * fine grained control on where to hook into.
16368          * 
16369          * The event object fired transports `command`, the name of the command and
16370          * `context`, the command context.
16371          * 
16372          *  ## Creating Command Handlers
16373          * 
16374          * Command handlers should provide the {@link CommandHandler#execute(ctx)} and
16375          * {@link CommandHandler#revert(ctx)} methods to implement redoing and undoing
16376          * of a command. They must ensure undo is performed properly in order not to
16377          * break the undo chain.
16378          * 
16379          * Command handlers may execute other modeling operations (and thus commands) in
16380          * their `preExecute` and `postExecute` phases. The command stack will properly
16381          * group all commands together into a logical unit that may be re- and undone
16382          * atomically.
16383          * 
16384          * Command handlers must not execute other commands from within their core
16385          * implementation (`execute`, `revert`).
16386          * 
16387          *  ## Change Tracking
16388          * 
16389          * During the execution of the CommandStack it will keep track of all elements
16390          * that have been touched during the command's execution.
16391          * 
16392          * At the end of the CommandStack execution it will notify interested components
16393          * via an 'elements.changed' event with all the dirty elements.
16394          * 
16395          * The event can be picked up by components that are interested in the fact that
16396          * elements have been changed. One use case for this is updating their graphical
16397          * representation after moving / resizing or deletion.
16398          * 
16399          * 
16400          * @param {EventBus}
16401          *            eventBus
16402          * @param {Injector}
16403          *            injector
16404          */
16405         function CommandStack(eventBus, injector) {
16406             /**
16407              * A map of all registered command handlers.
16408              * 
16409              * @type {Object}
16410              */
16411             this._handlerMap = {};
16412
16413             /**
16414              * A stack containing all re/undoable actions on the diagram
16415              * 
16416              * @type {Array<Object>}
16417              */
16418             this._stack = [];
16419
16420             /**
16421              * The current index on the stack
16422              * 
16423              * @type {Number}
16424              */
16425             this._stackIdx = -1;
16426
16427             /**
16428              * Current active commandStack execution
16429              * 
16430              * @type {Object}
16431              */
16432             this._currentExecution = {
16433                 actions: [],
16434                 dirty: []
16435             };
16436
16437
16438             this._injector = injector;
16439             this._eventBus = eventBus;
16440
16441             this._uid = 1;
16442             this._selectedModel = selected_model;
16443             
16444             commandStackList.push(this);
16445         }
16446
16447         CommandStack.$inject = ['eventBus', 'injector'];
16448         
16449         module.exports = CommandStack;
16450
16451
16452         /**
16453          * Execute a command
16454          * 
16455          * @param {String}
16456          *            command the command to execute
16457          * @param {Object}
16458          *            context the environment to execute the command in
16459          */
16460         CommandStack.prototype.execute = function(command, context) {
16461             if (!command) {
16462                 throw new Error('command required');
16463             }
16464
16465             var action = {
16466                 command: command,
16467                 context: context
16468             };
16469
16470             this._pushAction(action);
16471             this._internalExecute(action);
16472             this._popAction(action);
16473         };
16474
16475
16476         /**
16477          * Ask whether a given command can be executed.
16478          * 
16479          * Implementors may hook into the mechanism on two ways:
16480          *  * in event listeners:
16481          * 
16482          * Users may prevent the execution via an event listener. It must prevent the
16483          * default action for `commandStack.(<command>.)canExecute` events.
16484          *  * in command handlers:
16485          * 
16486          * If the method {@link CommandHandler#canExecute} is implemented in a handler
16487          * it will be called to figure out whether the execution is allowed.
16488          * 
16489          * @param {String}
16490          *            command the command to execute
16491          * @param {Object}
16492          *            context the environment to execute the command in
16493          * 
16494          * @return {Boolean} true if the command can be executed
16495          */
16496         CommandStack.prototype.canExecute = function(command, context) {
16497
16498             var action = {
16499                 command: command,
16500                 context: context
16501             };
16502
16503             var handler = this._getHandler(command);
16504
16505             if (!handler) {
16506                 return false;
16507             }
16508
16509             var result = this._fire(command, 'canExecute', action);
16510
16511             // handler#canExecute will only be called if no listener
16512             // decided on a result already
16513             if (result === undefined && handler.canExecute) {
16514                 result = handler.canExecute(context);
16515             }
16516
16517             return result;
16518         };
16519
16520
16521         /**
16522          * Clear the command stack, erasing all undo / redo history
16523          */
16524         CommandStack.prototype.clear = function() {
16525             this._stack.length = 0;
16526             this._stackIdx = -1;
16527
16528             this._fire('changed');
16529         };
16530
16531
16532         /**
16533          * Undo last command(s)
16534          */
16535         CommandStack.prototype.undo = function() {
16536             var action = this._getUndoAction(),
16537                 next;
16538             if (action) {
16539                 this._pushAction(action);
16540
16541                 while (action) {
16542                     this._internalUndo(action);
16543                     next = this._getUndoAction();
16544
16545                     if (!next || next.id !== action.id) {
16546                         break;
16547                     }
16548
16549                     action = next;
16550                 }
16551
16552                 this._popAction();
16553             }
16554         };
16555
16556
16557         /**
16558          * Redo last command(s)
16559          */
16560         CommandStack.prototype.redo = function() {
16561             var action = this._getRedoAction(),
16562                 next;
16563
16564             if (action) {
16565                 this._pushAction(action);
16566
16567                 while (action) {
16568                     this._internalExecute(action, true);
16569                     next = this._getRedoAction();
16570
16571                     if (!next || next.id !== action.id) {
16572                         break;
16573                     }
16574
16575                     action = next;
16576                 }
16577
16578                 this._popAction();
16579             }
16580         };
16581
16582
16583         /**
16584          * Register a handler instance with the command stack
16585          * 
16586          * @param {String}
16587          *            command
16588          * @param {CommandHandler}
16589          *            handler
16590          */
16591         CommandStack.prototype.register = function(command, handler) {
16592             this._setHandler(command, handler);
16593         };
16594
16595
16596         /**
16597          * Register a handler type with the command stack by instantiating it and
16598          * injecting its dependencies.
16599          * 
16600          * @param {String}
16601          *            command
16602          * @param {Function}
16603          *            a constructor for a {@link CommandHandler}
16604          */
16605         CommandStack.prototype.registerHandler = function(command, handlerCls) {
16606
16607             if (!command || !handlerCls) {
16608                 throw new Error('command and handlerCls must be defined');
16609             }
16610
16611             var handler = this._injector.instantiate(handlerCls);
16612             this.register(command, handler);
16613         };
16614
16615         CommandStack.prototype.canUndo = function() {
16616             return !!this._getUndoAction();
16617         };
16618
16619         CommandStack.prototype.canRedo = function() {
16620             return !!this._getRedoAction();
16621         };
16622
16623         // //// stack access //////////////////////////////////////
16624
16625         CommandStack.prototype._getRedoAction = function() {
16626             return this._stack[this._stackIdx + 1];
16627         };
16628
16629
16630         CommandStack.prototype._getUndoAction = function() {
16631             return this._stack[this._stackIdx];
16632         };
16633
16634
16635         // //// internal functionality /////////////////////////////
16636
16637         CommandStack.prototype._internalUndo = function(action) {
16638             var command = action.command,
16639                 context = action.context;
16640
16641             var handler = this._getHandler(command);
16642
16643             this._fire(command, 'revert', action);
16644
16645             this._markDirty(handler.revert(context));
16646
16647             this._revertedAction(action);
16648
16649             this._fire(command, 'reverted', action);
16650         };
16651
16652
16653         CommandStack.prototype._fire = function(command, qualifier, event) {
16654             if (arguments.length < 3) {
16655                 event = qualifier;
16656                 qualifier = null;
16657             }
16658
16659             var names = qualifier ? [command + '.' + qualifier, qualifier] : [command],
16660                 i, name, result;
16661
16662             event = assign(new InternalEvent(), event);
16663
16664             for (i = 0; !!(name = names[i]); i++) {
16665                 result = this._eventBus.fire('commandStack.' + name, event);
16666
16667                 if (event.cancelBubble) {
16668                     break;
16669                 }
16670             }
16671
16672             return result;
16673         };
16674
16675         CommandStack.prototype._createId = function() {
16676             return this._uid++;
16677         };
16678
16679
16680         CommandStack.prototype._internalExecute = function(action, redo) {
16681             var command = action.command,
16682                 context = action.context;
16683
16684             var handler = this._getHandler(command);
16685
16686             if (!handler) {
16687                 throw new Error('no command handler registered for <' + command + '>');
16688             }
16689
16690             this._pushAction(action);
16691
16692             if (!redo) {
16693                 this._fire(command, 'preExecute', action);
16694
16695                 if (handler.preExecute) {
16696                     handler.preExecute(context);
16697                 }
16698             }
16699
16700             this._fire(command, 'execute', action);
16701
16702             // execute
16703             this._markDirty(handler.execute(context));
16704
16705             // log to stack
16706             this._executedAction(action, redo);
16707
16708             this._fire(command, 'executed', action);
16709
16710             if (!redo) {
16711                 if (handler.postExecute) {
16712                     handler.postExecute(context);
16713                 }
16714
16715                 this._fire(command, 'postExecute', action);
16716             }
16717
16718             this._popAction(action);
16719         };
16720
16721
16722         CommandStack.prototype._pushAction = function(action) {
16723
16724             var execution = this._currentExecution,
16725                 actions = execution.actions;
16726
16727             var baseAction = actions[0];
16728
16729             if (!action.id) {
16730                 action.id = (baseAction && baseAction.id) || this._createId();
16731             }
16732
16733             actions.push(action);
16734         };
16735
16736
16737         CommandStack.prototype._popAction = function() {
16738             var execution = this._currentExecution,
16739                 actions = execution.actions,
16740                 dirty = execution.dirty;
16741
16742             actions.pop();
16743
16744             if (!actions.length) {
16745                 this._eventBus.fire('elements.changed', {
16746                     elements: unique(dirty)
16747                 });
16748
16749                 dirty.length = 0;
16750
16751                 this._fire('changed');
16752             }
16753         };
16754
16755
16756         CommandStack.prototype._markDirty = function(elements) {
16757             var execution = this._currentExecution;
16758
16759             if (!elements) {
16760                 return;
16761             }
16762
16763             elements = isArray(elements) ? elements : [elements];
16764
16765             execution.dirty = execution.dirty.concat(elements);
16766         };
16767
16768
16769         CommandStack.prototype._executedAction = function(action, redo) {
16770             var stackIdx = ++this._stackIdx;
16771
16772             if (!redo) {
16773                 this._stack.splice(stackIdx, this._stack.length, action);
16774             }
16775         };
16776
16777
16778         CommandStack.prototype._revertedAction = function(action) {
16779             this._stackIdx--;
16780         };
16781
16782
16783         CommandStack.prototype._getHandler = function(command) {
16784             return this._handlerMap[command];
16785         };
16786
16787         CommandStack.prototype._setHandler = function(command, handler) {
16788             if (!command || !handler) {
16789                 throw new Error('command and handler required');
16790             }
16791
16792             if (this._handlerMap[command]) {
16793                 throw new Error('overriding handler for command <' + command + '>');
16794             }
16795
16796             this._handlerMap[command] = handler;
16797         };
16798
16799     }, {
16800         "../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
16801         "lodash/array/unique": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js",
16802         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16803         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
16804     }],
16805     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js": [function(require, module, exports) {
16806         module.exports = {
16807             __depends__: [require('../core')],
16808             commandStack: ['type', require('./CommandStack')]
16809         };
16810     }, {
16811         "../core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16812         "./CommandStack": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js"
16813     }],
16814     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js": [function(require, module, exports) {
16815         'use strict';
16816
16817         var isNumber = require('lodash/lang/isNumber'),
16818             assign = require('lodash/object/assign'),
16819             forEach = require('lodash/collection/forEach');
16820
16821         var Collections = require('../util/Collections');
16822
16823         var Snap = require('../../vendor/snapsvg');
16824
16825         function round(number, resolution) {
16826             return Math.round(number * resolution) / resolution;
16827         }
16828
16829         function ensurePx(number) {
16830             return isNumber(number) ? number + 'px' : number;
16831         }
16832
16833         /**
16834          * Creates a HTML container element for a SVG element with the given
16835          * configuration
16836          * 
16837          * @param {Object}
16838          *            options
16839          * @return {HTMLElement} the container element
16840          */
16841         function createContainer(options) {
16842
16843             options = assign({}, {
16844                 width: '100%',
16845                 height: '100%'
16846             }, options);
16847
16848             var container = options.container || document.body;
16849
16850             // create a <div> around the svg element with the respective size
16851             // this way we can always get the correct container size
16852             // (this is impossible for <svg> elements at the moment)
16853             var parent = document.createElement('div');
16854             parent.setAttribute('class', 'djs-container');
16855
16856             assign(parent.style, {
16857                 position: 'relative',
16858                 overflow: 'hidden',
16859                 width: ensurePx(options.width),
16860                 height: ensurePx(options.height)
16861             });
16862
16863             container.appendChild(parent);
16864
16865             return parent;
16866         }
16867
16868         function createGroup(parent, cls) {
16869             return parent.group().attr({
16870                 'class': cls
16871             });
16872         }
16873
16874         var BASE_LAYER = 'base';
16875
16876
16877         /**
16878          * The main drawing canvas.
16879          * 
16880          * @class
16881          * @constructor
16882          * 
16883          * @emits Canvas#canvas.init
16884          * 
16885          * @param {Object}
16886          *            config
16887          * @param {EventBus}
16888          *            eventBus
16889          * @param {GraphicsFactory}
16890          *            graphicsFactory
16891          * @param {ElementRegistry}
16892          *            elementRegistry
16893          */
16894         function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
16895             this._eventBus = eventBus;
16896             this._elementRegistry = elementRegistry;
16897             this._graphicsFactory = graphicsFactory;
16898
16899             this._init(config || {});
16900         }
16901
16902         Canvas.$inject = ['config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry'];
16903
16904         module.exports = Canvas;
16905
16906
16907         Canvas.prototype._init = function(config) {
16908
16909             // Creates a <svg> element that is wrapped into a <div>.
16910             // This way we are always able to correctly figure out the size of the svg
16911             // element
16912             // by querying the parent node.
16913             //
16914             // (It is not possible to get the size of a svg element cross browser @
16915             // 2014-04-01)
16916             //
16917             // <div class="djs-container" style="width: {desired-width}, height:
16918             // {desired-height}">
16919             // <svg width="100%" height="100%">
16920             // ...
16921             // </svg>
16922             // </div>
16923
16924             // html container
16925             var eventBus = this._eventBus,
16926
16927                 container = createContainer(config),
16928                 svg = Snap.createSnapAt('100%', '100%', container),
16929                 viewport = createGroup(svg, 'viewport'),
16930
16931                 self = this;
16932
16933             this._container = container;
16934             this._svg = svg;
16935             this._viewport = viewport;
16936             this._layers = {};
16937
16938             eventBus.on('diagram.init', function(event) {
16939
16940                 /**
16941                  * An event indicating that the canvas is ready to be drawn on.
16942                  * 
16943                  * @memberOf Canvas
16944                  * 
16945                  * @event canvas.init
16946                  * 
16947                  * @type {Object}
16948                  * @property {Snap<SVGSVGElement>} svg the created svg element
16949                  * @property {Snap<SVGGroup>} viewport the direct parent of diagram
16950                  *           elements and shapes
16951                  */
16952                 eventBus.fire('canvas.init', {
16953                     svg: svg,
16954                     viewport: viewport
16955                 });
16956             });
16957
16958             eventBus.on('diagram.destroy', function() {
16959
16960                 var parent = self._container.parentNode;
16961
16962                 if (parent) {
16963                     parent.removeChild(container);
16964                 }
16965
16966                 eventBus.fire('canvas.destroy', {
16967                     svg: self._svg,
16968                     viewport: self._viewport
16969                 });
16970
16971                 self._svg.remove();
16972
16973                 self._svg = self._container = self._layers = self._viewport = null;
16974             });
16975
16976         };
16977
16978         /**
16979          * Returns the default layer on which all elements are drawn.
16980          * 
16981          * @returns {Snap<SVGGroup>}
16982          */
16983         Canvas.prototype.getDefaultLayer = function() {
16984             return this.getLayer(BASE_LAYER);
16985         };
16986
16987         /**
16988          * Returns a layer that is used to draw elements or annotations on it.
16989          * 
16990          * @param {String}
16991          *            name
16992          * 
16993          * @returns {Snap<SVGGroup>}
16994          */
16995         Canvas.prototype.getLayer = function(name) {
16996
16997             if (!name) {
16998                 throw new Error('must specify a name');
16999             }
17000
17001             var layer = this._layers[name];
17002             if (!layer) {
17003                 layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
17004             }
17005
17006             return layer;
17007         };
17008
17009
17010         /**
17011          * Returns the html element that encloses the drawing canvas.
17012          * 
17013          * @return {DOMNode}
17014          */
17015         Canvas.prototype.getContainer = function() {
17016             return this._container;
17017         };
17018
17019
17020         // ///////////// markers ///////////////////////////////////
17021
17022         Canvas.prototype._updateMarker = function(element, marker, add) {
17023             var container;
17024
17025             if (!element.id) {
17026                 element = this._elementRegistry.get(element);
17027             }
17028
17029             // we need to access all
17030             container = this._elementRegistry._elements[element.id];
17031
17032             if (!container) {
17033                 return;
17034             }
17035
17036             forEach([container.gfx, container.secondaryGfx], function(gfx) {
17037                 if (gfx) {
17038                     // invoke either addClass or removeClass based on mode
17039                     gfx[add ? 'addClass' : 'removeClass'](marker);
17040                 }
17041             });
17042
17043             /**
17044              * An event indicating that a marker has been updated for an element
17045              * 
17046              * @event element.marker.update
17047              * @type {Object}
17048              * @property {djs.model.Element} element the shape
17049              * @property {Object} gfx the graphical representation of the shape
17050              * @property {String} marker
17051              * @property {Boolean} add true if the marker was added, false if it got
17052              *           removed
17053              */
17054             this._eventBus.fire('element.marker.update', {
17055                 element: element,
17056                 gfx: container.gfx,
17057                 marker: marker,
17058                 add: !!add
17059             });
17060         };
17061
17062
17063         /**
17064          * Adds a marker to an element (basically a css class).
17065          * 
17066          * Fires the element.marker.update event, making it possible to integrate
17067          * extension into the marker life-cycle, too.
17068          * 
17069          * @example canvas.addMarker('foo', 'some-marker');
17070          * 
17071          * var fooGfx = canvas.getGraphics('foo');
17072          * 
17073          * fooGfx; // <g class="... some-marker"> ... </g>
17074          * 
17075          * @param {String|djs.model.Base}
17076          *            element
17077          * @param {String}
17078          *            marker
17079          */
17080         Canvas.prototype.addMarker = function(element, marker) {
17081             this._updateMarker(element, marker, true);
17082         };
17083
17084
17085         /**
17086          * Remove a marker from an element.
17087          * 
17088          * Fires the element.marker.update event, making it possible to integrate
17089          * extension into the marker life-cycle, too.
17090          * 
17091          * @param {String|djs.model.Base}
17092          *            element
17093          * @param {String}
17094          *            marker
17095          */
17096         Canvas.prototype.removeMarker = function(element, marker) {
17097             this._updateMarker(element, marker, false);
17098         };
17099
17100         /**
17101          * Check the existence of a marker on element.
17102          * 
17103          * @param {String|djs.model.Base}
17104          *            element
17105          * @param {String}
17106          *            marker
17107          */
17108         Canvas.prototype.hasMarker = function(element, marker) {
17109             if (!element.id) {
17110                 element = this._elementRegistry.get(element);
17111             }
17112
17113             var gfx = this.getGraphics(element);
17114
17115             return gfx && gfx.hasClass(marker);
17116         };
17117
17118         /**
17119          * Toggles a marker on an element.
17120          * 
17121          * Fires the element.marker.update event, making it possible to integrate
17122          * extension into the marker life-cycle, too.
17123          * 
17124          * @param {String|djs.model.Base}
17125          *            element
17126          * @param {String}
17127          *            marker
17128          */
17129         Canvas.prototype.toggleMarker = function(element, marker) {
17130             if (this.hasMarker(element, marker)) {
17131                 this.removeMarker(element, marker);
17132             } else {
17133                 this.addMarker(element, marker);
17134             }
17135         };
17136
17137         Canvas.prototype.getRootElement = function() {
17138             if (!this._rootElement) {
17139                 this.setRootElement({
17140                     id: '__implicitroot'
17141                 });
17142             }
17143
17144             return this._rootElement;
17145         };
17146
17147
17148
17149         // ////////////// root element handling ///////////////////////////
17150
17151         /**
17152          * Sets a given element as the new root element for the canvas and returns the
17153          * new root element.
17154          * 
17155          * @param {Object|djs.model.Root}
17156          *            element
17157          * @param {Boolean}
17158          *            [override] whether to override the current root element, if any
17159          * 
17160          * @return {Object|djs.model.Root} new root element
17161          */
17162         Canvas.prototype.setRootElement = function(element, override) {
17163
17164             this._ensureValidId(element);
17165
17166             var oldRoot = this._rootElement,
17167                 elementRegistry = this._elementRegistry,
17168                 eventBus = this._eventBus;
17169
17170             if (oldRoot) {
17171                 if (!override) {
17172                     throw new Error('rootElement already set, need to specify override');
17173                 }
17174
17175                 // simulate element remove event sequence
17176                 eventBus.fire('root.remove', {
17177                     element: oldRoot
17178                 });
17179                 eventBus.fire('root.removed', {
17180                     element: oldRoot
17181                 });
17182
17183                 elementRegistry.remove(oldRoot);
17184             }
17185
17186             var gfx = this.getDefaultLayer();
17187
17188             // resemble element add event sequence
17189             eventBus.fire('root.add', {
17190                 element: element
17191             });
17192
17193             elementRegistry.add(element, gfx, this._svg);
17194
17195             eventBus.fire('root.added', {
17196                 element: element,
17197                 gfx: gfx
17198             });
17199
17200             this._rootElement = element;
17201
17202             return element;
17203         };
17204
17205
17206
17207         // /////////// add functionality ///////////////////////////////
17208
17209         Canvas.prototype._ensureValidId = function(element) {
17210             if (!element.id) {
17211                 throw new Error('element must have an id');
17212             }
17213
17214             if (this._elementRegistry.get(element.id)) {
17215                 throw new Error('element with id ' + element.id + ' already exists');
17216             }
17217         };
17218
17219         Canvas.prototype._setParent = function(element, parent) {
17220             Collections.add(parent.children, element);
17221             element.parent = parent;
17222         };
17223
17224         /**
17225          * Adds an element to the canvas.
17226          * 
17227          * This wires the parent <-> child relationship between the element and a
17228          * explicitly specified parent or an implicit root element.
17229          * 
17230          * During add it emits the events
17231          *  * <{type}.add> (element, parent) * <{type}.added> (element, gfx)
17232          * 
17233          * Extensions may hook into these events to perform their magic.
17234          * 
17235          * @param {String}
17236          *            type
17237          * @param {Object|djs.model.Base}
17238          *            element
17239          * @param {Object|djs.model.Base}
17240          *            [parent]
17241          * 
17242          * @return {Object|djs.model.Base} the added element
17243          */
17244         Canvas.prototype._addElement = function(type, element, parent) {
17245
17246             parent = parent || this.getRootElement();
17247
17248             var eventBus = this._eventBus,
17249                 graphicsFactory = this._graphicsFactory;
17250
17251             this._ensureValidId(element);
17252
17253             eventBus.fire(type + '.add', {
17254                 element: element,
17255                 parent: parent
17256             });
17257
17258             this._setParent(element, parent);
17259
17260             // create graphics
17261             var gfx = graphicsFactory.create(type, element);
17262
17263             this._elementRegistry.add(element, gfx);
17264
17265             // update its visual
17266             graphicsFactory.update(type, element, gfx);
17267
17268             eventBus.fire(type + '.added', {
17269                 element: element,
17270                 gfx: gfx
17271             });
17272
17273             return element;
17274         };
17275
17276         /**
17277          * Adds a shape to the canvas
17278          * 
17279          * @param {Object|djs.model.Shape}
17280          *            shape to add to the diagram
17281          * @param {djs.model.Base}
17282          *            [parent]
17283          * 
17284          * @return {djs.model.Shape} the added shape
17285          */
17286         Canvas.prototype.addShape = function(shape, parent) {
17287             return this._addElement('shape', shape, parent);
17288         };
17289
17290         /**
17291          * Adds a connection to the canvas
17292          * 
17293          * @param {Object|djs.model.Connection}
17294          *            connection to add to the diagram
17295          * @param {djs.model.Base}
17296          *            [parent]
17297          * 
17298          * @return {djs.model.Connection} the added connection
17299          */
17300         Canvas.prototype.addConnection = function(connection, parent) {
17301             return this._addElement('connection', connection, parent);
17302         };
17303
17304
17305         /**
17306          * Internal remove element
17307          */
17308         Canvas.prototype._removeElement = function(element, type) {
17309             console.log(element);
17310             var elementRegistry = this._elementRegistry,
17311                 graphicsFactory = this._graphicsFactory,
17312                 eventBus = this._eventBus;
17313
17314             element = elementRegistry.get(element.id || element);
17315
17316             if (!element) {
17317                 // element was removed already
17318                 return;
17319             }
17320
17321             eventBus.fire(type + '.remove', {
17322                 element: element
17323             });
17324
17325             graphicsFactory.remove(element);
17326
17327             // unset parent <-> child relationship
17328             Collections.remove(element.parent && element.parent.children, element);
17329             element.parent = null;
17330
17331             eventBus.fire(type + '.removed', {
17332                 element: element
17333             });
17334
17335             elementRegistry.remove(element);
17336
17337             return element;
17338         };
17339
17340
17341         /**
17342          * Removes a shape from the canvas
17343          * 
17344          * @param {String|djs.model.Shape}
17345          *            shape or shape id to be removed
17346          * 
17347          * @return {djs.model.Shape} the removed shape
17348          */
17349         Canvas.prototype.removeShape = function(shape) {
17350
17351             /**
17352              * An event indicating that a shape is about to be removed from the canvas.
17353              * 
17354              * @memberOf Canvas
17355              * 
17356              * @event shape.remove
17357              * @type {Object}
17358              * @property {djs.model.Shape} element the shape descriptor
17359              * @property {Object} gfx the graphical representation of the shape
17360              */
17361
17362             /**
17363              * An event indicating that a shape has been removed from the canvas.
17364              * 
17365              * @memberOf Canvas
17366              * 
17367              * @event shape.removed
17368              * @type {Object}
17369              * @property {djs.model.Shape} element the shape descriptor
17370              * @property {Object} gfx the graphical representation of the shape
17371              */
17372             return this._removeElement(shape, 'shape');
17373         };
17374
17375
17376         /**
17377          * Removes a connection from the canvas
17378          * 
17379          * @param {String|djs.model.Connection}
17380          *            connection or connection id to be removed
17381          * 
17382          * @return {djs.model.Connection} the removed connection
17383          */
17384         Canvas.prototype.removeConnection = function(connection) {
17385
17386             /**
17387              * An event indicating that a connection is about to be removed from the
17388              * canvas.
17389              * 
17390              * @memberOf Canvas
17391              * 
17392              * @event connection.remove
17393              * @type {Object}
17394              * @property {djs.model.Connection} element the connection descriptor
17395              * @property {Object} gfx the graphical representation of the connection
17396              */
17397
17398             /**
17399              * An event indicating that a connection has been removed from the canvas.
17400              * 
17401              * @memberOf Canvas
17402              * 
17403              * @event connection.removed
17404              * @type {Object}
17405              * @property {djs.model.Connection} element the connection descriptor
17406              * @property {Object} gfx the graphical representation of the connection
17407              */
17408             return this._removeElement(connection, 'connection');
17409         };
17410
17411
17412         /**
17413          * Sends a shape to the front.
17414          * 
17415          * This method takes parent / child relationships between shapes into account
17416          * and makes sure that children are properly handled, too.
17417          * 
17418          * @param {djs.model.Shape}
17419          *            shape descriptor of the shape to be sent to front
17420          * @param {boolean}
17421          *            [bubble=true] whether to send parent shapes to front, too
17422          */
17423         Canvas.prototype.sendToFront = function(shape, bubble) {
17424
17425             if (bubble !== false) {
17426                 bubble = true;
17427             }
17428
17429             if (bubble && shape.parent) {
17430                 this.sendToFront(shape.parent);
17431             }
17432
17433             forEach(shape.children, function(child) {
17434                 this.sendToFront(child, false);
17435             }, this);
17436
17437             var gfx = this.getGraphics(shape),
17438                 gfxParent = gfx.parent();
17439
17440             gfx.remove().appendTo(gfxParent);
17441         };
17442
17443
17444         /**
17445          * Return the graphical object underlaying a certain diagram element
17446          * 
17447          * @param {String|djs.model.Base}
17448          *            element descriptor of the element
17449          * @param {Boolean}
17450          *            [secondary=false] whether to return the secondary connected
17451          *            element
17452          * 
17453          * @return {SVGElement}
17454          */
17455         Canvas.prototype.getGraphics = function(element, secondary) {
17456             return this._elementRegistry.getGraphics(element, secondary);
17457         };
17458
17459
17460         Canvas.prototype._fireViewboxChange = function() {
17461             this._eventBus.fire('canvas.viewbox.changed', {
17462                 viewbox: this.viewbox(false)
17463             });
17464         };
17465
17466
17467         /**
17468          * Gets or sets the view box of the canvas, i.e. the area that is currently
17469          * displayed
17470          * 
17471          * @param {Object}
17472          *            [box] the new view box to set
17473          * @param {Number}
17474          *            box.x the top left X coordinate of the canvas visible in view box
17475          * @param {Number}
17476          *            box.y the top left Y coordinate of the canvas visible in view box
17477          * @param {Number}
17478          *            box.width the visible width
17479          * @param {Number}
17480          *            box.height
17481          * 
17482          * @example
17483          * 
17484          * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
17485          *  // sets the visible area of the diagram to (100|100) -> (600|100) // and and
17486          * scales it according to the diagram width
17487          * 
17488          * @return {Object} the current view box
17489          */
17490         Canvas.prototype.viewbox = function(box) {
17491
17492             if (box === undefined && this._cachedViewbox) {
17493                 return this._cachedViewbox;
17494             }
17495
17496             var viewport = this._viewport,
17497                 innerBox,
17498                 outerBox = this.getSize(),
17499                 matrix,
17500                 scale,
17501                 x, y;
17502
17503             if (!box) {
17504                 // compute the inner box based on the
17505                 // diagrams default layer. This allows us to exclude
17506                 // external components, such as overlays
17507                 innerBox = this.getDefaultLayer().getBBox(true);
17508
17509                 matrix = viewport.transform().localMatrix;
17510                 scale = round(matrix.a, 1000);
17511
17512                 x = round(-matrix.e || 0, 1000);
17513                 y = round(-matrix.f || 0, 1000);
17514
17515                 box = this._cachedViewbox = {
17516                     x: x ? x / scale : 0,
17517                     y: y ? y / scale : 0,
17518                     width: outerBox.width / scale,
17519                     height: outerBox.height / scale,
17520                     scale: scale,
17521                     inner: {
17522                         width: innerBox.width,
17523                         height: innerBox.height,
17524                         x: innerBox.x,
17525                         y: innerBox.y
17526                     },
17527                     outer: outerBox
17528                 };
17529
17530                 return box;
17531             } else {
17532                 scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
17533
17534                 matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
17535                 viewport.transform(matrix);
17536
17537                 this._fireViewboxChange();
17538             }
17539
17540             return box;
17541         };
17542
17543
17544         /**
17545          * Gets or sets the scroll of the canvas.
17546          * 
17547          * @param {Object}
17548          *            [delta] the new scroll to apply.
17549          * 
17550          * @param {Number}
17551          *            [delta.dx]
17552          * @param {Number}
17553          *            [delta.dy]
17554          */
17555         Canvas.prototype.scroll = function(delta) {
17556             var node = this._viewport.node;
17557             var matrix = node.getCTM();
17558
17559             if (delta) {
17560                 delta = assign({
17561                     dx: 0,
17562                     dy: 0
17563                 }, delta || {});
17564
17565                 matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
17566
17567                 setCTM(node, matrix);
17568
17569                 this._fireViewboxChange();
17570             }
17571
17572             return {
17573                 x: matrix.e,
17574                 y: matrix.f
17575             };
17576         };
17577
17578
17579         /**
17580          * Gets or sets the current zoom of the canvas, optionally zooming to the
17581          * specified position.
17582          * 
17583          * @param {String|Number}
17584          *            [newScale] the new zoom level, either a number, i.e. 0.9, or
17585          *            `fit-viewport` to adjust the size to fit the current viewport
17586          * @param {String|Point}
17587          *            [center] the reference point { x: .., y: ..} to zoom to, 'auto' to
17588          *            zoom into mid or null
17589          * 
17590          * @return {Number} the current scale
17591          */
17592         Canvas.prototype.zoom = function(newScale, center) {
17593
17594             if (newScale === 'fit-viewport') {
17595                 return this._fitViewport(center);
17596             }
17597
17598             var vbox = this.viewbox();
17599
17600             if (newScale === undefined) {
17601                 return vbox.scale;
17602             }
17603
17604             var outer = vbox.outer;
17605
17606             if (center === 'auto') {
17607                 center = {
17608                     x: outer.width / 2,
17609                     y: outer.height / 2
17610                 };
17611             }
17612
17613             var matrix = this._setZoom(newScale, center);
17614
17615             this._fireViewboxChange();
17616
17617             return round(matrix.a, 1000);
17618         };
17619
17620         function setCTM(node, m) {
17621             var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
17622             node.setAttribute('transform', mstr);
17623         }
17624
17625         Canvas.prototype._fitViewport = function(center) {
17626
17627             var vbox = this.viewbox(),
17628                 outer = vbox.outer,
17629                 inner = vbox.inner,
17630                 newScale,
17631                 newViewbox;
17632
17633             // display the complete diagram without zooming in.
17634             // instead of relying on internal zoom, we perform a
17635             // hard reset on the canvas viewbox to realize this
17636             //
17637             // if diagram does not need to be zoomed in, we focus it around
17638             // the diagram origin instead
17639
17640             if (inner.x >= 0 &&
17641                 inner.y >= 0 &&
17642                 inner.x + inner.width <= outer.width &&
17643                 inner.y + inner.height <= outer.height &&
17644                 !center) {
17645
17646                 newViewbox = {
17647                     x: 0,
17648                     y: 0,
17649                     width: Math.max(inner.width + inner.x, outer.width),
17650                     height: Math.max(inner.height + inner.y, outer.height)
17651                 };
17652             } else {
17653
17654                 newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
17655                 newViewbox = {
17656                     x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
17657                     y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
17658                     width: outer.width / newScale,
17659                     height: outer.height / newScale
17660                 };
17661             }
17662
17663             this.viewbox(newViewbox);
17664
17665             return this.viewbox().scale;
17666         };
17667
17668
17669         Canvas.prototype._setZoom = function(scale, center) {
17670
17671             var svg = this._svg.node,
17672                 viewport = this._viewport.node;
17673
17674             var matrix = svg.createSVGMatrix();
17675             var point = svg.createSVGPoint();
17676
17677             var centerPoint,
17678                 originalPoint,
17679                 currentMatrix,
17680                 scaleMatrix,
17681                 newMatrix;
17682
17683             currentMatrix = viewport.getCTM();
17684
17685
17686             var currentScale = currentMatrix.a;
17687
17688             if (center) {
17689                 centerPoint = assign(point, center);
17690
17691                 // revert applied viewport transformations
17692                 originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
17693
17694                 // create scale matrix
17695                 scaleMatrix = matrix
17696                     .translate(originalPoint.x, originalPoint.y)
17697                     .scale(1 / currentScale * scale)
17698                     .translate(-originalPoint.x, -originalPoint.y);
17699
17700                 newMatrix = currentMatrix.multiply(scaleMatrix);
17701             } else {
17702                 newMatrix = matrix.scale(scale);
17703             }
17704
17705             setCTM(this._viewport.node, newMatrix);
17706
17707             return newMatrix;
17708         };
17709
17710
17711         /**
17712          * Returns the size of the canvas
17713          * 
17714          * @return {Dimensions}
17715          */
17716         Canvas.prototype.getSize = function() {
17717             return {
17718                 width: this._container.clientWidth,
17719                 height: this._container.clientHeight
17720             };
17721         };
17722
17723
17724         /**
17725          * Return the absolute bounding box for the given element
17726          * 
17727          * The absolute bounding box may be used to display overlays in the callers
17728          * (browser) coordinate system rather than the zoomed in/out canvas coordinates.
17729          * 
17730          * @param {ElementDescriptor}
17731          *            element
17732          * @return {Bounds} the absolute bounding box
17733          */
17734         Canvas.prototype.getAbsoluteBBox = function(element) {
17735             var vbox = this.viewbox();
17736             var bbox;
17737
17738             // connection
17739             // use svg bbox
17740             if (element.waypoints) {
17741                 var gfx = this.getGraphics(element);
17742
17743                 var transformBBox = gfx.getBBox(true);
17744                 bbox = gfx.getBBox();
17745
17746                 bbox.x -= transformBBox.x;
17747                 bbox.y -= transformBBox.y;
17748
17749                 bbox.width += 2 * transformBBox.x;
17750                 bbox.height += 2 * transformBBox.y;
17751             }
17752             // shapes
17753             // use data
17754             else {
17755                 bbox = element;
17756             }
17757
17758             var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
17759             var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
17760
17761             var width = bbox.width * vbox.scale;
17762             var height = bbox.height * vbox.scale;
17763
17764             return {
17765                 x: x,
17766                 y: y,
17767                 width: width,
17768                 height: height
17769             };
17770         };
17771
17772     }, {
17773         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
17774         "../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
17775         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
17776         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
17777         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
17778     }],
17779     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js": [function(require, module, exports) {
17780         'use strict';
17781
17782         var Model = require('../model');
17783
17784
17785         /**
17786          * A factory for diagram-js shapes
17787          */
17788         function ElementFactory() {
17789             this._uid = 12;
17790         }
17791
17792         module.exports = ElementFactory;
17793
17794
17795         ElementFactory.prototype.createRoot = function(attrs) {
17796             return this.create('root', attrs);
17797         };
17798
17799         ElementFactory.prototype.createLabel = function(attrs) {
17800             return this.create('label', attrs);
17801         };
17802
17803         ElementFactory.prototype.createShape = function(attrs) {
17804             // alert("In createShape");
17805             return this.create('shape', attrs);
17806         };
17807
17808         ElementFactory.prototype.createConnection = function(attrs) {
17809             return this.create('connection', attrs);
17810         };
17811
17812         /**
17813          * Create a model element with the given type and a number of pre-set
17814          * attributes.
17815          * 
17816          * @param {String}
17817          *            type
17818          * @param {Object}
17819          *            attrs
17820          * @return {djs.model.Base} the newly created model instance
17821          */
17822         ElementFactory.prototype.create = function(type, attrs) {
17823             // alert("In create");
17824
17825             attrs = attrs || {};
17826
17827             if (!attrs.id) {
17828                 attrs.id = type + '_' + (this._uid++);
17829             }
17830
17831             return Model.create(type, attrs);
17832         };
17833     }, {
17834         "../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js"
17835     }],
17836     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js": [function(require, module, exports) {
17837         'use strict';
17838
17839         var ELEMENT_ID = 'data-element-id';
17840
17841
17842         /**
17843          * @class
17844          * 
17845          * A registry that keeps track of all shapes in the diagram.
17846          */
17847         function ElementRegistry() {
17848             this._elements = {};
17849         }
17850
17851         module.exports = ElementRegistry;
17852
17853         /**
17854          * Register a pair of (element, gfx, (secondaryGfx)).
17855          * 
17856          * @param {djs.model.Base}
17857          *            element
17858          * @param {Snap
17859          *            <SVGElement>} gfx
17860          * @param {Snap
17861          *            <SVGElement>} [secondaryGfx] optional other element to register,
17862          *            too
17863          */
17864         ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
17865
17866             var id = element.id;
17867
17868             this._validateId(id);
17869
17870             // associate dom node with element
17871             gfx.attr(ELEMENT_ID, id);
17872
17873             if (secondaryGfx) {
17874                 secondaryGfx.attr(ELEMENT_ID, id);
17875             }
17876
17877             this._elements[id] = {
17878                 element: element,
17879                 gfx: gfx,
17880                 secondaryGfx: secondaryGfx
17881             };
17882         };
17883
17884         /**
17885          * Removes an element from the registry.
17886          * 
17887          * @param {djs.model.Base}
17888          *            element
17889          */
17890         ElementRegistry.prototype.remove = function(element) {
17891             var elements = this._elements,
17892                 id = element.id || element,
17893                 container = id && elements[id];
17894
17895             if (container) {
17896
17897                 // unset element id on gfx
17898                 container.gfx.attr(ELEMENT_ID, null);
17899
17900                 if (container.secondaryGfx) {
17901                     container.secondaryGfx.attr(ELEMENT_ID, null);
17902                 }
17903
17904                 delete elements[id];
17905             }
17906         };
17907
17908         /**
17909          * Update the id of an element
17910          * 
17911          * @param {djs.model.Base}
17912          *            element
17913          * @param {String}
17914          *            newId
17915          */
17916         ElementRegistry.prototype.updateId = function(element, newId) {
17917
17918             this._validateId(newId);
17919
17920             if (typeof element === 'string') {
17921                 element = this.get(element);
17922             }
17923
17924             var gfx = this.getGraphics(element),
17925                 secondaryGfx = this.getGraphics(element, true);
17926
17927             this.remove(element);
17928
17929             element.id = newId;
17930
17931             this.add(element, gfx, secondaryGfx);
17932         };
17933
17934         /**
17935          * Return the model element for a given id or graphics.
17936          * 
17937          * @example
17938          * 
17939          * elementRegistry.get('SomeElementId_1'); elementRegistry.get(gfx);
17940          * 
17941          * 
17942          * @param {String|SVGElement}
17943          *            filter for selecting the element
17944          * 
17945          * @return {djs.model.Base}
17946          */
17947         ElementRegistry.prototype.get = function(filter) {
17948             var id;
17949
17950             if (typeof filter === 'string') {
17951                 id = filter;
17952             } else {
17953                 id = filter && filter.attr(ELEMENT_ID);
17954             }
17955
17956             var container = this._elements[id];
17957             return container && container.element;
17958         };
17959
17960         /**
17961          * Return all elements that match a given filter function.
17962          * 
17963          * @param {Function}
17964          *            fn
17965          * 
17966          * @return {Array<djs.model.Base>}
17967          */
17968         ElementRegistry.prototype.filter = function(fn) {
17969
17970             var filtered = [];
17971
17972             this.forEach(function(element, gfx) {
17973                 if (fn(element, gfx)) {
17974                     filtered.push(element);
17975                 }
17976             });
17977
17978             return filtered;
17979         };
17980
17981         /**
17982          * Iterate over all diagram elements.
17983          * 
17984          * @param {Function}
17985          *            fn
17986          */
17987         ElementRegistry.prototype.forEach = function(fn) {
17988
17989             var map = this._elements;
17990
17991             Object.keys(map).forEach(function(id) {
17992                 var container = map[id],
17993                     element = container.element,
17994                     gfx = container.gfx;
17995
17996                 return fn(element, gfx);
17997             });
17998         };
17999
18000         /**
18001          * Return the graphical representation of an element or its id.
18002          * 
18003          * @example elementRegistry.getGraphics('SomeElementId_1');
18004          *          elementRegistry.getGraphics(rootElement); // <g ...>
18005          * 
18006          * elementRegistry.getGraphics(rootElement, true); // <svg ...>
18007          * 
18008          * 
18009          * @param {String|djs.model.Base}
18010          *            filter
18011          * @param {Boolean}
18012          *            [secondary=false] whether to return the secondary connected
18013          *            element
18014          * 
18015          * @return {SVGElement}
18016          */
18017         ElementRegistry.prototype.getGraphics = function(filter, secondary) {
18018             var id = filter.id || filter;
18019
18020             var container = this._elements[id];
18021             return container && (secondary ? container.secondaryGfx : container.gfx);
18022         };
18023
18024         /**
18025          * Validate the suitability of the given id and signals a problem with an
18026          * exception.
18027          * 
18028          * @param {String}
18029          *            id
18030          * 
18031          * @throws {Error}
18032          *             if id is empty or already assigned
18033          */
18034         ElementRegistry.prototype._validateId = function(id) {
18035             if (!id) {
18036                 throw new Error('element must have an id');
18037             }
18038
18039             if (this._elements[id]) {
18040                 throw new Error('element with id ' + id + ' already added');
18041             }
18042         };
18043     }, {}],
18044     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js": [function(require, module, exports) {
18045         'use strict';
18046
18047         var isFunction = require('lodash/lang/isFunction'),
18048             isArray = require('lodash/lang/isArray'),
18049             isNumber = require('lodash/lang/isNumber'),
18050             assign = require('lodash/object/assign');
18051
18052         var DEFAULT_PRIORITY = 1000;
18053
18054
18055         /**
18056          * A general purpose event bus.
18057          * 
18058          * This component is used to communicate across a diagram instance. Other parts
18059          * of a diagram can use it to listen to and broadcast events.
18060          * 
18061          *  ## Registering for Events
18062          * 
18063          * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
18064          * methods to register for events. {@link EventBus#off} can be used to remove
18065          * event registrations. Listeners receive an instance of {@link Event} as the
18066          * first argument. It allows them to hook into the event execution.
18067          * 
18068          * ```javascript
18069          *  // listen for event eventBus.on('foo', function(event) {
18070          *  // access event type event.type; // 'foo'
18071          *  // stop propagation to other listeners event.stopPropagation();
18072          *  // prevent event default event.preventDefault(); });
18073          *  // listen for event with custom payload eventBus.on('bar', function(event,
18074          * payload) { console.log(payload); });
18075          *  // listen for event returning value eventBus.on('foobar', function(event) {
18076          *  // stop event propagation + prevent default return false;
18077          *  // stop event propagation + return custom result return { complex:
18078          * 'listening result' }; });
18079          * 
18080          *  // listen with custom priority (default=1000, higher is better)
18081          * eventBus.on('priorityfoo', 1500, function(event) { console.log('invoked
18082          * first!'); }); ```
18083          * 
18084          *  ## Emitting Events
18085          * 
18086          * Events can be emitted via the event bus using {@link EventBus#fire}.
18087          * 
18088          * ```javascript
18089          *  // false indicates that the default action // was prevented by listeners if
18090          * (eventBus.fire('foo') === false) { console.log('default has been
18091          * prevented!'); };
18092          * 
18093          *  // custom args + return value listener eventBus.on('sum', function(event, a,
18094          * b) { return a + b; });
18095          *  // you can pass custom arguments + retrieve result values. var sum =
18096          * eventBus.fire('sum', 1, 2); console.log(sum); // 3 ```
18097          */
18098         function EventBus() {
18099             this._listeners = {};
18100
18101             // cleanup on destroy
18102
18103             var self = this;
18104
18105             // destroy on lowest priority to allow
18106             // message passing until the bitter end
18107             this.on('diagram.destroy', 1, function() {
18108                 self._listeners = null;
18109             });
18110         }
18111
18112         module.exports = EventBus;
18113
18114
18115         /**
18116          * Register an event listener for events with the given name.
18117          * 
18118          * The callback will be invoked with `event, ...additionalArguments` that have
18119          * been passed to {@link EventBus#fire}.
18120          * 
18121          * Returning false from a listener will prevent the events default action (if
18122          * any is specified). To stop an event from being processed further in other
18123          * listeners execute {@link Event#stopPropagation}.
18124          * 
18125          * Returning anything but `undefined` from a listener will stop the listener
18126          * propagation.
18127          * 
18128          * @param {String|Array
18129          *            <String>} events
18130          * @param {Number}
18131          *            [priority=1000] the priority in which this listener is called,
18132          *            larger is higher
18133          * @param {Function}
18134          *            callback
18135          */
18136         EventBus.prototype.on = function(events, priority, callback) {
18137
18138             events = isArray(events) ? events : [events];
18139
18140             if (isFunction(priority)) {
18141                 callback = priority;
18142                 priority = DEFAULT_PRIORITY;
18143             }
18144
18145             if (!isNumber(priority)) {
18146                 throw new Error('priority must be a number');
18147             }
18148
18149             var self = this,
18150                 listener = {
18151                     priority: priority,
18152                     callback: callback
18153                 };
18154
18155             events.forEach(function(e) {
18156                 self._addListener(e, listener);
18157             });
18158         };
18159
18160
18161         /**
18162          * Register an event listener that is executed only once.
18163          * 
18164          * @param {String}
18165          *            event the event name to register for
18166          * @param {Function}
18167          *            callback the callback to execute
18168          */
18169         EventBus.prototype.once = function(event, callback) {
18170
18171             var self = this;
18172
18173             function wrappedCallback() {
18174                 callback.apply(self, arguments);
18175                 self.off(event, wrappedCallback);
18176             }
18177
18178             this.on(event, wrappedCallback);
18179         };
18180
18181
18182         /**
18183          * Removes event listeners by event and callback.
18184          * 
18185          * If no callback is given, all listeners for a given event name are being
18186          * removed.
18187          * 
18188          * @param {String}
18189          *            event
18190          * @param {Function}
18191          *            [callback]
18192          */
18193         EventBus.prototype.off = function(event, callback) {
18194             var listeners = this._getListeners(event),
18195                 listener, idx;
18196
18197             if (callback) {
18198
18199                 // move through listeners from back to front
18200                 // and remove matching listeners
18201                 for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
18202                     if (listener.callback === callback) {
18203                         listeners.splice(idx, 1);
18204                     }
18205                 }
18206             } else {
18207                 // clear listeners
18208                 listeners.length = 0;
18209             }
18210         };
18211
18212
18213         /**
18214          * Fires a named event.
18215          * 
18216          * @example
18217          *  // fire event by name events.fire('foo');
18218          *  // fire event object with nested type var event = { type: 'foo' };
18219          * events.fire(event);
18220          *  // fire event with explicit type var event = { x: 10, y: 20 };
18221          * events.fire('element.moved', event);
18222          *  // pass additional arguments to the event events.on('foo', function(event,
18223          * bar) { alert(bar); });
18224          * 
18225          * events.fire({ type: 'foo' }, 'I am bar!');
18226          * 
18227          * @param {String}
18228          *            [name] the optional event name
18229          * @param {Object}
18230          *            [event] the event object
18231          * @param {...Object}
18232          *            additional arguments to be passed to the callback functions
18233          * 
18234          * @return {Boolean} the events return value, if specified or false if the
18235          *         default action was prevented by listeners
18236          */
18237         EventBus.prototype.fire = function(type, data) {
18238
18239             var event,
18240                 originalType,
18241                 listeners, idx, listener,
18242                 returnValue,
18243                 args;
18244
18245             args = Array.prototype.slice.call(arguments);
18246
18247             if (typeof type === 'object') {
18248                 event = type;
18249                 type = event.type;
18250             }
18251
18252             if (!type) {
18253                 throw new Error('no event type specified');
18254             }
18255
18256             listeners = this._listeners[type];
18257
18258             if (!listeners) {
18259                 return;
18260             }
18261
18262             // we make sure we fire instances of our home made
18263             // events here. We wrap them only once, though
18264             if (data instanceof Event) {
18265                 // we are fine, we alread have an event
18266                 event = data;
18267             } else {
18268                 event = new Event();
18269                 event.init(data);
18270             }
18271
18272             // ensure we pass the event as the first parameter
18273             args[0] = event;
18274
18275             // original event type (in case we delegate)
18276             originalType = event.type;
18277
18278             try {
18279
18280                 // update event type before delegation
18281                 if (type !== originalType) {
18282                     event.type = type;
18283                 }
18284
18285                 for (idx = 0; !!(listener = listeners[idx]); idx++) {
18286
18287                     // handle stopped propagation
18288                     if (event.cancelBubble) {
18289                         break;
18290                     }
18291
18292                     try {
18293                         // returning false prevents the default action
18294                         returnValue = event.returnValue = listener.callback.apply(null, args);
18295
18296                         // stop propagation on return value
18297                         if (returnValue !== undefined) {
18298                             event.stopPropagation();
18299                         }
18300
18301                         // prevent default on return false
18302                         if (returnValue === false) {
18303                             event.preventDefault();
18304                         }
18305                     } catch (e) {
18306                         if (!this.handleError(e)) {
18307                             console.error('unhandled error in event listener');
18308                             console.error(e.stack);
18309
18310                             throw e;
18311                         }
18312                     }
18313                 }
18314             } finally {
18315                 // reset event type after delegation
18316                 if (type !== originalType) {
18317                     event.type = originalType;
18318                 }
18319             }
18320
18321             // set the return value to false if the event default
18322             // got prevented and no other return value exists
18323             if (returnValue === undefined && event.defaultPrevented) {
18324                 returnValue = false;
18325             }
18326
18327             return returnValue;
18328         };
18329
18330
18331         EventBus.prototype.handleError = function(error) {
18332             return this.fire('error', {
18333                 error: error
18334             }) === false;
18335         };
18336
18337
18338         /*
18339          * Add new listener with a certain priority to the list of listeners (for the
18340          * given event).
18341          * 
18342          * The semantics of listener registration / listener execution are first
18343          * register, first serve: New listeners will always be inserted after existing
18344          * listeners with the same priority.
18345          * 
18346          * Example: Inserting two listeners with priority 1000 and 1300
18347          *  * before: [ 1500, 1500, 1000, 1000 ] * after: [ 1500, 1500, (new=1300),
18348          * 1000, 1000, (new=1000) ]
18349          * 
18350          * @param {String} event @param {Object} listener { priority, callback }
18351          */
18352         EventBus.prototype._addListener = function(event, newListener) {
18353
18354             var listeners = this._getListeners(event),
18355                 existingListener,
18356                 idx;
18357
18358             // ensure we order listeners by priority from
18359             // 0 (high) to n > 0 (low)
18360             for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
18361                 if (existingListener.priority < newListener.priority) {
18362
18363                     // prepend newListener at before existingListener
18364                     listeners.splice(idx, 0, newListener);
18365                     return;
18366                 }
18367             }
18368
18369             listeners.push(newListener);
18370         };
18371
18372
18373         EventBus.prototype._getListeners = function(name) {
18374             var listeners = this._listeners[name];
18375
18376             if (!listeners) {
18377                 this._listeners[name] = listeners = [];
18378             }
18379
18380             return listeners;
18381         };
18382
18383
18384         /**
18385          * A event that is emitted via the event bus.
18386          */
18387         function Event() {}
18388
18389         module.exports.Event = Event;
18390
18391         Event.prototype.stopPropagation = function() {
18392             this.cancelBubble = true;
18393         };
18394
18395         Event.prototype.preventDefault = function() {
18396             this.defaultPrevented = true;
18397         };
18398
18399         Event.prototype.init = function(data) {
18400             assign(this, data || {});
18401         };
18402
18403     }, {
18404         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18405         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
18406         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
18407         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18408     }],
18409     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js": [function(require, module, exports) {
18410         'use strict';
18411
18412         var forEach = require('lodash/collection/forEach'),
18413             reduce = require('lodash/collection/reduce');
18414
18415         var GraphicsUtil = require('../util/GraphicsUtil'),
18416             domClear = require('min-dom/lib/clear');
18417
18418         /**
18419          * A factory that creates graphical elements
18420          * 
18421          * @param {Renderer}
18422          *            renderer
18423          */
18424         function GraphicsFactory(renderer, elementRegistry) {
18425             this._renderer = renderer;
18426             this._elementRegistry = elementRegistry;
18427         }
18428
18429         GraphicsFactory.$inject = ['renderer', 'elementRegistry'];
18430
18431         module.exports = GraphicsFactory;
18432
18433
18434         GraphicsFactory.prototype._getChildren = function(element) {
18435
18436             var gfx = this._elementRegistry.getGraphics(element);
18437
18438             var childrenGfx;
18439
18440             // root element
18441             if (!element.parent) {
18442                 childrenGfx = gfx;
18443             } else {
18444                 childrenGfx = GraphicsUtil.getChildren(gfx);
18445                 if (!childrenGfx) {
18446                     childrenGfx = gfx.parent().group().attr('class', 'djs-children');
18447                 }
18448             }
18449
18450             return childrenGfx;
18451         };
18452
18453         /**
18454          * Clears the graphical representation of the element and returns the cleared
18455          * visual (the <g class="djs-visual" /> element).
18456          */
18457         GraphicsFactory.prototype._clear = function(gfx) {
18458             var visual = GraphicsUtil.getVisual(gfx);
18459
18460             domClear(visual.node);
18461
18462             return visual;
18463         };
18464
18465         /**
18466          * Creates a gfx container for shapes and connections
18467          * 
18468          * The layout is as follows:
18469          * 
18470          * <g class="djs-group">
18471          * 
18472          * <!-- the gfx --> <g class="djs-element djs-(shape|connection)"> <g
18473          * class="djs-visual"> <!-- the renderer draws in here --> </g>
18474          * 
18475          * <!-- extensions (overlays, click box, ...) goes here </g>
18476          * 
18477          * <!-- the gfx child nodes --> <g class="djs-children"></g> </g>
18478          * 
18479          * @param {Object}
18480          *            parent
18481          * @param {String}
18482          *            type the type of the element, i.e. shape | connection
18483          */
18484         GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
18485             var outerGfx = parentGfx.group().attr('class', 'djs-group'),
18486                 gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
18487
18488             // create visual
18489             gfx.group().attr('class', 'djs-visual');
18490
18491             return gfx;
18492         };
18493
18494         GraphicsFactory.prototype.create = function(type, element) {
18495             var childrenGfx = this._getChildren(element.parent);
18496             return this._createContainer(type, childrenGfx);
18497         };
18498
18499
18500         GraphicsFactory.prototype.updateContainments = function(elements) {
18501
18502             var self = this,
18503                 elementRegistry = this._elementRegistry,
18504                 parents;
18505
18506
18507             parents = reduce(elements, function(map, e) {
18508
18509                 if (e.parent) {
18510                     map[e.parent.id] = e.parent;
18511                 }
18512
18513                 return map;
18514             }, {});
18515
18516             // update all parents of changed and reorganized their children
18517             // in the correct order (as indicated in our model)
18518             forEach(parents, function(parent) {
18519
18520                 var childGfx = self._getChildren(parent),
18521                     children = parent.children;
18522
18523                 if (!children) {
18524                     return;
18525                 }
18526
18527                 forEach(children.slice().reverse(), function(c) {
18528                     var gfx = elementRegistry.getGraphics(c);
18529                     gfx.parent().prependTo(childGfx);
18530                 });
18531             });
18532
18533         };
18534
18535         GraphicsFactory.prototype.update = function(type, element, gfx) {
18536
18537             // Do not update root element
18538             if (!element.parent) {
18539                 return;
18540             }
18541
18542             var visual = this._clear(gfx);
18543
18544             // redraw
18545             if (type === 'shape') {
18546                 this._renderer.drawShape(visual, element);
18547
18548                 // update positioning
18549                 gfx.translate(element.x, element.y);
18550             } else
18551             if (type === 'connection') {
18552                 this._renderer.drawConnection(visual, element);
18553             } else {
18554                 throw new Error('unknown type: ' + type);
18555             }
18556
18557             gfx.attr('display', element.hidden ? 'none' : 'block');
18558         };
18559
18560
18561         GraphicsFactory.prototype.remove = function(element) {
18562             var gfx = this._elementRegistry.getGraphics(element);
18563
18564             // remove
18565             gfx.parent().remove();
18566         };
18567
18568     }, {
18569         "../util/GraphicsUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js",
18570         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
18571         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18572         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js"
18573     }],
18574     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js": [function(require, module, exports) {
18575         module.exports = {
18576             __depends__: [require('../draw')],
18577             __init__: ['canvas'],
18578             canvas: ['type', require('./Canvas')],
18579             elementRegistry: ['type', require('./ElementRegistry')],
18580             elementFactory: ['type', require('./ElementFactory')],
18581             eventBus: ['type', require('./EventBus')],
18582             graphicsFactory: ['type', require('./GraphicsFactory')]
18583         };
18584     }, {
18585         "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js",
18586         "./Canvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js",
18587         "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
18588         "./ElementRegistry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js",
18589         "./EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
18590         "./GraphicsFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js"
18591     }],
18592     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js": [function(require, module, exports) {
18593         'use strict';
18594
18595         var Snap = require('../../vendor/snapsvg');
18596
18597
18598         /**
18599          * The default renderer used for shapes and connections.
18600          * 
18601          * @param {Styles}
18602          *            styles
18603          */
18604         function Renderer(styles) {
18605             this.CONNECTION_STYLE = styles.style(['no-fill'], {
18606                 strokeWidth: 5,
18607                 stroke: 'fuchsia'
18608             });
18609             this.SHAPE_STYLE = styles.style({
18610                 fill: 'white',
18611                 stroke: 'fuchsia',
18612                 strokeWidth: 2
18613             });
18614         }
18615
18616         module.exports = Renderer;
18617
18618         Renderer.$inject = ['styles'];
18619
18620
18621         Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
18622             return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
18623         };
18624
18625         Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
18626             return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
18627         };
18628
18629         function componentsToPath(components) {
18630             return components.join(',').replace(/,?([A-z]),?/g, '$1');
18631         }
18632
18633         /**
18634          * Gets the default SVG path of a shape that represents it's visual bounds.
18635          * 
18636          * @param {djs.model.Shape}
18637          *            shape
18638          * @return {string} svg path
18639          */
18640         Renderer.prototype.getShapePath = function getShapePath(shape) {
18641
18642             var x = shape.x,
18643                 y = shape.y,
18644                 width = shape.width,
18645                 height = shape.height;
18646
18647             var shapePath = [
18648                 ['M', x, y],
18649                 ['l', width, 0],
18650                 ['l', 0, height],
18651                 ['l', -width, 0],
18652                 ['z']
18653             ];
18654
18655             return componentsToPath(shapePath);
18656         };
18657
18658         /**
18659          * Gets the default SVG path of a connection that represents it's visual bounds.
18660          * 
18661          * @param {djs.model.Connection}
18662          *            connection
18663          * @return {string} svg path
18664          */
18665         Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
18666             var waypoints = connection.waypoints;
18667
18668             var idx, point, connectionPath = [];
18669
18670             for (idx = 0; !!(point = waypoints[idx]); idx++) {
18671
18672                 // take invisible docking into account
18673                 // when creating the path
18674                 point = point.original || point;
18675
18676                 connectionPath.push([idx === 0 ? 'M' : 'L', point.x, point.y]);
18677             }
18678
18679             return componentsToPath(connectionPath);
18680         };
18681
18682
18683         function toSVGPoints(points) {
18684             var result = '';
18685
18686             for (var i = 0, p; !!(p = points[i]); i++) {
18687                 result += p.x + ',' + p.y + ' ';
18688             }
18689
18690             return result;
18691         }
18692
18693         function createLine(points, attrs) {
18694             return Snap.create('polyline', {
18695                 points: toSVGPoints(points)
18696             }).attr(attrs || {});
18697         }
18698
18699         function updateLine(gfx, points) {
18700             return gfx.attr({
18701                 points: toSVGPoints(points)
18702             });
18703         }
18704
18705         module.exports.createLine = createLine;
18706         module.exports.updateLine = updateLine;
18707     }, {
18708         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
18709     }],
18710     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js": [function(require, module, exports) {
18711         'use strict';
18712
18713         var isArray = require('lodash/lang/isArray'),
18714             assign = require('lodash/object/assign'),
18715             reduce = require('lodash/collection/reduce');
18716
18717
18718         /**
18719          * A component that manages shape styles
18720          */
18721         function Styles() {
18722
18723             var defaultTraits = {
18724
18725                 'no-fill': {
18726                     fill: 'none'
18727                 },
18728                 'no-border': {
18729                     strokeOpacity: 0.0
18730                 },
18731                 'no-events': {
18732                     pointerEvents: 'none'
18733                 }
18734             };
18735
18736             /**
18737              * Builds a style definition from a className, a list of traits and an
18738              * object of additional attributes.
18739              * 
18740              * @param {String}
18741              *            className
18742              * @param {Array
18743              *            <String>} traits
18744              * @param {Object}
18745              *            additionalAttrs
18746              * 
18747              * @return {Object} the style defintion
18748              */
18749             this.cls = function(className, traits, additionalAttrs) {
18750                 var attrs = this.style(traits, additionalAttrs);
18751
18752                 return assign(attrs, {
18753                     'class': className
18754                 });
18755             };
18756
18757             /**
18758              * Builds a style definition from a list of traits and an object of
18759              * additional attributes.
18760              * 
18761              * @param {Array
18762              *            <String>} traits
18763              * @param {Object}
18764              *            additionalAttrs
18765              * 
18766              * @return {Object} the style defintion
18767              */
18768             this.style = function(traits, additionalAttrs) {
18769
18770                 if (!isArray(traits) && !additionalAttrs) {
18771                     additionalAttrs = traits;
18772                     traits = [];
18773                 }
18774
18775                 var attrs = reduce(traits, function(attrs, t) {
18776                     return assign(attrs, defaultTraits[t] || {});
18777                 }, {});
18778
18779                 return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
18780             };
18781         }
18782
18783         module.exports = Styles;
18784     }, {
18785         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18786         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18787         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18788     }],
18789     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js": [function(require, module, exports) {
18790         module.exports = {
18791             renderer: ['type', require('./Renderer')],
18792             styles: ['type', require('./Styles')]
18793         };
18794     }, {
18795         "./Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
18796         "./Styles": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js"
18797     }],
18798     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js": [function(require, module, exports) {
18799         'use strict';
18800
18801         var Geometry = require('../../util/Geometry'),
18802             Util = require('./Util');
18803
18804         var MARKER_OK = 'connect-ok',
18805             MARKER_NOT_OK = 'connect-not-ok',
18806             MARKER_CONNECT_HOVER = 'connect-hover',
18807             MARKER_CONNECT_UPDATING = 'djs-updating';
18808
18809         var COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',
18810             COMMAND_RECONNECT_START = 'connection.reconnectStart',
18811             COMMAND_RECONNECT_END = 'connection.reconnectEnd';
18812
18813         var round = Math.round;
18814
18815
18816         /**
18817          * A component that implements moving of bendpoints
18818          */
18819         function BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {
18820
18821             var connectionDocking;
18822
18823             // optional connection docking integration
18824             try {
18825                 connectionDocking = injector.get('connectionDocking');
18826             } catch (e) {}
18827
18828
18829             // API
18830
18831             this.start = function(event, connection, bendpointIndex, insert) {
18832
18833                 var type,
18834                     context,
18835                     waypoints = connection.waypoints,
18836                     gfx = canvas.getGraphics(connection);
18837
18838                 if (!insert && bendpointIndex === 0) {
18839                     type = COMMAND_RECONNECT_START;
18840                 } else
18841                 if (!insert && bendpointIndex === waypoints.length - 1) {
18842                     type = COMMAND_RECONNECT_END;
18843                 } else {
18844                     type = COMMAND_BENDPOINT_UPDATE;
18845                 }
18846
18847                 context = {
18848                     connection: connection,
18849                     bendpointIndex: bendpointIndex,
18850                     insert: insert,
18851                     type: type
18852                 };
18853
18854                 dragging.activate(event, 'bendpoint.move', {
18855                     data: {
18856                         connection: connection,
18857                         connectionGfx: gfx,
18858                         context: context
18859                     }
18860                 });
18861             };
18862
18863
18864             // DRAGGING IMPLEMENTATION
18865
18866
18867             function redrawConnection(data) {
18868                 graphicsFactory.update('connection', data.connection, data.connectionGfx);
18869             }
18870
18871             function filterRedundantWaypoints(waypoints) {
18872                 return waypoints.filter(function(r, idx) {
18873                     return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);
18874                 });
18875             }
18876
18877             eventBus.on('bendpoint.move.start', function(e) {
18878
18879                 var context = e.context,
18880                     connection = context.connection,
18881                     originalWaypoints = connection.waypoints,
18882                     waypoints = originalWaypoints.slice(),
18883                     insert = context.insert,
18884                     idx = context.bendpointIndex;
18885
18886                 context.originalWaypoints = originalWaypoints;
18887
18888                 if (insert) {
18889                     // insert placeholder for bendpoint to-be-added
18890                     waypoints.splice(idx, 0, null);
18891                 }
18892
18893                 connection.waypoints = waypoints;
18894
18895                 // add dragger gfx
18896                 context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));
18897                 context.draggerGfx.addClass('djs-dragging');
18898
18899                 canvas.addMarker(connection, MARKER_CONNECT_UPDATING);
18900             });
18901
18902             eventBus.on('bendpoint.move.hover', function(e) {
18903                 e.context.hover = e.hover;
18904
18905                 canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);
18906             });
18907
18908             eventBus.on([
18909                 'bendpoint.move.out',
18910                 'bendpoint.move.cleanup'
18911             ], function(e) {
18912
18913                 // remove connect marker
18914                 // if it was added
18915                 var hover = e.context.hover;
18916
18917                 if (hover) {
18918                     canvas.removeMarker(hover, MARKER_CONNECT_HOVER);
18919                     canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);
18920                 }
18921             });
18922
18923             eventBus.on('bendpoint.move.move', function(e) {
18924
18925                 var context = e.context,
18926                     moveType = context.type,
18927                     connection = e.connection,
18928                     source, target;
18929
18930                 connection.waypoints[context.bendpointIndex] = {
18931                     x: e.x,
18932                     y: e.y
18933                 };
18934
18935                 if (connectionDocking) {
18936
18937                     if (context.hover) {
18938                         if (moveType === COMMAND_RECONNECT_START) {
18939                             source = context.hover;
18940                         }
18941
18942                         if (moveType === COMMAND_RECONNECT_END) {
18943                             target = context.hover;
18944                         }
18945                     }
18946
18947                     connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);
18948                 }
18949
18950                 // asks whether reconnect / bendpoint move / bendpoint add
18951                 // is allowed at the given position
18952                 var allowed = context.allowed = rules.allowed(context.type, context);
18953
18954                 if (allowed) {
18955
18956                     if (context.hover) {
18957                         canvas.removeMarker(context.hover, MARKER_NOT_OK);
18958                         canvas.addMarker(context.hover, MARKER_OK);
18959
18960                         context.target = context.hover;
18961                     }
18962                 } else
18963                 if (allowed === false) {
18964                     if (context.hover) {
18965                         canvas.removeMarker(context.hover, MARKER_OK);
18966                         canvas.addMarker(context.hover, MARKER_NOT_OK);
18967
18968                         context.target = null;
18969                     }
18970                 }
18971
18972                 // add dragger gfx
18973                 context.draggerGfx.translate(e.x, e.y);
18974
18975                 redrawConnection(e);
18976             });
18977
18978             eventBus.on([
18979                 'bendpoint.move.end',
18980                 'bendpoint.move.cancel'
18981             ], function(e) {
18982
18983                 var context = e.context,
18984                     connection = context.connection;
18985
18986                 // remove dragger gfx
18987                 context.draggerGfx.remove();
18988
18989                 context.newWaypoints = connection.waypoints.slice();
18990
18991                 connection.waypoints = context.originalWaypoints;
18992
18993                 canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);
18994             });
18995
18996             eventBus.on('bendpoint.move.end', function(e) {
18997
18998                 var context = e.context,
18999                     waypoints = context.newWaypoints,
19000                     bendpointIndex = context.bendpointIndex,
19001                     bendpoint = waypoints[bendpointIndex],
19002                     allowed = context.allowed;
19003
19004                 // ensure we have actual pixel values bendpoint
19005                 // coordinates (important when zoom level was > 1 during move)
19006                 bendpoint.x = round(bendpoint.x);
19007                 bendpoint.y = round(bendpoint.y);
19008
19009                 if (allowed === true && context.type === COMMAND_RECONNECT_START) {
19010                     modeling.reconnectStart(context.connection, context.target, bendpoint);
19011                 } else
19012                 if (allowed === true && context.type === COMMAND_RECONNECT_END) {
19013                     modeling.reconnectEnd(context.connection, context.target, bendpoint);
19014                 } else
19015                 if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {
19016                     modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));
19017                 } else {
19018                     redrawConnection(e);
19019
19020                     return false;
19021                 }
19022             });
19023
19024             eventBus.on('bendpoint.move.cancel', function(e) {
19025                 redrawConnection(e);
19026             });
19027         }
19028
19029         BendpointMove.$inject = ['injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling'];
19030
19031         module.exports = BendpointMove;
19032     }, {
19033         "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
19034         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js"
19035     }],
19036     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js": [function(require, module, exports) {
19037         'use strict';
19038
19039         var assign = require('lodash/object/assign'),
19040             pick = require('lodash/object/pick'),
19041             forEach = require('lodash/collection/forEach');
19042
19043         var Snap = require('../../../vendor/snapsvg');
19044
19045         var round = Math.round;
19046
19047
19048         function BendpointSnapping(eventBus) {
19049
19050             function snapTo(candidates, point) {
19051                 return Snap.snapTo(candidates, point);
19052             }
19053
19054             function toPoint(e) {
19055                 return pick(e, ['x', 'y']);
19056             }
19057
19058             function mid(element) {
19059                 if (element.width) {
19060                     return {
19061                         x: round(element.width / 2 + element.x),
19062                         y: round(element.height / 2 + element.y)
19063                     };
19064                 }
19065             }
19066
19067             function getSnapPoints(context) {
19068
19069                 var snapPoints = context.snapPoints,
19070                     waypoints = context.connection.waypoints,
19071                     bendpointIndex = context.bendpointIndex,
19072                     referenceWaypoints = [waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1]];
19073
19074                 if (!snapPoints) {
19075                     context.snapPoints = snapPoints = {
19076                         horizontal: [],
19077                         vertical: []
19078                     };
19079
19080                     forEach(referenceWaypoints, function(p) {
19081                         // we snap on existing bendpoints only,
19082                         // not placeholders that are inserted during add
19083                         if (p) {
19084                             p = p.original || p;
19085
19086                             snapPoints.horizontal.push(p.y);
19087                             snapPoints.vertical.push(p.x);
19088                         }
19089                     });
19090                 }
19091
19092                 return snapPoints;
19093             }
19094
19095             eventBus.on('bendpoint.move.start', function(event) {
19096                 event.context.snapStart = toPoint(event);
19097             });
19098
19099             eventBus.on('bendpoint.move.move', 1500, function(event) {
19100
19101                 var context = event.context,
19102                     snapPoints = getSnapPoints(context),
19103                     start = context.snapStart,
19104                     target = context.target,
19105                     targetMid = target && mid(target),
19106                     x = start.x + event.dx,
19107                     y = start.y + event.dy,
19108                     sx, sy;
19109
19110                 if (!snapPoints) {
19111                     return;
19112                 }
19113
19114                 // snap
19115                 sx = snapTo(targetMid ? snapPoints.vertical.concat([targetMid.x]) : snapPoints.vertical, x);
19116                 sy = snapTo(targetMid ? snapPoints.horizontal.concat([targetMid.y]) : snapPoints.horizontal, y);
19117
19118
19119                 // correction x/y
19120                 var cx = (x - sx),
19121                     cy = (y - sy);
19122
19123                 // update delta
19124                 assign(event, {
19125                     dx: event.dx - cx,
19126                     dy: event.dy - cy,
19127                     x: event.x - cx,
19128                     y: event.y - cy
19129                 });
19130             });
19131         }
19132
19133
19134         BendpointSnapping.$inject = ['eventBus'];
19135
19136         module.exports = BendpointSnapping;
19137     }, {
19138         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19139         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19140         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
19141         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
19142     }],
19143     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js": [function(require, module, exports) {
19144         'use strict';
19145
19146         var domEvent = require('min-dom/lib/event'),
19147             Util = require('./Util');
19148
19149         var BENDPOINT_CLS = Util.BENDPOINT_CLS;
19150
19151
19152         /**
19153          * A service that adds editable bendpoints to connections.
19154          */
19155         function Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {
19156
19157             function getConnectionIntersection(waypoints, event) {
19158                 var localPosition = Util.toCanvasCoordinates(canvas, event);
19159                 return Util.getApproxIntersection(waypoints, localPosition);
19160             }
19161
19162             function activateBendpointMove(event, connection) {
19163                 var waypoints = connection.waypoints,
19164                     intersection = getConnectionIntersection(waypoints, event);
19165
19166                 if (!intersection) {
19167                     return;
19168                 }
19169
19170                 bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);
19171             }
19172
19173             function getBendpointsContainer(element, create) {
19174
19175                 var layer = canvas.getLayer('overlays'),
19176                     gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');
19177
19178                 if (!gfx && create) {
19179                     gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);
19180
19181                     domEvent.bind(gfx.node, 'mousedown', function(event) {
19182                         activateBendpointMove(event, element);
19183                     });
19184                 }
19185
19186                 return gfx;
19187             }
19188
19189             function createBendpoints(gfx, connection) {
19190                 connection.waypoints.forEach(function(p, idx) {
19191                     Util.addBendpoint(gfx).translate(p.x, p.y);
19192                 });
19193
19194                 // add floating bendpoint
19195                 Util.addBendpoint(gfx).addClass('floating');
19196             }
19197
19198             function clearBendpoints(gfx) {
19199                 gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {
19200                     s.remove();
19201                 });
19202             }
19203
19204             function addBendpoints(connection) {
19205                 var gfx = getBendpointsContainer(connection);
19206
19207                 if (!gfx) {
19208                     gfx = getBendpointsContainer(connection, true);
19209                     createBendpoints(gfx, connection);
19210                 }
19211
19212                 return gfx;
19213             }
19214
19215             function updateBendpoints(connection) {
19216
19217                 var gfx = getBendpointsContainer(connection);
19218
19219                 if (gfx) {
19220                     clearBendpoints(gfx);
19221                     createBendpoints(gfx, connection);
19222                 }
19223             }
19224
19225             eventBus.on('connection.changed', function(event) {
19226                 updateBendpoints(event.element);
19227             });
19228
19229             eventBus.on('connection.remove', function(event) {
19230                 var gfx = getBendpointsContainer(event.element);
19231                 if (gfx) {
19232                     gfx.remove();
19233                 }
19234             });
19235
19236             eventBus.on('element.marker.update', function(event) {
19237
19238                 var element = event.element,
19239                     bendpointsGfx;
19240
19241                 if (!element.waypoints) {
19242                     return;
19243                 }
19244
19245                 bendpointsGfx = addBendpoints(element);
19246                 bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);
19247             });
19248
19249             eventBus.on('element.mousemove', function(event) {
19250
19251                 var element = event.element,
19252                     waypoints = element.waypoints,
19253                     bendpointsGfx,
19254                     floating,
19255                     intersection;
19256
19257                 if (waypoints) {
19258
19259                     bendpointsGfx = getBendpointsContainer(element, true);
19260                     floating = bendpointsGfx.select('.floating');
19261
19262                     if (!floating) {
19263                         return;
19264                     }
19265
19266                     intersection = getConnectionIntersection(waypoints, event.originalEvent);
19267
19268                     if (intersection) {
19269                         floating.translate(intersection.point.x, intersection.point.y);
19270                     }
19271                 }
19272             });
19273
19274             eventBus.on('element.mousedown', function(event) {
19275
19276                 var originalEvent = event.originalEvent,
19277                     element = event.element,
19278                     waypoints = element.waypoints;
19279
19280                 if (!waypoints) {
19281                     return;
19282                 }
19283
19284                 activateBendpointMove(originalEvent, element, waypoints);
19285             });
19286
19287             eventBus.on('selection.changed', function(event) {
19288                 var newSelection = event.newSelection,
19289                     primary = newSelection[0];
19290
19291                 if (primary && primary.waypoints) {
19292                     addBendpoints(primary);
19293                 }
19294             });
19295
19296             eventBus.on('element.hover', function(event) {
19297                 var element = event.element;
19298
19299                 if (element.waypoints) {
19300                     addBendpoints(element);
19301
19302                     interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19303                 }
19304             });
19305
19306             eventBus.on('element.out', function(event) {
19307                 interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19308             });
19309         }
19310
19311         Bendpoints.$inject = ['injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove'];
19312
19313         module.exports = Bendpoints;
19314     }, {
19315         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js",
19316         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
19317     }],
19318     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js": [function(require, module, exports) {
19319         'use strict';
19320
19321         var Snap = require('../../../vendor/snapsvg');
19322
19323         var Events = require('../../util/Event'),
19324             Geometry = require('../../util/Geometry');
19325
19326         var BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';
19327
19328         module.exports.toCanvasCoordinates = function(canvas, event) {
19329
19330             var position = Events.toPoint(event),
19331                 clientRect = canvas._container.getBoundingClientRect(),
19332                 offset;
19333
19334             // canvas relative position
19335
19336             offset = {
19337                 x: clientRect.left,
19338                 y: clientRect.top
19339             };
19340
19341             // update actual event payload with canvas relative measures
19342
19343             var viewbox = canvas.viewbox();
19344
19345             return {
19346                 x: viewbox.x + (position.x - offset.x) / viewbox.scale,
19347                 y: viewbox.y + (position.y - offset.y) / viewbox.scale
19348             };
19349         };
19350
19351         module.exports.addBendpoint = function(parentGfx) {
19352             var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);
19353
19354             groupGfx.circle(0, 0, 4).addClass('djs-visual');
19355             groupGfx.circle(0, 0, 10).addClass('djs-hit');
19356
19357             return groupGfx;
19358         };
19359
19360
19361         function circlePath(center, r) {
19362             var x = center.x,
19363                 y = center.y;
19364
19365             return [
19366                 ['M', x, y],
19367                 ['m', 0, -r],
19368                 ['a', r, r, 0, 1, 1, 0, 2 * r],
19369                 ['a', r, r, 0, 1, 1, 0, -2 * r],
19370                 ['z']
19371             ];
19372         }
19373
19374         function linePath(points) {
19375             var segments = [];
19376
19377             points.forEach(function(p, idx) {
19378                 segments.push([idx === 0 ? 'M' : 'L', p.x, p.y]);
19379             });
19380
19381             return segments;
19382         }
19383
19384
19385         var INTERSECTION_THRESHOLD = 10;
19386
19387         function getBendpointIntersection(waypoints, reference) {
19388
19389             var i, w;
19390
19391             for (i = 0; !!(w = waypoints[i]); i++) {
19392
19393                 if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {
19394                     return {
19395                         point: waypoints[i],
19396                         bendpoint: true,
19397                         index: i
19398                     };
19399                 }
19400             }
19401
19402             return null;
19403         }
19404
19405         function getPathIntersection(waypoints, reference) {
19406
19407             var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
19408
19409             var a = intersections[0],
19410                 b = intersections[intersections.length - 1],
19411                 idx;
19412
19413             if (!a) {
19414                 // no intersection
19415                 return null;
19416             }
19417
19418             if (a !== b) {
19419
19420                 if (a.segment2 !== b.segment2) {
19421                     // we use the bendpoint in between both segments
19422                     // as the intersection point
19423
19424                     idx = Math.max(a.segment2, b.segment2) - 1;
19425
19426                     return {
19427                         point: waypoints[idx],
19428                         bendpoint: true,
19429                         index: idx
19430                     };
19431                 }
19432
19433                 return {
19434                     point: {
19435                         x: (Math.round(a.x + b.x) / 2),
19436                         y: (Math.round(a.y + b.y) / 2)
19437                     },
19438                     index: a.segment2
19439                 };
19440             }
19441
19442             return {
19443                 point: {
19444                     x: Math.round(a.x),
19445                     y: Math.round(a.y)
19446                 },
19447                 index: a.segment2
19448             };
19449         }
19450
19451         /**
19452          * Returns the closest point on the connection towards a given reference point.
19453          * 
19454          * @param {Array
19455          *            <Point>} waypoints
19456          * @param {Point}
19457          *            reference
19458          * 
19459          * @return {Object} intersection data (segment, point)
19460          */
19461         module.exports.getApproxIntersection = function(waypoints, reference) {
19462             return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
19463         };
19464     }, {
19465         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19466         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
19467         "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js"
19468     }],
19469     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js": [function(require, module, exports) {
19470         module.exports = {
19471             __depends__: [require('../dragging'), require('../rules')],
19472             __init__: ['bendpoints', 'bendpointSnapping'],
19473             bendpoints: ['type', require('./Bendpoints')],
19474             bendpointMove: ['type', require('./BendpointMove')],
19475             bendpointSnapping: ['type', require('./BendpointSnapping')]
19476         };
19477     }, {
19478         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19479         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19480         "./BendpointMove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js",
19481         "./BendpointSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js",
19482         "./Bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js"
19483     }],
19484     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js": [function(require, module, exports) {
19485         'use strict';
19486
19487         /**
19488          * Adds change support to the diagram, including
19489          * 
19490          * <ul>
19491          * <li>redrawing shapes and connections on change</li>
19492          * </ul>
19493          * 
19494          * @param {EventBus}
19495          *            eventBus
19496          * @param {ElementRegistry}
19497          *            elementRegistry
19498          * @param {GraphicsFactory}
19499          *            graphicsFactory
19500          */
19501         function ChangeSupport(eventBus, elementRegistry, graphicsFactory) {
19502
19503             // redraw shapes / connections on change
19504
19505             eventBus.on('element.changed', function(event) {
19506
19507                 var element = event.element;
19508
19509                 if (!event.gfx) {
19510                     event.gfx = elementRegistry.getGraphics(element);
19511                 }
19512
19513                 // shape + gfx may have been deleted
19514                 if (!event.gfx) {
19515                     return;
19516                 }
19517
19518                 if (element.waypoints) {
19519                     eventBus.fire('connection.changed', event);
19520                 } else {
19521                     eventBus.fire('shape.changed', event);
19522                 }
19523             });
19524
19525             eventBus.on('elements.changed', function(event) {
19526
19527                 var elements = event.elements;
19528
19529                 elements.forEach(function(e) {
19530                     eventBus.fire('element.changed', {
19531                         element: e
19532                     });
19533                 });
19534
19535                 graphicsFactory.updateContainments(elements);
19536             });
19537
19538             eventBus.on('shape.changed', function(event) {
19539                 graphicsFactory.update('shape', event.element, event.gfx);
19540             });
19541
19542             eventBus.on('connection.changed', function(event) {
19543                 graphicsFactory.update('connection', event.element, event.gfx);
19544             });
19545         }
19546
19547         ChangeSupport.$inject = ['eventBus', 'elementRegistry', 'graphicsFactory'];
19548
19549         module.exports = ChangeSupport;
19550
19551     }, {}],
19552     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js": [function(require, module, exports) {
19553         module.exports = {
19554             __init__: ['changeSupport'],
19555             changeSupport: ['type', require('./ChangeSupport')]
19556         };
19557     }, {
19558         "./ChangeSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js"
19559     }],
19560     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js": [function(require, module, exports) {
19561         'use strict';
19562
19563         var LayoutUtil = require('../../layout/LayoutUtil');
19564
19565         var MARKER_OK = 'connect-ok',
19566             MARKER_NOT_OK = 'connect-not-ok';
19567
19568
19569         function Connect(eventBus, dragging, modeling, rules, canvas, renderer) {
19570
19571             // TODO(nre): separate UI and events
19572
19573             // rules
19574
19575             function canConnect(source, target) {
19576                 return rules.allowed('connection.create', {
19577                     source: source,
19578                     target: target
19579                 });
19580             }
19581
19582
19583             // layouting
19584
19585             function crop(start, end, source, target) {
19586
19587                 var sourcePath = renderer.getShapePath(source),
19588                     targetPath = target && renderer.getShapePath(target),
19589                     connectionPath = renderer.getConnectionPath({
19590                         waypoints: [start, end]
19591                     });
19592
19593                 start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;
19594                 end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;
19595
19596                 return [start, end];
19597             }
19598
19599
19600             // event handlers
19601
19602             eventBus.on('connect.move', function(event) {
19603
19604                 var context = event.context,
19605                     source = context.source,
19606                     target = context.target,
19607                     visual = context.visual,
19608                     start, end, waypoints;
19609
19610                 // update connection visuals during drag
19611
19612                 start = LayoutUtil.getMidPoint(source);
19613
19614                 end = {
19615                     x: event.x,
19616                     y: event.y
19617                 };
19618
19619                 waypoints = crop(start, end, source, target);
19620
19621                 visual.attr('points', [waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y]);
19622             });
19623
19624             eventBus.on('connect.hover', function(event) {
19625                 var context = event.context,
19626                     source = context.source,
19627                     hover = event.hover,
19628                     canExecute;
19629
19630                 canExecute = context.canExecute = canConnect(source, hover);
19631
19632                 // simply ignore hover
19633                 if (canExecute === null) {
19634                     return;
19635                 }
19636
19637                 context.target = hover;
19638
19639                 canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
19640             });
19641
19642             eventBus.on(['connect.out', 'connect.cleanup'], function(event) {
19643                 var context = event.context;
19644
19645                 if (context.target) {
19646                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
19647                 }
19648
19649                 context.target = null;
19650             });
19651
19652             eventBus.on('connect.cleanup', function(event) {
19653                 var context = event.context;
19654
19655                 if (context.visual) {
19656                     context.visual.remove();
19657                 }
19658             });
19659
19660             eventBus.on('connect.start', function(event) {
19661                 var context = event.context,
19662                     visual;
19663
19664                 visual = canvas.getDefaultLayer().polyline().attr({
19665                     'stroke': '#333',
19666                     'strokeDasharray': [1],
19667                     'strokeWidth': 2,
19668                     'pointer-events': 'none'
19669                 });
19670
19671                 context.visual = visual;
19672             });
19673
19674             eventBus.on('connect.end', function(event) {
19675
19676                 var context = event.context,
19677                     source = context.source,
19678                     target = context.target,
19679                     canExecute = context.canExecute || canConnect(source, target);
19680
19681                 if (!canExecute) {
19682                     return false;
19683                 }
19684
19685                 modeling.connect(source, target);
19686             });
19687
19688
19689             // API
19690
19691             this.start = function(event, source, autoActivate) {
19692
19693                 dragging.activate(event, 'connect', {
19694                     autoActivate: autoActivate,
19695                     data: {
19696                         shape: source,
19697                         context: {
19698                             source: source
19699                         }
19700                     }
19701                 });
19702             };
19703         }
19704
19705         Connect.$inject = ['eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer'];
19706
19707         module.exports = Connect;
19708     }, {
19709         "../../layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
19710     }],
19711     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js": [function(require, module, exports) {
19712         module.exports = {
19713             __depends__: [
19714                 require('../selection'),
19715                 require('../rules'),
19716                 require('../dragging')
19717             ],
19718             connect: ['type', require('./Connect')]
19719         };
19720
19721     }, {
19722         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19723         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19724         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
19725         "./Connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js"
19726     }],
19727     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js": [function(require, module, exports) {
19728         'use strict';
19729
19730         var isFunction = require('lodash/lang/isFunction'),
19731             forEach = require('lodash/collection/forEach'),
19732
19733             domDelegate = require('min-dom/lib/delegate'),
19734             domClear = require('min-dom/lib/clear'),
19735             domEvent = require('min-dom/lib/event'),
19736             domAttr = require('min-dom/lib/attr'),
19737             domQuery = require('min-dom/lib/query'),
19738             domClasses = require('min-dom/lib/classes'),
19739             domify = require('min-dom/lib/domify');
19740
19741
19742         var entrySelector = '.entry';
19743
19744
19745         /**
19746          * A context pad that displays element specific, contextual actions next to a
19747          * diagram element.
19748          * 
19749          * @param {EventBus}
19750          *            eventBus
19751          * @param {Overlays}
19752          *            overlays
19753          */
19754         function ContextPad(eventBus, overlays) {
19755
19756             this._providers = [];
19757
19758             this._eventBus = eventBus;
19759             this._overlays = overlays;
19760
19761             this._current = null;
19762
19763             this._init();
19764         }
19765
19766         ContextPad.$inject = ['eventBus', 'overlays'];
19767
19768         /**
19769          * Registers events needed for interaction with other components
19770          */
19771         ContextPad.prototype._init = function() {
19772
19773             var eventBus = this._eventBus;
19774
19775             var self = this;
19776
19777             eventBus.on('selection.changed', function(e) {
19778
19779                 var selection = e.newSelection;
19780
19781                 if (selection.length === 1) {
19782                     self.open(selection[0]);
19783                 } else {
19784                     self.close();
19785                 }
19786             });
19787         };
19788
19789
19790         /**
19791          * Register a provider with the context pad
19792          * 
19793          * @param {ContextPadProvider}
19794          *            provider
19795          */
19796         ContextPad.prototype.registerProvider = function(provider) {
19797             this._providers.push(provider);
19798         };
19799
19800
19801         /**
19802          * Returns the context pad entries for a given element
19803          * 
19804          * @param {djs.element.Base}
19805          *            element
19806          * 
19807          * @return {Array<ContextPadEntryDescriptor>} list of entries
19808          */
19809         ContextPad.prototype.getEntries = function(element) {
19810             var entries = {};
19811
19812             // loop through all providers and their entries.
19813             // group entries by id so that overriding an entry is possible
19814             forEach(this._providers, function(provider) {
19815                 var e = provider.getContextPadEntries(element);
19816
19817                 forEach(e, function(entry, id) {
19818                     entries[id] = entry;
19819                 });
19820             });
19821
19822             return entries;
19823         };
19824
19825
19826         /**
19827          * Trigger an action available on the opened context pad
19828          * 
19829          * @param {String}
19830          *            action
19831          * @param {Event}
19832          *            event
19833          */
19834         ContextPad.prototype.trigger = function(action, event, autoActivate) {
19835
19836             var current = this._current,
19837                 element = current.element,
19838                 entries = current.entries,
19839                 entry,
19840                 handler,
19841                 originalEvent,
19842                 button = event.delegateTarget || event.target;
19843
19844             if (!button) {
19845                 return event.preventDefault();
19846             }
19847
19848             entry = entries[domAttr(button, 'data-action')];
19849             handler = entry.action;
19850
19851             originalEvent = event.originalEvent || event;
19852
19853             // simple action (via callback function)
19854             if (isFunction(handler)) {
19855                 if (action === 'click') {
19856                     return handler(originalEvent, element, autoActivate);
19857                 }
19858             } else {
19859                 if (handler[action]) {
19860                     return handler[action](originalEvent, element, autoActivate);
19861                 }
19862             }
19863
19864             // silence other actions
19865             event.preventDefault();
19866         };
19867
19868
19869         /**
19870          * Open the context pad for the given element
19871          * 
19872          * @param {djs.model.Base}
19873          *            element
19874          */
19875         ContextPad.prototype.open = function(element) {
19876
19877             if (this._current && this._current.open) {
19878
19879                 if (this._current.element === element) {
19880                     // no change needed
19881                     return;
19882                 }
19883
19884                 this.close();
19885             }
19886
19887             this._updateAndOpen(element);
19888         };
19889
19890
19891         ContextPad.prototype._updateAndOpen = function(element) {
19892
19893             var entries = this.getEntries(element),
19894                 pad = this.getPad(element),
19895                 html = pad.html;
19896
19897             domClear(html);
19898
19899             forEach(entries, function(entry, id) {
19900                 var grouping = entry.group || 'default',
19901                     control = domify(entry.html || '<div class="entry" draggable="true"></div>'),
19902                     container;
19903
19904                 domAttr(control, 'data-action', id);
19905
19906                 container = domQuery('[data-group=' + grouping + ']', html);
19907                 if (!container) {
19908                     container = domify('<div class="group" data-group="' + grouping + '"></div>');
19909                     html.appendChild(container);
19910                 }
19911
19912                 container.appendChild(control);
19913
19914                 if (entry.className) {
19915                     domClasses(control).add(entry.className);
19916                 }
19917
19918                 if (entry.title) {
19919                     domAttr(control, 'title', entry.title);
19920                 }
19921
19922                 if (entry.imageUrl) {
19923                     control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
19924                 }
19925             });
19926
19927             domClasses(html).add('open');
19928
19929             this._current = {
19930                 element: element,
19931                 pad: pad,
19932                 entries: entries,
19933                 open: true
19934             };
19935
19936             this._eventBus.fire('contextPad.open', {
19937                 current: this._current
19938             });
19939         };
19940
19941         ContextPad.prototype.getPad = function(element) {
19942
19943             var self = this;
19944
19945             var overlays = this._overlays,
19946                 pads = overlays.get({
19947                     element: element,
19948                     type: 'context-pad'
19949                 });
19950
19951             // create context pad on demand if needed
19952             if (!pads.length) {
19953
19954                 var html = domify('<div class="djs-context-pad"></div>');
19955
19956                 domDelegate.bind(html, entrySelector, 'click', function(event) {
19957                     self.trigger('click', event);
19958                 });
19959
19960                 domDelegate.bind(html, entrySelector, 'dragstart', function(event) {
19961                     self.trigger('dragstart', event);
19962                 });
19963
19964                 // stop propagation of mouse events
19965                 domEvent.bind(html, 'mousedown', function(event) {
19966                     event.stopPropagation();
19967                 });
19968
19969
19970                 overlays.add(element, 'context-pad', {
19971                     position: {
19972                         right: -9,
19973                         top: -6
19974                     },
19975                     html: html
19976                 });
19977
19978                 pads = overlays.get({
19979                     element: element,
19980                     type: 'context-pad'
19981                 });
19982
19983                 this._eventBus.fire('contextPad.create', {
19984                     element: element,
19985                     pad: pads[0]
19986                 });
19987             }
19988
19989             return pads[0];
19990         };
19991
19992
19993         /**
19994          * Close the context pad
19995          */
19996         ContextPad.prototype.close = function() {
19997
19998             var html;
19999
20000             if (this._current) {
20001                 if (this._current.open) {
20002                     html = this._current.pad.html;
20003                     domClasses(html).remove('open');
20004                 }
20005
20006                 this._current.open = false;
20007
20008                 this._eventBus.fire('contextPad.close', {
20009                     current: this._current
20010                 });
20011             }
20012         };
20013
20014
20015         /**
20016          * Return the element the context pad is currently opened for, if it is opened.
20017          * 
20018          * @example
20019          * 
20020          * contextPad.open(shape1);
20021          * 
20022          * if (contextPad.isOpen()) { // yes, we are open }
20023          * 
20024          * @return {djs.model.Base} element
20025          */
20026         ContextPad.prototype.isOpen = function() {
20027             return this._current && this._current.open;
20028         };
20029
20030         module.exports = ContextPad;
20031
20032     }, {
20033         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20034         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
20035         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
20036         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
20037         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
20038         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
20039         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
20040         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
20041         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
20042     }],
20043     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
20044         module.exports = {
20045             __depends__: [
20046                 require('../interaction-events'),
20047                 require('../overlays')
20048             ],
20049             contextPad: ['type', require('./ContextPad')]
20050         };
20051     }, {
20052         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
20053         "../overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
20054         "./ContextPad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js"
20055     }],
20056     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js": [function(require, module, exports) {
20057         'use strict';
20058
20059         var MARKER_OK = 'drop-ok',
20060             MARKER_NOT_OK = 'drop-not-ok';
20061
20062
20063         function Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {
20064
20065             // rules
20066
20067             function canCreate(shape, target, source) {
20068
20069                 if (source) {
20070                     return rules.allowed('shape.append', {
20071                         source: source,
20072                         shape: shape,
20073                         parent: target
20074                     });
20075                 } else {
20076                     return rules.allowed('shape.create', {
20077                         shape: shape,
20078                         parent: target
20079                     });
20080                 }
20081             }
20082
20083
20084             // visual helpers
20085
20086             function createVisual(shape) {
20087                 var group, preview, visual;
20088
20089                 group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
20090
20091                 preview = group.group().addClass('djs-dragger');
20092
20093                 preview.translate(shape.width / -2, shape.height / -2);
20094
20095                 visual = preview.group().addClass('djs-visual');
20096
20097                 // hijack renderer to draw preview
20098                 renderer.drawShape(visual, shape);
20099
20100                 return group;
20101             }
20102
20103
20104             // event handlers
20105
20106             eventBus.on('create.move', function(event) {
20107
20108                 var context = event.context,
20109                     shape = context.shape,
20110                     visual = context.visual;
20111
20112                 // lazy init drag visual once we received the first real
20113                 // drag move event (this allows us to get the proper canvas local
20114                 // coordinates)
20115                 if (!visual) {
20116                     visual = context.visual = createVisual(shape);
20117                 }
20118
20119                 visual.translate(event.x, event.y);
20120
20121                 var hover = event.hover,
20122                     canExecute;
20123
20124                 canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);
20125
20126                 // ignore hover visually if canExecute is null
20127                 if (hover && canExecute !== null) {
20128                     context.target = hover;
20129                     canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
20130                 }
20131             });
20132
20133             eventBus.on(['create.end', 'create.out', 'create.cleanup'], function(event) {
20134                 var context = event.context;
20135
20136                 if (context.target) {
20137                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
20138                 }
20139             });
20140
20141             eventBus.on('create.end', function(event) {
20142                 var context = event.context,
20143                     source = context.source,
20144                     shape = context.shape,
20145                     target = context.target,
20146                     canExecute = context.canExecute,
20147                     position = {
20148                         x: event.x,
20149                         y: event.y
20150                     };
20151
20152                 if (!canExecute) {
20153                     return false;
20154                 }
20155
20156                 if (source) {
20157                     modeling.appendShape(source, shape, position, target);
20158                 } else {
20159                     modeling.createShape(shape, position, target);
20160                 }
20161             });
20162
20163
20164             eventBus.on('create.cleanup', function(event) {
20165                 var context = event.context;
20166
20167                 if (context.visual) {
20168                     context.visual.remove();
20169                 }
20170             });
20171
20172             // API
20173
20174             this.start = function(event, shape, source) {
20175
20176                 dragging.activate(event, 'create', {
20177                     cursor: 'grabbing',
20178                     autoActivate: true,
20179                     data: {
20180                         shape: shape,
20181                         context: {
20182                             shape: shape,
20183                             source: source
20184                         }
20185                     }
20186                 });
20187             };
20188         }
20189
20190         Create.$inject = ['eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles'];
20191
20192         module.exports = Create;
20193     }, {}],
20194     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js": [function(require, module, exports) {
20195         module.exports = {
20196             __depends__: [
20197                 require('../dragging'),
20198                 require('../selection')
20199             ],
20200             create: ['type', require('./Create')]
20201         };
20202     }, {
20203         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
20204         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20205         "./Create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js"
20206     }],
20207     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js": [function(require, module, exports) {
20208         'use strict';
20209
20210         /* global TouchEvent */
20211
20212         var assign = require('lodash/object/assign');
20213
20214         var domEvent = require('min-dom/lib/event'),
20215             Event = require('../../util/Event'),
20216             ClickTrap = require('../../util/ClickTrap'),
20217             Cursor = require('../../util/Cursor');
20218
20219         function suppressEvent(event) {
20220             if (event instanceof MouseEvent) {
20221                 Event.stopEvent(event, true);
20222             } else {
20223                 Event.preventDefault(event);
20224             }
20225         }
20226
20227         function getLength(point) {
20228             return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
20229         }
20230
20231         function substract(p1, p2) {
20232             return {
20233                 x: p1.x - p2.x,
20234                 y: p1.y - p2.y
20235             };
20236         }
20237
20238         /**
20239          * A helper that fires canvas localized drag events and realizes the general
20240          * "drag-and-drop" look and feel.
20241          * 
20242          * Calling {@link Dragging#activate} activates dragging on a canvas.
20243          * 
20244          * It provides the following:
20245          *  * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the
20246          * {@link EventBus}. Each of the events is prefixed with a prefix that is
20247          * assigned during activate. * sets and restores the cursor * sets and restores
20248          * the selection * ensures there can be only one drag operation active at a time
20249          * 
20250          * Dragging may be canceled manually by calling {@link Dragging#cancel} or by
20251          * pressing ESC.
20252          * 
20253          * @example
20254          * 
20255          * function MyDragComponent(eventBus, dragging) {
20256          * 
20257          * eventBus.on('mydrag.start', function(event) { console.log('yes, we start
20258          * dragging'); });
20259          * 
20260          * eventBus.on('mydrag.move', function(event) { console.log('canvas local
20261          * coordinates', event.x, event.y, event.dx, event.dy);
20262          *  // local drag data is passed with the event event.context.foo; // "BAR"
20263          *  // the original mouse event, too event.originalEvent; // MouseEvent(...) });
20264          * 
20265          * eventBus.on('element.click', function(event) { dragging.activate(event,
20266          * 'mydrag', { cursor: 'grabbing', data: { context: { foo: "BAR" } } }); }); }
20267          */
20268         function Dragging(eventBus, canvas, selection) {
20269
20270             var defaultOptions = {
20271                 threshold: 5
20272             };
20273
20274             // the currently active drag operation
20275             // dragging is active as soon as this context exists.
20276             //
20277             // it is visually _active_ only when a context.active flag is set to true.
20278             var context;
20279
20280
20281             // helpers
20282
20283             function fire(type) {
20284
20285                 var ActualEvent = require('../../core/EventBus').Event;
20286
20287                 var event = assign(new ActualEvent(), context.payload, context.data);
20288
20289                 // default integration
20290                 if (eventBus.fire('drag.' + type, event) === false) {
20291                     return false;
20292                 }
20293
20294                 return eventBus.fire(context.prefix + '.' + type, event);
20295             }
20296
20297             // event listeners
20298
20299             function move(event, activate) {
20300
20301                 var payload = context.payload,
20302                     start = context.start,
20303                     position = Event.toPoint(event),
20304                     delta = substract(position, start),
20305                     clientRect = canvas._container.getBoundingClientRect(),
20306                     offset;
20307
20308                 // canvas relative position
20309
20310                 offset = {
20311                     x: clientRect.left,
20312                     y: clientRect.top
20313                 };
20314
20315                 // update actual event payload with canvas relative measures
20316
20317                 var viewbox = canvas.viewbox();
20318
20319                 var movement = {
20320                     x: viewbox.x + (position.x - offset.x) / viewbox.scale,
20321                     y: viewbox.y + (position.y - offset.y) / viewbox.scale,
20322                     dx: delta.x / viewbox.scale,
20323                     dy: delta.y / viewbox.scale
20324                 };
20325
20326                 // activate context explicitly or once threshold is reached
20327
20328                 if (!context.active && (activate || getLength(delta) > context.threshold)) {
20329
20330                     // fire start event with original
20331                     // starting coordinates
20332
20333                     assign(payload, {
20334                         x: movement.x - movement.dx,
20335                         y: movement.y - movement.dy,
20336                         dx: 0,
20337                         dy: 0
20338                     }, {
20339                         originalEvent: event
20340                     });
20341
20342                     if (false === fire('start')) {
20343                         return cancel();
20344                     }
20345
20346                     context.active = true;
20347
20348                     // unset selection
20349                     if (!context.keepSelection) {
20350                         context.previousSelection = selection.get();
20351                         selection.select(null);
20352                     }
20353
20354                     // allow custom cursor
20355                     if (context.cursor) {
20356                         Cursor.set(context.cursor);
20357                     }
20358                 }
20359
20360                 suppressEvent(event);
20361
20362                 if (context.active) {
20363
20364                     // fire move event with actual coordinates
20365                     assign(payload, movement, {
20366                         originalEvent: event
20367                     });
20368
20369                     fire('move');
20370                 }
20371             }
20372
20373             function end(event) {
20374
20375                 var returnValue = true;
20376
20377                 if (context.active) {
20378
20379                     if (event) {
20380                         context.payload.originalEvent = event;
20381
20382                         // suppress original event (click, ...)
20383                         // because we just ended a drag operation
20384                         suppressEvent(event);
20385                     }
20386
20387                     // implementations may stop restoring the
20388                     // original state (selections, ...) by preventing the
20389                     // end events default action
20390                     returnValue = fire('end');
20391                 }
20392
20393                 if (returnValue === false) {
20394                     fire('rejected');
20395                 }
20396
20397                 cleanup(returnValue !== true);
20398             }
20399
20400
20401             // cancel active drag operation if the user presses
20402             // the ESC key on the keyboard
20403
20404             function checkCancel(event) {
20405
20406                 if (event.which === 27) {
20407                     event.preventDefault();
20408
20409                     cancel();
20410                 }
20411             }
20412
20413
20414             // prevent ghost click that might occur after a finished
20415             // drag and drop session
20416
20417             function trapClickAndEnd(event) {
20418
20419                 var untrap;
20420
20421                 // trap the click in case we are part of an active
20422                 // drag operation. This will effectively prevent
20423                 // the ghost click that cannot be canceled otherwise.
20424                 if (context.active) {
20425                     untrap = ClickTrap.install();
20426                     setTimeout(untrap, 400);
20427                 }
20428
20429                 end(event);
20430             }
20431
20432             function trapTouch(event) {
20433                 move(event);
20434             }
20435
20436             // update the drag events hover (djs.model.Base) and hoverGfx
20437             // (Snap<SVGElement>)
20438             // properties during hover and out and fire {prefix}.hover and {prefix}.out
20439             // properties
20440             // respectively
20441
20442             function hover(event) {
20443                 var payload = context.payload;
20444
20445                 payload.hoverGfx = event.gfx;
20446                 payload.hover = event.element;
20447
20448                 fire('hover');
20449             }
20450
20451             function out(event) {
20452                 fire('out');
20453
20454                 var payload = context.payload;
20455
20456                 payload.hoverGfx = null;
20457                 payload.hover = null;
20458             }
20459
20460
20461             // life-cycle methods
20462
20463             function cancel(restore) {
20464
20465                 if (!context) {
20466                     return;
20467                 }
20468
20469                 if (context.active) {
20470                     fire('cancel');
20471                 }
20472
20473                 cleanup(restore);
20474             }
20475
20476             function cleanup(restore) {
20477
20478                 fire('cleanup');
20479
20480                 // reset cursor
20481                 Cursor.unset();
20482
20483                 // reset dom listeners
20484                 domEvent.unbind(document, 'mousemove', move);
20485
20486                 domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);
20487                 domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);
20488
20489                 domEvent.unbind(document, 'keyup', checkCancel);
20490
20491                 domEvent.unbind(document, 'touchstart', trapTouch, true);
20492                 domEvent.unbind(document, 'touchcancel', cancel, true);
20493                 domEvent.unbind(document, 'touchmove', move, true);
20494                 domEvent.unbind(document, 'touchend', end, true);
20495
20496                 eventBus.off('element.hover', hover);
20497                 eventBus.off('element.out', out);
20498
20499                 // restore selection, unless it has changed
20500                 if (restore !== false && context.previousSelection && !selection.get().length) {
20501                     selection.select(context.previousSelection);
20502                 }
20503
20504                 context = null;
20505             }
20506
20507             /**
20508              * Activate a drag operation
20509              * 
20510              * @param {MouseEvent|TouchEvent}
20511              *            [event]
20512              * @param {String}
20513              *            prefix
20514              * @param {Object}
20515              *            [options]
20516              */
20517             function activate(event, prefix, options) {
20518
20519                 // only one drag operation may be active, at a time
20520                 if (context) {
20521                     cancel(false);
20522                 }
20523
20524                 options = assign({}, defaultOptions, options || {});
20525
20526                 var data = options.data || {},
20527                     originalEvent,
20528                     start;
20529
20530                 if (event) {
20531                     originalEvent = Event.getOriginal(event) || event;
20532                     start = Event.toPoint(event);
20533
20534                     suppressEvent(event);
20535                 } else {
20536                     originalEvent = null;
20537                     start = {
20538                         x: 0,
20539                         y: 0
20540                     };
20541                 }
20542
20543                 context = assign({
20544                     prefix: prefix,
20545                     data: data,
20546                     payload: {},
20547                     start: start
20548                 }, options);
20549
20550                 // skip dom registration if trigger
20551                 // is set to manual (during testing)
20552                 if (!options.manual) {
20553
20554                     // add dom listeners
20555
20556                     // fixes TouchEvent not being available on desktop Firefox
20557                     if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
20558                         domEvent.bind(document, 'touchstart', trapTouch, true);
20559                         domEvent.bind(document, 'touchcancel', cancel, true);
20560                         domEvent.bind(document, 'touchmove', move, true);
20561                         domEvent.bind(document, 'touchend', end, true);
20562                     } else {
20563                         // assume we use the mouse to interact per default
20564                         domEvent.bind(document, 'mousemove', move);
20565
20566                         domEvent.bind(document, 'mousedown', trapClickAndEnd, true);
20567                         domEvent.bind(document, 'mouseup', trapClickAndEnd, true);
20568                     }
20569
20570                     domEvent.bind(document, 'keyup', checkCancel);
20571
20572                     eventBus.on('element.hover', hover);
20573                     eventBus.on('element.out', out);
20574                 }
20575
20576                 fire('activate');
20577
20578                 if (options.autoActivate) {
20579                     move(event, true);
20580                 }
20581             }
20582
20583             // cancel on diagram destruction
20584             eventBus.on('diagram.destroy', cancel);
20585
20586
20587             // API
20588
20589             this.activate = activate;
20590             this.move = move;
20591             this.hover = hover;
20592             this.out = out;
20593             this.end = end;
20594
20595             this.cancel = cancel;
20596
20597             // for introspection
20598
20599             this.active = function() {
20600                 return context;
20601             };
20602
20603             this.setOptions = function(options) {
20604                 assign(defaultOptions, options);
20605             };
20606         }
20607
20608         Dragging.$inject = ['eventBus', 'canvas', 'selection'];
20609
20610         module.exports = Dragging;
20611     }, {
20612         "../../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
20613         "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
20614         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
20615         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
20616         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
20617         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
20618     }],
20619     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js": [function(require, module, exports) {
20620         module.exports = {
20621             __depends__: [
20622                 require('../selection')
20623             ],
20624             dragging: ['type', require('./Dragging')]
20625         };
20626     }, {
20627         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20628         "./Dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js"
20629     }],
20630     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js": [function(require, module, exports) {
20631         'use strict';
20632
20633         var forEach = require('lodash/collection/forEach'),
20634             domDelegate = require('min-dom/lib/delegate'),
20635             Renderer = require('../../draw/Renderer'),
20636             createLine = Renderer.createLine,
20637             updateLine = Renderer.updateLine;
20638
20639
20640         var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
20641
20642         var Snap = require('../../../vendor/snapsvg');
20643
20644         /**
20645          * A plugin that provides interaction events for diagram elements.
20646          * 
20647          * It emits the following events:
20648          *  * element.hover * element.out * element.click * element.dblclick *
20649          * element.mousedown
20650          * 
20651          * Each event is a tuple { element, gfx, originalEvent }.
20652          * 
20653          * Canceling the event via Event#preventDefault() prevents the original DOM
20654          * operation.
20655          * 
20656          * @param {EventBus}
20657          *            eventBus
20658          */
20659         function InteractionEvents(eventBus, elementRegistry, styles) {
20660
20661             var HIT_STYLE = styles.cls('djs-hit', ['no-fill', 'no-border'], {
20662                 stroke: 'white',
20663                 strokeWidth: 15
20664             });
20665
20666             function fire(type, event) {
20667                 var target = event.delegateTarget || event.target,
20668                     gfx = target && new Snap(target),
20669                     element = elementRegistry.get(gfx),
20670                     returnValue;
20671
20672                 if (!gfx || !element) {
20673                     return;
20674                 }
20675
20676                 returnValue = eventBus.fire(type, {
20677                     element: element,
20678                     gfx: gfx,
20679                     originalEvent: event
20680                 });
20681
20682                 if (returnValue === false) {
20683                     event.stopPropagation();
20684                     event.preventDefault();
20685                 }
20686             }
20687
20688             var handlers = {};
20689
20690             function mouseHandler(type) {
20691
20692                 var fn = handlers[type];
20693
20694                 if (!fn) {
20695                     fn = handlers[type] = function(event) {
20696                         // only indicate left mouse button interactions
20697                         if (isPrimaryButton(event)) {
20698                             fire(type, event);
20699                         }
20700                     };
20701                 }
20702
20703                 return fn;
20704             }
20705
20706             var bindings = {
20707                 mouseover: 'element.hover',
20708                 mouseout: 'element.out',
20709                 click: 'element.click',
20710                 dblclick: 'element.dblclick',
20711                 mousedown: 'element.mousedown',
20712                 mouseup: 'element.mouseup',
20713                 keydown: 'element.keyup'
20714
20715             };
20716
20717             var elementSelector = 'svg, .djs-element';
20718
20719             // /// event registration
20720
20721             function registerEvent(node, event, localEvent) {
20722                 var handler = mouseHandler(localEvent);
20723                 handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
20724             }
20725
20726             function unregisterEvent(node, event, localEvent) {
20727                 domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
20728             }
20729
20730             function registerEvents(svg) {
20731                 forEach(bindings, function(val, key) {
20732                     registerEvent(svg.node, key, val);
20733                 });
20734             }
20735
20736             function unregisterEvents(svg) {
20737                 forEach(bindings, function(val, key) {
20738                     unregisterEvent(svg.node, key, val);
20739                 });
20740             }
20741
20742             eventBus.on('canvas.destroy', function(event) {
20743                 unregisterEvents(event.svg);
20744             });
20745
20746             eventBus.on('canvas.init', function(event) {
20747                 registerEvents(event.svg);
20748             });
20749
20750
20751             eventBus.on(['shape.added', 'connection.added'], function(event) {
20752                 var element = event.element,
20753                     gfx = event.gfx,
20754                     hit,
20755                     type;
20756
20757                 if (element.waypoints) {
20758                     hit = createLine(element.waypoints);
20759                     type = 'connection';
20760                 } else {
20761                     hit = Snap.create('rect', {
20762                         x: 0,
20763                         y: 0,
20764                         width: element.width,
20765                         height: element.height
20766                     });
20767                     type = 'shape';
20768                 }
20769
20770                 hit.attr(HIT_STYLE).appendTo(gfx.node);
20771             });
20772
20773             // update djs-hit on change
20774
20775             eventBus.on('shape.changed', function(event) {
20776
20777                 var element = event.element,
20778                     gfx = event.gfx,
20779                     hit = gfx.select('.djs-hit');
20780
20781                 hit.attr({
20782                     width: element.width,
20783                     height: element.height
20784                 });
20785             });
20786
20787             eventBus.on('connection.changed', function(event) {
20788
20789                 var element = event.element,
20790                     gfx = event.gfx,
20791                     hit = gfx.select('.djs-hit');
20792
20793                 updateLine(hit, element.waypoints);
20794             });
20795
20796
20797             // API
20798
20799             this.fire = fire;
20800
20801             this.mouseHandler = mouseHandler;
20802
20803             this.registerEvent = registerEvent;
20804             this.unregisterEvent = unregisterEvent;
20805         }
20806
20807
20808         InteractionEvents.$inject = ['eventBus', 'elementRegistry', 'styles'];
20809
20810         module.exports = InteractionEvents;
20811
20812
20813         /**
20814          * An event indicating that the mouse hovered over an element
20815          * 
20816          * @event element.hover
20817          * 
20818          * @type {Object}
20819          * @property {djs.model.Base} element
20820          * @property {Snap<Element>} gfx
20821          * @property {Event} originalEvent
20822          */
20823
20824         /**
20825          * An event indicating that the mouse has left an element
20826          * 
20827          * @event element.out
20828          * 
20829          * @type {Object}
20830          * @property {djs.model.Base} element
20831          * @property {Snap<Element>} gfx
20832          * @property {Event} originalEvent
20833          */
20834
20835         /**
20836          * An event indicating that the mouse has clicked an element
20837          * 
20838          * @event element.click
20839          * 
20840          * @type {Object}
20841          * @property {djs.model.Base} element
20842          * @property {Snap<Element>} gfx
20843          * @property {Event} originalEvent
20844          */
20845
20846         /**
20847          * An event indicating that the mouse has double clicked an element
20848          * 
20849          * @event element.dblclick
20850          * 
20851          * @type {Object}
20852          * @property {djs.model.Base} element
20853          * @property {Snap<Element>} gfx
20854          * @property {Event} originalEvent
20855          */
20856
20857         /**
20858          * An event indicating that the mouse has gone down on an element.
20859          * 
20860          * @event element.mousedown
20861          * 
20862          * @type {Object}
20863          * @property {djs.model.Base} element
20864          * @property {Snap<Element>} gfx
20865          * @property {Event} originalEvent
20866          */
20867
20868         /**
20869          * An event indicating that the mouse has gone up on an element.
20870          * 
20871          * @event element.mouseup
20872          * 
20873          * @type {Object}
20874          * @property {djs.model.Base} element
20875          * @property {Snap<Element>} gfx
20876          * @property {Event} originalEvent
20877          */
20878     }, {
20879         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
20880         "../../draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
20881         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
20882         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20883         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js"
20884     }],
20885     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js": [function(require, module, exports) {
20886         module.exports = {
20887             __init__: ['interactionEvents'],
20888             interactionEvents: ['type', require('./InteractionEvents')]
20889         };
20890     }, {
20891         "./InteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js"
20892     }],
20893     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js": [function(require, module, exports) {
20894         'use strict';
20895
20896         var domEvent = require('min-dom/lib/event'),
20897             domMatches = require('min-dom/lib/matches');
20898         //keyboard.bindTo=DOMElement;
20899        // var $ = require('jquery'),
20900        
20901        
20902         
20903         
20904         /**
20905          * A keyboard abstraction that may be activated and
20906          * deactivated by users at will, consuming key events
20907          * and triggering diagram actions.
20908          *
20909          * The implementation fires the following key events that allow
20910          * other components to hook into key handling:
20911          *
20912          *  - keyboard.bind
20913          *  - keyboard.unbind
20914          *  - keyboard.init
20915          *  - keyboard.destroy
20916          *
20917          * All events contain the fields (node, listeners).
20918          *
20919          * A default binding for the keyboard may be specified via the
20920          * `keyboard.bindTo` configuration option.
20921          *
20922          * @param {EventBus} eventBus
20923          * @param {CommandStack} commandStack
20924          * @param {Modeling} modeling
20925          * @param {Selection} selection
20926          * 
20927          */
20928         
20929         function Keyboard(config, eventBus, commandStack, modeling, selection, zoomScroll, canvas) {
20930           
20931           $(document).keydown(function(e){
20932                   if(commandStack._selectedModel == selected_model){
20933                           if(commandStack._eventBus._listeners != null){
20934                                   
20935                                   var model_commandStack = [];
20936                                   for(var i = 0; i < commandStackList.length; i++){
20937                                           if(commandStackList[i]._selectedModel == selected_model){
20938                                                   if(commandStackList[i]._stack.length > 0){
20939                                                           model_commandStack.push(commandStackList[i]); 
20940                                                   }
20941                                           }
20942                                   }
20943                                   
20944                                   var selected_commandStack;
20945                                   for(var i = model_commandStack.length-1; i >= 0; i--){
20946                                           if(model_commandStack[i]._stackIdx > -1){
20947                                                   selected_commandStack = model_commandStack[i];
20948                                                   break;
20949                                           }
20950                                   }
20951                                   
20952                                if(e.which == 90 && e.ctrlKey){
20953                                    if(commandStack == selected_commandStack){
20954                                                    commandStack.undo();
20955                                                    return true;
20956                                    }
20957                                    } else if(e.which == 89 && e.ctrlKey){
20958                                            commandStack.redo();
20959                                            return true;
20960                                    } 
20961                           }
20962                         
20963                         
20964                   }
20965                         
20966
20967                 });
20968                 
20969           var self = this;
20970
20971           this._commandStack = commandStack;
20972           this._modeling = modeling;
20973           this._selection = selection;
20974           this._eventBus = eventBus;
20975           this._zoomScroll = zoomScroll;
20976           this._canvas = canvas;
20977
20978           this._listeners = [];
20979
20980           // our key handler is a singleton that passes
20981           // (keycode, modifiers) to each listener.
20982           //
20983           // listeners must indicate that they handled a key event
20984           // by returning true. This stops the event propagation.
20985           //
20986           this._keyHandler = function(event) {
20987
20988             var i, l,
20989                 target = event.target,
20990                 listeners = self._listeners,
20991                 code = event.keyCode || event.charCode || -1;
20992
20993             if (domMatches(target, 'input, textarea')) {
20994               return;
20995             }
20996
20997             for (i = 0; !!(l = listeners[i]); i++) {
20998               if (l(code, event)) {
20999                 event.preventDefault();
21000                 event.stopPropagation();
21001               }
21002             }
21003           };
21004
21005           // properly clean dom registrations
21006           eventBus.on('diagram.destroy', function() {
21007             self._fire('destroy');
21008
21009             self.unbind();
21010             self._listeners = null;
21011           });
21012
21013           eventBus.on('diagram.init', function() {
21014             self._fire('init');
21015
21016             if (config && config.bindTo) {
21017               self.bind(config.bindTo);
21018             }
21019           });
21020
21021           this._init();
21022         }
21023
21024         Keyboard.$inject = [
21025           'config.keyboard',
21026           'eventBus',
21027           'commandStack',
21028           'modeling',
21029           'selection',
21030           'zoomScroll',
21031           'canvas'];
21032
21033         module.exports = Keyboard;
21034
21035
21036         Keyboard.prototype.bind = function(node) {
21037           this._node = node;
21038
21039           // bind key events
21040           domEvent.bind(node, 'keydown', this._keyHandler, true);
21041
21042           this._fire('bind');
21043         };
21044
21045         Keyboard.prototype.getBinding = function() {
21046           return this._node;
21047         };
21048
21049         Keyboard.prototype.unbind = function() {
21050           var node = this._node;
21051
21052           if (node) {
21053             this._fire('unbind');
21054
21055             // unbind key events
21056             domEvent.unbind(node, 'keydown', this._keyHandler, true);
21057           }
21058
21059           this._node = null;
21060         };
21061
21062
21063         Keyboard.prototype._fire = function(event) {
21064           this._eventBus.fire('keyboard.' + event, { node: this._node, listeners: this._listeners });
21065           
21066           
21067         };
21068       
21069
21070         
21071         Keyboard.prototype._init = function() {
21072
21073           var listeners = this._listeners,
21074               commandStack = this._commandStack,
21075               modeling = this._modeling,
21076               selection = this._selection,
21077               zoomScroll = this._zoomScroll,
21078               canvas = this._canvas;
21079           
21080           // init default listeners
21081
21082           // undo
21083           // (CTRL|CMD) + Z
21084           function undo(key, modifiers) {
21085                   
21086             if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {
21087               commandStack.undo();
21088
21089               return true;
21090             }
21091           }
21092
21093           // redo
21094           // CTRL + Y
21095           // CMD + SHIFT + Z
21096           function redo(key, modifiers) {
21097
21098             if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {
21099               commandStack.redo();
21100
21101               return true;
21102             }
21103           }
21104
21105           /**
21106            * zoom in one step
21107            * CTRL + +
21108            *
21109            * 107 = numpad plus
21110            * 187 = regular plus
21111            * 171 = regular plus in Firefox (german keyboard layout)
21112            *  61 = regular plus in Firefox (US keyboard layout)
21113            */
21114           function zoomIn(key, modifiers) {
21115
21116             if ((key === 107 || key === 187 || key === 171 || key === 61) && isCmd(modifiers)) {
21117
21118               zoomScroll.stepZoom(1);
21119
21120               return true;
21121             }
21122           }
21123
21124           /**
21125            * zoom out one step
21126            * CTRL + -
21127            *
21128            * 109 = numpad minus
21129            * 189 = regular minus
21130            * 173 = regular minus in Firefox (US and german keyboard layout)
21131            */
21132           function zoomOut(key, modifiers) {
21133
21134             if ((key === 109 || key === 189 || key === 173)  && isCmd(modifiers)) {
21135
21136               zoomScroll.stepZoom(-1);
21137
21138               return true;
21139             }
21140           }
21141
21142           /**
21143            * zoom to the default level
21144            * CTRL + 0
21145            *
21146            * 96 = numpad zero
21147            * 48 = regular zero
21148            */
21149           function zoomDefault(key, modifiers) {
21150
21151             if ((key === 96 || key === 48) && isCmd(modifiers)) {
21152
21153               canvas.zoom(1);
21154
21155               return true;
21156             }
21157           }
21158
21159           // delete selected element
21160           // DEL
21161           function remove(key, modifiers) {
21162
21163             if (key === 46) {
21164
21165               var selectedElements = selection.get();
21166               console.log(selectedElements);
21167               if (selectedElements.length) {
21168                 modeling.removeElements(selectedElements.slice());
21169               }
21170
21171               return true;
21172             }
21173           }
21174
21175           listeners.push(undo);
21176           listeners.push(redo);
21177           listeners.push(remove);
21178           listeners.push(zoomIn);
21179           listeners.push(zoomOut);
21180           listeners.push(zoomDefault);
21181         };
21182
21183
21184         /**
21185          * Add a listener function that is notified with (key, modifiers) whenever
21186          * the keyboard is bound and the user presses a key.
21187          *
21188          * @param {Function} listenerFn
21189          */
21190         Keyboard.prototype.addListener = function(listenerFn) {
21191                 
21192           this._listeners.push(listenerFn);
21193         };
21194
21195         Keyboard.prototype.hasModifier = hasModifier;
21196         Keyboard.prototype.isCmd = isCmd;
21197         Keyboard.prototype.isShift = isShift;
21198
21199
21200         function hasModifier(modifiers) {
21201           return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);
21202         }
21203
21204         function isCmd(modifiers) {
21205           return modifiers.ctrlKey || modifiers.metaKey;
21206         }
21207
21208         function isShift(modifiers) {
21209           return modifiers.shiftKey;
21210         }
21211
21212     }, {
21213         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
21214         "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js"
21215     }],
21216     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
21217         module.exports = {
21218             __init__: ['keyboard'],
21219             keyboard: ['type', require('./Keyboard')]
21220         };
21221
21222     }, {
21223         "./Keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js"
21224     }],
21225     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js": [function(require, module, exports) {
21226         'use strict';
21227
21228         var values = require('lodash/object/values');
21229
21230         var getEnclosedElements = require('../../util/Elements').getEnclosedElements;
21231
21232         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
21233
21234         var Snap = require('../../../vendor/snapsvg');
21235
21236
21237         function LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {
21238
21239             this._selection = selection;
21240             this._dragging = dragging;
21241
21242             var self = this;
21243
21244             // lasso visuals implementation
21245
21246             /**
21247              * A helper that realizes the selection box visual
21248              */
21249             var visuals = {
21250
21251                 create: function(context) {
21252                     var container = canvas.getDefaultLayer(),
21253                         frame;
21254
21255                     frame = context.frame = Snap.create('rect', {
21256                         class: 'djs-lasso-overlay',
21257                         width: 1,
21258                         height: 1,
21259                         x: 0,
21260                         y: 0
21261                     });
21262
21263                     frame.appendTo(container);
21264                 },
21265
21266                 update: function(context) {
21267                     var frame = context.frame,
21268                         bbox = context.bbox;
21269
21270                     frame.attr({
21271                         x: bbox.x,
21272                         y: bbox.y,
21273                         width: bbox.width,
21274                         height: bbox.height
21275                     });
21276                 },
21277
21278                 remove: function(context) {
21279
21280                     if (context.frame) {
21281                         context.frame.remove();
21282                     }
21283                 }
21284             };
21285
21286
21287             eventBus.on('lasso.selection.end', function(event) {
21288
21289                 setTimeout(function() {
21290                     self.activateLasso(event.originalEvent, true);
21291                 });
21292             });
21293
21294             // lasso interaction implementation
21295
21296             eventBus.on('lasso.end', function(event) {
21297
21298                 var bbox = toBBox(event);
21299
21300                 var elements = elementRegistry.filter(function(element) {
21301                     return element;
21302                 });
21303
21304                 self.select(elements, bbox);
21305             });
21306
21307             eventBus.on('lasso.start', function(event) {
21308
21309                 var context = event.context;
21310
21311                 context.bbox = toBBox(event);
21312                 visuals.create(context);
21313             });
21314
21315             eventBus.on('lasso.move', function(event) {
21316
21317                 var context = event.context;
21318
21319                 context.bbox = toBBox(event);
21320                 visuals.update(context);
21321             });
21322
21323             eventBus.on('lasso.end', function(event) {
21324
21325                 var context = event.context;
21326
21327                 visuals.remove(context);
21328             });
21329
21330             eventBus.on('lasso.cleanup', function(event) {
21331
21332                 var context = event.context;
21333
21334                 visuals.remove(context);
21335             });
21336
21337
21338             // event integration
21339
21340             eventBus.on('element.mousedown', 1500, function(event) {
21341
21342                 if (hasPrimaryModifier(event)) {
21343                     self.activateLasso(event.originalEvent);
21344
21345                     event.stopPropagation();
21346                 }
21347             });
21348         }
21349
21350         LassoTool.$inject = [
21351             'eventBus',
21352             'canvas',
21353             'dragging',
21354             'elementRegistry',
21355             'selection'
21356         ];
21357
21358         module.exports = LassoTool;
21359
21360
21361         LassoTool.prototype.activateLasso = function(event, autoActivate) {
21362
21363             this._dragging.activate(event, 'lasso', {
21364                 autoActivate: autoActivate,
21365                 cursor: 'crosshair',
21366                 data: {
21367                     context: {}
21368                 }
21369             });
21370         };
21371
21372         LassoTool.prototype.activateSelection = function(event) {
21373
21374             this._dragging.activate(event, 'lasso.selection', {
21375                 cursor: 'crosshair'
21376             });
21377         };
21378
21379         LassoTool.prototype.select = function(elements, bbox) {
21380             var selectedElements = getEnclosedElements(elements, bbox);
21381
21382             this._selection.select(values(selectedElements));
21383         };
21384
21385
21386         function toBBox(event) {
21387
21388             var start = {
21389
21390                 x: event.x - event.dx,
21391                 y: event.y - event.dy
21392             };
21393
21394             var end = {
21395                 x: event.x,
21396                 y: event.y
21397             };
21398
21399             var bbox;
21400
21401             if ((start.x <= end.x && start.y < end.y) ||
21402                 (start.x < end.x && start.y <= end.y)) {
21403
21404                 bbox = {
21405                     x: start.x,
21406                     y: start.y,
21407                     width: end.x - start.x,
21408                     height: end.y - start.y
21409                 };
21410             } else if ((start.x >= end.x && start.y < end.y) ||
21411                 (start.x > end.x && start.y <= end.y)) {
21412
21413                 bbox = {
21414                     x: end.x,
21415                     y: start.y,
21416                     width: start.x - end.x,
21417                     height: end.y - start.y
21418                 };
21419             } else if ((start.x <= end.x && start.y > end.y) ||
21420                 (start.x < end.x && start.y >= end.y)) {
21421
21422                 bbox = {
21423                     x: start.x,
21424                     y: end.y,
21425                     width: end.x - start.x,
21426                     height: start.y - end.y
21427                 };
21428             } else if ((start.x >= end.x && start.y > end.y) ||
21429                 (start.x > end.x && start.y >= end.y)) {
21430
21431                 bbox = {
21432                     x: end.x,
21433                     y: end.y,
21434                     width: start.x - end.x,
21435                     height: start.y - end.y
21436                 };
21437             } else {
21438
21439                 bbox = {
21440                     x: end.x,
21441                     y: end.y,
21442                     width: 0,
21443                     height: 0
21444                 };
21445             }
21446             return bbox;
21447         }
21448     }, {
21449         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
21450         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
21451         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
21452         "lodash/object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
21453     }],
21454     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js": [function(require, module, exports) {
21455         'use strict';
21456
21457         module.exports = {
21458             __init__: ['lassoTool'],
21459             lassoTool: ['type', require('./LassoTool')]
21460         };
21461
21462     }, {
21463         "./LassoTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js"
21464     }],
21465     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
21466         'use strict';
21467
21468         var forEach = require('lodash/collection/forEach');
21469
21470         var model = require('../../model');
21471
21472
21473         /**
21474          * The basic modeling entry point.
21475          * 
21476          * @param {EventBus}
21477          *            eventBus
21478          * @param {ElementFactory}
21479          *            elementFactory
21480          * @param {CommandStack}
21481          *            commandStack
21482          */
21483         function Modeling(eventBus, elementFactory, commandStack) {
21484             this._eventBus = eventBus;
21485             this._elementFactory = elementFactory;
21486             this._commandStack = commandStack;
21487             var self = this;
21488
21489             eventBus.on('diagram.init', function() {
21490                 // register modeling handlers
21491                 self.registerHandlers(commandStack);
21492             });
21493         }
21494
21495         Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack'];
21496
21497         module.exports = Modeling;
21498
21499
21500         Modeling.prototype.getHandlers = function() {
21501             return {
21502                 'shape.append': require('./cmd/AppendShapeHandler'),
21503                 'shape.create': require('./cmd/CreateShapeHandler'),
21504                 'shape.delete': require('./cmd/DeleteShapeHandler'),
21505                 'shape.move': require('./cmd/MoveShapeHandler'),
21506                 'shapes.move': require('./cmd/MoveShapesHandler'),
21507                 'shape.resize': require('./cmd/ResizeShapeHandler'),
21508                 'shape.replace': require('./cmd/ReplaceShapeHandler'),
21509
21510                 'spaceTool': require('./cmd/SpaceToolHandler'),
21511
21512                 'label.create': require('./cmd/CreateLabelHandler'),
21513
21514                 'connection.create': require('./cmd/CreateConnectionHandler'),
21515                 'connection.delete': require('./cmd/DeleteConnectionHandler'),
21516                 'connection.move': require('./cmd/MoveConnectionHandler'),
21517                 'connection.layout': require('./cmd/LayoutConnectionHandler'),
21518
21519                 'connection.updateWaypoints': require('./cmd/UpdateWaypointsHandler'),
21520
21521                 'connection.reconnectStart': require('./cmd/ReconnectConnectionHandler'),
21522                 'connection.reconnectEnd': require('./cmd/ReconnectConnectionHandler'),
21523
21524                 'elements.delete': require('./cmd/DeleteElementsHandler'),
21525                 'element.updateAnchors': require('./cmd/UpdateAnchorsHandler')
21526             };
21527         };
21528
21529         /**
21530          * Register handlers with the command stack
21531          * 
21532          * @param {CommandStack}
21533          *            commandStack
21534          */
21535         Modeling.prototype.registerHandlers = function(commandStack) {
21536             forEach(this.getHandlers(), function(handler, id) {
21537                 commandStack.registerHandler(id, handler);
21538             });
21539         };
21540
21541
21542         // /// modeling helpers /////////////////////////////////////////
21543
21544
21545         Modeling.prototype.moveShape = function(shape, delta, newParent, hints) {
21546
21547             var context = {
21548                 shape: shape,
21549                 delta: delta,
21550                 newParent: newParent,
21551                 hints: hints || {}
21552             };
21553
21554             this._commandStack.execute('shape.move', context);
21555         };
21556
21557
21558         Modeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {
21559
21560             var context = {
21561                 shapes: shapes,
21562                 delta: delta,
21563                 newParent: newParent,
21564                 hints: hints || {}
21565             };
21566
21567             this._commandStack.execute('shapes.move', context);
21568         };
21569
21570         /**
21571          * Update the anchors on the element with the given delta movement
21572          * 
21573          * @param {djs.model.Element}
21574          *            element
21575          * @param {Point}
21576          *            delta
21577          */
21578         Modeling.prototype.updateAnchors = function(element, delta) {
21579             var context = {
21580                 element: element,
21581                 delta: delta
21582             };
21583
21584             this._commandStack.execute('element.updateAnchors', context);
21585         };
21586
21587         Modeling.prototype.moveConnection = function(connection, delta, newParent, hints) {
21588
21589             var context = {
21590                 connection: connection,
21591                 delta: delta,
21592                 newParent: newParent,
21593                 hints: hints || {}
21594             };
21595
21596             this._commandStack.execute('connection.move', context);
21597         };
21598
21599
21600         Modeling.prototype.layoutConnection = function(connection, hints) {
21601
21602             var context = {
21603                 connection: connection,
21604                 hints: hints || {}
21605             };
21606
21607             this._commandStack.execute('connection.layout', context);
21608         };
21609
21610
21611         Modeling.prototype.createConnection = function(source, target, connection, parent) {
21612
21613             connection = this._create('connection', connection);
21614
21615             var context = {
21616                 source: source,
21617                 target: target,
21618                 parent: parent,
21619                 connection: connection
21620             };
21621
21622             this._commandStack.execute('connection.create', context);
21623
21624             return context.connection;
21625         };
21626
21627         Modeling.prototype.createShape = function(shape, position, parent) {
21628
21629             shape = this._create('shape', shape);
21630
21631             var context = {
21632                 position: position,
21633                 parent: parent,
21634                 shape: shape
21635             };
21636
21637             this._commandStack.execute('shape.create', context);
21638
21639             return context.shape;
21640         };
21641
21642
21643         Modeling.prototype.createLabel = function(labelTarget, position, label, parent) {
21644
21645             label = this._create('label', label);
21646
21647             var context = {
21648                 labelTarget: labelTarget,
21649                 position: position,
21650                 parent: parent,
21651                 shape: label
21652             };
21653
21654             this._commandStack.execute('label.create', context);
21655
21656             return context.shape;
21657         };
21658
21659
21660         Modeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {
21661
21662             shape = this._create('shape', shape);
21663
21664             var context = {
21665                 source: source,
21666                 position: position,
21667                 parent: parent,
21668                 shape: shape,
21669                 connection: connection,
21670                 connectionParent: connectionParent
21671             };
21672
21673             this._commandStack.execute('shape.append', context);
21674
21675             return context.shape;
21676         };
21677
21678
21679         Modeling.prototype.removeElements = function(elements) {
21680           console.log(elements);
21681             var context = {
21682                 elements: elements
21683             };
21684
21685             this._commandStack.execute('elements.delete', context);
21686         };
21687
21688
21689         Modeling.prototype.removeShape = function(shape) {
21690             var context = {
21691                 shape: shape
21692             };
21693
21694             this._commandStack.execute('shape.delete', context);
21695         };
21696
21697
21698         Modeling.prototype.removeConnection = function(connection) {
21699             var context = {
21700                 connection: connection
21701             };
21702
21703             this._commandStack.execute('connection.delete', context);
21704         };
21705
21706         Modeling.prototype.replaceShape = function(oldShape, newShape, options) {
21707             var context = {
21708                 oldShape: oldShape,
21709                 newData: newShape,
21710                 options: options
21711             };
21712
21713             this._commandStack.execute('shape.replace', context);
21714
21715             return context.newShape;
21716         };
21717
21718         Modeling.prototype.resizeShape = function(shape, newBounds) {
21719             var context = {
21720                 shape: shape,
21721                 newBounds: newBounds
21722             };
21723
21724             this._commandStack.execute('shape.resize', context);
21725         };
21726
21727         Modeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {
21728             var context = {
21729                 movingShapes: movingShapes,
21730                 resizingShapes: resizingShapes,
21731                 delta: delta,
21732                 direction: direction
21733             };
21734
21735             this._commandStack.execute('spaceTool', context);
21736         };
21737
21738         Modeling.prototype.updateWaypoints = function(connection, newWaypoints) {
21739             var context = {
21740                 connection: connection,
21741                 newWaypoints: newWaypoints
21742             };
21743
21744             this._commandStack.execute('connection.updateWaypoints', context);
21745         };
21746
21747         Modeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {
21748             var context = {
21749                 connection: connection,
21750                 newSource: newSource,
21751                 dockingPoint: dockingPoint
21752             };
21753
21754             this._commandStack.execute('connection.reconnectStart', context);
21755         };
21756
21757         Modeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {
21758             var context = {
21759                 connection: connection,
21760                 newTarget: newTarget,
21761                 dockingPoint: dockingPoint
21762             };
21763
21764             this._commandStack.execute('connection.reconnectEnd', context);
21765         };
21766
21767         Modeling.prototype.connect = function(source, target, attrs) {
21768             return this.createConnection(source, target, attrs || {}, source.parent);
21769         };
21770
21771
21772         Modeling.prototype._create = function(type, attrs) {
21773             if (attrs instanceof model.Base) {
21774                 return attrs;
21775             } else {
21776                 return this._elementFactory.create(type, attrs);
21777             }
21778         };
21779
21780     }, {
21781         "../../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
21782         "./cmd/AppendShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js",
21783         "./cmd/CreateConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js",
21784         "./cmd/CreateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js",
21785         "./cmd/CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21786         "./cmd/DeleteConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js",
21787         "./cmd/DeleteElementsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js",
21788         "./cmd/DeleteShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js",
21789         "./cmd/LayoutConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js",
21790         "./cmd/MoveConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js",
21791         "./cmd/MoveShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js",
21792         "./cmd/MoveShapesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js",
21793         "./cmd/ReconnectConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js",
21794         "./cmd/ReplaceShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js",
21795         "./cmd/ResizeShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js",
21796         "./cmd/SpaceToolHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js",
21797         "./cmd/UpdateAnchorsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js",
21798         "./cmd/UpdateWaypointsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js",
21799         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
21800     }],
21801     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js": [function(require, module, exports) {
21802         'use strict';
21803
21804         var inherits = require('inherits');
21805
21806
21807         /**
21808          * A handler that implements reversible appending of shapes to a source shape.
21809          * 
21810          * @param {canvas}
21811          *            Canvas
21812          * @param {elementFactory}
21813          *            ElementFactory
21814          * @param {modeling}
21815          *            Modeling
21816          */
21817         function AppendShapeHandler(modeling) {
21818             this._modeling = modeling;
21819         }
21820
21821         inherits(AppendShapeHandler, require('./NoopHandler'));
21822
21823
21824         AppendShapeHandler.$inject = ['modeling'];
21825
21826         module.exports = AppendShapeHandler;
21827
21828
21829         // //// api /////////////////////////////////////////////
21830
21831         /**
21832          * Creates a new shape
21833          * 
21834          * @param {Object}
21835          *            context
21836          * @param {ElementDescriptor}
21837          *            context.shape the new shape
21838          * @param {ElementDescriptor}
21839          *            context.source the source object
21840          * @param {ElementDescriptor}
21841          *            context.parent the parent object
21842          * @param {Point}
21843          *            context.position position of the new element
21844          */
21845         AppendShapeHandler.prototype.preExecute = function(context) {
21846
21847             if (!context.source) {
21848                 throw new Error('source required');
21849             }
21850
21851             var parent = context.parent || context.source.parent,
21852                 shape = this._modeling.createShape(context.shape, context.position, parent);
21853
21854             context.shape = shape;
21855         };
21856
21857         AppendShapeHandler.prototype.postExecute = function(context) {
21858             var parent = context.connectionParent || context.shape.parent;
21859
21860             // create connection
21861             this._modeling.connect(context.source, context.shape, context.connection, parent);
21862         };
21863     }, {
21864         "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
21865         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21866     }],
21867     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js": [function(require, module, exports) {
21868         'use strict';
21869
21870
21871         function CreateConnectionHandler(canvas, layouter) {
21872             this._canvas = canvas;
21873             this._layouter = layouter;
21874         }
21875
21876         CreateConnectionHandler.$inject = ['canvas', 'layouter'];
21877
21878         module.exports = CreateConnectionHandler;
21879
21880
21881
21882         // //// api /////////////////////////////////////////
21883
21884         /**
21885          * Appends a shape to a target shape
21886          * 
21887          * @param {Object}
21888          *            context
21889          * @param {djs.element.Base}
21890          *            context.source the source object
21891          * @param {djs.element.Base}
21892          *            context.target the parent object
21893          * @param {Point}
21894          *            context.position position of the new element
21895          */
21896         CreateConnectionHandler.prototype.execute = function(context) {
21897
21898             var source = context.source,
21899                 target = context.target,
21900                 parent = context.parent;
21901
21902             if (!source || !target) {
21903                 throw new Error('source and target required');
21904             }
21905
21906             if (!parent) {
21907                 throw new Error('parent required');
21908             }
21909
21910             var connection = context.connection;
21911
21912             connection.source = source;
21913             connection.target = target;
21914
21915             if (!connection.waypoints) {
21916                 connection.waypoints = this._layouter.layoutConnection(connection);
21917             }
21918
21919             // add connection
21920             this._canvas.addConnection(connection, parent);
21921
21922             return connection;
21923         };
21924
21925         CreateConnectionHandler.prototype.revert = function(context) {
21926             var connection = context.connection;
21927
21928             this._canvas.removeConnection(connection);
21929
21930             connection.source = null;
21931             connection.target = null;
21932         };
21933     }, {}],
21934     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js": [function(require, module, exports) {
21935         'use strict';
21936
21937         var inherits = require('inherits');
21938
21939         var CreateShapeHandler = require('./CreateShapeHandler');
21940
21941
21942         /**
21943          * A handler that attaches a label to a given target shape.
21944          * 
21945          * @param {canvas}
21946          *            Canvas
21947          */
21948         function CreateLabelHandler(canvas) {
21949             CreateShapeHandler.call(this, canvas);
21950         }
21951
21952         inherits(CreateLabelHandler, CreateShapeHandler);
21953
21954         CreateLabelHandler.$inject = ['canvas'];
21955
21956         module.exports = CreateLabelHandler;
21957
21958
21959
21960         // //// api /////////////////////////////////////////
21961
21962
21963         /**
21964          * Appends a label to a target shape.
21965          * 
21966          * @method CreateLabelHandler#execute
21967          * 
21968          * @param {Object}
21969          *            context
21970          * @param {ElementDescriptor}
21971          *            context.target the element the label is attached to
21972          * @param {ElementDescriptor}
21973          *            context.parent the parent object
21974          * @param {Point}
21975          *            context.position position of the new element
21976          */
21977
21978         /**
21979          * Undo append by removing the shape
21980          */
21981         CreateLabelHandler.prototype.revert = function(context) {
21982             context.shape.labelTarget = null;
21983             this._canvas.removeShape(context.shape);
21984         };
21985
21986
21987         // //// helpers /////////////////////////////////////////
21988
21989         CreateLabelHandler.prototype.getParent = function(context) {
21990             return context.parent || context.labelTarget && context.labelTarget.parent;
21991         };
21992
21993         CreateLabelHandler.prototype.addElement = function(shape, parent, context) {
21994             shape.labelTarget = context.labelTarget;
21995             this._canvas.addShape(shape, parent, true);
21996         };
21997     }, {
21998         "./CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21999         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
22000     }],
22001     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js": [function(require, module, exports) {
22002         'use strict';
22003
22004         var assign = require('lodash/object/assign');
22005
22006
22007         /**
22008          * A handler that implements reversible addition of shapes.
22009          * 
22010          * @param {canvas}
22011          *            Canvas
22012          */
22013         function CreateShapeHandler(canvas) {
22014             this._canvas = canvas;
22015         }
22016
22017         CreateShapeHandler.$inject = ['canvas'];
22018
22019         module.exports = CreateShapeHandler;
22020
22021
22022
22023         // //// api /////////////////////////////////////////
22024
22025
22026         /**
22027          * Appends a shape to a target shape
22028          * 
22029          * @param {Object}
22030          *            context
22031          * @param {djs.model.Base}
22032          *            context.parent the parent object
22033          * @param {Point}
22034          *            context.position position of the new element
22035          */
22036         CreateShapeHandler.prototype.execute = function(context) {
22037
22038             var parent = this.getParent(context);
22039
22040             var shape = context.shape;
22041
22042             this.setPosition(shape, context);
22043
22044             this.addElement(shape, parent, context);
22045
22046             return shape;
22047         };
22048
22049
22050         /**
22051          * Undo append by removing the shape
22052          */
22053         CreateShapeHandler.prototype.revert = function(context) {
22054             this._canvas.removeShape(context.shape);
22055         };
22056
22057
22058         // //// helpers /////////////////////////////////////////
22059
22060         CreateShapeHandler.prototype.getParent = function(context) {
22061             var parent = context.parent;
22062
22063             if (!parent) {
22064                 throw new Error('parent required');
22065             }
22066
22067             return parent;
22068         };
22069
22070         CreateShapeHandler.prototype.getPosition = function(context) {
22071             if (!context.position) {
22072                 throw new Error('no position given');
22073             }
22074
22075             return context.position;
22076         };
22077
22078         CreateShapeHandler.prototype.addElement = function(shape, parent) {
22079             this._canvas.addShape(shape, parent);
22080         };
22081
22082         CreateShapeHandler.prototype.setPosition = function(shape, context) {
22083             var position = this.getPosition(context);
22084
22085             // update to center position
22086             // specified in create context
22087             assign(shape, {
22088                 x: position.x - shape.width / 2,
22089                 y: position.y - shape.height / 2
22090             });
22091         };
22092     }, {
22093         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22094     }],
22095     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js": [function(require, module, exports) {
22096         'use strict';
22097
22098         var Collections = require('../../../util/Collections');
22099
22100
22101         /**
22102          * A handler that implements reversible deletion of Connections.
22103          * 
22104          */
22105         function DeleteConnectionHandler(canvas, modeling) {
22106             this._canvas = canvas;
22107             this._modeling = modeling;
22108         }
22109
22110         DeleteConnectionHandler.$inject = ['canvas', 'modeling'];
22111
22112         module.exports = DeleteConnectionHandler;
22113
22114
22115         /**
22116          * - Remove attached label
22117          */
22118         DeleteConnectionHandler.prototype.preExecute = function(context) {
22119
22120             var connection = context.connection;
22121
22122             // Remove label
22123             if (connection.label) {
22124                 this._modeling.removeShape(connection.label);
22125             }
22126         };
22127
22128         DeleteConnectionHandler.prototype.execute = function(context) {
22129
22130             var connection = context.connection,
22131                 parent = connection.parent;
22132
22133             context.parent = parent;
22134             context.parentIndex = Collections.indexOf(parent.children, connection);
22135
22136             context.source = connection.source;
22137             context.target = connection.target;
22138
22139             this._canvas.removeConnection(connection);
22140
22141             connection.source = null;
22142             connection.target = null;
22143             connection.label = null;
22144         };
22145
22146         /**
22147          * Command revert implementation.
22148          */
22149         DeleteConnectionHandler.prototype.revert = function(context) {
22150
22151             var connection = context.connection,
22152                 parent = context.parent,
22153                 parentIndex = context.parentIndex;
22154
22155             connection.source = context.source;
22156             connection.target = context.target;
22157
22158             // restore previous location in old parent
22159             Collections.add(parent.children, connection, parentIndex);
22160
22161             this._canvas.addConnection(connection, parent);
22162         };
22163
22164     }, {
22165         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22166     }],
22167     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js": [function(require, module, exports) {
22168         'use strict';
22169
22170         var forEach = require('lodash/collection/forEach'),
22171             inherits = require('inherits');
22172
22173
22174         function DeleteElementsHandler(modeling, elementRegistry) {
22175             this._modeling = modeling;
22176             this._elementRegistry = elementRegistry;
22177         }
22178
22179         inherits(DeleteElementsHandler, require('./NoopHandler'));
22180
22181         DeleteElementsHandler.$inject = ['modeling', 'elementRegistry'];
22182
22183         module.exports = DeleteElementsHandler;
22184
22185
22186         DeleteElementsHandler.prototype.postExecute = function(context) {
22187
22188             var modeling = this._modeling,
22189                 elementRegistry = this._elementRegistry,
22190                 elements = context.elements;
22191
22192             forEach(elements, function(element) {
22193
22194                 // element may have been removed with previous
22195                 // remove operations already (e.g. in case of nesting)
22196                 if (!elementRegistry.get(element.id)) {
22197                     return;
22198                 }
22199
22200                 if (element.waypoints) {
22201                     modeling.removeConnection(element);
22202                 } else {
22203                     modeling.removeShape(element);
22204                 }
22205             });
22206         };
22207     }, {
22208         "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
22209         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
22210         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22211     }],
22212     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js": [function(require, module, exports) {
22213         'use strict';
22214
22215         var Collections = require('../../../util/Collections');
22216
22217
22218         /**
22219          * A handler that implements reversible deletion of shapes.
22220          * 
22221          */
22222         function DeleteShapeHandler(canvas, modeling) {
22223             this._canvas = canvas;
22224             this._modeling = modeling;
22225         }
22226
22227         DeleteShapeHandler.$inject = ['canvas', 'modeling'];
22228
22229         module.exports = DeleteShapeHandler;
22230
22231
22232         /**
22233          * - Remove connections - Remove all direct children
22234          */
22235         DeleteShapeHandler.prototype.preExecute = function(context) {
22236
22237             var shape = context.shape,
22238                 label = shape.label,
22239                 modeling = this._modeling;
22240
22241             // Clean up on removeShape(label)
22242             if (shape.labelTarget) {
22243                 context.labelTarget = shape.labelTarget;
22244                 shape.labelTarget = null;
22245             }
22246
22247             // Remove label
22248             if (label) {
22249                 this._modeling.removeShape(label);
22250             }
22251
22252             // remove connections
22253             this._saveClear(shape.incoming, function(connection) {
22254                 // To make sure that the connection isn't removed twice
22255                 // For example if a container is removed
22256                 modeling.removeConnection(connection);
22257             });
22258
22259             this._saveClear(shape.outgoing, function(connection) {
22260                 modeling.removeConnection(connection);
22261             });
22262
22263
22264             // remove children
22265             this._saveClear(shape.children, function(e) {
22266                 modeling.removeShape(e);
22267             });
22268         };
22269
22270
22271         DeleteShapeHandler.prototype._saveClear = function(collection, remove) {
22272
22273             var e;
22274
22275             while (!!(e = collection[0])) {
22276                 remove(e);
22277             }
22278         };
22279
22280
22281         /**
22282          * Remove shape and remember the parent
22283          */
22284         DeleteShapeHandler.prototype.execute = function(context) {
22285
22286             var shape = context.shape,
22287                 parent = shape.parent;
22288
22289             context.parent = parent;
22290             context.parentIndex = Collections.indexOf(parent.children, shape);
22291
22292             shape.label = null;
22293
22294             this._canvas.removeShape(shape);
22295         };
22296
22297
22298         /**
22299          * Command revert implementation
22300          */
22301         DeleteShapeHandler.prototype.revert = function(context) {
22302
22303             var shape = context.shape,
22304                 parent = context.parent,
22305                 parentIndex = context.parentIndex,
22306                 labelTarget = context.labelTarget;
22307
22308             // restore previous location in old parent
22309             Collections.add(parent.children, shape, parentIndex);
22310
22311             if (labelTarget) {
22312                 labelTarget.label = shape;
22313             }
22314
22315             this._canvas.addShape(shape, parent);
22316         };
22317
22318     }, {
22319         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22320     }],
22321     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js": [function(require, module, exports) {
22322         'use strict';
22323
22324         var assign = require('lodash/object/assign');
22325
22326
22327         /**
22328          * A handler that implements reversible moving of shapes.
22329          */
22330         function LayoutConnectionHandler(layouter, canvas) {
22331             this._layouter = layouter;
22332             this._canvas = canvas;
22333         }
22334
22335         LayoutConnectionHandler.$inject = ['layouter', 'canvas'];
22336
22337         module.exports = LayoutConnectionHandler;
22338
22339         LayoutConnectionHandler.prototype.execute = function(context) {
22340
22341             var connection = context.connection,
22342                 parent = connection.parent,
22343                 connectionSiblings = parent.children;
22344
22345             var oldIndex = connectionSiblings.indexOf(connection);
22346
22347             assign(context, {
22348                 oldWaypoints: connection.waypoints,
22349                 oldIndex: oldIndex
22350             });
22351
22352             sendToFront(connection);
22353
22354             connection.waypoints = this._layouter.layoutConnection(connection, context.hints);
22355
22356             return connection;
22357         };
22358
22359         LayoutConnectionHandler.prototype.revert = function(context) {
22360
22361             var connection = context.connection,
22362                 parent = connection.parent,
22363                 connectionSiblings = parent.children,
22364                 currentIndex = connectionSiblings.indexOf(connection),
22365                 oldIndex = context.oldIndex;
22366
22367             connection.waypoints = context.oldWaypoints;
22368
22369             if (oldIndex !== currentIndex) {
22370
22371                 // change position of connection in shape
22372                 connectionSiblings.splice(currentIndex, 1);
22373                 connectionSiblings.splice(oldIndex, 0, connection);
22374             }
22375
22376             return connection;
22377         };
22378
22379         // connections should have a higher z-order as there source and targets
22380         function sendToFront(connection) {
22381
22382             var connectionSiblings = connection.parent.children;
22383
22384             var connectionIdx = connectionSiblings.indexOf(connection),
22385                 sourceIdx = findIndex(connectionSiblings, connection.source),
22386                 targetIdx = findIndex(connectionSiblings, connection.target),
22387
22388                 // ensure we do not send the connection back
22389                 // if it is already in front
22390                 insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);
22391
22392             if (connectionIdx < insertIndex) {
22393                 connectionSiblings.splice(insertIndex, 0, connection); // add to new
22394                 // position
22395                 connectionSiblings.splice(connectionIdx, 1); // remove from old position
22396             }
22397
22398             function findIndex(array, obj) {
22399
22400                 var index = array.indexOf(obj);
22401                 if (index < 0 && obj) {
22402                     var parent = obj.parent;
22403                     index = findIndex(array, parent);
22404                 }
22405                 return index;
22406             }
22407
22408             return insertIndex;
22409         }
22410
22411     }, {
22412         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22413     }],
22414     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js": [function(require, module, exports) {
22415         'use strict';
22416
22417         var forEach = require('lodash/collection/forEach');
22418
22419         var Collections = require('../../../util/Collections');
22420
22421
22422         /**
22423          * A handler that implements reversible moving of connections.
22424          * 
22425          * The handler differs from the layout connection handler in a sense that it
22426          * preserves the connection layout.
22427          */
22428         function MoveConnectionHandler() {}
22429
22430         module.exports = MoveConnectionHandler;
22431
22432
22433         MoveConnectionHandler.prototype.execute = function(context) {
22434
22435             var updateAnchors = (context.hints.updateAnchors !== false);
22436
22437             var connection = context.connection,
22438                 delta = context.delta;
22439
22440             var newParent = this.getNewParent(connection, context),
22441                 oldParent = connection.parent;
22442
22443             // save old position + parent in context
22444             context.oldParent = oldParent;
22445             context.oldParentIndex = Collections.indexOf(oldParent.children, connection);
22446
22447             // update waypoint positions
22448             forEach(connection.waypoints, function(p) {
22449                 p.x += delta.x;
22450                 p.y += delta.y;
22451
22452                 if (updateAnchors && p.original) {
22453                     p.original.x += delta.x;
22454                     p.original.y += delta.y;
22455                 }
22456             });
22457
22458             // update parent
22459             connection.parent = newParent;
22460
22461             return connection;
22462         };
22463
22464         MoveConnectionHandler.prototype.revert = function(context) {
22465
22466             var updateAnchors = (context.hints.updateAnchors !== false);
22467
22468             var connection = context.connection,
22469                 oldParent = context.oldParent,
22470                 oldParentIndex = context.oldParentIndex,
22471                 delta = context.delta;
22472
22473             // restore previous location in old parent
22474             Collections.add(oldParent.children, connection, oldParentIndex);
22475
22476             // restore parent
22477             connection.parent = oldParent;
22478
22479             // revert to old waypoint positions
22480             forEach(connection.waypoints, function(p) {
22481                 p.x -= delta.x;
22482                 p.y -= delta.y;
22483
22484                 if (updateAnchors && p.original) {
22485                     p.original.x -= delta.x;
22486                     p.original.y -= delta.y;
22487                 }
22488             });
22489
22490             return connection;
22491         };
22492
22493
22494         MoveConnectionHandler.prototype.getNewParent = function(connection, context) {
22495             return context.newParent || connection.parent;
22496         };
22497
22498     }, {
22499         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22500         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22501     }],
22502     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js": [function(require, module, exports) {
22503         'use strict';
22504
22505         var assign = require('lodash/object/assign'),
22506             forEach = require('lodash/collection/forEach');
22507
22508         var MoveHelper = require('./helper/MoveHelper'),
22509             Collections = require('../../../util/Collections');
22510
22511
22512         /**
22513          * A handler that implements reversible moving of shapes.
22514          */
22515         function MoveShapeHandler(modeling) {
22516             this._modeling = modeling;
22517
22518             this._helper = new MoveHelper(modeling);
22519         }
22520
22521         MoveShapeHandler.$inject = ['modeling'];
22522
22523         module.exports = MoveShapeHandler;
22524
22525
22526         MoveShapeHandler.prototype.execute = function(context) {
22527
22528             var shape = context.shape,
22529                 delta = context.delta,
22530                 newParent = this.getNewParent(context),
22531                 oldParent = shape.parent;
22532
22533             // save old parent in context
22534             context.oldParent = oldParent;
22535             context.oldParentIndex = Collections.indexOf(oldParent.children, shape);
22536
22537             // update shape parent + position
22538             assign(shape, {
22539                 parent: newParent,
22540                 x: shape.x + delta.x,
22541                 y: shape.y + delta.y
22542             });
22543
22544             return shape;
22545         };
22546
22547         MoveShapeHandler.prototype.postExecute = function(context) {
22548
22549             var shape = context.shape,
22550                 delta = context.delta;
22551
22552             var modeling = this._modeling;
22553
22554             if (context.hints.updateAnchors !== false) {
22555                 modeling.updateAnchors(shape, delta);
22556             }
22557
22558             if (context.hints.layout !== false) {
22559                 forEach(shape.incoming, function(c) {
22560                     modeling.layoutConnection(c, {
22561                         endChanged: true
22562                     });
22563                 });
22564
22565                 forEach(shape.outgoing, function(c) {
22566                     modeling.layoutConnection(c, {
22567                         startChanged: true
22568                     });
22569                 });
22570             }
22571
22572             if (context.hints.recurse !== false) {
22573                 this.moveChildren(context);
22574             }
22575         };
22576
22577         MoveShapeHandler.prototype.revert = function(context) {
22578
22579             var shape = context.shape,
22580                 oldParent = context.oldParent,
22581                 oldParentIndex = context.oldParentIndex,
22582                 delta = context.delta;
22583
22584             // restore previous location in old parent
22585             Collections.add(oldParent.children, shape, oldParentIndex);
22586
22587             // revert to old position and parent
22588             assign(shape, {
22589                 parent: oldParent,
22590                 x: shape.x - delta.x,
22591                 y: shape.y - delta.y
22592             });
22593
22594             return shape;
22595         };
22596
22597         MoveShapeHandler.prototype.moveChildren = function(context) {
22598
22599             var delta = context.delta,
22600                 shape = context.shape;
22601
22602             this._helper.moveRecursive(shape.children, delta, null);
22603         };
22604
22605         MoveShapeHandler.prototype.getNewParent = function(context) {
22606             return context.newParent || context.shape.parent;
22607         };
22608     }, {
22609         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22610         "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js",
22611         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22612         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22613     }],
22614     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js": [function(require, module, exports) {
22615         'use strict';
22616
22617         var MoveHelper = require('./helper/MoveHelper');
22618
22619
22620         /**
22621          * A handler that implements reversible moving of shapes.
22622          */
22623         function MoveShapesHandler(modeling) {
22624             this._helper = new MoveHelper(modeling);
22625         }
22626
22627         MoveShapesHandler.$inject = ['modeling'];
22628
22629         module.exports = MoveShapesHandler;
22630
22631         MoveShapesHandler.prototype.preExecute = function(context) {
22632             context.closure = this._helper.getClosure(context.shapes);
22633         };
22634
22635         MoveShapesHandler.prototype.postExecute = function(context) {
22636             this._helper.moveClosure(context.closure, context.delta, context.newParent);
22637         };
22638
22639
22640         MoveShapesHandler.prototype.execute = function(context) {};
22641         MoveShapesHandler.prototype.revert = function(context) {};
22642
22643     }, {
22644         "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js"
22645     }],
22646     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js": [function(require, module, exports) {
22647         'use strict';
22648
22649         function NoopHandler() {}
22650
22651         module.exports = NoopHandler;
22652
22653         NoopHandler.prototype.execute = function() {};
22654         NoopHandler.prototype.revert = function() {};
22655     }, {}],
22656     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js": [function(require, module, exports) {
22657         'use strict';
22658
22659
22660         function ReconnectConnectionHandler(layouter) {}
22661
22662         ReconnectConnectionHandler.$inject = ['layouter'];
22663
22664         module.exports = ReconnectConnectionHandler;
22665
22666         ReconnectConnectionHandler.prototype.execute = function(context) {
22667
22668             var newSource = context.newSource,
22669                 newTarget = context.newTarget,
22670                 connection = context.connection;
22671
22672             if (!newSource && !newTarget) {
22673                 throw new Error('newSource or newTarget are required');
22674             }
22675
22676             if (newSource && newTarget) {
22677                 throw new Error('must specify either newSource or newTarget');
22678             }
22679
22680             if (newSource) {
22681                 context.oldSource = connection.source;
22682                 connection.source = newSource;
22683
22684                 context.oldDockingPoint = connection.waypoints[0];
22685                 connection.waypoints[0] = context.dockingPoint;
22686             }
22687
22688             if (newTarget) {
22689                 context.oldTarget = connection.target;
22690                 connection.target = newTarget;
22691
22692                 context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];
22693                 connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;
22694             }
22695
22696             return connection;
22697         };
22698
22699         ReconnectConnectionHandler.prototype.revert = function(context) {
22700
22701             var newSource = context.newSource,
22702                 newTarget = context.newTarget,
22703                 connection = context.connection;
22704
22705             if (newSource) {
22706                 connection.source = context.oldSource;
22707                 connection.waypoints[0] = context.oldDockingPoint;
22708             }
22709
22710             if (newTarget) {
22711                 connection.target = context.oldTarget;
22712                 connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;
22713             }
22714
22715             return connection;
22716         };
22717     }, {}],
22718     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js": [function(require, module, exports) {
22719         'use strict';
22720
22721         var forEach = require('lodash/collection/forEach');
22722
22723
22724         /**
22725          * A handler that implements reversible replacing of shapes. Internally the old
22726          * shape will be removed and the new shape will be added.
22727          * 
22728          * 
22729          * @class
22730          * @constructor
22731          * 
22732          * @param {canvas}
22733          *            Canvas
22734          */
22735         function ReplaceShapeHandler(modeling, rules) {
22736             this._modeling = modeling;
22737             this._rules = rules;
22738         }
22739
22740         ReplaceShapeHandler.$inject = ['modeling', 'rules'];
22741
22742         module.exports = ReplaceShapeHandler;
22743
22744
22745
22746         // //// api /////////////////////////////////////////
22747
22748
22749         /**
22750          * Replaces a shape with an replacement Element.
22751          * 
22752          * The newData object should contain type, x, y.
22753          * 
22754          * If possible also the incoming/outgoing connection will be restored.
22755          * 
22756          * @param {Object}
22757          *            context
22758          */
22759         ReplaceShapeHandler.prototype.preExecute = function(context) {
22760
22761             var modeling = this._modeling,
22762                 rules = this._rules;
22763
22764             var oldShape = context.oldShape,
22765                 newData = context.newData,
22766                 newShape;
22767
22768
22769             // (1) place a new shape at the given position
22770
22771             var position = {
22772                 x: newData.x,
22773                 y: newData.y
22774             };
22775
22776             newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);
22777
22778
22779             // (2) reconnect connections to the new shape (where allowed)
22780
22781             var incoming = oldShape.incoming.slice(),
22782                 outgoing = oldShape.outgoing.slice();
22783
22784             forEach(incoming, function(connection) {
22785                 var waypoints = connection.waypoints,
22786                     docking = waypoints[waypoints.length - 1],
22787                     allowed = rules.allowed('connection.reconnectEnd', {
22788                         source: connection.source,
22789                         target: newShape,
22790                         connection: connection
22791                     });
22792
22793                 if (allowed) {
22794                     modeling.reconnectEnd(connection, newShape, docking);
22795                 }
22796             });
22797
22798             forEach(outgoing, function(connection) {
22799                 var waypoints = connection.waypoints,
22800                     docking = waypoints[0],
22801                     allowed = rules.allowed('connection.reconnectStart', {
22802                         source: newShape,
22803                         target: connection.target,
22804                         connection: connection
22805                     });
22806
22807                 if (allowed) {
22808                     modeling.reconnectStart(connection, newShape, docking);
22809                 }
22810             });
22811         };
22812
22813
22814         ReplaceShapeHandler.prototype.postExecute = function(context) {
22815             var modeling = this._modeling;
22816
22817             var oldShape = context.oldShape;
22818
22819             modeling.removeShape(oldShape);
22820         };
22821
22822
22823         ReplaceShapeHandler.prototype.execute = function(context) {};
22824
22825         ReplaceShapeHandler.prototype.revert = function(context) {};
22826
22827     }, {
22828         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22829     }],
22830     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js": [function(require, module, exports) {
22831         'use strict';
22832
22833         var assign = require('lodash/object/assign'),
22834             forEach = require('lodash/collection/forEach');
22835
22836
22837         /**
22838          * A handler that implements reversible resizing of shapes.
22839          * 
22840          */
22841         function ResizeShapeHandler(modeling) {
22842             this._modeling = modeling;
22843         }
22844
22845         ResizeShapeHandler.$inject = ['modeling'];
22846
22847         module.exports = ResizeShapeHandler;
22848
22849         /**
22850          * { shape: {....} newBounds: { width: 20, height: 40, x: 5, y: 10 }
22851          *  }
22852          */
22853         ResizeShapeHandler.prototype.execute = function(context) {
22854
22855             var shape = context.shape,
22856                 newBounds = context.newBounds;
22857
22858             if (newBounds.x === undefined || newBounds.y === undefined ||
22859                 newBounds.width === undefined || newBounds.height === undefined) {
22860                 throw new Error('newBounds must have {x, y, width, height} properties');
22861             }
22862
22863             if (newBounds.width < 10 || newBounds.height < 10) {
22864                 throw new Error('width and height cannot be less than 10px');
22865             }
22866
22867             // save old bbox in context
22868             context.oldBounds = {
22869                 width: shape.width,
22870                 height: shape.height,
22871                 x: shape.x,
22872                 y: shape.y
22873             };
22874
22875             // update shape
22876             assign(shape, {
22877                 width: newBounds.width,
22878                 height: newBounds.height,
22879                 x: newBounds.x,
22880                 y: newBounds.y
22881             });
22882
22883             return shape;
22884         };
22885
22886         ResizeShapeHandler.prototype.postExecute = function(context) {
22887
22888             var shape = context.shape;
22889
22890             var modeling = this._modeling;
22891
22892             forEach(shape.incoming, function(c) {
22893                 modeling.layoutConnection(c, {
22894                     endChanged: true
22895                 });
22896             });
22897
22898             forEach(shape.outgoing, function(c) {
22899                 modeling.layoutConnection(c, {
22900                     startChanged: true
22901                 });
22902             });
22903
22904         };
22905
22906         ResizeShapeHandler.prototype.revert = function(context) {
22907
22908             var shape = context.shape,
22909                 oldBounds = context.oldBounds;
22910
22911             // restore previous bbox
22912             assign(shape, {
22913                 width: oldBounds.width,
22914                 height: oldBounds.height,
22915                 x: oldBounds.x,
22916                 y: oldBounds.y
22917             });
22918
22919             return shape;
22920         };
22921
22922     }, {
22923         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22924         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22925     }],
22926     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js": [function(require, module, exports) {
22927         'use strict';
22928
22929         var forEach = require('lodash/collection/forEach');
22930
22931         var SpaceUtil = require('../../space-tool/SpaceUtil');
22932
22933         /**
22934          * A handler that implements reversible creating and removing of space.
22935          * 
22936          * It executes in two phases:
22937          * 
22938          * (1) resize all affected resizeShapes (2) move all affected moveShapes
22939          */
22940         function SpaceToolHandler(modeling) {
22941             this._modeling = modeling;
22942         }
22943
22944         SpaceToolHandler.$inject = ['modeling'];
22945
22946         module.exports = SpaceToolHandler;
22947
22948
22949         SpaceToolHandler.prototype.preExecute = function(context) {
22950
22951             // resize
22952             var modeling = this._modeling,
22953                 resizingShapes = context.resizingShapes,
22954                 delta = context.delta,
22955                 direction = context.direction;
22956
22957             forEach(resizingShapes, function(shape) {
22958                 var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);
22959
22960                 modeling.resizeShape(shape, newBounds);
22961             });
22962         };
22963
22964         SpaceToolHandler.prototype.postExecute = function(context) {
22965             // move
22966             var modeling = this._modeling,
22967                 movingShapes = context.movingShapes,
22968                 delta = context.delta;
22969
22970             modeling.moveShapes(movingShapes, delta);
22971         };
22972
22973         SpaceToolHandler.prototype.execute = function(context) {};
22974         SpaceToolHandler.prototype.revert = function(context) {};
22975
22976     }, {
22977         "../../space-tool/SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js",
22978         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22979     }],
22980     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js": [function(require, module, exports) {
22981         'use strict';
22982
22983         var forEach = require('lodash/collection/forEach'),
22984             assign = require('lodash/object/assign');
22985
22986
22987         /**
22988          * Update the anchors of
22989          */
22990         function UpdateAnchorsHandler() {}
22991
22992         module.exports = UpdateAnchorsHandler;
22993
22994
22995         UpdateAnchorsHandler.prototype.execute = function(context) {
22996
22997             // update connection anchors
22998             return this.updateAnchors(context.element, context.delta);
22999         };
23000
23001         UpdateAnchorsHandler.prototype.revert = function(context) {
23002
23003             var delta = context.delta,
23004                 revertedDelta = {
23005                     x: -1 * delta.x,
23006                     y: -1 * delta.y
23007                 };
23008
23009             // revert update connection anchors
23010             return this.updateAnchors(context.element, revertedDelta);
23011         };
23012
23013         /**
23014          * Update anchors on the element according to the delta movement.
23015          * 
23016          * @param {djs.model.Element}
23017          *            element
23018          * @param {Point}
23019          *            delta
23020          * 
23021          * @return Array<djs.model.Connection>
23022          */
23023         UpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {
23024
23025             function add(point, delta) {
23026                 return {
23027                     x: point.x + delta.x,
23028                     y: point.y + delta.y
23029                 };
23030             }
23031
23032             function updateAnchor(waypoint) {
23033                 var original = waypoint.original;
23034
23035                 waypoint.original = assign(original || {}, add(original || waypoint, delta));
23036             }
23037
23038             var changed = [];
23039
23040             forEach(element.incoming, function(c) {
23041                 var waypoints = c.waypoints;
23042                 updateAnchor(waypoints[waypoints.length - 1]);
23043
23044                 changed.push(c);
23045             });
23046
23047             forEach(element.outgoing, function(c) {
23048                 var waypoints = c.waypoints;
23049                 updateAnchor(waypoints[0]);
23050
23051                 changed.push(c);
23052             });
23053
23054             return changed;
23055         };
23056     }, {
23057         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23058         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23059     }],
23060     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js": [function(require, module, exports) {
23061         'use strict';
23062
23063         function UpdateWaypointsHandler() {}
23064
23065         module.exports = UpdateWaypointsHandler;
23066
23067         UpdateWaypointsHandler.prototype.execute = function(context) {
23068
23069             var connection = context.connection,
23070                 newWaypoints = context.newWaypoints;
23071
23072             context.oldWaypoints = connection.waypoints;
23073
23074             connection.waypoints = newWaypoints;
23075
23076             return connection;
23077         };
23078
23079         UpdateWaypointsHandler.prototype.revert = function(context) {
23080
23081             var connection = context.connection,
23082                 oldWaypoints = context.oldWaypoints;
23083
23084             connection.waypoints = oldWaypoints;
23085
23086             return connection;
23087         };
23088     }, {}],
23089     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js": [function(require, module, exports) {
23090         'use strict';
23091
23092         var forEach = require('lodash/collection/forEach');
23093
23094         var Elements = require('../../../../util/Elements');
23095
23096
23097         /**
23098          * A helper that is able to carry out serialized move operations on multiple
23099          * elements.
23100          * 
23101          * @param {Modeling}
23102          *            modeling
23103          */
23104         function MoveHelper(modeling) {
23105             this._modeling = modeling;
23106         }
23107
23108         module.exports = MoveHelper;
23109
23110         /**
23111          * Move the specified elements and all children by the given delta.
23112          * 
23113          * This moves all enclosed connections, too and layouts all affected external
23114          * connections.
23115          * 
23116          * @param {Array
23117          *            <djs.model.Base>} elements
23118          * @param {Point}
23119          *            delta
23120          * @param {djs.model.Base}
23121          *            newParent applied to the first level of shapes
23122          * 
23123          * @return {Array<djs.model.Base>} list of touched elements
23124          */
23125         MoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {
23126             return this.moveClosure(this.getClosure(elements), delta, newParent);
23127         };
23128
23129         /**
23130          * Move the given closure of elmements
23131          */
23132         MoveHelper.prototype.moveClosure = function(closure, delta, newParent) {
23133
23134             var modeling = this._modeling;
23135
23136             var allShapes = closure.allShapes,
23137                 allConnections = closure.allConnections,
23138                 enclosedConnections = closure.enclosedConnections,
23139                 topLevel = closure.topLevel;
23140
23141             // move all shapes
23142             forEach(allShapes, function(s) {
23143
23144                 modeling.moveShape(s, delta, topLevel[s.id] && newParent, {
23145                     recurse: false,
23146                     layout: false
23147                 });
23148             });
23149
23150             // move all child connections / layout external connections
23151             forEach(allConnections, function(c) {
23152
23153                 var startMoved = !!allShapes[c.source.id],
23154                     endMoved = !!allShapes[c.target.id];
23155
23156                 if (enclosedConnections[c.id] &&
23157                     startMoved && endMoved) {
23158                     modeling.moveConnection(c, delta, topLevel[c.id] && newParent, {
23159                         updateAnchors: false
23160                     });
23161                 } else {
23162                     modeling.layoutConnection(c, {
23163                         startChanged: startMoved,
23164                         endChanged: endMoved
23165                     });
23166                 }
23167             });
23168         };
23169
23170         /**
23171          * Returns the closure for the selected elements
23172          * 
23173          * @param {Array
23174          *            <djs.model.Base>} elements
23175          * @return {Object} closure
23176          */
23177         MoveHelper.prototype.getClosure = function(elements) {
23178             return Elements.getClosure(elements);
23179         };
23180
23181     }, {
23182         "../../../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23183         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23184     }],
23185     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
23186         module.exports = {
23187             __depends__: [
23188                 require('../../command'),
23189                 require('../change-support'),
23190                 require('../rules')
23191             ],
23192             __init__: ['modeling'],
23193             modeling: ['type', require('./Modeling')],
23194             layouter: ['type', require('../../layout/BaseLayouter')]
23195         };
23196
23197     }, {
23198         "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
23199         "../../layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
23200         "../change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
23201         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23202         "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js"
23203     }],
23204     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js": [function(require, module, exports) {
23205         'use strict';
23206
23207         var assign = require('lodash/object/assign'),
23208             filter = require('lodash/collection/filter'),
23209             groupBy = require('lodash/collection/groupBy');
23210
23211
23212         var LOW_PRIORITY = 500,
23213             HIGH_PRIORITY = 1500;
23214
23215         var getOriginalEvent = require('../../util/Event').getOriginal;
23216
23217         var round = Math.round;
23218
23219
23220         /**
23221          * Return a filtered list of elements that do not contain those nested into
23222          * others.
23223          * 
23224          * @param {Array
23225          *            <djs.model.Base>} elements
23226          * 
23227          * @return {Array<djs.model.Base>} filtered
23228          */
23229         function removeNested(elements) {
23230
23231             var ids = groupBy(elements, 'id');
23232
23233             return filter(elements, function(element) {
23234                 while (!!(element = element.parent)) {
23235                     if (ids[element.id]) {
23236                         return false;
23237                     }
23238                 }
23239
23240                 return true;
23241             });
23242         }
23243
23244
23245
23246         /**
23247          * A plugin that makes shapes draggable / droppable.
23248          * 
23249          * @param {EventBus}
23250          *            eventBus
23251          * @param {Dragging}
23252          *            dragging
23253          * @param {Modeling}
23254          *            modeling
23255          * @param {Selection}
23256          *            selection
23257          * @param {Rules}
23258          *            rules
23259          */
23260         function MoveEvents(eventBus, dragging, modeling, selection, rules) {
23261
23262             // rules
23263
23264             function canMove(shapes, delta, target) {
23265
23266                 return rules.allowed('shapes.move', {
23267                     shapes: shapes,
23268                     delta: delta,
23269                     newParent: target
23270                 });
23271             }
23272
23273
23274             // move events
23275
23276             // assign a high priority to this handler to setup the environment
23277             // others may hook up later, e.g. at default priority and modify
23278             // the move environment
23279             //
23280             eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {
23281                 
23282                 var context = event.context,
23283                     shape = event.shape,
23284                     shapes = selection.get().slice();
23285
23286                 // move only single shape shape if the dragged element
23287                 // is not part of the current selection
23288                 if (shapes.indexOf(shape) === -1) {
23289                     shapes = [shape];
23290                 }
23291
23292                 // ensure we remove nested elements in the collection
23293                 shapes = removeNested(shapes);
23294
23295                 // attach shapes to drag context
23296                 assign(context, {
23297                     shapes: shapes,
23298                     shape: shape
23299                 });
23300
23301                 // check if we can move the elements
23302                 if (!canMove(shapes)) {
23303                     // suppress move operation
23304                     event.stopPropagation();
23305
23306                     return false;
23307                 }
23308             });
23309
23310             // assign a low priority to this handler
23311             // to let others modify the move event before we update
23312             // the context
23313             //
23314             eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23315
23316                 var context = event.context,
23317                     shapes = context.shapes,
23318                     hover = event.hover,
23319                     delta = {
23320                         x: event.dx,
23321                         y: event.dy
23322                     },
23323                     canExecute;
23324
23325                 // check if we can move the elements
23326                 canExecute = canMove(shapes, delta, hover);
23327
23328                 context.delta = delta;
23329                 context.canExecute = canExecute;
23330
23331                 // simply ignore move over
23332                 if (canExecute === null) {
23333                     context.target = null;
23334
23335                     return;
23336                 }
23337
23338                 context.target = hover;
23339             });
23340
23341             eventBus.on('shape.move.end', function(event) {
23342
23343                 var context = event.context;
23344
23345                 var delta = context.delta,
23346                     canExecute = context.canExecute;
23347
23348                 if (!canExecute) {
23349                     return false;
23350                 }
23351
23352                 // ensure we have actual pixel values deltas
23353                 // (important when zoom level was > 1 during move)
23354                 delta.x = round(delta.x);
23355                 delta.y = round(delta.y);
23356
23357                 modeling.moveShapes(context.shapes, delta, context.target);
23358             });
23359
23360
23361             // move activation
23362
23363             eventBus.on('element.mousedown', function(event) {
23364
23365                 var originalEvent = getOriginalEvent(event);
23366
23367                 if (!originalEvent) {
23368                     throw new Error('must supply DOM mousedown event');
23369                 }
23370
23371                 start(originalEvent, event.element);
23372             });
23373
23374
23375             function start(event, element, activate) {
23376
23377                 // do not move connections or the root element
23378                 if (element.waypoints || !element.parent) {
23379                     return;
23380                 }
23381
23382                 dragging.activate(event, 'shape.move', {
23383                     cursor: 'grabbing',
23384                     autoActivate: activate,
23385                     data: {
23386                         shape: element,
23387                         context: {}
23388                     }
23389                 });
23390             }
23391
23392             // API
23393
23394             this.start = start;
23395         }
23396
23397         MoveEvents.$inject = ['eventBus', 'dragging', 'modeling', 'selection', 'rules'];
23398
23399         module.exports = MoveEvents;
23400
23401     }, {
23402         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
23403         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23404         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
23405         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23406     }],
23407     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js": [function(require, module, exports) {
23408         'use strict';
23409
23410         var flatten = require('lodash/array/flatten'),
23411             forEach = require('lodash/collection/forEach'),
23412             filter = require('lodash/collection/filter'),
23413             find = require('lodash/collection/find'),
23414             map = require('lodash/collection/map');
23415
23416         var Elements = require('../../util/Elements');
23417
23418         var LOW_PRIORITY = 500;
23419
23420         var MARKER_DRAGGING = 'djs-dragging',
23421             MARKER_OK = 'drop-ok',
23422             MARKER_NOT_OK = 'drop-not-ok';
23423
23424
23425         /**
23426          * A plugin that makes shapes draggable / droppable.
23427          * 
23428          * @param {EventBus}
23429          *            eventBus
23430          * @param {ElementRegistry}
23431          *            elementRegistry
23432          * @param {Canvas}
23433          *            canvas
23434          * @param {Styles}
23435          *            styles
23436          */
23437         function MoveVisuals(eventBus, elementRegistry, canvas, styles) {
23438
23439             function getGfx(e) {
23440                 return elementRegistry.getGraphics(e);
23441             }
23442
23443             function getVisualDragShapes(shapes) {
23444
23445                 var elements = Elements.selfAndDirectChildren(shapes, true);
23446                 var filteredElements = removeEdges(elements);
23447
23448                 return filteredElements;
23449             }
23450
23451             function getAllDraggedElements(shapes) {
23452                 var allShapes = Elements.selfAndAllChildren(shapes, true);
23453
23454                 var allConnections = map(allShapes, function(shape) {
23455                     return (shape.incoming || []).concat(shape.outgoing || []);
23456                 });
23457
23458                 return flatten(allShapes.concat(allConnections), true);
23459             }
23460
23461             function addDragger(shape, dragGroup) {
23462                 var gfx = getGfx(shape);
23463                 var dragger = gfx.clone();
23464                 var bbox = gfx.getBBox();
23465
23466                 dragger.attr(styles.cls('djs-dragger', [], {
23467                     x: bbox.x,
23468                     y: bbox.y
23469                 }));
23470
23471                 dragGroup.add(dragger);
23472             }
23473
23474             // assign a low priority to this handler
23475             // to let others modify the move context before
23476             // we draw things
23477             //
23478             eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {
23479
23480                 var context = event.context,
23481                     dragShapes = context.shapes;
23482
23483                 var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
23484
23485                 var visuallyDraggedShapes = getVisualDragShapes(dragShapes);
23486
23487                 visuallyDraggedShapes.forEach(function(shape) {
23488                     addDragger(shape, dragGroup);
23489                 });
23490
23491
23492                 // cache all dragged elements / gfx
23493                 // so that we can quickly undo their state changes later
23494                 var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);
23495
23496                 // add dragging marker
23497                 forEach(allDraggedElements, function(e) {
23498                     canvas.addMarker(e, MARKER_DRAGGING);
23499                 });
23500
23501                 context.dragGroup = dragGroup;
23502             });
23503
23504             // assign a low priority to this handler
23505             // to let others modify the move context before
23506             // we draw things
23507             //
23508             eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23509
23510                 var context = event.context,
23511                     dragGroup = context.dragGroup,
23512                     target = context.target;
23513
23514                 if (target) {
23515                     canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23516                 }
23517
23518                 dragGroup.translate(event.dx, event.dy);
23519             });
23520
23521             eventBus.on(['shape.move.out', 'shape.move.cleanup'], function(event) {
23522                 var context = event.context;
23523
23524                 if (context.target) {
23525                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23526                 }
23527             });
23528
23529             eventBus.on('shape.move.cleanup', function(event) {
23530
23531                 var context = event.context,
23532                     allDraggedElements = context.allDraggedElements,
23533                     dragGroup = context.dragGroup;
23534
23535
23536                 // remove dragging marker
23537                 forEach(allDraggedElements, function(e) {
23538                     canvas.removeMarker(e, MARKER_DRAGGING);
23539                 });
23540
23541                 if (dragGroup) {
23542                     dragGroup.remove();
23543                 }
23544             });
23545         }
23546
23547         // returns elements minus all connections
23548         // where source or target is not elements
23549         function removeEdges(elements) {
23550
23551             var filteredElements = filter(elements, function(element) {
23552
23553                 if (!element.waypoints) { // shapes
23554                     return true;
23555                 } else { // connections
23556                     var srcFound = find(elements, element.source);
23557                     var targetFound = find(elements, element.target);
23558
23559                     return srcFound && targetFound;
23560                 }
23561             });
23562
23563             return filteredElements;
23564         }
23565
23566         MoveVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
23567
23568         module.exports = MoveVisuals;
23569
23570     }, {
23571         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23572         "lodash/array/flatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js",
23573         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23574         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
23575         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23576         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js"
23577     }],
23578     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js": [function(require, module, exports) {
23579         module.exports = {
23580             __depends__: [
23581                 require('../interaction-events'),
23582                 require('../selection'),
23583                 require('../outline'),
23584                 require('../rules'),
23585                 require('../dragging')
23586             ],
23587             __init__: ['move', 'moveVisuals'],
23588             move: ['type', require('./Move')],
23589             moveVisuals: ['type', require('./MoveVisuals')]
23590         };
23591
23592     }, {
23593         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
23594         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
23595         "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
23596         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23597         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
23598         "./Move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js",
23599         "./MoveVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js"
23600     }],
23601     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js": [function(require, module, exports) {
23602         'use strict';
23603
23604         var Snap = require('../../../vendor/snapsvg');
23605         var getBBox = require('../../util/Elements').getBBox;
23606
23607
23608         /**
23609          * @class
23610          * 
23611          * A plugin that adds an outline to shapes and connections that may be activated
23612          * and styled via CSS classes.
23613          * 
23614          * @param {EventBus}
23615          *            events the event bus
23616          */
23617         function Outline(eventBus, styles, elementRegistry) {
23618
23619             var OUTLINE_OFFSET = 6;
23620
23621             var OUTLINE_STYLE = styles.cls('djs-outline', ['no-fill']);
23622
23623             function createOutline(gfx, bounds) {
23624                 return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
23625             }
23626
23627             function updateShapeOutline(outline, bounds) {
23628
23629                 outline.attr({
23630                     x: -OUTLINE_OFFSET,
23631                     y: -OUTLINE_OFFSET,
23632                     width: bounds.width + OUTLINE_OFFSET * 2,
23633                     height: bounds.height + OUTLINE_OFFSET * 2
23634                 });
23635             }
23636
23637             function updateConnectionOutline(outline, connection) {
23638
23639                 var bbox = getBBox(connection);
23640
23641                 outline.attr({
23642                     x: bbox.x - OUTLINE_OFFSET,
23643                     y: bbox.y - OUTLINE_OFFSET,
23644                     width: bbox.width + OUTLINE_OFFSET * 2,
23645                     height: bbox.height + OUTLINE_OFFSET * 2
23646                 });
23647             }
23648
23649             eventBus.on(['shape.added', 'shape.changed'], function(event) {
23650                 var element = event.element,
23651                     gfx = event.gfx;
23652
23653                 var outline = gfx.select('.djs-outline');
23654
23655                 if (!outline) {
23656                     outline = createOutline(gfx, element);
23657                 }
23658
23659                 updateShapeOutline(outline, element);
23660             });
23661
23662             eventBus.on(['connection.added', 'connection.changed'], function(event) {
23663                 var element = event.element,
23664                     gfx = event.gfx;
23665
23666                 var outline = gfx.select('.djs-outline');
23667
23668                 if (!outline) {
23669                     outline = createOutline(gfx, element);
23670                 }
23671
23672                 updateConnectionOutline(outline, element);
23673             });
23674
23675
23676         }
23677
23678
23679         Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
23680
23681         module.exports = Outline;
23682
23683     }, {
23684         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
23685         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js"
23686     }],
23687     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js": [function(require, module, exports) {
23688         'use strict';
23689
23690         module.exports = {
23691             __init__: ['outline'],
23692             outline: ['type', require('./Outline')]
23693         };
23694     }, {
23695         "./Outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js"
23696     }],
23697     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js": [function(require, module, exports) {
23698         'use strict';
23699
23700         var isArray = require('lodash/lang/isArray'),
23701             isString = require('lodash/lang/isString'),
23702             isObject = require('lodash/lang/isObject'),
23703             assign = require('lodash/object/assign'),
23704             forEach = require('lodash/collection/forEach'),
23705             filter = require('lodash/collection/filter'),
23706             debounce = require('lodash/function/debounce');
23707
23708         var domify = require('min-dom/lib/domify'),
23709             domClasses = require('min-dom/lib/classes'),
23710             domRemove = require('min-dom/lib/remove');
23711
23712         var getBBox = require('../../util/Elements').getBBox;
23713
23714         // document wide unique overlay ids
23715         var ids = new(require('../../util/IdGenerator'))('ov');
23716
23717
23718         function createRoot(parent) {
23719             var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
23720             parent.insertBefore(root, parent.firstChild);
23721
23722             return root;
23723         }
23724
23725
23726         function setPosition(el, x, y) {
23727             assign(el.style, {
23728                 left: x + 'px',
23729                 top: y + 'px'
23730             });
23731         }
23732
23733         function setVisible(el, visible) {
23734             el.style.display = visible === false ? 'none' : '';
23735         }
23736
23737         /**
23738          * A service that allows users to attach overlays to diagram elements.
23739          * 
23740          * The overlay service will take care of overlay positioning during updates.
23741          * 
23742          * @example
23743          *  // add a pink badge on the top left of the shape overlays.add(someShape, {
23744          * position: { top: -5, left: -5 }, html: '<div style="width: 10px; background:
23745          * fuchsia; color: white;">0</div>' });
23746          *  // or add via shape id
23747          * 
23748          * overlays.add('some-element-id', { position: { top: -5, left: -5 } html: '<div
23749          * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23750          *  // or add with optional type
23751          * 
23752          * overlays.add(someShape, 'badge', { position: { top: -5, left: -5 } html: '<div
23753          * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23754          * 
23755          *  // remove an overlay
23756          * 
23757          * var id = overlays.add(...); overlays.remove(id);
23758          * 
23759          * @param {EventBus}
23760          *            eventBus
23761          * @param {Canvas}
23762          *            canvas
23763          * @param {ElementRegistry}
23764          *            elementRegistry
23765          */
23766         function Overlays(config, eventBus, canvas, elementRegistry) {
23767
23768             this._eventBus = eventBus;
23769             this._canvas = canvas;
23770             this._elementRegistry = elementRegistry;
23771
23772             this._ids = ids;
23773
23774             this._overlayDefaults = {
23775                 show: {
23776                     minZoom: 0.7,
23777                     maxZoom: 5.0
23778                 }
23779             };
23780
23781             /**
23782              * Mapping overlayId -> overlay
23783              */
23784             this._overlays = {};
23785
23786             /**
23787              * Mapping elementId -> overlay container
23788              */
23789             this._overlayContainers = {};
23790
23791             // root html element for all overlays
23792             this._overlayRoot = createRoot(canvas.getContainer());
23793
23794             this._init(config);
23795         }
23796
23797
23798         Overlays.$inject = ['config.overlays', 'eventBus', 'canvas', 'elementRegistry'];
23799
23800         module.exports = Overlays;
23801
23802
23803         /**
23804          * Returns the overlay with the specified id or a list of overlays for an
23805          * element with a given type.
23806          * 
23807          * @example
23808          *  // return the single overlay with the given id overlays.get('some-id');
23809          *  // return all overlays for the shape overlays.get({ element: someShape });
23810          *  // return all overlays on shape with type 'badge' overlays.get({ element:
23811          * someShape, type: 'badge' });
23812          *  // shape can also be specified as id overlays.get({ element: 'element-id',
23813          * type: 'badge' });
23814          * 
23815          * 
23816          * @param {Object}
23817          *            search
23818          * @param {String}
23819          *            [search.id]
23820          * @param {String|djs.model.Base}
23821          *            [search.element]
23822          * @param {String}
23823          *            [search.type]
23824          * 
23825          * @return {Object|Array<Object>} the overlay(s)
23826          */
23827         Overlays.prototype.get = function(search) {
23828
23829             if (isString(search)) {
23830                 search = {
23831                     id: search
23832                 };
23833             }
23834
23835             if (search.element) {
23836                 var container = this._getOverlayContainer(search.element, true);
23837
23838                 // return a list of overlays when searching by element (+type)
23839                 if (container) {
23840                     return search.type ? filter(container.overlays, {
23841                         type: search.type
23842                     }) : container.overlays.slice();
23843                 } else {
23844                     return [];
23845                 }
23846             } else
23847             if (search.type) {
23848                 return filter(this._overlays, {
23849                     type: search.type
23850                 });
23851             } else {
23852                 // return single element when searching by id
23853                 return search.id ? this._overlays[search.id] : null;
23854             }
23855         };
23856
23857         /**
23858          * Adds a HTML overlay to an element.
23859          * 
23860          * @param {String|djs.model.Base}
23861          *            element attach overlay to this shape
23862          * @param {String}
23863          *            [type] optional type to assign to the overlay
23864          * @param {Object}
23865          *            overlay the overlay configuration
23866          * 
23867          * @param {String|DOMElement}
23868          *            overlay.html html element to use as an overlay
23869          * @param {Object}
23870          *            [overlay.show] show configuration
23871          * @param {Number}
23872          *            [overlay.show.minZoom] minimal zoom level to show the overlay
23873          * @param {Number}
23874          *            [overlay.show.maxZoom] maximum zoom level to show the overlay
23875          * @param {Object}
23876          *            overlay.position where to attach the overlay
23877          * @param {Number}
23878          *            [overlay.position.left] relative to element bbox left attachment
23879          * @param {Number}
23880          *            [overlay.position.top] relative to element bbox top attachment
23881          * @param {Number}
23882          *            [overlay.position.bottom] relative to element bbox bottom
23883          *            attachment
23884          * @param {Number}
23885          *            [overlay.position.right] relative to element bbox right attachment
23886          * 
23887          * @return {String} id that may be used to reference the overlay for update or
23888          *         removal
23889          */
23890         Overlays.prototype.add = function(element, type, overlay) {
23891
23892             if (isObject(type)) {
23893                 overlay = type;
23894                 type = null;
23895             }
23896
23897             if (!element.id) {
23898                 element = this._elementRegistry.get(element);
23899             }
23900
23901             if (!overlay.position) {
23902                 throw new Error('must specifiy overlay position');
23903             }
23904
23905             if (!overlay.html) {
23906                 throw new Error('must specifiy overlay html');
23907             }
23908
23909             if (!element) {
23910                 throw new Error('invalid element specified');
23911             }
23912
23913             var id = this._ids.next();
23914
23915             overlay = assign({}, this._overlayDefaults, overlay, {
23916                 id: id,
23917                 type: type,
23918                 element: element,
23919                 html: overlay.html
23920             });
23921
23922             this._addOverlay(overlay);
23923
23924             return id;
23925         };
23926
23927
23928         /**
23929          * Remove an overlay with the given id or all overlays matching the given
23930          * filter.
23931          * 
23932          * @see Overlays#get for filter options.
23933          * 
23934          * @param {String}
23935          *            [id]
23936          * @param {Object}
23937          *            [filter]
23938          */
23939         Overlays.prototype.remove = function(filter) {
23940
23941             var overlays = this.get(filter) || [];
23942
23943             if (!isArray(overlays)) {
23944                 overlays = [overlays];
23945             }
23946
23947             var self = this;
23948
23949             forEach(overlays, function(overlay) {
23950
23951                 var container = self._getOverlayContainer(overlay.element, true);
23952
23953                 if (overlay) {
23954                     domRemove(overlay.html);
23955                     domRemove(overlay.htmlContainer);
23956
23957                     delete overlay.htmlContainer;
23958                     delete overlay.element;
23959
23960                     delete self._overlays[overlay.id];
23961                 }
23962
23963                 if (container) {
23964                     var idx = container.overlays.indexOf(overlay);
23965                     if (idx !== -1) {
23966                         container.overlays.splice(idx, 1);
23967                     }
23968                 }
23969             });
23970
23971         };
23972
23973
23974         Overlays.prototype.show = function() {
23975             setVisible(this._overlayRoot);
23976         };
23977
23978
23979         Overlays.prototype.hide = function() {
23980             setVisible(this._overlayRoot, false);
23981         };
23982
23983
23984         Overlays.prototype._updateOverlayContainer = function(container) {
23985             var element = container.element,
23986                 html = container.html;
23987
23988             // update container left,top according to the elements x,y coordinates
23989             // this ensures we can attach child elements relative to this container
23990
23991             var x = element.x,
23992                 y = element.y;
23993
23994             if (element.waypoints) {
23995                 var bbox = getBBox(element);
23996                 x = bbox.x;
23997                 y = bbox.y;
23998             }
23999
24000             setPosition(html, x, y);
24001         };
24002
24003
24004         Overlays.prototype._updateOverlay = function(overlay) {
24005
24006             var position = overlay.position,
24007                 htmlContainer = overlay.htmlContainer,
24008                 element = overlay.element;
24009
24010             // update overlay html relative to shape because
24011             // it is already positioned on the element
24012
24013             // update relative
24014             var left = position.left,
24015                 top = position.top;
24016
24017             if (position.right !== undefined) {
24018
24019                 var width;
24020
24021                 if (element.waypoints) {
24022                     width = getBBox(element).width;
24023                 } else {
24024                     width = element.width;
24025                 }
24026
24027                 left = position.right * -1 + width;
24028             }
24029
24030             if (position.bottom !== undefined) {
24031
24032                 var height;
24033
24034                 if (element.waypoints) {
24035                     height = getBBox(element).height;
24036                 } else {
24037                     height = element.height;
24038                 }
24039
24040                 top = position.bottom * -1 + height;
24041             }
24042
24043             setPosition(htmlContainer, left || 0, top || 0);
24044         };
24045
24046
24047         Overlays.prototype._createOverlayContainer = function(element) {
24048             var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
24049
24050             this._overlayRoot.appendChild(html);
24051
24052             var container = {
24053                 html: html,
24054                 element: element,
24055                 overlays: []
24056             };
24057
24058             this._updateOverlayContainer(container);
24059
24060             return container;
24061         };
24062
24063
24064         Overlays.prototype._updateRoot = function(viewbox) {
24065             var a = viewbox.scale || 1;
24066             var d = viewbox.scale || 1;
24067
24068             var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
24069
24070             this._overlayRoot.style.transform = matrix;
24071             this._overlayRoot.style['-ms-transform'] = matrix;
24072         };
24073
24074
24075         Overlays.prototype._getOverlayContainer = function(element, raw) {
24076             var id = (element && element.id) || element;
24077
24078             var container = this._overlayContainers[id];
24079             if (!container && !raw) {
24080                 container = this._overlayContainers[id] = this._createOverlayContainer(element);
24081             }
24082
24083             return container;
24084         };
24085
24086
24087         Overlays.prototype._addOverlay = function(overlay) {
24088
24089             var id = overlay.id,
24090                 element = overlay.element,
24091                 html = overlay.html,
24092                 htmlContainer,
24093                 overlayContainer;
24094
24095             // unwrap jquery (for those who need it)
24096             if (html.get) {
24097                 html = html.get(0);
24098             }
24099
24100             // create proper html elements from
24101             // overlay HTML strings
24102             if (isString(html)) {
24103                 html = domify(html);
24104             }
24105
24106             overlayContainer = this._getOverlayContainer(element);
24107
24108             htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
24109
24110             htmlContainer.appendChild(html);
24111
24112             if (overlay.type) {
24113                 domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
24114             }
24115
24116             overlay.htmlContainer = htmlContainer;
24117
24118             overlayContainer.overlays.push(overlay);
24119             overlayContainer.html.appendChild(htmlContainer);
24120
24121             this._overlays[id] = overlay;
24122
24123             this._updateOverlay(overlay);
24124         };
24125
24126         Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
24127
24128             forEach(this._overlays, function(overlay) {
24129                 var show = overlay.show,
24130                     htmlContainer = overlay.htmlContainer,
24131                     visible = true;
24132
24133                 if (show) {
24134                     if (show.minZoom > viewbox.scale ||
24135                         show.maxZoom < viewbox.scale) {
24136                         visible = false;
24137                     }
24138
24139                     setVisible(htmlContainer, visible);
24140                 }
24141             });
24142         };
24143
24144         Overlays.prototype._init = function(config) {
24145
24146             var eventBus = this._eventBus;
24147
24148             var self = this;
24149
24150
24151             // scroll/zoom integration
24152
24153             var updateViewbox = function(viewbox) {
24154                 self._updateRoot(viewbox);
24155                 self._updateOverlayVisibilty(viewbox);
24156
24157                 self.show();
24158             };
24159
24160             if (!config || config.deferUpdate !== false) {
24161                 updateViewbox = debounce(updateViewbox, 300);
24162             }
24163
24164             eventBus.on('canvas.viewbox.changed', function(event) {
24165                 self.hide();
24166                 updateViewbox(event.viewbox);
24167             });
24168
24169
24170             // remove integration
24171
24172             eventBus.on(['shape.remove', 'connection.remove'], function(e) {
24173                 var overlays = self.get({
24174                     element: e.element
24175                 });
24176
24177                 forEach(overlays, function(o) {
24178                     self.remove(o.id);
24179                 });
24180             });
24181
24182
24183             // move integration
24184
24185             eventBus.on([
24186                 'element.changed'
24187             ], function(e) {
24188                 var element = e.element;
24189
24190                 var container = self._getOverlayContainer(element, true);
24191
24192                 if (container) {
24193                     forEach(container.overlays, function(overlay) {
24194                         self._updateOverlay(overlay);
24195                     });
24196
24197                     self._updateOverlayContainer(container);
24198                 }
24199             });
24200
24201
24202             // marker integration, simply add them on the overlays as classes, too.
24203
24204             eventBus.on('element.marker.update', function(e) {
24205                 var container = self._getOverlayContainer(e.element, true);
24206                 if (container) {
24207                     domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
24208                 }
24209             });
24210         };
24211
24212     }, {
24213         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
24214         "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
24215         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
24216         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24217         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
24218         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
24219         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
24220         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
24221         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24222         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24223         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24224         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24225     }],
24226     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js": [function(require, module, exports) {
24227         module.exports = {
24228             __init__: ['overlays'],
24229             overlays: ['type', require('./Overlays')]
24230         };
24231     }, {
24232         "./Overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js"
24233     }],
24234     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js": [function(require, module, exports) {
24235         'use strict';
24236
24237         var isFunction = require('lodash/lang/isFunction'),
24238             forEach = require('lodash/collection/forEach');
24239
24240         var domify = require('min-dom/lib/domify'),
24241             domQuery = require('min-dom/lib/query'),
24242             domAttr = require('min-dom/lib/attr'),
24243             domClear = require('min-dom/lib/clear'),
24244             domClasses = require('min-dom/lib/classes'),
24245             domMatches = require('min-dom/lib/matches'),
24246             domDelegate = require('min-dom/lib/delegate'),
24247             domEvent = require('min-dom/lib/event');
24248
24249
24250         var toggleSelector = '.djs-palette-toggle',
24251             entrySelector = '.entry',
24252             elementSelector = toggleSelector + ', ' + entrySelector;
24253
24254
24255         /**
24256          * A palette containing modeling elements.
24257          */
24258         function Palette(eventBus, canvas) {
24259
24260             this._eventBus = eventBus;
24261             this._canvas = canvas;
24262
24263             this._providers = [];
24264         }
24265
24266         Palette.$inject = ['eventBus', 'canvas'];
24267
24268         module.exports = Palette;
24269
24270
24271         /**
24272          * Register a provider with the palette
24273          * 
24274          * @param {PaletteProvider}
24275          *            provider
24276          */
24277         Palette.prototype.registerProvider = function(provider) {
24278             this._providers.push(provider);
24279
24280             if (!this._container) {
24281                 this._init();
24282             }
24283
24284             this._update();
24285         };
24286
24287
24288         /**
24289          * Returns the palette entries for a given element
24290          * 
24291          * @return {Array<PaletteEntryDescriptor>} list of entries
24292          */
24293         Palette.prototype.getEntries = function() {
24294
24295             var entries = {};
24296
24297             // loop through all providers and their entries.
24298             // group entries by id so that overriding an entry is possible
24299             forEach(this._providers, function(provider) {
24300                 var e = provider.getPaletteEntries();
24301
24302                 forEach(e, function(entry, id) {
24303                     entries[id] = entry;
24304                 });
24305             });
24306
24307             return entries;
24308         };
24309
24310
24311         /**
24312          * Initialize
24313          */
24314         Palette.prototype._init = function() {
24315             var parent = this._canvas.getContainer(),
24316                 container = this._container = domify(Palette.HTML_MARKUP),
24317                 self = this;
24318
24319             parent.appendChild(container);
24320
24321             domDelegate.bind(container, elementSelector, 'click', function(event) {
24322
24323                 var target = event.delegateTarget;
24324
24325                 if (domMatches(target, toggleSelector)) {
24326                     return self.toggle();
24327                 }
24328
24329                 self.trigger('click', event);
24330             });
24331
24332             // prevent drag propagation
24333             domEvent.bind(container, 'mousedown', function(event) {
24334                 event.stopPropagation();
24335             });
24336
24337             // prevent drag propagation
24338             domDelegate.bind(container, entrySelector, 'dragstart', function(event) {
24339                 self.trigger('dragstart', event);
24340             });
24341
24342             this._eventBus.fire('palette.create', {
24343                 html: container
24344             });
24345         };
24346
24347
24348         Palette.prototype._update = function() {
24349
24350             var entriesContainer = domQuery('.djs-palette-entries', this._container),
24351                 entries = this._entries = this.getEntries();
24352
24353             domClear(entriesContainer);
24354
24355             forEach(entries, function(entry, id) {
24356
24357                 var grouping = entry.group || 'default';
24358
24359                 var container = domQuery('[data-group=' + grouping + ']', entriesContainer);
24360                 if (!container) {
24361                     container = domify('<div class="group" data-group="' + grouping + '"></div>');
24362                     entriesContainer.appendChild(container);
24363                 }
24364
24365                 var html = entry.html || (
24366                     entry.separator ?
24367                     '<hr class="separator" />' :
24368                     '<div class="entry" draggable="true"></div>');
24369
24370
24371                 var control = domify(html);
24372                 // alert("Control ::" + control + " HTML :: " + html);
24373
24374                 container.appendChild(control);
24375
24376                 if (!entry.separator) {
24377                     domAttr(control, 'data-action', id);
24378
24379                     if (entry.title) {
24380                         domAttr(control, 'title', entry.title);
24381                     }
24382
24383
24384
24385                     if (entry.className) {
24386                         domClasses(control).add(entry.className);
24387                     }
24388
24389                     if (entry.imageUrl) {
24390                         control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
24391                     }
24392                 }
24393
24394                 // alert("Entry Title :: " + entry.title + " Entry HTML :: " + html);
24395             });
24396
24397             // open after update
24398             this.open(true);
24399         };
24400
24401
24402         /**
24403          * Trigger an action available on the palette
24404          * 
24405          * @param {String}
24406          *            action
24407          * @param {Event}
24408          *            event
24409          */
24410         Palette.prototype.trigger = function(action, event, autoActivate) {
24411
24412             var entries = this._entries,
24413                 entry,
24414                 handler,
24415                 originalEvent,
24416                 button = event.delegateTarget || event.target;
24417
24418             if (!button) {
24419                 return event.preventDefault();
24420             }
24421
24422
24423             entry = entries[domAttr(button, 'data-action')];
24424             handler = entry.action;
24425
24426             originalEvent = event.originalEvent || event;
24427
24428             // simple action (via callback function)
24429             if (isFunction(handler)) {
24430                 if (action === 'click') {
24431                     return handler(originalEvent, autoActivate);
24432                 }
24433             } else {
24434                 if (handler[action]) {
24435                     return handler[action](originalEvent, autoActivate);
24436                 }
24437             }
24438
24439             // silence other actions
24440             event.preventDefault();
24441         };
24442
24443
24444         /**
24445          * Close the palette
24446          */
24447         Palette.prototype.close = function() {
24448             domClasses(this._container).remove('open');
24449         };
24450
24451
24452         /**
24453          * Open the palette
24454          */
24455         Palette.prototype.open = function() {
24456             domClasses(this._container).add('open');
24457         };
24458
24459
24460         Palette.prototype.toggle = function(open) {
24461             if (this.isOpen()) {
24462                 this.close();
24463             } else {
24464                 this.open();
24465             }
24466         };
24467
24468
24469         /**
24470          * Return true if the palette is opened.
24471          * 
24472          * @example
24473          * 
24474          * palette.open();
24475          * 
24476          * if (palette.isOpen()) { // yes, we are open }
24477          * 
24478          * @return {boolean} true if palette is opened
24479          */
24480         Palette.prototype.isOpen = function() {
24481             return this._container && domClasses(this._container).has('open');
24482         };
24483
24484
24485         /* markup definition */
24486
24487         Palette.HTML_MARKUP =
24488             '<div class="djs-palette">' +
24489             '<div class="djs-palette-entries"></div>' +
24490             '<div class="djs-palette-toggle"></div>' +
24491             '</div>';
24492     }, {
24493         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24494         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
24495         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24496         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24497         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
24498         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
24499         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24500         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24501         "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js",
24502         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
24503     }],
24504     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
24505         module.exports = {
24506             __init__: ['palette'],
24507             palette: ['type', require('./Palette')]
24508         };
24509
24510     }, {
24511         "./Palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js"
24512     }],
24513     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js": [function(require, module, exports) {
24514         'use strict';
24515
24516         var forEach = require('lodash/collection/forEach'),
24517             assign = require('lodash/object/assign'),
24518             domEvent = require('min-dom/lib/event'),
24519             domify = require('min-dom/lib/domify'),
24520             domClasses = require('min-dom/lib/classes'),
24521             domAttr = require('min-dom/lib/attr'),
24522             domRemove = require('min-dom/lib/remove');
24523
24524
24525         function PopupMenu(eventBus, canvas) {
24526
24527             this._eventBus = eventBus;
24528             this._canvas = canvas;
24529             this._instances = {};
24530         }
24531
24532         PopupMenu.$inject = ['eventBus', 'canvas'];
24533
24534         module.exports = PopupMenu;
24535
24536         PopupMenu.prototype.open = function(name, position, entries, options) {
24537
24538             var outer = this,
24539                 canvas = this._canvas,
24540                 instances = outer._instances;
24541
24542             // return existing instance
24543             if (instances[name]) {
24544                 return instances[name];
24545             }
24546
24547             var parent = canvas.getContainer();
24548
24549             // ------------------------
24550             function PopupMenuInstance() {
24551
24552                 var self = this;
24553
24554                 self._actions = {};
24555                 self.name = name || 'popup-menu';
24556
24557                 var _options = {
24558                     entryClassName: 'entry'
24559                 };
24560                 assign(_options, options);
24561
24562                 // Container setup
24563                 var container = this._container = domify('<div class="djs-popup">');
24564
24565                 assign(container.style, {
24566                     position: 'absolute',
24567                     left: position.x + 'px',
24568                     top: position.y + 'px'
24569                 });
24570                 domClasses(container).add(name);
24571
24572                 // Add entries
24573                 forEach(entries, function(entry) {
24574
24575                     var entryContainer = domify('<div>');
24576                     domClasses(entryContainer).add(entry.className || _options.entryClassName);
24577                     domClasses(entryContainer).add('djs-popup-entry');
24578
24579                     if (entry.style) {
24580                         domAttr(entryContainer, 'style', entry.style);
24581                     }
24582
24583                     if (entry.action) {
24584                         domAttr(entryContainer, 'data-action', entry.action.name);
24585                         self._actions[entry.action.name] = entry.action.handler;
24586                     }
24587
24588                     var title = domify('<span>');
24589                     title.textContent = entry.label;
24590                     entryContainer.appendChild(title);
24591
24592                     container.appendChild(entryContainer);
24593                 });
24594
24595                 // Event handler
24596                 domEvent.bind(container, 'click', function(event) {
24597                     self.trigger(event);
24598                 });
24599
24600
24601
24602                 // apply canvas zoom level
24603                 var zoom = canvas.zoom();
24604
24605                 container.style.transformOrigin = 'top left';
24606                 container.style.transform = 'scale(' + zoom + ')';
24607
24608                 // Attach to DOM
24609                 parent.appendChild(container);
24610
24611                 // Add Handler
24612                 this.bindHandlers();
24613             }
24614
24615             PopupMenuInstance.prototype.close = function() {
24616                 this.unbindHandlers();
24617                 domRemove(this._container);
24618                 delete outer._instances[this.name];
24619             };
24620
24621             PopupMenuInstance.prototype.bindHandlers = function() {
24622
24623                 var self = this,
24624                     eventBus = outer._eventBus;
24625
24626                 this._closeHandler = function() {
24627                     self.close();
24628                 };
24629
24630                 eventBus.once('contextPad.close', this._closeHandler);
24631                 eventBus.once('canvas.viewbox.changed', this._closeHandler);
24632             };
24633
24634             PopupMenuInstance.prototype.unbindHandlers = function() {
24635
24636                 var eventBus = outer._eventBus;
24637
24638                 eventBus.off('contextPad.close', this._closeHandler);
24639                 eventBus.off('canvas.viewbox.changed', this._closeHandler);
24640             };
24641
24642             PopupMenuInstance.prototype.trigger = function(event) {
24643
24644                 var element = event.target,
24645                     actionName = element.getAttribute('data-action') ||
24646                     element.parentNode.getAttribute('data-action');
24647
24648                 var action = this._actions[actionName];
24649
24650
24651                 if (action) {
24652                     action();
24653                 }
24654
24655                 // silence other actions
24656                 event.preventDefault();
24657             };
24658
24659             var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);
24660
24661             return instance;
24662         };
24663
24664     }, {
24665         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24666         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24667         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24668         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24669         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24670         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24671         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24672     }],
24673     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js": [function(require, module, exports) {
24674         'use strict';
24675
24676         module.exports = {
24677             __init__: ['popupMenu'],
24678             popupMenu: ['type', require('./PopupMenu')]
24679         };
24680
24681     }, {
24682         "./PopupMenu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js"
24683     }],
24684     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js": [function(require, module, exports) {
24685         'use strict';
24686
24687
24688         /**
24689          * Service that allow replacing of elements.
24690          * 
24691          * 
24692          * @class
24693          * @constructor
24694          */
24695         function Replace(modeling) {
24696
24697             this._modeling = modeling;
24698         }
24699
24700         module.exports = Replace;
24701
24702         Replace.$inject = ['modeling'];
24703
24704         /**
24705          * @param {Element}
24706          *            oldElement - Element to be replaced
24707          * @param {Object}
24708          *            newElementData - Containing information about the new Element, for
24709          *            example height, width, type.
24710          * @param {Object}
24711          *            options - Custom options that will be attached to the context. It
24712          *            can be used to inject data that is needed in the command chain.
24713          *            For example it could be used in
24714          *            eventbus.on('commandStack.shape.replace.postExecute') to change
24715          *            shape attributes after shape creation.
24716          */
24717         Replace.prototype.replaceElement = function(oldElement, newElementData, options) {
24718
24719             var modeling = this._modeling;
24720
24721             var newElement = null;
24722
24723             if (oldElement.waypoints) {
24724                 // TODO
24725                 // modeling.replaceConnection
24726             } else {
24727                 // set center of element for modeling API
24728                 // if no new width / height is given use old elements size
24729                 newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;
24730                 newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;
24731
24732                 newElement = modeling.replaceShape(oldElement, newElementData, options);
24733             }
24734
24735             return newElement;
24736         };
24737
24738     }, {}],
24739     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
24740         'use strict';
24741
24742         module.exports = {
24743             __init__: ['replace'],
24744             replace: ['type', require('./Replace')]
24745         };
24746
24747     }, {
24748         "./Replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js"
24749     }],
24750     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js": [function(require, module, exports) {
24751         'use strict';
24752
24753         var forEach = require('lodash/collection/forEach'),
24754             filter = require('lodash/collection/filter'),
24755             pick = require('lodash/object/pick');
24756
24757         var ResizeUtil = require('./ResizeUtil'),
24758             domEvent = require('min-dom/lib/event'),
24759             Elements = require('../../util/Elements');
24760
24761         var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
24762
24763         var round = Math.round;
24764
24765         var Snap = require('../../../vendor/snapsvg');
24766
24767         var HANDLE_OFFSET = -2,
24768             HANDLE_SIZE = 5,
24769             HANDLE_HIT_SIZE = 20;
24770
24771         var MARKER_RESIZING = 'djs-resizing',
24772             MARKER_RESIZE_NOT_OK = 'resize-not-ok',
24773             CLS_RESIZER = 'djs-resizer';
24774
24775
24776         /**
24777          * Implements resize on shapes by
24778          *  * adding resize handles, * creating a visual during resize * checking resize
24779          * rules * committing a change once finished
24780          * 
24781          *  ## Customizing
24782          * 
24783          * It's possible to customize the resizing behaviour by intercepting
24784          * 'resize.start' and providing the following parameters through the 'context':
24785          *  * minDimensions ({ width, height }) - Minimum shape dimensions *
24786          * childrenBoxPadding (number) - Gap between the minimum bounding box and the
24787          * container
24788          * 
24789          * f.ex:
24790          * 
24791          * eventBus.on('resize.start', 1500, function(event) { var context =
24792          * event.context,
24793          * 
24794          * context.minDimensions = { width: 140, height: 120 };
24795          * context.childrenBoxPadding = 30; });
24796          */
24797
24798         function Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {
24799
24800             function canResize(context) {
24801                 var ctx = pick(context, ['newBounds', 'shape', 'delta', 'direction']);
24802                 return rules.allowed('shape.resize', ctx);
24803             }
24804
24805
24806             // resizing implementation //////////////////////////////////
24807
24808             /**
24809              * A helper that realizes the resize visuals
24810              */
24811             var visuals = {
24812                 create: function(context) {
24813                     var container = canvas.getDefaultLayer(),
24814                         shape = context.shape,
24815                         frame;
24816
24817                     frame = context.frame = Snap.create('rect', {
24818                         class: 'djs-resize-overlay',
24819                         width: shape.width + 10,
24820                         height: shape.height + 10,
24821                         x: shape.x - 5,
24822                         y: shape.y - 5
24823                     });
24824
24825                     frame.appendTo(container);
24826                 },
24827
24828                 update: function(context) {
24829                     var frame = context.frame,
24830                         bounds = context.newBounds;
24831
24832                     if (bounds.width > 5) {
24833                         frame.attr({
24834                             x: bounds.x,
24835                             width: bounds.width
24836                         });
24837                     }
24838
24839                     if (bounds.height > 5) {
24840                         frame.attr({
24841                             y: bounds.y,
24842                             height: bounds.height
24843                         });
24844                     }
24845
24846                     frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);
24847                 },
24848
24849                 remove: function(context) {
24850                     if (context.frame) {
24851                         context.frame.remove();
24852                     }
24853                 }
24854             };
24855
24856             function computeMinBoundaryBox(context) {
24857
24858                 var shape = context.shape,
24859                     direction = context.direction,
24860                     minDimensions = context.minDimensions || {},
24861                     childrenBoxPadding = context.childrenBoxPadding || 20,
24862                     children,
24863                     minBoundaryBox;
24864
24865                 // grab all the shapes that are NOT labels or connections
24866                 children = filter(shape.children, function(child) {
24867                     // connections
24868                     if (child.waypoints) {
24869                         return false;
24870                     }
24871
24872                     // labels
24873                     if (child.type === 'label') {
24874                         return false;
24875                     }
24876
24877                     return true;
24878                 });
24879
24880                 // compute a minimum bounding box
24881                 // around the existing children
24882                 if (children.length) {
24883                     minBoundaryBox = Elements.getBBox(children);
24884
24885                     // add a gap between the minBoundaryBox and the resizable container
24886                     minBoundaryBox.width += childrenBoxPadding * 2;
24887                     minBoundaryBox.height += childrenBoxPadding * 2;
24888                     minBoundaryBox.x -= childrenBoxPadding;
24889                     minBoundaryBox.y -= childrenBoxPadding;
24890                 } else {
24891                     minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {
24892                         width: minDimensions.width || 10,
24893                         height: minDimensions.height || 10
24894                     });
24895                 }
24896
24897                 return minBoundaryBox;
24898             }
24899
24900             eventBus.on('resize.start', function(event) {
24901
24902                 var context = event.context,
24903                     shape = context.shape,
24904                     minBoundaryBox = context.minBoundaryBox;
24905
24906                 if (minBoundaryBox === undefined) {
24907                     context.minBoundaryBox = computeMinBoundaryBox(context);
24908                 }
24909
24910                 // add resizable indicator
24911                 canvas.addMarker(shape, MARKER_RESIZING);
24912
24913                 visuals.create(context);
24914             });
24915
24916             eventBus.on('resize.move', function(event) {
24917
24918                 var context = event.context,
24919                     shape = context.shape,
24920                     direction = context.direction,
24921                     minBoundaryBox = context.minBoundaryBox,
24922                     delta;
24923
24924                 delta = {
24925                     x: event.dx,
24926                     y: event.dy
24927                 };
24928
24929                 context.delta = delta;
24930
24931                 context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);
24932
24933                 if (minBoundaryBox) {
24934                     context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);
24935                 }
24936
24937                 // update + cache executable state
24938                 context.canExecute = canResize(context);
24939
24940                 // update resize frame visuals
24941                 visuals.update(context);
24942             });
24943
24944             eventBus.on('resize.end', function(event) {
24945                 var context = event.context,
24946                     shape = context.shape;
24947
24948                 var newBounds = context.newBounds;
24949
24950
24951                 // ensure we have actual pixel values for new bounds
24952                 // (important when zoom level was > 1 during move)
24953                 newBounds.x = round(newBounds.x);
24954                 newBounds.y = round(newBounds.y);
24955                 newBounds.width = round(newBounds.width);
24956                 newBounds.height = round(newBounds.height);
24957
24958                 // perform the actual resize
24959                 if (context.canExecute) {
24960                     modeling.resizeShape(shape, context.newBounds);
24961                 }
24962             });
24963
24964             eventBus.on('resize.cleanup', function(event) {
24965
24966                 var context = event.context,
24967                     shape = context.shape;
24968
24969                 // remove resizable indicator
24970                 canvas.removeMarker(shape, MARKER_RESIZING);
24971
24972                 // remove frame + destroy context
24973                 visuals.remove(context);
24974             });
24975
24976
24977             function activate(event, shape, direction) {
24978
24979                 dragging.activate(event, 'resize', {
24980                     autoActivate: true,
24981                     cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),
24982                     data: {
24983                         shape: shape,
24984                         context: {
24985                             direction: direction,
24986                             shape: shape
24987                         }
24988                     }
24989                 });
24990             }
24991
24992             function makeDraggable(element, gfx, direction) {
24993
24994                 function listener(event) {
24995                     // only trigger on left mouse button
24996                     if (isPrimaryButton(event)) {
24997                         activate(event, element, direction);
24998                     }
24999                 }
25000
25001                 domEvent.bind(gfx.node, 'mousedown', listener);
25002                 domEvent.bind(gfx.node, 'touchstart', listener);
25003             }
25004
25005             function __createResizer(gfx, x, y, rotation, direction) {
25006
25007                 var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);
25008
25009                 var origin = -HANDLE_SIZE + HANDLE_OFFSET;
25010
25011                 // Create four drag indicators on the outline
25012                 group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');
25013                 group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');
25014
25015                 var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);
25016                 group.transform(matrix);
25017
25018                 return group;
25019             }
25020
25021             function createResizer(element, gfx, direction) {
25022
25023                 var resizer;
25024
25025                 if (direction === 'nw') {
25026                     resizer = __createResizer(gfx, 0, 0, 0, direction);
25027                 } else if (direction === 'ne') {
25028                     resizer = __createResizer(gfx, element.width, 0, 90, direction);
25029                 } else if (direction === 'se') {
25030                     resizer = __createResizer(gfx, element.width, element.height, 180, direction);
25031                 } else {
25032                     resizer = __createResizer(gfx, 0, element.height, 270, direction);
25033                 }
25034
25035                 makeDraggable(element, resizer, direction);
25036             }
25037
25038             // resize handles implementation ///////////////////////////////
25039
25040             function addResize(shape) {
25041
25042                 if (!canResize({
25043                         shape: shape
25044                     })) {
25045                     return;
25046                 }
25047
25048                 var gfx = elementRegistry.getGraphics(shape);
25049
25050                 createResizer(shape, gfx, 'nw');
25051                 createResizer(shape, gfx, 'ne');
25052                 createResizer(shape, gfx, 'se');
25053                 createResizer(shape, gfx, 'sw');
25054             }
25055
25056             function removeResize(shape) {
25057
25058                 var gfx = elementRegistry.getGraphics(shape);
25059                 var resizers = gfx.selectAll('.' + CLS_RESIZER);
25060
25061                 forEach(resizers, function(resizer) {
25062                     resizer.remove();
25063                 });
25064             }
25065
25066             eventBus.on('selection.changed', function(e) {
25067
25068                 var oldSelection = e.oldSelection,
25069                     newSelection = e.newSelection;
25070
25071                 // remove old selection markers
25072                 forEach(oldSelection, removeResize);
25073
25074                 // add new selection markers ONLY if single selection
25075                 if (newSelection.length === 1) {
25076                     forEach(newSelection, addResize);
25077                 }
25078             });
25079
25080             eventBus.on('shape.changed', function(e) {
25081                 var shape = e.element;
25082
25083                 removeResize(shape);
25084
25085                 if (selection.isSelected(shape)) {
25086                     addResize(shape);
25087                 }
25088             });
25089
25090
25091             // API
25092
25093             this.activate = activate;
25094         }
25095
25096         Resize.$inject = ['eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging'];
25097
25098         module.exports = Resize;
25099
25100     }, {
25101         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
25102         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
25103         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
25104         "./ResizeUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js",
25105         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
25106         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25107         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js",
25108         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
25109     }],
25110     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js": [function(require, module, exports) {
25111         'use strict';
25112
25113         /**
25114          * Resize the given bounds by the specified delta from a given anchor point.
25115          * 
25116          * @param {Bounds}
25117          *            bounds the bounding box that should be resized
25118          * @param {String}
25119          *            direction in which the element is resized (nw, ne, se, sw)
25120          * @param {Point}
25121          *            delta of the resize operation
25122          * 
25123          * @return {Bounds} resized bounding box
25124          */
25125         module.exports.resizeBounds = function(bounds, direction, delta) {
25126
25127             var dx = delta.x,
25128                 dy = delta.y;
25129
25130             switch (direction) {
25131
25132                 case 'nw':
25133                     return {
25134                         x: bounds.x + dx,
25135                         y: bounds.y + dy,
25136                         width: bounds.width - dx,
25137                         height: bounds.height - dy
25138                     };
25139
25140                 case 'sw':
25141                     return {
25142                         x: bounds.x + dx,
25143                         y: bounds.y,
25144                         width: bounds.width - dx,
25145                         height: bounds.height + dy
25146                     };
25147
25148                 case 'ne':
25149                     return {
25150                         x: bounds.x,
25151                         y: bounds.y + dy,
25152                         width: bounds.width + dx,
25153                         height: bounds.height - dy
25154                     };
25155
25156                 case 'se':
25157                     return {
25158                         x: bounds.x,
25159                         y: bounds.y,
25160                         width: bounds.width + dx,
25161                         height: bounds.height + dy
25162                     };
25163
25164                 default:
25165                     throw new Error('unrecognized direction: ' + direction);
25166             }
25167         };
25168
25169         module.exports.reattachPoint = function(bounds, newBounds, point) {
25170
25171             var sx = bounds.width / newBounds.width,
25172                 sy = bounds.height / newBounds.height;
25173
25174             return {
25175                 x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),
25176                 y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)
25177             };
25178         };
25179
25180
25181         module.exports.ensureMinBounds = function(currentBounds, minBounds) {
25182             var topLeft = {
25183                 x: Math.min(currentBounds.x, minBounds.x),
25184                 y: Math.min(currentBounds.y, minBounds.y)
25185             };
25186
25187             var bottomRight = {
25188                 x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),
25189                 y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)
25190             };
25191
25192             return {
25193                 x: topLeft.x,
25194                 y: topLeft.y,
25195                 width: bottomRight.x - topLeft.x,
25196                 height: bottomRight.y - topLeft.y
25197             };
25198         };
25199
25200
25201         module.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {
25202
25203             switch (direction) {
25204                 case 'nw':
25205                     return {
25206                         x: currentBounds.x + currentBounds.width - minDimensions.width,
25207                         y: currentBounds.y + currentBounds.height - minDimensions.height,
25208                         width: minDimensions.width,
25209                         height: minDimensions.height
25210                     };
25211                 case 'sw':
25212                     return {
25213                         x: currentBounds.x + currentBounds.width - minDimensions.width,
25214                         y: currentBounds.y,
25215                         width: minDimensions.width,
25216                         height: minDimensions.height
25217                     };
25218                 case 'ne':
25219                     return {
25220                         x: currentBounds.x,
25221                         y: currentBounds.y + currentBounds.height - minDimensions.height,
25222                         width: minDimensions.width,
25223                         height: minDimensions.height
25224                     };
25225                 case 'se':
25226                     return {
25227                         x: currentBounds.x,
25228                         y: currentBounds.y,
25229                         width: minDimensions.width,
25230                         height: minDimensions.height
25231                     };
25232                 default:
25233                     throw new Error('unrecognized direction: ' + direction);
25234             }
25235         };
25236
25237
25238
25239     }, {}],
25240     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js": [function(require, module, exports) {
25241         module.exports = {
25242             __depends__: [
25243                 require('../modeling'),
25244                 require('../rules'),
25245                 require('../dragging')
25246             ],
25247             __init__: ['resize'],
25248             resize: ['type', require('./Resize')]
25249         };
25250
25251     }, {
25252         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
25253         "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
25254         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
25255         "./Resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js"
25256     }],
25257     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js": [function(require, module, exports) {
25258         'use strict';
25259
25260         var inherits = require('inherits');
25261
25262         var CommandInterceptor = require('../../command/CommandInterceptor');
25263
25264         /**
25265          * A basic provider that may be extended to implement modeling rules.
25266          * 
25267          * Extensions should implement the init method to actually add their custom
25268          * modeling checks. Checks may be added via the #addRule(action, fn) method.
25269          * 
25270          * @param {EventBus}
25271          *            eventBus
25272          */
25273         function RuleProvider(eventBus) {
25274             CommandInterceptor.call(this, eventBus);
25275
25276             this.init();
25277         }
25278
25279         RuleProvider.$inject = ['eventBus'];
25280
25281         inherits(RuleProvider, CommandInterceptor);
25282
25283         module.exports = RuleProvider;
25284
25285
25286         /**
25287          * Adds a modeling rule for the given action, implemented through a callback
25288          * function.
25289          * 
25290          * The function will receive the modeling specific action context to perform its
25291          * check. It must return false or null to disallow the action from happening.
25292          * 
25293          * Returning <code>null</code> may encode simply ignoring the action.
25294          * 
25295          * @example
25296          * 
25297          * ResizableRules.prototype.init = function() {
25298          * 
25299          * this.addRule('shape.resize', function(context) {
25300          * 
25301          * var shape = context.shape;
25302          * 
25303          * if (!context.newBounds) { // check general resizability if (!shape.resizable) {
25304          * return false; } } else { // element must have minimum size of 10*10 points
25305          * return context.newBounds.width > 10 && context.newBounds.height > 10; } }); };
25306          * 
25307          * @param {String|Array
25308          *            <String>} actions the identifier for the modeling action to check
25309          * @param {Function}
25310          *            fn the callback function that performs the actual check
25311          */
25312         RuleProvider.prototype.addRule = function(actions, fn) {
25313
25314             var self = this;
25315
25316             if (typeof actions === 'string') {
25317                 actions = [actions];
25318             }
25319
25320             actions.forEach(function(action) {
25321
25322                 self.canExecute(action, function(context, action, event) {
25323                     return fn(context);
25324                 }, true);
25325             });
25326         };
25327     }, {
25328         "../../command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
25329         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
25330     }],
25331     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js": [function(require, module, exports) {
25332         'use strict';
25333
25334         /**
25335          * A service that provides rules for certain diagram actions.
25336          * 
25337          * @param {CommandStack}
25338          *            commandStack
25339          */
25340         function Rules(commandStack) {
25341             this._commandStack = commandStack;
25342         }
25343
25344         Rules.$inject = ['commandStack'];
25345
25346         module.exports = Rules;
25347
25348
25349         /**
25350          * This method can be queried to ask whether certain modeling actions are
25351          * allowed or not.
25352          * 
25353          * @param {String}
25354          *            action the action to be checked
25355          * @param {Object}
25356          *            [context] the context to check the action in
25357          * 
25358          * @return {Boolean} returns true, false or null depending on whether the
25359          *         operation is allowed, not allowed or should be ignored.
25360          */
25361         Rules.prototype.allowed = function(action, context) {
25362             var allowed = this._commandStack.canExecute(action, context);
25363
25364             // map undefined to true, i.e. no rules
25365             return allowed === undefined ? true : allowed;
25366         };
25367     }, {}],
25368     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js": [function(require, module, exports) {
25369         module.exports = {
25370             __depends__: [require('../../command')],
25371             __init__: ['rules'],
25372             rules: ['type', require('./Rules')]
25373         };
25374
25375     }, {
25376         "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
25377         "./Rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js"
25378     }],
25379     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js": [function(require, module, exports) {
25380         'use strict';
25381
25382         var isArray = require('lodash/lang/isArray'),
25383             forEach = require('lodash/collection/forEach');
25384
25385
25386         /**
25387          * A service that offers the current selection in a diagram. Offers the api to
25388          * control the selection, too.
25389          * 
25390          * @class
25391          * 
25392          * @param {EventBus}
25393          *            eventBus the event bus
25394          */
25395         function Selection(eventBus) {
25396
25397             this._eventBus = eventBus;
25398
25399             this._selectedElements = [];
25400
25401             var self = this;
25402
25403             eventBus.on(['shape.remove', 'connection.remove'], function(e) {
25404                 var element = e.element;
25405                 self.deselect(element);
25406             });
25407         }
25408
25409         Selection.$inject = ['eventBus'];
25410
25411         module.exports = Selection;
25412
25413
25414         Selection.prototype.deselect = function(element) {
25415             var selectedElements = this._selectedElements;
25416
25417             var idx = selectedElements.indexOf(element);
25418
25419             if (idx !== -1) {
25420                 var oldSelection = selectedElements.slice();
25421
25422                 selectedElements.splice(idx, 1);
25423
25424                 this._eventBus.fire('selection.changed', {
25425                     oldSelection: oldSelection,
25426                     newSelection: selectedElements
25427                 });
25428             }
25429         };
25430
25431
25432         Selection.prototype.get = function() {
25433             return this._selectedElements;
25434         };
25435
25436         Selection.prototype.isSelected = function(element) {
25437             return this._selectedElements.indexOf(element) !== -1;
25438         };
25439
25440
25441         /**
25442          * This method selects one or more elements on the diagram.
25443          * 
25444          * By passing an additional add parameter you can decide whether or not the
25445          * element(s) should be added to the already existing selection or not.
25446          * 
25447          * @method Selection#select
25448          * 
25449          * @param {Object|Object[]}
25450          *            elements element or array of elements to be selected
25451          * @param {boolean}
25452          *            [add] whether the element(s) should be appended to the current
25453          *            selection, defaults to false
25454          */
25455         Selection.prototype.select = function(elements, add) {
25456             var selectedElements = this._selectedElements,
25457                 oldSelection = selectedElements.slice();
25458
25459             if (!isArray(elements)) {
25460                 elements = elements ? [elements] : [];
25461             }
25462
25463             // selection may be cleared by passing an empty array or null
25464             // to the method
25465             if (add) {
25466                 forEach(elements, function(element) {
25467                     if (selectedElements.indexOf(element) !== -1) {
25468                         // already selected
25469                         return;
25470                     } else {
25471                         selectedElements.push(element);
25472                     }
25473                 });
25474             } else {
25475                 this._selectedElements = selectedElements = elements.slice();
25476             }
25477             this._eventBus.fire('selection.changed', {
25478                 oldSelection: oldSelection,
25479                 newSelection: selectedElements
25480             });
25481         };
25482
25483     }, {
25484         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25485         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
25486     }],
25487     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js": [function(require, module, exports) {
25488         'use strict';
25489
25490         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
25491
25492
25493         function SelectionBehavior(eventBus, selection, canvas) {
25494
25495             eventBus.on('create.end', 500, function(e) {
25496                 if (e.context.canExecute) {
25497                     selection.select(e.shape);
25498                 }
25499             });
25500
25501             eventBus.on('connect.end', 500, function(e) {
25502                 if (e.context.canExecute && e.context.target) {
25503                     selection.select(e.context.target);
25504                 }
25505             });
25506
25507             eventBus.on('shape.move.end', 500, function(e) {
25508                 selection.select(e.context.shapes);
25509             });
25510
25511             eventBus.on('element.keydown', function(event) {
25512                 alert("Key Down Elements ");
25513             });
25514             // Shift + click selection
25515             eventBus.on('element.click', function(event) {
25516
25517                 var element = event.element;
25518
25519                 // do not select the root element
25520                 // or connections
25521                 if (element === canvas.getRootElement()) {
25522                     element = null;
25523                 }
25524
25525                 var isSelected = selection.isSelected(element),
25526                     isMultiSelect = selection.get().length > 1;
25527
25528                 // mouse-event: SELECTION_KEY
25529                 var add = hasPrimaryModifier(event);
25530
25531                 // select OR deselect element in multi selection
25532                 if (isSelected && isMultiSelect) {
25533                     if (add) {
25534                         return selection.deselect(element);
25535                     } else {
25536                         return selection.select(element);
25537                     }
25538                 } else
25539                 if (!isSelected) {
25540                     selection.select(element, add);
25541                 } else {
25542                     selection.deselect(element);
25543                 }
25544             });
25545
25546         }
25547
25548         SelectionBehavior.$inject = ['eventBus', 'selection', 'canvas'];
25549
25550         module.exports = SelectionBehavior;
25551
25552     }, {
25553         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js"
25554     }],
25555     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js": [function(require, module, exports) {
25556         'use strict';
25557
25558         var forEach = require('lodash/collection/forEach');
25559
25560         var MARKER_HOVER = 'hover',
25561             MARKER_SELECTED = 'selected';
25562
25563
25564         /**
25565          * A plugin that adds a visible selection UI to shapes and connections by
25566          * appending the <code>hover</code> and <code>selected</code> classes to
25567          * them.
25568          * 
25569          * @class
25570          * 
25571          * Makes elements selectable, too.
25572          * 
25573          * @param {EventBus}
25574          *            events
25575          * @param {SelectionService}
25576          *            selection
25577          * @param {Canvas}
25578          *            canvas
25579          */
25580         function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
25581
25582             this._multiSelectionBox = null;
25583
25584             function addMarker(e, cls) {
25585                 canvas.addMarker(e, cls);
25586             }
25587
25588             function removeMarker(e, cls) {
25589                 canvas.removeMarker(e, cls);
25590             }
25591
25592             events.on('element.hover', function(event) {
25593                 addMarker(event.element, MARKER_HOVER);
25594             });
25595
25596             events.on('element.out', function(event) {
25597                 removeMarker(event.element, MARKER_HOVER);
25598             });
25599
25600             events.on('selection.changed', function(event) {
25601
25602                 function deselect(s) {
25603                     removeMarker(s, MARKER_SELECTED);
25604                 }
25605
25606                 function select(s) {
25607                     addMarker(s, MARKER_SELECTED);
25608                 }
25609
25610                 var oldSelection = event.oldSelection,
25611                     newSelection = event.newSelection;
25612
25613                 forEach(oldSelection, function(e) {
25614                     if (newSelection.indexOf(e) === -1) {
25615                         deselect(e);
25616                     }
25617                 });
25618
25619                 forEach(newSelection, function(e) {
25620                     if (oldSelection.indexOf(e) === -1) {
25621                         select(e);
25622                     }
25623                 });
25624             });
25625         }
25626
25627         SelectionVisuals.$inject = [
25628             'eventBus',
25629             'canvas',
25630             'selection',
25631             'graphicsFactory',
25632             'styles'
25633         ];
25634
25635         module.exports = SelectionVisuals;
25636
25637     }, {
25638         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25639     }],
25640     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js": [function(require, module, exports) {
25641         module.exports = {
25642             __init__: ['selectionVisuals', 'selectionBehavior'],
25643             __depends__: [
25644                 require('../interaction-events'),
25645                 require('../outline')
25646             ],
25647             selection: ['type', require('./Selection')],
25648             selectionVisuals: ['type', require('./SelectionVisuals')],
25649             selectionBehavior: ['type', require('./SelectionBehavior')]
25650         };
25651
25652     }, {
25653         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
25654         "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
25655         "./Selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js",
25656         "./SelectionBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js",
25657         "./SelectionVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js"
25658     }],
25659     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js": [function(require, module, exports) {
25660         'use strict';
25661
25662         var forEach = require('lodash/collection/forEach');
25663
25664         var snapTo = require('./SnapUtil').snapTo;
25665
25666
25667         /**
25668          * A snap context, containing the (possibly incomplete) mappings of drop targets
25669          * (to identify the snapping) to computed snap points.
25670          */
25671         function SnapContext() {
25672
25673             /**
25674              * Map<String, SnapPoints> mapping drop targets to a list of possible
25675              * snappings.
25676              * 
25677              * @type {Object}
25678              */
25679             this._targets = {};
25680
25681             /**
25682              * Map<String, Point> initial positioning of element regarding various snap
25683              * directions.
25684              * 
25685              * @type {Object}
25686              */
25687             this._snapOrigins = {};
25688
25689             /**
25690              * List of snap locations
25691              * 
25692              * @type {Array<String>}
25693              */
25694             this._snapLocations = [];
25695
25696             /**
25697              * Map<String, Array<Point>> of default snapping locations
25698              * 
25699              * @type {Object}
25700              */
25701             this._defaultSnaps = {};
25702         }
25703
25704
25705         SnapContext.prototype.getSnapOrigin = function(snapLocation) {
25706             return this._snapOrigins[snapLocation];
25707         };
25708
25709
25710         SnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {
25711             this._snapOrigins[snapLocation] = initialValue;
25712
25713             if (this._snapLocations.indexOf(snapLocation) === -1) {
25714                 this._snapLocations.push(snapLocation);
25715             }
25716         };
25717
25718
25719         SnapContext.prototype.addDefaultSnap = function(type, point) {
25720
25721             var snapValues = this._defaultSnaps[type];
25722
25723             if (!snapValues) {
25724                 snapValues = this._defaultSnaps[type] = [];
25725             }
25726
25727             snapValues.push(point);
25728         };
25729
25730         /**
25731          * Return a number of initialized snaps, i.e. snap locations such as top-left,
25732          * mid, bottom-right and so forth.
25733          * 
25734          * @return {Array<String>} snapLocations
25735          */
25736         SnapContext.prototype.getSnapLocations = function() {
25737             return this._snapLocations;
25738         };
25739
25740         /**
25741          * Set the snap locations for this context.
25742          * 
25743          * The order of locations determines precedence.
25744          * 
25745          * @param {Array
25746          *            <String>} snapLocations
25747          */
25748         SnapContext.prototype.setSnapLocations = function(snapLocations) {
25749             this._snapLocations = snapLocations;
25750         };
25751
25752         /**
25753          * Get snap points for a given target
25754          * 
25755          * @param {Element|String}
25756          *            target
25757          */
25758         SnapContext.prototype.pointsForTarget = function(target) {
25759
25760             var targetId = target.id || target;
25761
25762             var snapPoints = this._targets[targetId];
25763
25764             if (!snapPoints) {
25765                 snapPoints = this._targets[targetId] = new SnapPoints();
25766                 snapPoints.initDefaults(this._defaultSnaps);
25767             }
25768
25769             return snapPoints;
25770         };
25771
25772         module.exports = SnapContext;
25773
25774
25775         /**
25776          * Creates the snap points and initializes them with the given default values.
25777          * 
25778          * @param {Object
25779          *            <String, Array<Point>>} [defaultPoints]
25780          */
25781         function SnapPoints(defaultSnaps) {
25782
25783             /**
25784              * Map<String, Map<(x|y), Array<Number>>> mapping snap locations, i.e.
25785              * top-left, bottom-right, center to actual snap values.
25786              * 
25787              * @type {Object}
25788              */
25789             this._snapValues = {};
25790         }
25791
25792         SnapPoints.prototype.add = function(snapLocation, point) {
25793
25794             var snapValues = this._snapValues[snapLocation];
25795
25796             if (!snapValues) {
25797                 snapValues = this._snapValues[snapLocation] = {
25798                     x: [],
25799                     y: []
25800                 };
25801             }
25802
25803             if (snapValues.x.indexOf(point.x) === -1) {
25804                 snapValues.x.push(point.x);
25805             }
25806
25807             if (snapValues.y.indexOf(point.y) === -1) {
25808                 snapValues.y.push(point.y);
25809             }
25810         };
25811
25812
25813         SnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {
25814             var snappingValues = this._snapValues[snapLocation];
25815
25816             return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);
25817         };
25818
25819         /**
25820          * Initialize a number of default snapping points.
25821          * 
25822          * @param {Object}
25823          *            defaultSnaps
25824          */
25825         SnapPoints.prototype.initDefaults = function(defaultSnaps) {
25826
25827             var self = this;
25828
25829             forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {
25830                 forEach(snapPoints, function(point) {
25831                     self.add(snapLocation, point);
25832                 });
25833             });
25834         };
25835     }, {
25836         "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
25837         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25838     }],
25839     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js": [function(require, module, exports) {
25840         'use strict';
25841
25842         var abs = Math.abs,
25843             round = Math.round;
25844
25845
25846         /**
25847          * Snap value to a collection of reference values.
25848          * 
25849          * @param {Number}
25850          *            value
25851          * @param {Array
25852          *            <Number>} values
25853          * @param {Number}
25854          *            [tolerance=10]
25855          * 
25856          * @return {Number} the value we snapped to or null, if none snapped
25857          */
25858         function snapTo(value, values, tolerance) {
25859             tolerance = tolerance === undefined ? 10 : tolerance;
25860
25861             var idx, snapValue;
25862
25863             for (idx = 0; idx < values.length; idx++) {
25864                 snapValue = values[idx];
25865
25866                 if (abs(snapValue - value) <= tolerance) {
25867                     return snapValue;
25868                 }
25869             }
25870         }
25871
25872
25873         module.exports.snapTo = snapTo;
25874
25875
25876         function topLeft(bounds) {
25877             return {
25878                 x: bounds.x,
25879                 y: bounds.y
25880             };
25881         }
25882
25883         module.exports.topLeft = topLeft;
25884
25885
25886         function mid(bounds, defaultValue) {
25887
25888             if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
25889                 return defaultValue;
25890             }
25891
25892             return {
25893                 x: round(bounds.x + bounds.width / 2),
25894                 y: round(bounds.y + bounds.height / 2)
25895             };
25896         }
25897
25898         module.exports.mid = mid;
25899
25900
25901         function bottomRight(bounds) {
25902             return {
25903                 x: bounds.x + bounds.width,
25904                 y: bounds.y + bounds.height
25905             };
25906         }
25907
25908         module.exports.bottomRight = bottomRight;
25909     }, {}],
25910     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js": [function(require, module, exports) {
25911         'use strict';
25912
25913         var filter = require('lodash/collection/filter'),
25914             forEach = require('lodash/collection/forEach'),
25915             debounce = require('lodash/function/debounce');
25916
25917
25918         var mid = require('./SnapUtil').mid;
25919
25920         var SnapContext = require('./SnapContext');
25921
25922         /**
25923          * A general purpose snapping component for diagram elements.
25924          * 
25925          * @param {EventBus}
25926          *            eventBus
25927          * @param {Canvas}
25928          *            canvas
25929          */
25930         function Snapping(eventBus, canvas) {
25931
25932             this._canvas = canvas;
25933
25934             var self = this;
25935
25936             eventBus.on(['shape.move.start', 'create.start'], function(event) {
25937                 self.initSnap(event);
25938             });
25939
25940             eventBus.on(['shape.move.move', 'shape.move.end', 'create.move', 'create.end'], function(event) {
25941                 if (event.snapped) {
25942                     return;
25943                 }
25944
25945                 self.snap(event);
25946             });
25947
25948             eventBus.on(['shape.move.cleanup', 'create.cleanup'], function(event) {
25949                 self.hide();
25950             });
25951
25952             // delay hide by 1000 seconds since last match
25953             this._asyncHide = debounce(this.hide, 1000);
25954         }
25955
25956         Snapping.$inject = ['eventBus', 'canvas'];
25957
25958         module.exports = Snapping;
25959
25960
25961         Snapping.prototype.initSnap = function(event) {
25962
25963             var context = event.context,
25964                 shape = context.shape,
25965                 snapContext = context.snapContext;
25966
25967             if (!snapContext) {
25968                 snapContext = context.snapContext = new SnapContext();
25969             }
25970
25971             var snapMid = mid(shape, event);
25972
25973             snapContext.setSnapOrigin('mid', {
25974                 x: snapMid.x - event.x,
25975                 y: snapMid.y - event.y
25976             });
25977
25978             return snapContext;
25979         };
25980
25981
25982         Snapping.prototype.snap = function(event) {
25983
25984             var context = event.context,
25985                 snapContext = context.snapContext,
25986                 shape = context.shape,
25987                 target = context.target,
25988                 snapLocations = snapContext.getSnapLocations();
25989
25990             if (!target) {
25991                 return;
25992             }
25993
25994             var snapPoints = snapContext.pointsForTarget(target);
25995
25996             if (!snapPoints.initialized) {
25997                 this.addTargetSnaps(snapPoints, shape, target);
25998
25999                 snapPoints.initialized = true;
26000             }
26001
26002
26003             var snapping = {};
26004
26005             forEach(snapLocations, function(location) {
26006
26007                 var snapOrigin = snapContext.getSnapOrigin(location);
26008
26009                 var snapCurrent = {
26010                     x: event.x + snapOrigin.x,
26011                     y: event.y + snapOrigin.y
26012                 };
26013
26014                 // snap on both axis, if not snapped already
26015                 forEach(['x', 'y'], function(axis) {
26016                     var locationSnapping;
26017
26018                     if (!snapping[axis]) {
26019                         locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);
26020
26021                         if (locationSnapping !== undefined) {
26022                             snapping[axis] = {
26023                                 value: locationSnapping,
26024                                 originValue: locationSnapping - snapOrigin[axis]
26025                             };
26026                         }
26027                     }
26028                 });
26029
26030                 // no more need to snap, drop out of interation
26031                 if (snapping.x && snapping.y) {
26032                     return false;
26033                 }
26034             });
26035
26036
26037             // show snap visuals
26038
26039             this.showSnapLine('vertical', snapping.x && snapping.x.value);
26040             this.showSnapLine('horizontal', snapping.y && snapping.y.value);
26041
26042
26043             // adjust event { x, y, dx, dy } and mark as snapping
26044             var cx, cy;
26045
26046             if (snapping.x) {
26047
26048                 cx = event.x - snapping.x.originValue;
26049
26050                 event.x = snapping.x.originValue;
26051                 event.dx = event.dx - cx;
26052
26053                 event.snapped = true;
26054             }
26055
26056             if (snapping.y) {
26057                 cy = event.y - snapping.y.originValue;
26058
26059                 event.y = snapping.y.originValue;
26060                 event.dy = event.dy - cy;
26061
26062                 event.snapped = true;
26063             }
26064         };
26065
26066
26067         Snapping.prototype._createLine = function(orientation) {
26068
26069             var root = this._canvas.getLayer('snap');
26070
26071             var line = root.path('M0,0 L0,0').addClass('djs-snap-line');
26072
26073             return {
26074                 update: function(position) {
26075
26076                     if (position === undefined) {
26077                         line.attr({
26078                             display: 'none'
26079                         });
26080                     } else {
26081                         if (orientation === 'horizontal') {
26082                             line.attr({
26083                                 path: 'M-100000,' + position + ' L+100000,' + position,
26084                                 display: ''
26085                             });
26086                         } else {
26087                             line.attr({
26088                                 path: 'M ' + position + ',-100000 L ' + position + ', +100000',
26089                                 display: ''
26090                             });
26091                         }
26092                     }
26093                 }
26094             };
26095         };
26096
26097
26098         Snapping.prototype._createSnapLines = function() {
26099
26100             this._snapLines = {
26101                 horizontal: this._createLine('horizontal'),
26102                 vertical: this._createLine('vertical')
26103             };
26104         };
26105
26106         Snapping.prototype.showSnapLine = function(orientation, position) {
26107
26108             var line = this.getSnapLine(orientation);
26109
26110             if (line) {
26111                 line.update(position);
26112             }
26113
26114             this._asyncHide();
26115         };
26116
26117         Snapping.prototype.getSnapLine = function(orientation) {
26118             if (!this._snapLines) {
26119                 this._createSnapLines();
26120             }
26121
26122             return this._snapLines[orientation];
26123         };
26124
26125         Snapping.prototype.hide = function() {
26126             forEach(this._snapLines, function(l) {
26127                 l.update();
26128             });
26129         };
26130
26131         Snapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
26132
26133             var siblings = this.getSiblings(shape, target);
26134
26135             forEach(siblings, function(s) {
26136                 snapPoints.add('mid', mid(s));
26137             });
26138
26139         };
26140
26141         Snapping.prototype.getSiblings = function(element, target) {
26142
26143             // snap to all non connection siblings
26144             return target && filter(target.children, function(e) {
26145                 return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;
26146             });
26147         };
26148     }, {
26149         "./SnapContext": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js",
26150         "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
26151         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
26152         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26153         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js"
26154     }],
26155     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js": [function(require, module, exports) {
26156         'use strict';
26157
26158         var SpaceUtil = require('./SpaceUtil');
26159
26160         var Cursor = require('../../util/Cursor');
26161
26162         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
26163
26164         var abs = Math.abs,
26165             round = Math.round;
26166
26167         var HIGH_PRIORITY = 1500;
26168
26169         /**
26170          * A tool that allows users to create and remove space in a diagram.
26171          * 
26172          * The tool needs to be activated manually via
26173          * {@link SpaceTool#activate(MouseEvent)}.
26174          */
26175         function SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {
26176
26177             function canResize(shape) {
26178                 var ctx = {
26179                     shape: shape
26180                 };
26181                 return rules.allowed('shape.resize', ctx);
26182             }
26183
26184             function activateSelection(event, autoActivate) {
26185                 dragging.activate(event, 'spaceTool.selection', {
26186                     cursor: 'crosshair',
26187                     autoActivate: autoActivate,
26188                     data: {
26189                         context: {
26190                             crosshair: {}
26191                         }
26192                     }
26193                 });
26194             }
26195
26196             function activateMakeSpace(event) {
26197                 dragging.activate(event, 'spaceTool', {
26198                     autoActivate: true,
26199                     cursor: 'crosshair',
26200                     data: {
26201                         context: {}
26202                     }
26203                 });
26204             }
26205
26206
26207             eventBus.on('spaceTool.selection.end', function(event) {
26208                 setTimeout(function() {
26209                     activateMakeSpace(event.originalEvent);
26210                 });
26211             });
26212
26213
26214             var AXIS_TO_DIMENSION = {
26215                     x: 'width',
26216                     y: 'height'
26217                 },
26218                 AXIS_INVERTED = {
26219                     x: 'y',
26220                     y: 'x'
26221                 };
26222
26223
26224             function initializeMakeSpace(event, context) {
26225
26226                 var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',
26227                     offset = event['d' + axis],
26228                     // start point of create space operation
26229                     spacePos = event[axis] - offset,
26230                     // list of moving shapes
26231                     movingShapes = [],
26232                     // list of resizing shapes
26233                     resizingShapes = [];
26234
26235                 if (abs(offset) < 5) {
26236                     return false;
26237                 }
26238
26239                 // inverts the offset to choose the shapes
26240                 // on the opposite side of the resizer if
26241                 // a key modifier is pressed
26242                 if (hasPrimaryModifier(event)) {
26243                     offset *= -1;
26244                 }
26245
26246                 // collect all elements that need to be moved _AND_
26247                 // resized given on the initial create space position
26248                 elementRegistry.forEach(function(shape) {
26249                     var shapeStart = shape[[axis]],
26250                         shapeEnd = shapeStart + shape[AXIS_TO_DIMENSION[axis]];
26251
26252                     // checking if it's root
26253                     if (!shape.parent) {
26254                         return;
26255                     }
26256
26257                     // checking if it's a shape
26258                     if (shape.waypoints) {
26259                         return;
26260                     }
26261
26262                     // shape after spacePos
26263                     if (offset > 0 && shapeStart > spacePos) {
26264                         return movingShapes.push(shape);
26265                     }
26266
26267                     // shape before spacePos
26268                     if (offset < 0 && shapeEnd < spacePos) {
26269                         return movingShapes.push(shape);
26270                     }
26271
26272                     // shape on top of spacePos, resize only if allowed
26273                     if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {
26274                         return resizingShapes.push(shape);
26275                     }
26276                 });
26277
26278                 // store data in context
26279                 context.axis = axis;
26280                 context.direction = SpaceUtil.getDirection(axis, offset);
26281                 context.movingShapes = movingShapes;
26282                 context.resizingShapes = resizingShapes;
26283
26284                 Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
26285
26286                 return true;
26287             }
26288
26289
26290             eventBus.on('spaceTool.move', HIGH_PRIORITY, function(event) {
26291
26292                 var context = event.context;
26293
26294                 if (!context.initialized) {
26295                     context.initialized = initializeMakeSpace(event, context);
26296                 }
26297             });
26298
26299
26300             eventBus.on('spaceTool.end', function(event) {
26301
26302                 var context = event.context,
26303                     axis = context.axis,
26304                     direction = context.direction,
26305                     movingShapes = context.movingShapes,
26306                     resizingShapes = context.resizingShapes;
26307
26308                 // skip if create space has not been initialized yet
26309                 if (!context.initialized) {
26310                     return;
26311                 }
26312
26313                 var delta = {
26314                     x: round(event.dx),
26315                     y: round(event.dy)
26316                 };
26317                 delta[AXIS_INVERTED[axis]] = 0;
26318
26319                 return modeling.createSpace(movingShapes, resizingShapes, delta, direction);
26320             });
26321
26322             // API
26323             this.activateSelection = activateSelection;
26324             this.activateMakeSpace = activateMakeSpace;
26325         }
26326
26327         SpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];
26328
26329         module.exports = SpaceTool;
26330
26331     }, {
26332         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
26333         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
26334         "./SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js"
26335     }],
26336     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js": [function(require, module, exports) {
26337         'use strict';
26338
26339         var forEach = require('lodash/collection/forEach');
26340
26341
26342         var MARKER_DRAGGING = 'djs-dragging';
26343
26344
26345         /**
26346          * A plugin that makes shapes draggable / droppable.
26347          * 
26348          * @param {EventBus}
26349          *            eventBus
26350          * @param {ElementRegistry}
26351          *            elementRegistry
26352          * @param {Canvas}
26353          *            canvas
26354          * @param {Styles}
26355          *            styles
26356          */
26357
26358         function SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {
26359
26360             function getGfx(e) {
26361                 return elementRegistry.getGraphics(e);
26362             }
26363
26364             function addDragger(shape, dragGroup) {
26365                 var gfx = getGfx(shape);
26366                 var dragger = gfx.clone();
26367                 var bbox = gfx.getBBox();
26368
26369                 dragger.attr(styles.cls('djs-dragger', [], {
26370                     x: bbox.x,
26371                     y: bbox.y
26372                 }));
26373
26374                 dragGroup.add(dragger);
26375             }
26376
26377             eventBus.on('spaceTool.selection.start', function(event) {
26378                 var space = canvas.getLayer('space'),
26379                     context = event.context;
26380
26381                 var orientation = {
26382                     x: 'M 0,-10000 L 0,10000',
26383                     y: 'M -10000,0 L 10000,0'
26384                 };
26385
26386                 var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', ['no-events']));
26387
26388                 crosshairGroup.path(orientation.x).addClass('djs-crosshair');
26389                 crosshairGroup.path(orientation.y).addClass('djs-crosshair');
26390
26391                 context.crosshairGroup = crosshairGroup;
26392             });
26393
26394             eventBus.on('spaceTool.selection.move', function(event) {
26395                 var crosshairGroup = event.context.crosshairGroup;
26396
26397                 crosshairGroup.translate(event.x, event.y);
26398             });
26399
26400             eventBus.on('spaceTool.selection.cleanup', function(event) {
26401                 var context = event.context,
26402                     crosshairGroup = context.crosshairGroup;
26403
26404                 if (crosshairGroup) {
26405                     crosshairGroup.remove();
26406                 }
26407             });
26408
26409
26410             // assign a low priority to this handler
26411             // to let others modify the move context before
26412             // we draw things
26413             eventBus.on('spaceTool.move', function(event) {
26414                 /*
26415                  * TODO (Ricardo): extend connections while adding space
26416                  */
26417
26418                 var context = event.context,
26419                     line = context.line,
26420                     axis = context.axis,
26421                     dragShapes = context.movingShapes;
26422
26423                 if (!context.initialized) {
26424                     return;
26425                 }
26426
26427                 if (!context.dragGroup) {
26428                     var spaceLayer = canvas.getLayer('space');
26429                     line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');
26430
26431                     context.line = line;
26432                     var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
26433
26434
26435                     forEach(dragShapes, function(shape) {
26436                         addDragger(shape, dragGroup);
26437                         canvas.addMarker(shape, MARKER_DRAGGING);
26438                     });
26439
26440                     context.dragGroup = dragGroup;
26441                 }
26442
26443                 var orientation = {
26444                     x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',
26445                     y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
26446                 };
26447
26448                 line.attr({
26449                     path: orientation[axis],
26450                     display: ''
26451                 });
26452
26453                 var opposite = {
26454                     x: 'y',
26455                     y: 'x'
26456                 };
26457                 var delta = {
26458                     x: event.dx,
26459                     y: event.dy
26460                 };
26461                 delta[opposite[context.axis]] = 0;
26462
26463                 context.dragGroup.translate(delta.x, delta.y);
26464             });
26465
26466             eventBus.on('spaceTool.cleanup', function(event) {
26467
26468                 var context = event.context,
26469                     shapes = context.movingShapes,
26470                     line = context.line,
26471                     dragGroup = context.dragGroup;
26472
26473                 // remove dragging marker
26474                 forEach(shapes, function(e) {
26475                     canvas.removeMarker(e, MARKER_DRAGGING);
26476                 });
26477
26478                 if (dragGroup) {
26479                     line.remove();
26480                     dragGroup.remove();
26481                 }
26482             });
26483         }
26484
26485         SpaceToolVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
26486
26487         module.exports = SpaceToolVisuals;
26488
26489     }, {
26490         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
26491     }],
26492     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js": [function(require, module, exports) {
26493         'use strict';
26494
26495         /**
26496          * Get Resize direction given axis + offset
26497          * 
26498          * @param {String}
26499          *            axis (x|y)
26500          * @param {Number}
26501          *            offset
26502          * 
26503          * @return {String} (e|w|n|s)
26504          */
26505         function getDirection(axis, offset) {
26506
26507             if (axis === 'x') {
26508                 if (offset > 0) {
26509                     return 'e';
26510                 }
26511
26512                 if (offset < 0) {
26513                     return 'w';
26514                 }
26515             }
26516
26517             if (axis === 'y') {
26518                 if (offset > 0) {
26519                     return 's';
26520                 }
26521
26522                 if (offset < 0) {
26523                     return 'n';
26524                 }
26525             }
26526
26527             return null;
26528         }
26529
26530         module.exports.getDirection = getDirection;
26531
26532         /**
26533          * Resize the given bounds by the specified delta from a given anchor point.
26534          * 
26535          * @param {Bounds}
26536          *            bounds the bounding box that should be resized
26537          * @param {String}
26538          *            direction in which the element is resized (n, s, e, w)
26539          * @param {Point}
26540          *            delta of the resize operation
26541          * 
26542          * @return {Bounds} resized bounding box
26543          */
26544         module.exports.resizeBounds = function(bounds, direction, delta) {
26545
26546             var dx = delta.x,
26547                 dy = delta.y;
26548
26549             switch (direction) {
26550
26551                 case 'n':
26552                     return {
26553                         x: bounds.x,
26554                         y: bounds.y + dy,
26555                         width: bounds.width,
26556                         height: bounds.height - dy
26557                     };
26558
26559                 case 's':
26560                     return {
26561                         x: bounds.x,
26562                         y: bounds.y,
26563                         width: bounds.width,
26564                         height: bounds.height + dy
26565                     };
26566
26567                 case 'w':
26568                     return {
26569                         x: bounds.x + dx,
26570                         y: bounds.y,
26571                         width: bounds.width - dx,
26572                         height: bounds.height
26573                     };
26574
26575                 case 'e':
26576                     return {
26577                         x: bounds.x,
26578                         y: bounds.y,
26579                         width: bounds.width + dx,
26580                         height: bounds.height
26581                     };
26582
26583                 default:
26584                     throw new Error('unrecognized direction: ' + direction);
26585             }
26586         };
26587     }, {}],
26588     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js": [function(require, module, exports) {
26589         module.exports = {
26590             __init__: ['spaceToolVisuals'],
26591             __depends__: [require('../dragging'), require('../modeling'), require('../rules')],
26592             spaceTool: ['type', require('./SpaceTool')],
26593             spaceToolVisuals: ['type', require('./SpaceToolVisuals')]
26594         };
26595
26596     }, {
26597         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
26598         "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
26599         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
26600         "./SpaceTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js",
26601         "./SpaceToolVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js"
26602     }],
26603     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js": [function(require, module, exports) {
26604         'use strict';
26605
26606         var isString = require('lodash/lang/isString'),
26607             assign = require('lodash/object/assign'),
26608             forEach = require('lodash/collection/forEach'),
26609             debounce = require('lodash/function/debounce');
26610
26611         var domify = require('min-dom/lib/domify'),
26612             domAttr = require('min-dom/lib/attr'),
26613             domClasses = require('min-dom/lib/classes'),
26614             domRemove = require('min-dom/lib/remove'),
26615             domDelegate = require('min-dom/lib/delegate');
26616
26617
26618         // document wide unique tooltip ids
26619         var ids = new(require('../../util/IdGenerator'))('tt');
26620
26621
26622         function createRoot(parent) {
26623             var root = domify('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');
26624             parent.insertBefore(root, parent.firstChild);
26625
26626             return root;
26627         }
26628
26629
26630         function setPosition(el, x, y) {
26631             assign(el.style, {
26632                 left: x + 'px',
26633                 top: y + 'px'
26634             });
26635         }
26636
26637         function setVisible(el, visible) {
26638             el.style.display = visible === false ? 'none' : '';
26639         }
26640
26641
26642         var tooltipClass = 'djs-tooltip',
26643             tooltipSelector = '.' + tooltipClass;
26644
26645         /**
26646          * A service that allows users to render tool tips on the diagram.
26647          * 
26648          * The tooltip service will take care of updating the tooltip positioning during
26649          * navigation + zooming.
26650          * 
26651          * @example
26652          * 
26653          * ```javascript
26654          *  // add a pink badge on the top left of the shape tooltips.add({ position: {
26655          * x: 50, y: 100 }, html: '<div style="width: 10px; background: fuchsia; color:
26656          * white;">0</div>' });
26657          *  // or with optional life span tooltips.add({ position: { top: -5, left: -5 },
26658          * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
26659          * ttl: 2000 });
26660          *  // remove a tool tip var id = tooltips.add(...); tooltips.remove(id); ```
26661          * 
26662          * @param {Object}
26663          *            config
26664          * @param {EventBus}
26665          *            eventBus
26666          * @param {Canvas}
26667          *            canvas
26668          */
26669         function Tooltips(config, eventBus, canvas) {
26670
26671             this._eventBus = eventBus;
26672             this._canvas = canvas;
26673
26674             this._ids = ids;
26675
26676             this._tooltipDefaults = {
26677                 show: {
26678                     minZoom: 0.7,
26679                     maxZoom: 5.0
26680                 }
26681             };
26682
26683             /**
26684              * Mapping tooltipId -> tooltip
26685              */
26686             this._tooltips = {};
26687
26688             // root html element for all tooltips
26689             this._tooltipRoot = createRoot(canvas.getContainer());
26690
26691
26692             var self = this;
26693
26694             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
26695                 event.stopPropagation();
26696             });
26697
26698             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
26699                 self.trigger('mouseover', event);
26700             });
26701
26702             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
26703                 self.trigger('mouseout', event);
26704             });
26705
26706             this._init(config);
26707         }
26708
26709
26710         Tooltips.$inject = ['config.tooltips', 'eventBus', 'canvas'];
26711
26712         module.exports = Tooltips;
26713
26714
26715         /**
26716          * Adds a HTML tooltip to the diagram
26717          * 
26718          * @param {Object}
26719          *            tooltip the tooltip configuration
26720          * 
26721          * @param {String|DOMElement}
26722          *            tooltip.html html element to use as an tooltip
26723          * @param {Object}
26724          *            [tooltip.show] show configuration
26725          * @param {Number}
26726          *            [tooltip.show.minZoom] minimal zoom level to show the tooltip
26727          * @param {Number}
26728          *            [tooltip.show.maxZoom] maximum zoom level to show the tooltip
26729          * @param {Object}
26730          *            tooltip.position where to attach the tooltip
26731          * @param {Number}
26732          *            [tooltip.position.left] relative to element bbox left attachment
26733          * @param {Number}
26734          *            [tooltip.position.top] relative to element bbox top attachment
26735          * @param {Number}
26736          *            [tooltip.position.bottom] relative to element bbox bottom
26737          *            attachment
26738          * @param {Number}
26739          *            [tooltip.position.right] relative to element bbox right attachment
26740          * @param {Number}
26741          *            [tooltip.timeout=-1]
26742          * 
26743          * @return {String} id that may be used to reference the tooltip for update or
26744          *         removal
26745          */
26746         Tooltips.prototype.add = function(tooltip) {
26747
26748             if (!tooltip.position) {
26749                 throw new Error('must specifiy tooltip position');
26750             }
26751
26752             if (!tooltip.html) {
26753                 throw new Error('must specifiy tooltip html');
26754             }
26755
26756             var id = this._ids.next();
26757
26758             tooltip = assign({}, this._tooltipDefaults, tooltip, {
26759                 id: id
26760             });
26761
26762             this._addTooltip(tooltip);
26763
26764             if (tooltip.timeout) {
26765                 this.setTimeout(tooltip);
26766             }
26767
26768             return id;
26769         };
26770
26771         Tooltips.prototype.trigger = function(action, event) {
26772
26773             var node = event.delegateTarget || event.target;
26774
26775             var tooltip = this.get(domAttr(node, 'data-tooltip-id'));
26776
26777             if (!tooltip) {
26778                 return;
26779             }
26780
26781             if (action === 'mouseover' && tooltip.timeout) {
26782                 this.clearTimeout(tooltip);
26783             }
26784
26785             if (action === 'mouseout' && tooltip.timeout) {
26786                 // cut timeout after mouse out
26787                 tooltip.timeout = 1000;
26788
26789                 this.setTimeout(tooltip);
26790             }
26791
26792             console.log('mouse leave', event);
26793         };
26794
26795         /**
26796          * Get a tooltip with the given id
26797          * 
26798          * @param {String}
26799          *            id
26800          */
26801         Tooltips.prototype.get = function(id) {
26802
26803             if (typeof id !== 'string') {
26804                 id = id.id;
26805             }
26806
26807             return this._tooltips[id];
26808         };
26809
26810         Tooltips.prototype.clearTimeout = function(tooltip) {
26811
26812             tooltip = this.get(tooltip);
26813
26814             if (!tooltip) {
26815                 return;
26816             }
26817
26818             var removeTimer = tooltip.removeTimer;
26819
26820             if (removeTimer) {
26821                 clearTimeout(removeTimer);
26822                 tooltip.removeTimer = null;
26823             }
26824         };
26825
26826         Tooltips.prototype.setTimeout = function(tooltip) {
26827
26828             tooltip = this.get(tooltip);
26829
26830             if (!tooltip) {
26831                 return;
26832             }
26833
26834             this.clearTimeout(tooltip);
26835
26836             var self = this;
26837
26838             tooltip.removeTimer = setTimeout(function() {
26839                 self.remove(tooltip);
26840             }, tooltip.timeout);
26841         };
26842
26843         /**
26844          * Remove an tooltip with the given id
26845          * 
26846          * @param {String}
26847          *            id
26848          */
26849         Tooltips.prototype.remove = function(id) {
26850
26851             var tooltip = this.get(id);
26852
26853             if (tooltip) {
26854                 domRemove(tooltip.html);
26855                 domRemove(tooltip.htmlContainer);
26856
26857                 delete tooltip.htmlContainer;
26858
26859                 delete this._tooltips[tooltip.id];
26860             }
26861         };
26862
26863
26864         Tooltips.prototype.show = function() {
26865             setVisible(this._tooltipRoot);
26866         };
26867
26868
26869         Tooltips.prototype.hide = function() {
26870             setVisible(this._tooltipRoot, false);
26871         };
26872
26873
26874         Tooltips.prototype._updateRoot = function(viewbox) {
26875             var a = viewbox.scale || 1;
26876             var d = viewbox.scale || 1;
26877
26878             var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
26879
26880             this._tooltipRoot.style.transform = matrix;
26881             this._tooltipRoot.style['-ms-transform'] = matrix;
26882         };
26883
26884
26885         Tooltips.prototype._addTooltip = function(tooltip) {
26886
26887             var id = tooltip.id,
26888                 html = tooltip.html,
26889                 htmlContainer,
26890                 tooltipRoot = this._tooltipRoot;
26891
26892             // unwrap jquery (for those who need it)
26893             if (html.get) {
26894                 html = html.get(0);
26895             }
26896
26897             // create proper html elements from
26898             // tooltip HTML strings
26899             if (isString(html)) {
26900                 html = domify(html);
26901             }
26902
26903             htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="position: absolute">');
26904
26905             htmlContainer.appendChild(html);
26906
26907             if (tooltip.type) {
26908                 domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
26909             }
26910
26911             if (tooltip.className) {
26912                 domClasses(htmlContainer).add(tooltip.className);
26913             }
26914
26915             tooltip.htmlContainer = htmlContainer;
26916
26917             tooltipRoot.appendChild(htmlContainer);
26918
26919             this._tooltips[id] = tooltip;
26920
26921             this._updateTooltip(tooltip);
26922         };
26923
26924
26925         Tooltips.prototype._updateTooltip = function(tooltip) {
26926
26927             var position = tooltip.position,
26928                 htmlContainer = tooltip.htmlContainer;
26929
26930             // update overlay html based on tooltip x, y
26931
26932             setPosition(htmlContainer, position.x, position.y);
26933         };
26934
26935
26936         Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
26937
26938             forEach(this._tooltips, function(tooltip) {
26939                 var show = tooltip.show,
26940                     htmlContainer = tooltip.htmlContainer,
26941                     visible = true;
26942
26943                 if (show) {
26944                     if (show.minZoom > viewbox.scale ||
26945                         show.maxZoom < viewbox.scale) {
26946                         visible = false;
26947                     }
26948
26949                     setVisible(htmlContainer, visible);
26950                 }
26951             });
26952         };
26953
26954         Tooltips.prototype._init = function(config) {
26955
26956             var self = this;
26957
26958
26959             // scroll/zoom integration
26960
26961             var updateViewbox = function(viewbox) {
26962                 self._updateRoot(viewbox);
26963                 self._updateTooltipVisibilty(viewbox);
26964
26965                 self.show();
26966             };
26967
26968             if (!config || config.deferUpdate !== false) {
26969                 updateViewbox = debounce(updateViewbox, 300);
26970             }
26971
26972             this._eventBus.on('canvas.viewbox.changed', function(event) {
26973                 self.hide();
26974                 updateViewbox(event.viewbox);
26975             });
26976         };
26977
26978     }, {
26979         "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
26980         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26981         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
26982         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
26983         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
26984         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
26985         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
26986         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
26987         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
26988         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
26989     }],
26990     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js": [function(require, module, exports) {
26991         module.exports = {
26992             __init__: ['tooltips'],
26993             tooltips: ['type', require('./Tooltips')]
26994         };
26995     }, {
26996         "./Tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js"
26997     }],
26998     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js": [function(require, module, exports) {
26999         'use strict';
27000
27001         function TouchFix(canvas, eventBus) {
27002
27003             var self = this;
27004
27005             eventBus.on('canvas.init', function(e) {
27006                 self.addBBoxMarker(e.svg);
27007             });
27008         }
27009
27010         TouchFix.$inject = ['canvas', 'eventBus'];
27011
27012         module.exports = TouchFix;
27013
27014
27015         /**
27016          * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element if
27017          * there is no shape between 0,0 and viewport elements origin.
27018          * 
27019          * So touchstart event is only fired when the <g class="viewport"> element was
27020          * hit. Putting an element over and below the 'viewport' fixes that behavior.
27021          */
27022         TouchFix.prototype.addBBoxMarker = function(paper) {
27023
27024             var markerStyle = {
27025                 fill: 'none',
27026                 class: 'outer-bound-marker'
27027             };
27028
27029             paper.rect(-10000, -10000, 10, 10).attr(markerStyle);
27030             paper.rect(10000, 10000, 10, 10).attr(markerStyle);
27031         };
27032
27033     }, {}],
27034     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js": [function(require, module, exports) {
27035         'use strict';
27036
27037         var forEach = require('lodash/collection/forEach'),
27038             domEvent = require('min-dom/lib/event'),
27039             domClosest = require('min-dom/lib/closest'),
27040             Hammer = require('hammerjs'),
27041             Snap = require('../../../vendor/snapsvg'),
27042             Event = require('../../util/Event');
27043
27044         var MIN_ZOOM = 0.2,
27045             MAX_ZOOM = 4;
27046
27047         var mouseEvents = [
27048             'mousedown',
27049             'mouseup',
27050             'mouseover',
27051             'mouseout',
27052             'click',
27053             'dblclick'
27054         ];
27055
27056         function log() {
27057             if (false) {
27058                 console.log.apply(console, arguments);
27059             }
27060         }
27061
27062         function get(service, injector) {
27063             try {
27064                 return injector.get(service);
27065             } catch (e) {
27066                 return null;
27067             }
27068         }
27069
27070         function createTouchRecognizer(node) {
27071
27072             function stopEvent(event) {
27073                 Event.stopEvent(event, true);
27074             }
27075
27076             function stopMouse(event) {
27077
27078                 forEach(mouseEvents, function(e) {
27079                     domEvent.bind(node, e, stopEvent, true);
27080                 });
27081             }
27082
27083             function allowMouse(event) {
27084                 setTimeout(function() {
27085                     forEach(mouseEvents, function(e) {
27086                         domEvent.unbind(node, e, stopEvent, true);
27087                     });
27088                 }, 500);
27089             }
27090
27091             domEvent.bind(node, 'touchstart', stopMouse, true);
27092             domEvent.bind(node, 'touchend', allowMouse, true);
27093             domEvent.bind(node, 'touchcancel', allowMouse, true);
27094
27095             // A touch event recognizer that handles
27096             // touch events only (we know, we can already handle
27097             // mouse events out of the box)
27098
27099             var recognizer = new Hammer.Manager(node, {
27100                 inputClass: Hammer.TouchInput,
27101                 recognizers: []
27102             });
27103
27104
27105             var tap = new Hammer.Tap();
27106             var pan = new Hammer.Pan({
27107                 threshold: 10
27108             });
27109             var press = new Hammer.Press();
27110             var pinch = new Hammer.Pinch();
27111
27112             var doubleTap = new Hammer.Tap({
27113                 event: 'doubletap',
27114                 taps: 2
27115             });
27116
27117             pinch.requireFailure(pan);
27118             pinch.requireFailure(press);
27119
27120             recognizer.add([pan, press, pinch, doubleTap, tap]);
27121
27122             recognizer.reset = function(force) {
27123                 var recognizers = this.recognizers,
27124                     session = this.session;
27125
27126                 if (session.stopped) {
27127                     return;
27128                 }
27129
27130                 log('recognizer', 'stop');
27131
27132                 recognizer.stop(force);
27133
27134                 setTimeout(function() {
27135                     var i, r;
27136
27137                     log('recognizer', 'reset');
27138                     for (i = 0; !!(r = recognizers[i]); i++) {
27139                         r.reset();
27140                         r.state = 8; // FAILED STATE
27141                     }
27142
27143                     session.curRecognizer = null;
27144                 }, 0);
27145             };
27146
27147             recognizer.on('hammer.input', function(event) {
27148                 if (event.srcEvent.defaultPrevented) {
27149                     recognizer.reset(true);
27150                 }
27151             });
27152
27153             return recognizer;
27154         }
27155
27156         /**
27157          * A plugin that provides touch events for elements.
27158          * 
27159          * @param {EventBus}
27160          *            eventBus
27161          * @param {InteractionEvents}
27162          *            interactionEvents
27163          */
27164         function TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {
27165
27166             // optional integrations
27167             var dragging = get('dragging', injector),
27168                 move = get('move', injector),
27169                 contextPad = get('contextPad', injector),
27170                 palette = get('palette', injector);
27171
27172             // the touch recognizer
27173             var recognizer;
27174
27175             function handler(type) {
27176
27177                 return function(event) {
27178                     log('element', type, event);
27179
27180                     interactionEvents.fire(type, event);
27181                 };
27182             }
27183
27184             function getGfx(target) {
27185                 var node = domClosest(target, 'svg, .djs-element', true);
27186                 return node && new Snap(node);
27187             }
27188
27189             function initEvents(svg) {
27190
27191                 // touch recognizer
27192                 recognizer = createTouchRecognizer(svg);
27193
27194                 recognizer.on('doubletap', handler('element.dblclick'));
27195
27196                 recognizer.on('tap', handler('element.click'));
27197
27198                 function startGrabCanvas(event) {
27199
27200                     log('canvas', 'grab start');
27201
27202                     var lx = 0,
27203                         ly = 0;
27204
27205                     function update(e) {
27206
27207                         var dx = e.deltaX - lx,
27208                             dy = e.deltaY - ly;
27209
27210                         canvas.scroll({
27211                             dx: dx,
27212                             dy: dy
27213                         });
27214
27215                         lx = e.deltaX;
27216                         ly = e.deltaY;
27217                     }
27218
27219                     function end(e) {
27220                         recognizer.off('panmove', update);
27221                         recognizer.off('panend', end);
27222                         recognizer.off('pancancel', end);
27223
27224                         log('canvas', 'grab end');
27225                     }
27226
27227                     recognizer.on('panmove', update);
27228                     recognizer.on('panend', end);
27229                     recognizer.on('pancancel', end);
27230                 }
27231
27232                 function startGrab(event) {
27233
27234                     var gfx = getGfx(event.target),
27235                         element = gfx && elementRegistry.get(gfx);
27236
27237                     // recognizer
27238                     if (move && canvas.getRootElement() !== element) {
27239                         log('element', 'move start', element, event, true);
27240                         return move.start(event, element, true);
27241                     } else {
27242                         startGrabCanvas(event);
27243                     }
27244                 }
27245
27246                 function startZoom(e) {
27247
27248                     log('canvas', 'zoom start');
27249
27250                     var zoom = canvas.zoom(),
27251                         mid = e.center;
27252
27253                     function update(e) {
27254
27255                         var ratio = 1 - (1 - e.scale) / 1.50,
27256                             newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));
27257
27258                         canvas.zoom(newZoom, mid);
27259
27260                         Event.stopEvent(e, true);
27261                     }
27262
27263                     function end(e) {
27264                         recognizer.off('pinchmove', update);
27265                         recognizer.off('pinchend', end);
27266                         recognizer.off('pinchcancel', end);
27267
27268                         recognizer.reset(true);
27269
27270                         log('canvas', 'zoom end');
27271                     }
27272
27273                     recognizer.on('pinchmove', update);
27274                     recognizer.on('pinchend', end);
27275                     recognizer.on('pinchcancel', end);
27276                 }
27277
27278                 recognizer.on('panstart', startGrab);
27279                 recognizer.on('press', startGrab);
27280
27281                 recognizer.on('pinchstart', startZoom);
27282             }
27283
27284             if (dragging) {
27285
27286                 // simulate hover during dragging
27287                 eventBus.on('drag.move', function(event) {
27288
27289                     var position = Event.toPoint(event.originalEvent);
27290
27291                     var node = document.elementFromPoint(position.x, position.y),
27292                         gfx = getGfx(node),
27293                         element = gfx && elementRegistry.get(gfx);
27294
27295                     if (element !== event.hover) {
27296                         if (event.hover) {
27297                             dragging.out(event);
27298                         }
27299
27300                         if (element) {
27301                             dragging.hover({
27302                                 element: element,
27303                                 gfx: gfx
27304                             });
27305
27306                             event.hover = element;
27307                             event.hoverGfx = gfx;
27308                         }
27309                     }
27310                 });
27311             }
27312
27313             if (contextPad) {
27314
27315                 eventBus.on('contextPad.create', function(event) {
27316                     var node = event.pad.html;
27317
27318                     // touch recognizer
27319                     var padRecognizer = createTouchRecognizer(node);
27320
27321                     padRecognizer.on('panstart', function(event) {
27322                         log('context-pad', 'panstart', event);
27323                         contextPad.trigger('dragstart', event, true);
27324                     });
27325
27326                     padRecognizer.on('press', function(event) {
27327                         log('context-pad', 'press', event);
27328                         contextPad.trigger('dragstart', event, true);
27329                     });
27330
27331                     padRecognizer.on('tap', function(event) {
27332                         log('context-pad', 'tap', event);
27333                         contextPad.trigger('click', event);
27334                     });
27335                 });
27336             }
27337
27338             if (palette) {
27339                 eventBus.on('palette.create', function(event) {
27340                     var node = event.html;
27341
27342                     // touch recognizer
27343                     var padRecognizer = createTouchRecognizer(node);
27344
27345                     padRecognizer.on('panstart', function(event) {
27346                         log('palette', 'panstart', event);
27347                         palette.trigger('dragstart', event, true);
27348                     });
27349
27350                     padRecognizer.on('press', function(event) {
27351                         log('palette', 'press', event);
27352                         palette.trigger('dragstart', event, true);
27353                     });
27354
27355                     padRecognizer.on('tap', function(event) {
27356                         log('palette', 'tap', event);
27357                         palette.trigger('click', event);
27358                     });
27359                 });
27360             }
27361
27362             eventBus.on('canvas.init', function(event) {
27363                 initEvents(event.svg.node);
27364             });
27365         }
27366
27367
27368         TouchInteractionEvents.$inject = [
27369             'injector',
27370             'canvas',
27371             'eventBus',
27372             'elementRegistry',
27373             'interactionEvents',
27374             'touchFix'
27375         ];
27376
27377         module.exports = TouchInteractionEvents;
27378     }, {
27379         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27380         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
27381         "hammerjs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js",
27382         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27383         "min-dom/lib/closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js",
27384         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
27385     }],
27386     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js": [function(require, module, exports) {
27387         module.exports = {
27388             __depends__: [require('../interaction-events')],
27389             __init__: ['touchInteractionEvents'],
27390             touchInteractionEvents: ['type', require('./TouchInteractionEvents')],
27391             touchFix: ['type', require('./TouchFix')]
27392         };
27393     }, {
27394         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
27395         "./TouchFix": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js",
27396         "./TouchInteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js"
27397     }],
27398     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js": [function(require, module, exports) {
27399         'use strict';
27400
27401         var LayoutUtil = require('./LayoutUtil');
27402
27403
27404         /**
27405          * A base connection layouter implementation that layouts the connection by
27406          * directly connecting mid(source) + mid(target).
27407          */
27408         function BaseLayouter() {}
27409
27410         module.exports = BaseLayouter;
27411
27412
27413         /**
27414          * Return the new layouted waypoints for the given connection.
27415          * 
27416          * @param {djs.model.Connection}
27417          *            connection
27418          * @param {Object}
27419          *            hints
27420          * @param {Boolean}
27421          *            [hints.movedStart=false]
27422          * @param {Boolean}
27423          *            [hints.movedEnd=false]
27424          * 
27425          * @return {Array<Point>} the layouted connection waypoints
27426          */
27427         BaseLayouter.prototype.layoutConnection = function(connection, hints) {
27428             return [
27429                 LayoutUtil.getMidPoint(connection.source),
27430                 LayoutUtil.getMidPoint(connection.target)
27431             ];
27432         };
27433
27434     }, {
27435         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
27436     }],
27437     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js": [function(require, module, exports) {
27438         'use strict';
27439
27440         var assign = require('lodash/object/assign');
27441
27442         var LayoutUtil = require('./LayoutUtil');
27443
27444
27445         function dockingToPoint(docking) {
27446             // use the dockings actual point and
27447             // retain the original docking
27448             return assign({
27449                 original: docking.point.original || docking.point
27450             }, docking.actual);
27451         }
27452
27453
27454         /**
27455          * A {@link ConnectionDocking} that crops connection waypoints based on the
27456          * path(s) of the connection source and target.
27457          * 
27458          * @param {djs.core.ElementRegistry}
27459          *            elementRegistry
27460          */
27461         function CroppingConnectionDocking(elementRegistry, renderer) {
27462             this._elementRegistry = elementRegistry;
27463             this._renderer = renderer;
27464         }
27465
27466         CroppingConnectionDocking.$inject = ['elementRegistry', 'renderer'];
27467
27468         module.exports = CroppingConnectionDocking;
27469
27470
27471         /**
27472          * @inheritDoc ConnectionDocking#getCroppedWaypoints
27473          */
27474         CroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {
27475
27476             source = source || connection.source;
27477             target = target || connection.target;
27478
27479             var sourceDocking = this.getDockingPoint(connection, source, true),
27480                 targetDocking = this.getDockingPoint(connection, target);
27481
27482             var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);
27483
27484             croppedWaypoints.unshift(dockingToPoint(sourceDocking));
27485             croppedWaypoints.push(dockingToPoint(targetDocking));
27486
27487             return croppedWaypoints;
27488         };
27489
27490         /**
27491          * Return the connection docking point on the specified shape
27492          * 
27493          * @inheritDoc ConnectionDocking#getDockingPoint
27494          */
27495         CroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {
27496
27497             var waypoints = connection.waypoints,
27498                 dockingIdx,
27499                 dockingPoint,
27500                 croppedPoint;
27501
27502             dockingIdx = dockStart ? 0 : waypoints.length - 1;
27503             dockingPoint = waypoints[dockingIdx];
27504
27505             croppedPoint = this._getIntersection(shape, connection, dockStart);
27506
27507             return {
27508                 point: dockingPoint,
27509                 actual: croppedPoint || dockingPoint,
27510                 idx: dockingIdx
27511             };
27512         };
27513
27514
27515         // //// helper methods ///////////////////////////////////////////////////
27516
27517         CroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
27518
27519             var shapePath = this._getShapePath(shape),
27520                 connectionPath = this._getConnectionPath(connection);
27521
27522             return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);
27523         };
27524
27525         CroppingConnectionDocking.prototype._getConnectionPath = function(connection) {
27526             return this._renderer.getConnectionPath(connection);
27527         };
27528
27529         CroppingConnectionDocking.prototype._getShapePath = function(shape) {
27530             return this._renderer.getShapePath(shape);
27531         };
27532
27533         CroppingConnectionDocking.prototype._getGfx = function(element) {
27534             return this._elementRegistry.getGraphics(element);
27535         };
27536     }, {
27537         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
27538         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
27539     }],
27540     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js": [function(require, module, exports) {
27541         'use strict';
27542
27543         var isArray = require('lodash/lang/isArray'),
27544             sortBy = require('lodash/collection/sortBy');
27545
27546         var Snap = require('../../vendor/snapsvg');
27547
27548         /**
27549          * Returns whether two points are in a horizontal or vertical line.
27550          * 
27551          * @param {Point}
27552          *            a
27553          * @param {Point}
27554          *            b
27555          * 
27556          * @return {String|Boolean} returns false if the points are not aligned or 'h|v'
27557          *         if they are aligned horizontally / vertically.
27558          */
27559         function pointsAligned(a, b) {
27560             switch (true) {
27561                 case a.x === b.x:
27562                     return 'h';
27563                 case a.y === b.y:
27564                     return 'v';
27565             }
27566
27567             return false;
27568         }
27569
27570         module.exports.pointsAligned = pointsAligned;
27571
27572
27573         function roundPoint(point) {
27574
27575             return {
27576                 x: Math.round(point.x),
27577                 y: Math.round(point.y)
27578             };
27579         }
27580
27581         module.exports.roundPoint = roundPoint;
27582
27583
27584         function pointsEqual(a, b) {
27585             return a.x === b.x && a.y === b.y;
27586         }
27587
27588         module.exports.pointsEqual = pointsEqual;
27589
27590
27591         function pointDistance(a, b) {
27592             return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
27593         }
27594
27595         module.exports.pointDistance = pointDistance;
27596
27597
27598         function asTRBL(bounds) {
27599             return {
27600                 top: bounds.y,
27601                 right: bounds.x + (bounds.width || 0),
27602                 bottom: bounds.y + (bounds.height || 0),
27603                 left: bounds.x
27604             };
27605         }
27606
27607         module.exports.asTRBL = asTRBL;
27608
27609
27610         function getMidPoint(bounds) {
27611             return roundPoint({
27612                 x: bounds.x + bounds.width / 2,
27613                 y: bounds.y + bounds.height / 2
27614             });
27615         }
27616
27617         module.exports.getMidPoint = getMidPoint;
27618
27619
27620         // //// orientation utils //////////////////////////////
27621
27622         function getOrientation(rect, reference, pointDistance) {
27623
27624             pointDistance = pointDistance || 0;
27625
27626             var rectOrientation = asTRBL(rect),
27627                 referenceOrientation = asTRBL(reference);
27628
27629             var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,
27630                 right = rectOrientation.left - pointDistance >= referenceOrientation.right,
27631                 bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,
27632                 left = rectOrientation.right + pointDistance <= referenceOrientation.left;
27633
27634             var vertical = top ? 'top' : (bottom ? 'bottom' : null),
27635                 horizontal = left ? 'left' : (right ? 'right' : null);
27636
27637             if (horizontal && vertical) {
27638                 return vertical + '-' + horizontal;
27639             } else
27640             if (horizontal || vertical) {
27641                 return horizontal || vertical;
27642             } else {
27643                 return 'intersect';
27644             }
27645         }
27646
27647         module.exports.getOrientation = getOrientation;
27648
27649
27650         function hasAnyOrientation(rect, reference, pointDistance, locations) {
27651
27652             if (isArray(pointDistance)) {
27653                 locations = pointDistance;
27654                 pointDistance = 0;
27655             }
27656
27657             var orientation = getOrientation(rect, reference, pointDistance);
27658
27659             return locations.indexOf(orientation) !== -1;
27660         }
27661
27662         module.exports.hasAnyOrientation = hasAnyOrientation;
27663
27664
27665         // //// intersection utils //////////////////////////////
27666
27667         function getElementLineIntersection(elementPath, linePath, cropStart) {
27668
27669             var intersections = getIntersections(elementPath, linePath);
27670
27671             // recognize intersections
27672             // only one -> choose
27673             // two close together -> choose first
27674             // two or more distinct -> pull out appropriate one
27675             // none -> ok (fallback to point itself)
27676             if (intersections.length === 1) {
27677                 return roundPoint(intersections[0]);
27678             } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {
27679                 return roundPoint(intersections[0]);
27680             } else if (intersections.length > 1) {
27681
27682                 // sort by intersections based on connection segment +
27683                 // distance from start
27684                 intersections = sortBy(intersections, function(i) {
27685                     var distance = Math.floor(i.t2 * 100) || 1;
27686
27687                     distance = 100 - distance;
27688
27689                     distance = (distance < 10 ? '0' : '') + distance;
27690
27691                     // create a sort string that makes sure we sort
27692                     // line segment ASC + line segment position DESC (for cropStart)
27693                     // line segment ASC + line segment position ASC (for cropEnd)
27694                     return i.segment2 + '#' + distance;
27695                 });
27696
27697                 return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
27698             }
27699
27700             return null;
27701         }
27702
27703         module.exports.getElementLineIntersection = getElementLineIntersection;
27704
27705
27706         function getIntersections(a, b) {
27707             return Snap.path.intersection(a, b);
27708         }
27709
27710         module.exports.getIntersections = getIntersections;
27711     }, {
27712         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27713         "lodash/collection/sortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js",
27714         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
27715     }],
27716     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js": [function(require, module, exports) {
27717         'use strict';
27718
27719         var isArray = require('lodash/lang/isArray'),
27720             find = require('lodash/collection/find');
27721
27722         var LayoutUtil = require('./LayoutUtil'),
27723             Geometry = require('../util/Geometry');
27724
27725         var MIN_DISTANCE = 20;
27726
27727
27728         /**
27729          * Returns the mid points for a manhattan connection between two points.
27730          * 
27731          * @example
27732          * 
27733          * [a]----[x] | [x]--->[b]
27734          * 
27735          * @param {Point}
27736          *            a
27737          * @param {Point}
27738          *            b
27739          * @param {String}
27740          *            directions
27741          * 
27742          * @return {Array<Point>}
27743          */
27744         module.exports.getMidPoints = function(a, b, directions) {
27745
27746             directions = directions || 'h:h';
27747
27748             var xmid, ymid;
27749
27750             // one point, next to a
27751             if (directions === 'h:v') {
27752                 return [{
27753                     x: b.x,
27754                     y: a.y
27755                 }];
27756             } else
27757             // one point, above a
27758             if (directions === 'v:h') {
27759                 return [{
27760                     x: a.x,
27761                     y: b.y
27762                 }];
27763             } else
27764             // vertical edge xmid
27765             if (directions === 'h:h') {
27766                 xmid = Math.round((b.x - a.x) / 2 + a.x);
27767
27768                 return [{
27769                     x: xmid,
27770                     y: a.y
27771                 }, {
27772                     x: xmid,
27773                     y: b.y
27774                 }];
27775             } else
27776             // horizontal edge ymid
27777             if (directions === 'v:v') {
27778                 ymid = Math.round((b.y - a.y) / 2 + a.y);
27779
27780                 return [{
27781                     x: a.x,
27782                     y: ymid
27783                 }, {
27784                     x: b.x,
27785                     y: ymid
27786                 }];
27787             } else {
27788                 throw new Error(
27789                     'unknown directions: <' + directions + '>: ' +
27790                     'directions must be specified as {a direction}:{b direction} (direction in h|v)');
27791             }
27792         };
27793
27794
27795         /**
27796          * Create a connection between the two points according to the manhattan layout
27797          * (only horizontal and vertical) edges.
27798          * 
27799          * @param {Point}
27800          *            a
27801          * @param {Point}
27802          *            b
27803          * 
27804          * @param {String}
27805          *            [directions='h:h'] specifies manhattan directions for each point
27806          *            as {adirection}:{bdirection}. A directionfor a point is either `h`
27807          *            (horizontal) or `v` (vertical)
27808          * 
27809          * @return {Array<Point>}
27810          */
27811         module.exports.connectPoints = function(a, b, directions) {
27812
27813             var points = [];
27814
27815             if (!LayoutUtil.pointsAligned(a, b)) {
27816                 points = this.getMidPoints(a, b, directions);
27817             }
27818
27819             points.unshift(a);
27820             points.push(b);
27821
27822             return points;
27823         };
27824
27825
27826         /**
27827          * Connect two rectangles using a manhattan layouted connection.
27828          * 
27829          * @param {Bounds}
27830          *            source source rectangle
27831          * @param {Bounds}
27832          *            target target rectangle
27833          * @param {Point}
27834          *            [start] source docking
27835          * @param {Point}
27836          *            [end] target docking
27837          * 
27838          * @return {Array<Point>} connection points
27839          */
27840         module.exports.connectRectangles = function(source, target, start, end, options) {
27841
27842             options = options || {};
27843
27844             var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
27845
27846             var directions = this.getDirections(source, target, options.preferVertical);
27847
27848             start = start || LayoutUtil.getMidPoint(source);
27849             end = end || LayoutUtil.getMidPoint(target);
27850
27851             // overlapping elements
27852             if (!directions) {
27853                 return;
27854             }
27855
27856             if (directions === 'h:h') {
27857
27858                 switch (orientation) {
27859                     case 'top-right':
27860                     case 'right':
27861                     case 'bottom-right':
27862                         start = {
27863                             original: start,
27864                             x: source.x,
27865                             y: start.y
27866                         };
27867                         end = {
27868                             original: end,
27869                             x: target.x + target.width,
27870                             y: end.y
27871                         };
27872                         break;
27873                     case 'top-left':
27874                     case 'left':
27875                     case 'bottom-left':
27876                         start = {
27877                             original: start,
27878                             x: source.x + source.width,
27879                             y: start.y
27880                         };
27881                         end = {
27882                             original: end,
27883                             x: target.x,
27884                             y: end.y
27885                         };
27886                         break;
27887                 }
27888             }
27889
27890             if (directions === 'v:v') {
27891
27892                 switch (orientation) {
27893                     case 'top-left':
27894                     case 'top':
27895                     case 'top-right':
27896                         start = {
27897                             original: start,
27898                             x: start.x,
27899                             y: source.y + source.height
27900                         };
27901                         end = {
27902                             original: end,
27903                             x: end.x,
27904                             y: target.y
27905                         };
27906                         break;
27907                     case 'bottom-left':
27908                     case 'bottom':
27909                     case 'bottom-right':
27910                         start = {
27911                             original: start,
27912                             x: start.x,
27913                             y: source.y
27914                         };
27915                         end = {
27916                             original: end,
27917                             x: end.x,
27918                             y: target.y + target.height
27919                         };
27920                         break;
27921                 }
27922             }
27923
27924             return this.connectPoints(start, end, directions);
27925         };
27926
27927         /**
27928          * Repair the connection between two rectangles, of which one has been updated.
27929          * 
27930          * @param {Bounds}
27931          *            source
27932          * @param {Bounds}
27933          *            target
27934          * @param {Point}
27935          *            [start]
27936          * @param {Point}
27937          *            [end]
27938          * @param {Array
27939          *            <Point>} waypoints
27940          * @param {Object}
27941          *            [hints]
27942          * @param {Boolean}
27943          *            hints.preferStraight
27944          * @param {Boolean}
27945          *            hints.preferVertical
27946          * @param {Boolean}
27947          *            hints.startChanged
27948          * @param {Boolean}
27949          *            hints.endChanged
27950          * 
27951          * @return {Array<Point>} repaired waypoints
27952          */
27953         module.exports.repairConnection = function(source, target, start, end, waypoints, hints) {
27954
27955             if (isArray(start)) {
27956                 waypoints = start;
27957                 hints = end;
27958
27959                 start = LayoutUtil.getMidPoint(source);
27960                 end = LayoutUtil.getMidPoint(target);
27961             }
27962
27963             hints = hints || {};
27964
27965
27966             var repairedWaypoints;
27967
27968             // just layout non-existing or simple connections
27969             // attempt to render straight lines, if required
27970             if (!waypoints || waypoints.length < 3) {
27971
27972                 if (hints.preferStraight) {
27973                     // attempt to layout a straight line
27974                     repairedWaypoints = this.layoutStraight(source, target, start, end, hints);
27975                 }
27976             } else {
27977                 // check if we layout from start or end
27978                 if (hints.endChanged) {
27979                     repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());
27980                     repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();
27981                 } else
27982                 if (hints.startChanged) {
27983                     repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);
27984                 }
27985                 // or whether nothing seems to have changed
27986                 else {
27987                     repairedWaypoints = waypoints;
27988                 }
27989             }
27990
27991             // simply reconnect if nothing else worked
27992             if (!repairedWaypoints) {
27993                 return this.connectRectangles(source, target, start, end, hints);
27994             }
27995
27996             return repairedWaypoints;
27997         };
27998
27999         function max(a, b) {
28000             return Math.max(a, b);
28001         }
28002
28003         function min(a, b) {
28004             return Math.min(a, b);
28005         }
28006
28007         function inRange(a, start, end) {
28008             return a >= start && a <= end;
28009         }
28010
28011         module.exports.layoutStraight = function(source, target, start, end, hints) {
28012
28013             var startX, endX, x,
28014                 startY, endY, y;
28015
28016             startX = max(source.x + 10, target.x + 10);
28017             endX = min(source.x + source.width - 10, target.x + target.width - 10);
28018
28019             if (startX < endX) {
28020
28021                 if (source.width === target.width) {
28022
28023                     if (hints.endChanged && inRange(end.x, startX, endX)) {
28024                         x = end.x;
28025                     } else
28026                     if (inRange(start.x, startX, endX)) {
28027                         x = start.x;
28028                     }
28029                 }
28030
28031                 if (x === undefined) {
28032                     if (source.width < target.width && inRange(start.x, startX, endX)) {
28033                         x = start.x;
28034                     } else
28035                     if (source.width > target.width && inRange(end.x, startX, endX)) {
28036                         x = end.x;
28037                     } else {
28038                         x = (startX + endX) / 2;
28039                     }
28040                 }
28041             }
28042
28043             startY = max(source.y + 10, target.y + 10);
28044             endY = min(source.y + source.height - 10, target.y + target.height - 10);
28045
28046             if (startY < endY) {
28047
28048                 if (source.height === target.height) {
28049                     if (hints.endChanged && inRange(end.y, startY, endY)) {
28050                         y = end.y;
28051                     } else
28052                     if (inRange(start.y, startY, endY)) {
28053                         y = start.y;
28054                     }
28055                 }
28056
28057                 if (y === undefined) {
28058                     if (source.height <= target.height && inRange(start.y, startY, endY)) {
28059                         y = start.y;
28060                     } else
28061                     if (target.height <= source.height && inRange(end.y, startY, endY)) {
28062                         y = end.y;
28063                     } else {
28064                         y = (startY + endY) / 2;
28065                     }
28066                 }
28067             }
28068
28069             // cannot layout straight
28070             if (x === undefined && y === undefined) {
28071                 return null;
28072             }
28073
28074             return [{
28075                 x: x !== undefined ? x : start.x,
28076                 y: y !== undefined ? y : start.y
28077             }, {
28078                 x: x !== undefined ? x : end.x,
28079                 y: y !== undefined ? y : end.y
28080             }];
28081         };
28082
28083
28084         /**
28085          * Repair a connection from one side that moved.
28086          * 
28087          * @param {Bounds}
28088          *            moved
28089          * @param {Bounds}
28090          *            other
28091          * @param {Point}
28092          *            newDocking
28093          * @param {Array
28094          *            <Point>} points originalPoints from moved to other
28095          * 
28096          * @return {Array<Point>} the repaired points between the two rectangles
28097          */
28098         module.exports._repairConnectionSide = function(moved, other, newDocking, points) {
28099
28100             function needsRelayout(moved, other, points) {
28101
28102                 if (points.length < 3) {
28103                     return true;
28104                 }
28105
28106                 if (points.length > 4) {
28107                     return false;
28108                 }
28109
28110                 // relayout if two points overlap
28111                 // this is most likely due to
28112                 return !!find(points, function(p, idx) {
28113                     var q = points[idx - 1];
28114
28115                     return q && Geometry.distance(p, q) < 3;
28116                 });
28117             }
28118
28119             function repairBendpoint(candidate, oldPeer, newPeer) {
28120
28121                 var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);
28122
28123                 switch (alignment) {
28124                     case 'v':
28125                         // repair vertical alignment
28126                         return {
28127                             x: candidate.x,
28128                             y: newPeer.y
28129                         };
28130                     case 'h':
28131                         // repair horizontal alignment
28132                         return {
28133                             x: newPeer.x,
28134                             y: candidate.y
28135                         };
28136                 }
28137
28138                 return {
28139                     x: candidate.x,
28140                     y: candidate.y
28141                 };
28142             }
28143
28144             function removeOverlapping(points, a, b) {
28145                 var i;
28146
28147                 for (i = points.length - 2; i !== 0; i--) {
28148
28149                     // intersects (?) break, remove all bendpoints up to this one and
28150                     // relayout
28151                     if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||
28152                         Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {
28153
28154                         // return sliced old connection
28155                         return points.slice(i);
28156                     }
28157                 }
28158
28159                 return points;
28160             }
28161
28162
28163             // (0) only repair what has layoutable bendpoints
28164
28165             // (1) if only one bendpoint and on shape moved onto other shapes axis
28166             // (horizontally / vertically), relayout
28167
28168             if (needsRelayout(moved, other, points)) {
28169                 return null;
28170             }
28171
28172             var oldDocking = points[0],
28173                 newPoints = points.slice(),
28174                 slicedPoints;
28175
28176             // (2) repair only last line segment and only if it was layouted before
28177
28178             newPoints[0] = newDocking;
28179             newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);
28180
28181
28182             // (3) if shape intersects with any bendpoint after repair,
28183             // remove all segments up to this bendpoint and repair from there
28184
28185             slicedPoints = removeOverlapping(newPoints, moved, other);
28186             if (slicedPoints !== newPoints) {
28187                 return this._repairConnectionSide(moved, other, newDocking, slicedPoints);
28188             }
28189
28190             return newPoints;
28191         };
28192
28193         /**
28194          * Returns the default manhattan directions connecting two rectangles.
28195          * 
28196          * @param {Bounds}
28197          *            source
28198          * @param {Bounds}
28199          *            target
28200          * @param {Boolean}
28201          *            preferVertical
28202          * 
28203          * @return {String}
28204          */
28205         module.exports.getDirections = function(source, target, preferVertical) {
28206             var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
28207
28208             switch (orientation) {
28209                 case 'intersect':
28210                     return null;
28211
28212                 case 'top':
28213                 case 'bottom':
28214                     return 'v:v';
28215
28216                 case 'left':
28217                 case 'right':
28218                     return 'h:h';
28219
28220                 default:
28221                     return preferVertical ? 'v:v' : 'h:h';
28222             }
28223         };
28224     }, {
28225         "../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
28226         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
28227         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
28228         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
28229     }],
28230     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js": [function(require, module, exports) {
28231         'use strict';
28232
28233         var assign = require('lodash/object/assign'),
28234             inherits = require('inherits');
28235
28236         var Refs = require('object-refs');
28237
28238         var parentRefs = new Refs({
28239                 name: 'children',
28240                 enumerable: true,
28241                 collection: true
28242             }, {
28243                 name: 'parent'
28244             }),
28245             labelRefs = new Refs({
28246                 name: 'label',
28247                 enumerable: true
28248             }, {
28249                 name: 'labelTarget'
28250             }),
28251             outgoingRefs = new Refs({
28252                 name: 'outgoing',
28253                 collection: true
28254             }, {
28255                 name: 'source'
28256             }),
28257             incomingRefs = new Refs({
28258                 name: 'incoming',
28259                 collection: true
28260             }, {
28261                 name: 'target'
28262             });
28263
28264         /**
28265          * @namespace djs.model
28266          */
28267
28268         /**
28269          * @memberOf djs.model
28270          */
28271
28272         /**
28273          * The basic graphical representation
28274          * 
28275          * @class
28276          * 
28277          * @abstract
28278          */
28279         function Base() {
28280
28281             /**
28282              * The object that backs up the shape
28283              * 
28284              * @name Base#businessObject
28285              * @type Object
28286              */
28287             Object.defineProperty(this, 'businessObject', {
28288                 writable: true
28289             });
28290
28291             /**
28292              * The parent shape
28293              * 
28294              * @name Base#parent
28295              * @type Shape
28296              */
28297             parentRefs.bind(this, 'parent');
28298
28299             /**
28300              * @name Base#label
28301              * @type Label
28302              */
28303             labelRefs.bind(this, 'label');
28304
28305             /**
28306              * The list of outgoing connections
28307              * 
28308              * @name Base#outgoing
28309              * @type Array<Connection>
28310              */
28311             outgoingRefs.bind(this, 'outgoing');
28312
28313             /**
28314              * The list of outgoing connections
28315              * 
28316              * @name Base#incoming
28317              * @type Array<Connection>
28318              */
28319             incomingRefs.bind(this, 'incoming');
28320         }
28321
28322
28323         /**
28324          * A graphical object
28325          * 
28326          * @class
28327          * @constructor
28328          * 
28329          * @extends Base
28330          */
28331         function Shape() {
28332             Base.call(this);
28333
28334             /**
28335              * The list of children
28336              * 
28337              * @name Shape#children
28338              * @type Array<Base>
28339              */
28340             parentRefs.bind(this, 'children');
28341         }
28342
28343         inherits(Shape, Base);
28344
28345
28346         /**
28347          * A root graphical object
28348          * 
28349          * @class
28350          * @constructor
28351          * 
28352          * @extends Shape
28353          */
28354         function Root() {
28355             Shape.call(this);
28356         }
28357
28358         inherits(Root, Shape);
28359
28360
28361         /**
28362          * A label for an element
28363          * 
28364          * @class
28365          * @constructor
28366          * 
28367          * @extends Shape
28368          */
28369         function Label() {
28370             Shape.call(this);
28371
28372             /**
28373              * The labeled element
28374              * 
28375              * @name Label#labelTarget
28376              * @type Base
28377              */
28378             labelRefs.bind(this, 'labelTarget');
28379         }
28380
28381         inherits(Label, Shape);
28382
28383
28384         /**
28385          * A connection between two elements
28386          * 
28387          * @class
28388          * @constructor
28389          * 
28390          * @extends Base
28391          */
28392         function Connection() {
28393             Base.call(this);
28394
28395             /**
28396              * The element this connection originates from
28397              * 
28398              * @name Connection#source
28399              * @type Base
28400              */
28401             outgoingRefs.bind(this, 'source');
28402
28403             /**
28404              * The element this connection points to
28405              * 
28406              * @name Connection#target
28407              * @type Base
28408              */
28409             incomingRefs.bind(this, 'target');
28410         }
28411
28412         inherits(Connection, Base);
28413
28414
28415         var types = {
28416             connection: Connection,
28417             shape: Shape,
28418             label: Label,
28419             root: Root
28420         };
28421
28422         /**
28423          * Creates a new model element of the specified type
28424          * 
28425          * @method create
28426          * 
28427          * @example
28428          * 
28429          * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100
28430          * }); var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height:
28431          * 100 });
28432          * 
28433          * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 },
28434          * {x: 210, y: 55 } ] });
28435          * 
28436          * @param {String}
28437          *            type lower-cased model name
28438          * @param {Object}
28439          *            attrs attributes to initialize the new model instance with
28440          * 
28441          * @return {Base} the new model instance
28442          */
28443         module.exports.create = function(type, attrs) {
28444             var Type = types[type];
28445             if (!Type) {
28446                 throw new Error('unknown type: <' + type + '>');
28447             }
28448             return assign(new Type(), attrs);
28449         };
28450
28451
28452         module.exports.Base = Base;
28453         module.exports.Root = Root;
28454         module.exports.Shape = Shape;
28455         module.exports.Connection = Connection;
28456         module.exports.Label = Label;
28457     }, {
28458         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
28459         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
28460         "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js"
28461     }],
28462     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js": [function(require, module, exports) {
28463         'use strict';
28464
28465         var Cursor = require('../../util/Cursor'),
28466             ClickTrap = require('../../util/ClickTrap'),
28467             domEvent = require('min-dom/lib/event'),
28468             Event = require('../../util/Event');
28469
28470         function substract(p1, p2) {
28471             return {
28472                 x: p1.x - p2.x,
28473                 y: p1.y - p2.y
28474             };
28475         }
28476
28477         function length(point) {
28478             return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
28479         }
28480
28481
28482         var THRESHOLD = 15;
28483
28484
28485         function MoveCanvas(eventBus, canvas) {
28486
28487             var container = canvas._container,
28488                 context;
28489
28490
28491             function handleMove(event) {
28492
28493                 var start = context.start,
28494                     position = Event.toPoint(event),
28495                     delta = substract(position, start);
28496
28497                 if (!context.dragging && length(delta) > THRESHOLD) {
28498                     context.dragging = true;
28499
28500                     // prevent mouse click in this
28501                     // interaction sequence
28502                     ClickTrap.install();
28503
28504                     Cursor.set('move');
28505                 }
28506
28507                 if (context.dragging) {
28508
28509                     var lastPosition = context.last || context.start;
28510
28511                     delta = substract(position, lastPosition);
28512
28513                     canvas.scroll({
28514                         dx: delta.x,
28515                         dy: delta.y
28516                     });
28517
28518                     context.last = position;
28519                 }
28520
28521                 // prevent select
28522                 event.preventDefault();
28523             }
28524
28525
28526             function handleEnd(event) {
28527                 domEvent.unbind(document, 'mousemove', handleMove);
28528                 domEvent.unbind(document, 'mouseup', handleEnd);
28529
28530                 context = null;
28531
28532                 Cursor.unset();
28533
28534                 // prevent select
28535                 Event.stopEvent(event);
28536             }
28537
28538             function handleStart(event) {
28539
28540                 // reject non-left left mouse button or modifier key
28541                 if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
28542                     return;
28543                 }
28544
28545                 context = {
28546                     start: Event.toPoint(event)
28547                 };
28548
28549                 domEvent.bind(document, 'mousemove', handleMove);
28550                 domEvent.bind(document, 'mouseup', handleEnd);
28551
28552                 // prevent select
28553                 Event.stopEvent(event);
28554             }
28555
28556             domEvent.bind(container, 'mousedown', handleStart);
28557         }
28558
28559
28560         MoveCanvas.$inject = ['eventBus', 'canvas'];
28561
28562         module.exports = MoveCanvas;
28563
28564     }, {
28565         "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
28566         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
28567         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28568         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28569     }],
28570     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js": [function(require, module, exports) {
28571         module.exports = {
28572             __init__: ['moveCanvas'],
28573             moveCanvas: ['type', require('./MoveCanvas')]
28574         };
28575     }, {
28576         "./MoveCanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js"
28577     }],
28578     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js": [function(require, module, exports) {
28579         module.exports = {
28580             __depends__: [require('../../features/touch')]
28581         };
28582     }, {
28583         "../../features/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js"
28584     }],
28585     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js": [function(require, module, exports) {
28586         'use strict';
28587
28588         var domEvent = require('min-dom/lib/event');
28589
28590         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier,
28591             hasSecondaryModifier = require('../../util/Mouse').hasSecondaryModifier;
28592
28593         var isMac = require('../../util/Platform').isMac;
28594
28595
28596         function ZoomScroll(events, canvas) {
28597                 var $canvas = $( canvas.getContainer() ), //canvas.getContainer() 
28598             $controls = $( '<div></div>' ),
28599             $zoomOut = $( '<div><span class="glyphicon glyphicon-zoom-out"></span></div>' ),
28600             $zoomIn = $( '<div><span class="glyphicon glyphicon-zoom-in"></span></div>' ),
28601             $zoomFit= $( '<div><span class="glyphicon glyphicon-fullscreen"></span></div>' ),
28602             zlevel = 1,
28603             zstep = 0.2;
28604
28605         $canvas.append( $controls );
28606         $controls.append( $zoomIn );
28607         $controls.append( $zoomOut );
28608         $controls.append( $zoomFit );
28609
28610         $controls.addClass( 'zoom-controls' );
28611         $zoomOut.addClass( 'zoom zoom-out' );
28612         $zoomIn.addClass( 'zoom zoom-in' );
28613         $zoomFit.addClass( 'zoom zoom-fit' );
28614
28615         $zoomOut.attr( 'title', 'Zoom out' );
28616         $zoomIn.attr( 'title', 'Zoom in' );
28617         $zoomFit.attr( 'title', 'Fit to viewport' );
28618
28619         // set initial zoom level
28620         //canvas.zoom( zlevel, 'auto' );
28621
28622         // update our zoom level on viewbox change
28623         events.on( 'canvas.viewbox.changed', function( evt ) {
28624             zlevel = evt.viewbox.scale;
28625         });
28626
28627         // define click handlers for controls
28628         $zoomFit.on( 'click', function() {
28629             canvas.zoom( 'fit-viewport', 'auto' );
28630         });
28631
28632         $zoomOut.on( 'click', function() {
28633             zlevel = Math.max( zlevel - zstep, zstep );
28634             canvas.zoom( zlevel, 'auto' );
28635         });
28636         
28637         $zoomIn.on( 'click', function() {
28638             zlevel = Math.min( zlevel + zstep, 7 );
28639             canvas.zoom( zlevel, 'auto' );
28640         });
28641         
28642         $(".TCS").click(function() {
28643                 console.log($(this).data("stuff"));
28644                 var modelElements = $(this).data("stuff").modelElements;
28645                 var modelName = $(this).data("model").name;
28646                 var hElements = [];
28647                 modelElements.forEach(function(mElement){
28648                         if(hElements.indexOf(mElement.elementID)==-1){
28649                                 hElements.push(mElement.elementID);
28650                         }
28651                 });
28652                 highlightPath(hElements);
28653         });
28654         
28655         function highlightPath(hElements){
28656                 clear();
28657             var elementRegistry = canvas._elementRegistry;
28658             //console.log(elementRegistry);
28659             hElements.forEach(function(hElement){
28660                 try{
28661                 //console.log(hElement);
28662                 var activityShape = elementRegistry.get(hElement);
28663                 var outgoing = activityShape.incoming;
28664                 
28665                 if (canvas.hasMarker(hElement, 'highlight')) {
28666                         canvas.removeMarker(hElement, 'highlight');
28667                         outgoing.forEach(function(flow){
28668                         var outgoingGfx = elementRegistry.getGraphics(flow.id);
28669                         if(hElements.indexOf(flow.id)!=-1){
28670                                 outgoingGfx.select('path').attr({stroke: 'black'});
28671                         }
28672                     });
28673                 } else {
28674                         canvas.addMarker(hElement, 'highlight');
28675                         outgoing.forEach(function(flow){
28676                         var outgoingGfx = elementRegistry.getGraphics(flow.id);
28677                         if(hElements.indexOf(flow.id)!=-1){
28678                                 outgoingGfx.select('path').attr({stroke: 'blue'});
28679                         }
28680                     });
28681                 }
28682                 }catch(err){
28683                         //console.log(err);
28684                 }
28685                 
28686             });
28687         }
28688         
28689         function clear() {
28690                 var elementRegistry = canvas._elementRegistry;
28691                 elementRegistry.forEach(function(hElement){
28692                         try {
28693                                 canvas.removeMarker(hElement, 'highlight');
28694                                 var outgoing = hElement.incoming;
28695                                 outgoing.forEach(function(flow){
28696                             var outgoingGfx = elementRegistry.getGraphics(flow.id);
28697                             outgoingGfx.select('path').attr({stroke: 'black'});
28698                         });
28699                         }catch(err){
28700                                 
28701                         }
28702                 });
28703         }
28704         
28705         //console.log('endzoom');
28706                 
28707                 
28708             var RANGE = {
28709                 min: 0.2,
28710                 max: 4
28711             };
28712
28713             function cap(scale) {
28714                 return Math.max(RANGE.min, Math.min(RANGE.max, scale));
28715             }
28716
28717             function reset() {
28718                 canvas.zoom('fit-viewport');
28719             }
28720
28721             function zoom(direction, position) {
28722
28723                 var currentZoom = canvas.zoom();
28724                 var factor = Math.pow(1 + Math.abs(direction), direction > 0 ? 1 : -1);
28725
28726                 canvas.zoom(cap(currentZoom * factor), position);
28727             }
28728
28729             function scroll(delta) {
28730                 canvas.scroll(delta);
28731             }
28732
28733             function init(element) {
28734
28735                 domEvent.bind(element, 'wheel', function(event) {/*
28736
28737                     event.preventDefault();
28738
28739                     // mouse-event: SELECTION_KEY
28740                     // mouse-event: AND_KEY
28741                     var isVerticalScroll = hasPrimaryModifier(event),
28742                         isHorizontalScroll = hasSecondaryModifier(event);
28743
28744                     var factor;
28745
28746                     if (isVerticalScroll || isHorizontalScroll) {
28747
28748                         if (isMac) {
28749                             factor = event.deltaMode === 0 ? 1.25 : 50;
28750                         } else {
28751                             factor = event.deltaMode === 0 ? 1 / 40 : 1 / 2;
28752                         }
28753
28754                         var delta = {};
28755
28756                         if (isHorizontalScroll) {
28757                             delta.dx = (factor * (event.deltaX || event.deltaY));
28758                         } else {
28759                             delta.dy = (factor * event.deltaY);
28760                         }
28761
28762                         scroll(delta);
28763                     } else {
28764                         factor = (event.deltaMode === 0 ? 1 / 40 : 1 / 2);
28765
28766                         var elementRect = element.getBoundingClientRect();
28767
28768                         var offset = {
28769                             x: event.clientX - elementRect.left,
28770                             y: event.clientY - elementRect.top
28771                         };
28772
28773                         // zoom in relative to diagram {x,y} coordinates
28774                         zoom(event.deltaY * factor / (-5), offset);
28775                     }
28776                 */});
28777             }
28778
28779             events.on('canvas.init', function(e) {
28780                 init(canvas._container);
28781             });
28782
28783             // API
28784             this.zoom = zoom;
28785             this.reset = reset;
28786         }
28787
28788
28789         ZoomScroll.$inject = ['eventBus', 'canvas'];
28790
28791         module.exports = ZoomScroll;
28792
28793
28794     }, {
28795         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
28796         "../../util/Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js",
28797         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28798     }],
28799     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js": [function(require, module, exports) {
28800         module.exports = {
28801             __init__: ['zoomScroll'],
28802             zoomScroll: ['type', require('./ZoomScroll')]
28803         };
28804     }, {
28805         "./ZoomScroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js"
28806     }],
28807     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js": [function(require, module, exports) {
28808         'use strict';
28809
28810         var domEvent = require('min-dom/lib/event'),
28811             stopEvent = require('./Event').stopEvent;
28812
28813         function trap(event) {
28814             stopEvent(event);
28815
28816             toggle(false);
28817         }
28818
28819         function toggle(active) {
28820             domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
28821         }
28822
28823         /**
28824          * Installs a click trap that prevents a ghost click following a dragging
28825          * operation.
28826          * 
28827          * @return {Function} a function to immediately remove the installed trap.
28828          */
28829         function install() {
28830
28831             toggle(true);
28832
28833             return function() {
28834                 toggle(false);
28835             };
28836         }
28837
28838         module.exports.install = install;
28839     }, {
28840         "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28841         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28842     }],
28843     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js": [function(require, module, exports) {
28844         'use strict';
28845
28846         /**
28847          * Failsafe remove an element from a collection
28848          * 
28849          * @param {Array
28850          *            <Object>} [collection]
28851          * @param {Object}
28852          *            [element]
28853          * 
28854          * @return {Object} the element that got removed or undefined
28855          */
28856         module.exports.remove = function(collection, element) {
28857
28858             if (!collection || !element) {
28859                 return;
28860             }
28861
28862             var idx = collection.indexOf(element);
28863             if (idx === -1) {
28864                 return;
28865             }
28866
28867             collection.splice(idx, 1);
28868
28869             return element;
28870         };
28871
28872         /**
28873          * Fail save add an element to the given connection, ensuring it does not yet
28874          * exist.
28875          * 
28876          * @param {Array
28877          *            <Object>} collection
28878          * @param {Object}
28879          *            element
28880          * @param {Number}
28881          *            idx
28882          */
28883         module.exports.add = function(collection, element, idx) {
28884
28885             if (!collection || !element) {
28886                 return;
28887             }
28888
28889             if (isNaN(idx)) {
28890                 idx = -1;
28891             }
28892
28893             var currentIdx = collection.indexOf(element);
28894
28895             if (currentIdx !== -1) {
28896
28897                 if (currentIdx === idx) {
28898                     // nothing to do, position has not changed
28899                     return;
28900                 } else {
28901
28902                     if (idx !== -1) {
28903                         // remove from current position
28904                         collection.splice(currentIdx, 1);
28905                     } else {
28906                         // already exists in collection
28907                         return;
28908                     }
28909                 }
28910             }
28911
28912             if (idx !== -1) {
28913                 // insert at specified position
28914                 collection.splice(idx, 0, element);
28915             } else {
28916                 // push to end
28917                 collection.push(element);
28918             }
28919         };
28920
28921
28922         /**
28923          * Fail get the index of an element in a collection.
28924          * 
28925          * @param {Array
28926          *            <Object>} collection
28927          * @param {Object}
28928          *            element
28929          * 
28930          * @return {Number} the index or -1 if collection or element do not exist or the
28931          *         element is not contained.
28932          */
28933         module.exports.indexOf = function(collection, element) {
28934
28935             if (!collection || !element) {
28936                 return -1;
28937             }
28938
28939             return collection.indexOf(element);
28940         };
28941
28942     }, {}],
28943     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js": [function(require, module, exports) {
28944         'use strict';
28945
28946         var domClasses = require('min-dom/lib/classes');
28947
28948         var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
28949
28950
28951         module.exports.set = function(mode) {
28952             var classes = domClasses(document.body);
28953
28954             classes.removeMatching(CURSOR_CLS_PATTERN);
28955
28956             if (mode) {
28957                 classes.add('djs-cursor-' + mode);
28958             }
28959         };
28960
28961         module.exports.unset = function() {
28962             this.set(null);
28963         };
28964     }, {
28965         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js"
28966     }],
28967     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js": [function(require, module, exports) {
28968         'use strict';
28969
28970         var isArray = require('lodash/lang/isArray'),
28971             isNumber = require('lodash/lang/isNumber'),
28972             groupBy = require('lodash/collection/groupBy'),
28973             forEach = require('lodash/collection/forEach');
28974
28975         /**
28976          * Adds an element to a collection and returns true if the element was added.
28977          * 
28978          * @param {Array
28979          *            <Object>} elements
28980          * @param {Object}
28981          *            e
28982          * @param {Boolean}
28983          *            unique
28984          */
28985         function add(elements, e, unique) {
28986             var canAdd = !unique || elements.indexOf(e) === -1;
28987
28988             if (canAdd) {
28989                 elements.push(e);
28990             }
28991
28992             return canAdd;
28993         }
28994
28995         function eachElement(elements, fn, depth) {
28996
28997             depth = depth || 0;
28998
28999             forEach(elements, function(s, i) {
29000                 var filter = fn(s, i, depth);
29001
29002                 if (isArray(filter) && filter.length) {
29003                     eachElement(filter, fn, depth + 1);
29004                 }
29005             });
29006         }
29007
29008         /**
29009          * Collects self + child elements up to a given depth from a list of elements.
29010          * 
29011          * @param {Array
29012          *            <djs.model.Base>} elements the elements to select the children
29013          *            from
29014          * @param {Boolean}
29015          *            unique whether to return a unique result set (no duplicates)
29016          * @param {Number}
29017          *            maxDepth the depth to search through or -1 for infinite
29018          * 
29019          * @return {Array<djs.model.Base>} found elements
29020          */
29021         function selfAndChildren(elements, unique, maxDepth) {
29022             var result = [],
29023                 processedChildren = [];
29024
29025             eachElement(elements, function(element, i, depth) {
29026                 add(result, element, unique);
29027
29028                 var children = element.children;
29029
29030                 // max traversal depth not reached yet
29031                 if (maxDepth === -1 || depth < maxDepth) {
29032
29033                     // children exist && children not yet processed
29034                     if (children && add(processedChildren, children, unique)) {
29035                         return children;
29036                     }
29037                 }
29038             });
29039
29040             return result;
29041         }
29042
29043         /**
29044          * Return self + direct children for a number of elements
29045          * 
29046          * @param {Array
29047          *            <djs.model.Base>} elements to query
29048          * @param {Boolean}
29049          *            allowDuplicates to allow duplicates in the result set
29050          * 
29051          * @return {Array<djs.model.Base>} the collected elements
29052          */
29053         function selfAndDirectChildren(elements, allowDuplicates) {
29054             return selfAndChildren(elements, !allowDuplicates, 1);
29055         }
29056
29057         /**
29058          * Return self + ALL children for a number of elements
29059          * 
29060          * @param {Array
29061          *            <djs.model.Base>} elements to query
29062          * @param {Boolean}
29063          *            allowDuplicates to allow duplicates in the result set
29064          * 
29065          * @return {Array<djs.model.Base>} the collected elements
29066          */
29067         function selfAndAllChildren(elements, allowDuplicates) {
29068             return selfAndChildren(elements, !allowDuplicates, -1);
29069         }
29070
29071         /**
29072          * Gets the the closure fo all selected elements, their connections and
29073          * 
29074          * @param {Array
29075          *            <djs.model.Base>} elements
29076          * @return {Object} enclosure
29077          */
29078         function getClosure(elements) {
29079
29080             // original elements passed to this function
29081             var topLevel = groupBy(elements, function(e) {
29082                 return e.id;
29083             });
29084
29085             var allShapes = {},
29086                 allConnections = {},
29087                 enclosedElements = {},
29088                 enclosedConnections = {};
29089
29090             function handleConnection(c) {
29091                 if (topLevel[c.source.id] && topLevel[c.target.id]) {
29092                     topLevel[c.id] = c;
29093                 }
29094
29095                 // not enclosed as a child, but maybe logically
29096                 // (connecting two moved elements?)
29097                 if (allShapes[c.source.id] && allShapes[c.target.id]) {
29098                     enclosedConnections[c.id] = enclosedElements[c.id] = c;
29099                 }
29100
29101                 allConnections[c.id] = c;
29102             }
29103
29104             function handleElement(element) {
29105
29106                 enclosedElements[element.id] = element;
29107
29108                 if (element.waypoints) {
29109                     // remember connection
29110                     enclosedConnections[element.id] = allConnections[element.id] = element;
29111                 } else {
29112                     // remember shape
29113                     allShapes[element.id] = element;
29114
29115                     // remember all connections
29116                     forEach(element.incoming, handleConnection);
29117
29118                     forEach(element.outgoing, handleConnection);
29119
29120                     // recurse into children
29121                     return element.children;
29122                 }
29123             }
29124
29125             eachElement(elements, handleElement);
29126
29127             return {
29128                 allShapes: allShapes,
29129                 allConnections: allConnections,
29130                 topLevel: topLevel,
29131                 enclosedConnections: enclosedConnections,
29132                 enclosedElements: enclosedElements
29133             };
29134         }
29135
29136         /**
29137          * Returns the surrounding bbox for all elements in the array or the element
29138          * primitive.
29139          */
29140         function getBBox(elements, stopRecursion) {
29141
29142             stopRecursion = !!stopRecursion;
29143             if (!isArray(elements)) {
29144                 elements = [elements];
29145             }
29146
29147             var minX,
29148                 minY,
29149                 maxX,
29150                 maxY;
29151
29152             forEach(elements, function(element) {
29153
29154                 // If element is a connection the bbox must be computed first
29155                 var bbox = element;
29156                 if (element.waypoints && !stopRecursion) {
29157                     bbox = getBBox(element.waypoints, true);
29158                 }
29159
29160                 var x = bbox.x,
29161                     y = bbox.y,
29162                     height = bbox.height || 0,
29163                     width = bbox.width || 0;
29164
29165                 if (x < minX || minX === undefined) {
29166                     minX = x;
29167                 }
29168                 if (y < minY || minY === undefined) {
29169                     minY = y;
29170                 }
29171
29172                 if ((x + width) > maxX || maxX === undefined) {
29173                     maxX = x + width;
29174                 }
29175                 if ((y + height) > maxY || maxY === undefined) {
29176                     maxY = y + height;
29177                 }
29178             });
29179
29180             return {
29181                 x: minX,
29182                 y: minY,
29183                 height: maxY - minY,
29184                 width: maxX - minX
29185             };
29186         }
29187
29188
29189         /**
29190          * Returns all elements that are enclosed from the bounding box.
29191          * 
29192          * @param {Array
29193          *            <Object>} elements List of Elements to search through
29194          * @param {Object}
29195          *            bbox the enclosing bbox.
29196          *            <ul>
29197          *            <li>If bbox.(width|height) is not specified the method returns
29198          *            all elements with element.x/y &gt; bbox.x/y </li>
29199          *            <li>If only bbox.x or bbox.y is specified, method return all
29200          *            elements with e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
29201          *            </ul>
29202          * 
29203          */
29204         function getEnclosedElements(elements, bbox) {
29205
29206             var filteredElements = {};
29207
29208             forEach(elements, function(element) {
29209
29210                 var e = element;
29211
29212                 if (e.waypoints) {
29213                     e = getBBox(e);
29214                 }
29215
29216                 if (!isNumber(bbox.y) && (e.x > bbox.x)) {
29217                     filteredElements[element.id] = element;
29218                 }
29219                 if (!isNumber(bbox.x) && (e.y > bbox.y)) {
29220                     filteredElements[element.id] = element;
29221                 }
29222                 if (e.x > bbox.x && e.y > bbox.y) {
29223                     if (isNumber(bbox.width) && isNumber(bbox.height) &&
29224                         e.width + e.x < bbox.width + bbox.x &&
29225                         e.height + e.y < bbox.height + bbox.y) {
29226
29227                         filteredElements[element.id] = element;
29228                     } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
29229                         filteredElements[element.id] = element;
29230                     }
29231                 }
29232             });
29233
29234             return filteredElements;
29235         }
29236
29237
29238
29239         module.exports.eachElement = eachElement;
29240         module.exports.selfAndDirectChildren = selfAndDirectChildren;
29241         module.exports.selfAndAllChildren = selfAndAllChildren;
29242         module.exports.getBBox = getBBox;
29243         module.exports.getEnclosedElements = getEnclosedElements;
29244
29245         module.exports.getClosure = getClosure;
29246
29247     }, {
29248         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29249         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
29250         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
29251         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js"
29252     }],
29253     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js": [function(require, module, exports) {
29254         'use strict';
29255
29256         function __preventDefault(event) {
29257             return event && event.preventDefault();
29258         }
29259
29260         function __stopPropagation(event, immediate) {
29261             if (!event) {
29262                 return;
29263             }
29264
29265             if (event.stopPropagation) {
29266                 event.stopPropagation();
29267             }
29268
29269             if (immediate && event.stopImmediatePropagation) {
29270                 event.stopImmediatePropagation();
29271             }
29272         }
29273
29274
29275         function getOriginal(event) {
29276             return event.originalEvent || event.srcEvent;
29277         }
29278
29279         module.exports.getOriginal = getOriginal;
29280
29281
29282         function stopEvent(event, immediate) {
29283             stopPropagation(event, immediate);
29284             preventDefault(event);
29285         }
29286
29287         module.exports.stopEvent = stopEvent;
29288
29289
29290         function preventDefault(event) {
29291             __preventDefault(event);
29292             __preventDefault(getOriginal(event));
29293         }
29294
29295         module.exports.preventDefault = preventDefault;
29296
29297
29298         function stopPropagation(event, immediate) {
29299             __stopPropagation(event, immediate);
29300             __stopPropagation(getOriginal(event), immediate);
29301         }
29302
29303         module.exports.stopPropagation = stopPropagation;
29304
29305
29306         function toPoint(event) {
29307
29308             if (event.pointers && event.pointers.length) {
29309                 event = event.pointers[0];
29310             }
29311
29312             if (event.touches && event.touches.length) {
29313                 event = event.touches[0];
29314             }
29315
29316             return event ? {
29317                 x: event.clientX,
29318                 y: event.clientY
29319             } : null;
29320         }
29321
29322         module.exports.toPoint = toPoint;
29323
29324     }, {}],
29325     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js": [function(require, module, exports) {
29326         'use strict';
29327
29328         /**
29329          * Computes the distance between two points
29330          * 
29331          * @param {Point}
29332          *            p
29333          * @param {Point}
29334          *            q
29335          * 
29336          * @return {Number} distance
29337          */
29338         var distance = module.exports.distance = function(p, q) {
29339             return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));
29340         };
29341
29342         /**
29343          * Returns true if the point r is on the line between p and y
29344          * 
29345          * @param {Point}
29346          *            p
29347          * @param {Point}
29348          *            q
29349          * @param {Point}
29350          *            r
29351          * 
29352          * @return {Boolean}
29353          */
29354         module.exports.pointsOnLine = function(p, q, r) {
29355
29356             if (!p || !q || !r) {
29357                 return false;
29358             }
29359
29360             var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
29361                 dist = distance(p, q);
29362
29363             // @see http://stackoverflow.com/a/907491/412190
29364             return Math.abs(val / dist) < 5;
29365         };
29366
29367         module.exports.pointInRect = function(p, rect, tolerance) {
29368             tolerance = tolerance || 0;
29369
29370             return p.x > rect.x - tolerance &&
29371                 p.y > rect.y - tolerance &&
29372                 p.x < rect.x + rect.width + tolerance &&
29373                 p.y < rect.y + rect.height + tolerance;
29374         };
29375     }, {}],
29376     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js": [function(require, module, exports) {
29377         'use strict';
29378
29379         /**
29380          * SVGs for elements are generated by the {@link GraphicsFactory}.
29381          * 
29382          * This utility gives quick access to the important semantic parts of an
29383          * element.
29384          */
29385
29386         /**
29387          * Returns the visual part of a diagram element
29388          * 
29389          * @param {Snap
29390          *            <SVGElement>} gfx
29391          * 
29392          * @return {Snap<SVGElement>}
29393          */
29394         function getVisual(gfx) {
29395             return gfx.select('.djs-visual');
29396         }
29397
29398         /**
29399          * Returns the children for a given diagram element.
29400          * 
29401          * @param {Snap
29402          *            <SVGElement>} gfx
29403          * @return {Snap<SVGElement>}
29404          */
29405         function getChildren(gfx) {
29406             return gfx.parent().children()[1];
29407         }
29408
29409         /**
29410          * Returns the visual bbox of an element
29411          * 
29412          * @param {Snap
29413          *            <SVGElement>} gfx
29414          * 
29415          * @return {Bounds}
29416          */
29417         function getBBox(gfx) {
29418             return getVisual(gfx).select('*').getBBox();
29419         }
29420
29421
29422         module.exports.getVisual = getVisual;
29423         module.exports.getChildren = getChildren;
29424         module.exports.getBBox = getBBox;
29425     }, {}],
29426     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js": [function(require, module, exports) {
29427         'use strict';
29428
29429         /**
29430          * Util that provides unique IDs.
29431          * 
29432          * @class djs.util.IdGenerator
29433          * @constructor
29434          * @memberOf djs.util
29435          * 
29436          * The ids can be customized via a given prefix and contain a random value to
29437          * avoid collisions.
29438          * 
29439          * @param {String}
29440          *            prefix a prefix to prepend to generated ids (for better
29441          *            readability)
29442          */
29443         function IdGenerator(prefix) {
29444
29445             this._counter = 0;
29446             this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
29447         }
29448
29449         module.exports = IdGenerator;
29450
29451         /**
29452          * Returns a next unique ID.
29453          * 
29454          * @method djs.util.IdGenerator#next
29455          * 
29456          * @returns {String} the id
29457          */
29458         IdGenerator.prototype.next = function() {
29459             return this._prefix + (++this._counter);
29460         };
29461
29462     }, {}],
29463     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js": [function(require, module, exports) {
29464         'use strict';
29465
29466         var getOriginalEvent = require('./Event').getOriginal;
29467
29468         var isMac = require('./Platform').isMac;
29469
29470
29471         function isPrimaryButton(event) {
29472             // button === 0 -> left ÃƒÆ’ƒÂ¡ka primary mouse button
29473             return !(getOriginalEvent(event) || event).button;
29474         }
29475
29476         module.exports.isPrimaryButton = isPrimaryButton;
29477
29478         module.exports.isMac = isMac;
29479
29480         module.exports.hasPrimaryModifier = function(event) {
29481             var originalEvent = getOriginalEvent(event) || event;
29482
29483             if (!isPrimaryButton(event)) {
29484                 return false;
29485             }
29486
29487             // Use alt as primary modifier key for mac OS
29488             if (isMac()) {
29489                 return originalEvent.altKey;
29490             } else {
29491                 return originalEvent.ctrlKey;
29492             }
29493         };
29494
29495
29496         module.exports.hasSecondaryModifier = function(event) {
29497             var originalEvent = getOriginalEvent(event) || event;
29498
29499             return isPrimaryButton(event) && originalEvent.shiftKey;
29500         };
29501
29502     }, {
29503         "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
29504         "./Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js"
29505     }],
29506     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js": [function(require, module, exports) {
29507         'use strict';
29508
29509         module.exports.isMac = function isMac() {
29510             return (/mac/i).test(navigator.platform);
29511         };
29512     }, {}],
29513     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js": [function(require, module, exports) {
29514         'use strict';
29515
29516         var isObject = require('lodash/lang/isObject'),
29517             assign = require('lodash/object/assign'),
29518             forEach = require('lodash/collection/forEach'),
29519             reduce = require('lodash/collection/reduce'),
29520             merge = require('lodash/object/merge');
29521
29522         var Snap = require('../../vendor/snapsvg');
29523
29524         var DEFAULT_BOX_PADDING = 0;
29525
29526         var DEFAULT_LABEL_SIZE = {
29527             width: 150,
29528             height: 50
29529         };
29530
29531
29532         function parseAlign(align) {
29533
29534             var parts = align.split('-');
29535
29536             return {
29537                 horizontal: parts[0] || 'center',
29538                 vertical: parts[1] || 'top'
29539             };
29540         }
29541
29542         function parsePadding(padding) {
29543
29544             if (isObject(padding)) {
29545                 return assign({
29546                     top: 0,
29547                     left: 0,
29548                     right: 0,
29549                     bottom: 0
29550                 }, padding);
29551             } else {
29552                 return {
29553                     top: padding,
29554                     left: padding,
29555                     right: padding,
29556                     bottom: padding
29557                 };
29558             }
29559         }
29560
29561         function getTextBBox(text, fakeText) {
29562             fakeText.textContent = text;
29563             return fakeText.getBBox();
29564         }
29565
29566
29567         /**
29568          * Layout the next line and return the layouted element.
29569          * 
29570          * Alters the lines passed.
29571          * 
29572          * @param {Array
29573          *            <String>} lines
29574          * @return {Object} the line descriptor, an object { width, height, text }
29575          */
29576         function layoutNext(lines, maxWidth, fakeText) {
29577
29578             var originalLine = lines.shift(),
29579                 fitLine = originalLine;
29580
29581             var textBBox;
29582
29583             while (true) {
29584                 textBBox = getTextBBox(fitLine, fakeText);
29585
29586                 textBBox.width = fitLine ? textBBox.width : 0;
29587
29588                 // try to fit
29589                 if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
29590                     return fit(lines, fitLine, originalLine, textBBox);
29591                 }
29592
29593
29594                 fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
29595             }
29596         }
29597
29598         function fit(lines, fitLine, originalLine, textBBox) {
29599             if (fitLine.length < originalLine.length) {
29600                 var nextLine = lines[0] || '',
29601                     remainder = originalLine.slice(fitLine.length).trim();
29602
29603                 if (/-\s*$/.test(remainder)) {
29604                     nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
29605                 } else {
29606                     nextLine = remainder + ' ' + nextLine;
29607                 }
29608
29609                 lines[0] = nextLine;
29610             }
29611             return {
29612                 width: textBBox.width,
29613                 height: textBBox.height,
29614                 text: fitLine
29615             };
29616         }
29617
29618
29619         /**
29620          * Shortens a line based on spacing and hyphens. Returns the shortened result on
29621          * success.
29622          * 
29623          * @param {String}
29624          *            line
29625          * @param {Number}
29626          *            maxLength the maximum characters of the string
29627          * @return {String} the shortened string
29628          */
29629         function semanticShorten(line, maxLength) {
29630             var parts = line.split(/(\s|-)/g),
29631                 part,
29632                 shortenedParts = [],
29633                 length = 0;
29634
29635             // try to shorten via spaces + hyphens
29636             if (parts.length > 1) {
29637                 while ((part = parts.shift())) {
29638                     if (part.length + length < maxLength) {
29639                         shortenedParts.push(part);
29640                         length += part.length;
29641                     } else {
29642                         // remove previous part, too if hyphen does not fit anymore
29643                         if (part === '-') {
29644                             shortenedParts.pop();
29645                         }
29646
29647                         break;
29648                     }
29649                 }
29650             }
29651
29652             return shortenedParts.join('');
29653         }
29654
29655
29656         function shortenLine(line, width, maxWidth) {
29657             var length = Math.max(line.length * (maxWidth / width), 1);
29658
29659             // try to shorten semantically (i.e. based on spaces and hyphens)
29660             var shortenedLine = semanticShorten(line, length);
29661
29662             if (!shortenedLine) {
29663
29664                 // force shorten by cutting the long word
29665                 shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
29666             }
29667
29668             return shortenedLine;
29669         }
29670
29671
29672         /**
29673          * Creates a new label utility
29674          * 
29675          * @param {Object}
29676          *            config
29677          * @param {Dimensions}
29678          *            config.size
29679          * @param {Number}
29680          *            config.padding
29681          * @param {Object}
29682          *            config.style
29683          * @param {String}
29684          *            config.align
29685          */
29686         function Text(config) {
29687
29688             this._config = assign({}, {
29689                 size: DEFAULT_LABEL_SIZE,
29690                 padding: DEFAULT_BOX_PADDING,
29691                 style: {},
29692                 align: 'center-top'
29693             }, config || {});
29694         }
29695
29696
29697         /**
29698          * Create a label in the parent node.
29699          * 
29700          * @method Text#createText
29701          * 
29702          * @param {SVGElement}
29703          *            parent the parent to draw the label on
29704          * @param {String}
29705          *            text the text to render on the label
29706          * @param {Object}
29707          *            options
29708          * @param {String}
29709          *            options.align how to align in the bounding box. Any of {
29710          *            'center-middle', 'center-top' }, defaults to 'center-top'.
29711          * @param {String}
29712          *            options.style style to be applied to the text
29713          * 
29714          * @return {SVGText} the text element created
29715          */
29716         Text.prototype.createText = function(parent, text, options) {
29717
29718             var box = merge({}, this._config.size, options.box || {}),
29719                 style = merge({}, this._config.style, options.style || {}),
29720                 align = parseAlign(options.align || this._config.align),
29721                 padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
29722
29723             var lines = text.split(/\r?\n/g),
29724                 layouted = [];
29725
29726             var maxWidth = box.width - padding.left - padding.right;
29727
29728             // FF regression: ensure text is shown during rendering
29729             // by attaching it directly to the body
29730             var fakeText = parent.paper.text(0, 0, '').attr(style).node;
29731
29732             while (lines.length) {
29733                 layouted.push(layoutNext(lines, maxWidth, fakeText));
29734             }
29735
29736             var totalHeight = reduce(layouted, function(sum, line, idx) {
29737                 return sum + line.height;
29738             }, 0);
29739
29740             // the y position of the next line
29741             var y, x;
29742
29743             switch (align.vertical) {
29744                 case 'middle':
29745                     y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
29746                     break;
29747
29748                 default:
29749                     y = padding.top;
29750             }
29751
29752             var textElement = parent.text().attr(style);
29753
29754             forEach(layouted, function(line) {
29755                 y += line.height;
29756
29757                 switch (align.horizontal) {
29758                     case 'left':
29759                         x = padding.left;
29760                         break;
29761
29762                     case 'right':
29763                         x = (maxWidth - padding.right - line.width);
29764                         break;
29765
29766                     default:
29767                         // aka center
29768                         x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
29769                 }
29770
29771
29772                 var tspan = Snap.create('tspan', {
29773                     x: x,
29774                     y: y
29775                 }).node;
29776                 tspan.textContent = line.text;
29777
29778                 textElement.append(tspan);
29779             });
29780
29781             // remove fake text
29782             fakeText.parentNode.removeChild(fakeText);
29783
29784             return textElement;
29785         };
29786
29787
29788         module.exports = Text;
29789     }, {
29790         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
29791         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29792         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
29793         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
29794         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
29795         "lodash/object/merge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js"
29796     }],
29797     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js": [function(require, module, exports) {
29798
29799         var isArray = function(obj) {
29800             return Object.prototype.toString.call(obj) === '[object Array]';
29801         };
29802
29803         var annotate = function() {
29804             var args = Array.prototype.slice.call(arguments);
29805
29806             if (args.length === 1 && isArray(args[0])) {
29807                 args = args[0];
29808             }
29809
29810             var fn = args.pop();
29811
29812             fn.$inject = args;
29813
29814             return fn;
29815         };
29816
29817
29818         // Current limitations:
29819         // - can't put into "function arg" comments
29820         // function /* (no parenthesis like this) */ (){}
29821         // function abc( /* xx (no parenthesis like this) */ a, b) {}
29822         //
29823         // Just put the comment before function or inside:
29824         // /* (((this is fine))) */ function(a, b) {}
29825         // function abc(a) { /* (((this is fine))) */}
29826
29827         var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
29828         var FN_ARG = /\/\*([^\*]*)\*\//m;
29829
29830         var parse = function(fn) {
29831             if (typeof fn !== 'function') {
29832                 throw new Error('Cannot annotate "' + fn + '". Expected a function!');
29833             }
29834
29835             var match = fn.toString().match(FN_ARGS);
29836             return match[1] && match[1].split(',').map(function(arg) {
29837                 match = arg.match(FN_ARG);
29838                 return match ? match[1].trim() : arg.trim();
29839             }) || [];
29840         };
29841
29842
29843         exports.annotate = annotate;
29844         exports.parse = parse;
29845         exports.isArray = isArray;
29846
29847     }, {}],
29848     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js": [function(require, module, exports) {
29849         module.exports = {
29850             annotate: require('./annotation').annotate,
29851             Module: require('./module'),
29852             Injector: require('./injector')
29853         };
29854
29855     }, {
29856         "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
29857         "./injector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js",
29858         "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
29859     }],
29860     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js": [function(require, module, exports) {
29861         var Module = require('./module');
29862         var autoAnnotate = require('./annotation').parse;
29863         var annotate = require('./annotation').annotate;
29864         var isArray = require('./annotation').isArray;
29865
29866
29867         var Injector = function(modules, parent) {
29868             parent = parent || {
29869                 get: function(name) {
29870                     currentlyResolving.push(name);
29871                     throw error('No provider for "' + name + '"!');
29872                 }
29873             };
29874
29875             var currentlyResolving = [];
29876             var providers = this._providers = Object.create(parent._providers || null);
29877             var instances = this._instances = Object.create(null);
29878
29879             var self = instances.injector = this;
29880
29881             var error = function(msg) {
29882                 var stack = currentlyResolving.join(' -> ');
29883                 currentlyResolving.length = 0;
29884                 return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
29885             };
29886
29887             var get = function(name) {
29888                 if (!providers[name] && name.indexOf('.') !== -1) {
29889                     var parts = name.split('.');
29890                     var pivot = get(parts.shift());
29891
29892                     while (parts.length) {
29893                         pivot = pivot[parts.shift()];
29894                     }
29895
29896                     return pivot;
29897                 }
29898
29899                 if (Object.hasOwnProperty.call(instances, name)) {
29900                     return instances[name];
29901                 }
29902
29903                 if (Object.hasOwnProperty.call(providers, name)) {
29904                     if (currentlyResolving.indexOf(name) !== -1) {
29905                         currentlyResolving.push(name);
29906                         throw error('Cannot resolve circular dependency!');
29907                     }
29908
29909                     currentlyResolving.push(name);
29910                     instances[name] = providers[name][0](providers[name][1]);
29911                     currentlyResolving.pop();
29912
29913                     return instances[name];
29914                 }
29915
29916                 return parent.get(name);
29917             };
29918
29919             var instantiate = function(Type) {
29920                 var instance = Object.create(Type.prototype);
29921                 var returned = invoke(Type, instance);
29922
29923                 return typeof returned === 'object' ? returned : instance;
29924             };
29925
29926             var invoke = function(fn, context) {
29927                 if (typeof fn !== 'function') {
29928                     if (isArray(fn)) {
29929                         fn = annotate(fn.slice());
29930                     } else {
29931                         throw new Error('Cannot invoke "' + fn + '". Expected a function!');
29932                     }
29933                 }
29934
29935                 var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
29936                 var dependencies = inject.map(function(dep) {
29937                     return get(dep);
29938                 });
29939
29940                 // TODO(vojta): optimize without apply
29941                 return fn.apply(context, dependencies);
29942             };
29943
29944
29945             var createPrivateInjectorFactory = function(privateChildInjector) {
29946                 return annotate(function(key) {
29947                     return privateChildInjector.get(key);
29948                 });
29949             };
29950
29951             var createChild = function(modules, forceNewInstances) {
29952                 if (forceNewInstances && forceNewInstances.length) {
29953                     var fromParentModule = Object.create(null);
29954                     var matchedScopes = Object.create(null);
29955
29956                     var privateInjectorsCache = [];
29957                     var privateChildInjectors = [];
29958                     var privateChildFactories = [];
29959
29960                     var provider;
29961                     var cacheIdx;
29962                     var privateChildInjector;
29963                     var privateChildInjectorFactory;
29964                     for (var name in providers) {
29965                         provider = providers[name];
29966
29967                         if (forceNewInstances.indexOf(name) !== -1) {
29968                             if (provider[2] === 'private') {
29969                                 cacheIdx = privateInjectorsCache.indexOf(provider[3]);
29970                                 if (cacheIdx === -1) {
29971                                     privateChildInjector = provider[3].createChild([], forceNewInstances);
29972                                     privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
29973                                     privateInjectorsCache.push(provider[3]);
29974                                     privateChildInjectors.push(privateChildInjector);
29975                                     privateChildFactories.push(privateChildInjectorFactory);
29976                                     fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
29977                                 } else {
29978                                     fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
29979                                 }
29980                             } else {
29981                                 fromParentModule[name] = [provider[2], provider[1]];
29982                             }
29983                             matchedScopes[name] = true;
29984                         }
29985
29986                         if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
29987                             forceNewInstances.forEach(function(scope) {
29988                                 if (provider[1].$scope.indexOf(scope) !== -1) {
29989                                     fromParentModule[name] = [provider[2], provider[1]];
29990                                     matchedScopes[scope] = true;
29991                                 }
29992                             });
29993                         }
29994                     }
29995
29996                     forceNewInstances.forEach(function(scope) {
29997                         if (!matchedScopes[scope]) {
29998                             throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
29999                         }
30000                     });
30001
30002                     modules.unshift(fromParentModule);
30003                 }
30004
30005                 return new Injector(modules, self);
30006             };
30007
30008             var factoryMap = {
30009                 factory: invoke,
30010                 type: instantiate,
30011                 value: function(value) {
30012                     return value;
30013                 }
30014             };
30015
30016             modules.forEach(function(module) {
30017
30018                 function arrayUnwrap(type, value) {
30019                     if (type !== 'value' && isArray(value)) {
30020                         value = annotate(value.slice());
30021                     }
30022
30023                     return value;
30024                 }
30025
30026                 // TODO(vojta): handle wrong inputs (modules)
30027                 if (module instanceof Module) {
30028                     module.forEach(function(provider) {
30029                         var name = provider[0];
30030                         var type = provider[1];
30031                         var value = provider[2];
30032
30033                         providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
30034                     });
30035                 } else if (typeof module === 'object') {
30036                     if (module.__exports__) {
30037                         var clonedModule = Object.keys(module).reduce(function(m, key) {
30038                             if (key.substring(0, 2) !== '__') {
30039                                 m[key] = module[key];
30040                             }
30041                             return m;
30042                         }, Object.create(null));
30043
30044                         var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
30045                         var getFromPrivateInjector = annotate(function(key) {
30046                             return privateInjector.get(key);
30047                         });
30048                         module.__exports__.forEach(function(key) {
30049                             providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
30050                         });
30051                     } else {
30052                         Object.keys(module).forEach(function(name) {
30053                             if (module[name][2] === 'private') {
30054                                 providers[name] = module[name];
30055                                 return;
30056                             }
30057
30058                             var type = module[name][0];
30059                             var value = module[name][1];
30060
30061                             providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
30062                         });
30063                     }
30064                 }
30065             });
30066
30067             // public API
30068             this.get = get;
30069             this.invoke = invoke;
30070             this.instantiate = instantiate;
30071             this.createChild = createChild;
30072         };
30073
30074         module.exports = Injector;
30075
30076     }, {
30077         "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
30078         "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
30079     }],
30080     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js": [function(require, module, exports) {
30081         var Module = function() {
30082             var providers = [];
30083
30084             this.factory = function(name, factory) {
30085                 providers.push([name, 'factory', factory]);
30086                 return this;
30087             };
30088
30089             this.value = function(name, value) {
30090                 providers.push([name, 'value', value]);
30091                 return this;
30092             };
30093
30094             this.type = function(name, type) {
30095                 providers.push([name, 'type', type]);
30096                 return this;
30097             };
30098
30099             this.forEach = function(iterator) {
30100                 providers.forEach(iterator);
30101             };
30102         };
30103
30104         module.exports = Module;
30105
30106     }, {}],
30107     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js": [function(require, module, exports) {
30108         // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
30109         // 
30110         // Licensed under the Apache License, Version 2.0 (the "License");
30111         // you may not use this file except in compliance with the License.
30112         // You may obtain a copy of the License at
30113         // 
30114         // http://www.apache.org/licenses/LICENSE-2.0
30115         // 
30116         // Unless required by applicable law or agreed to in writing, software
30117         // distributed under the License is distributed on an "AS IS" BASIS,
30118         // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30119         // See the License for the specific language governing permissions and
30120         // limitations under the License.
30121         // ÃƒÆ’¢â€�Ήâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Â�
30122         // \\
30123         // ÃƒÆ’¢â€�‚ Eve 0.4.2 - JavaScript Events Library ÃƒÆ’¢â€�‚ \\
30124         // ÃƒÆ’¢â€�ωâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�¤
30125         // \\
30126         // ÃƒÆ’¢â€�‚ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) ÃƒÆ’¢â€�‚
30127         // \\
30128         // ÃƒÆ’¢â€�â€�ââ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Ëœ
30129         // \\
30130
30131         (function(glob) {
30132             var version = "0.4.2",
30133                 has = "hasOwnProperty",
30134                 separator = /[\.\/]/,
30135                 comaseparator = /\s*,\s*/,
30136                 wildcard = "*",
30137                 fun = function() {},
30138                 numsort = function(a, b) {
30139                     return a - b;
30140                 },
30141                 current_event,
30142                 stop,
30143                 events = {
30144                     n: {}
30145                 },
30146                 firstDefined = function() {
30147                     for (var i = 0, ii = this.length; i < ii; i++) {
30148                         if (typeof this[i] != "undefined") {
30149                             return this[i];
30150                         }
30151                     }
30152                 },
30153                 lastDefined = function() {
30154                     var i = this.length;
30155                     while (--i) {
30156                         if (typeof this[i] != "undefined") {
30157                             return this[i];
30158                         }
30159                     }
30160                 },
30161                 /*
30162                  * \ eve [ method ]
30163                  * 
30164                  * Fires event with given `name`, given scope and other parameters.
30165                  *  > Arguments
30166                  *  - name (string) name of the *event*, dot (`.`) or slash (`/`) separated -
30167                  * scope (object) context for the event handlers - varargs (...) the rest of
30168                  * arguments will be sent to event handlers
30169                  *  = (object) array of returned values from the listeners. Array has two
30170                  * methods `.firstDefined()` and `.lastDefined()` to get first or last not
30171                  * `undefined` value. \
30172                  */
30173                 eve = function(name, scope) {
30174                     name = String(name);
30175                     var e = events,
30176                         oldstop = stop,
30177                         args = Array.prototype.slice.call(arguments, 2),
30178                         listeners = eve.listeners(name),
30179                         z = 0,
30180                         f = false,
30181                         l,
30182                         indexed = [],
30183                         queue = {},
30184                         out = [],
30185                         ce = current_event,
30186                         errors = [];
30187                     out.firstDefined = firstDefined;
30188                     out.lastDefined = lastDefined;
30189                     current_event = name;
30190                     stop = 0;
30191                     for (var i = 0, ii = listeners.length; i < ii; i++)
30192                         if ("zIndex" in listeners[i]) {
30193                             indexed.push(listeners[i].zIndex);
30194                             if (listeners[i].zIndex < 0) {
30195                                 queue[listeners[i].zIndex] = listeners[i];
30196                             }
30197                         }
30198                     indexed.sort(numsort);
30199                     while (indexed[z] < 0) {
30200                         l = queue[indexed[z++]];
30201                         out.push(l.apply(scope, args));
30202                         if (stop) {
30203                             stop = oldstop;
30204                             return out;
30205                         }
30206                     }
30207                     for (i = 0; i < ii; i++) {
30208                         l = listeners[i];
30209                         if ("zIndex" in l) {
30210                             if (l.zIndex == indexed[z]) {
30211                                 out.push(l.apply(scope, args));
30212                                 if (stop) {
30213                                     break;
30214                                 }
30215                                 do {
30216                                     z++;
30217                                     l = queue[indexed[z]];
30218                                     l && out.push(l.apply(scope, args));
30219                                     if (stop) {
30220                                         break;
30221                                     }
30222                                 } while (l)
30223                             } else {
30224                                 queue[l.zIndex] = l;
30225                             }
30226                         } else {
30227                             out.push(l.apply(scope, args));
30228                             if (stop) {
30229                                 break;
30230                             }
30231                         }
30232                     }
30233                     stop = oldstop;
30234                     current_event = ce;
30235                     return out;
30236                 };
30237             // Undocumented. Debug only.
30238             eve._events = events;
30239             /*
30240              * \ eve.listeners [ method ]
30241              * 
30242              * Internal method which gives you array of all event handlers that will be
30243              * triggered by the given `name`.
30244              *  > Arguments
30245              *  - name (string) name of the event, dot (`.`) or slash (`/`) separated
30246              *  = (array) array of event handlers \
30247              */
30248             eve.listeners = function(name) {
30249                 var names = name.split(separator),
30250                     e = events,
30251                     item,
30252                     items,
30253                     k,
30254                     i,
30255                     ii,
30256                     j,
30257                     jj,
30258                     nes,
30259                     es = [e],
30260                     out = [];
30261                 for (i = 0, ii = names.length; i < ii; i++) {
30262                     nes = [];
30263                     for (j = 0, jj = es.length; j < jj; j++) {
30264                         e = es[j].n;
30265                         items = [e[names[i]], e[wildcard]];
30266                         k = 2;
30267                         while (k--) {
30268                             item = items[k];
30269                             if (item) {
30270                                 nes.push(item);
30271                                 out = out.concat(item.f || []);
30272                             }
30273                         }
30274                     }
30275                     es = nes;
30276                 }
30277                 return out;
30278             };
30279
30280             /*
30281              * \ eve.on [ method ] * Binds given event handler with a given name. You
30282              * can use wildcards ÃƒÆ’¢â‚¬Å“`*`� for the names: | eve.on("*.under.*",
30283              * f); | eve("mouse.under.floor"); // triggers f Use @eve to trigger the
30284              * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30285              * slash (`/`) separated, with optional wildcards - f (function) event
30286              * handler function * = (function) returned function accepts a single
30287              * numeric parameter that represents z-index of the handler. It is an
30288              * optional feature and only used when you need to ensure that some subset
30289              * of handlers will be invoked in a given order, despite of the order of
30290              * assignment. > Example: | eve.on("mouse", eatIt)(2); | eve.on("mouse",
30291              * scream); | eve.on("mouse", catchIt)(1); This will ensure that `catchIt`
30292              * function will be called before `eatIt`.
30293              * 
30294              * If you want to put your handler before non-indexed handlers, specify a
30295              * negative value. Note: I assume most of the time you don’t need to
30296              * worry about z-index, but it’s nice to have this feature
30297              * ÃƒÆ’¢â‚¬Å“just in case�. \
30298              */
30299             eve.on = function(name, f) {
30300                 name = String(name);
30301                 if (typeof f != "function") {
30302                     return function() {};
30303                 }
30304                 var names = name.split(comaseparator);
30305                 for (var i = 0, ii = names.length; i < ii; i++) {
30306                     (function(name) {
30307                         var names = name.split(separator),
30308                             e = events,
30309                             exist;
30310                         for (var i = 0, ii = names.length; i < ii; i++) {
30311                             e = e.n;
30312                             e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {
30313                                 n: {}
30314                             });
30315                         }
30316                         e.f = e.f || [];
30317                         for (i = 0, ii = e.f.length; i < ii; i++)
30318                             if (e.f[i] == f) {
30319                                 exist = true;
30320                                 break;
30321                             }!exist && e.f.push(f);
30322                     }(names[i]));
30323                 }
30324                 return function(zIndex) {
30325                     if (+zIndex == +zIndex) {
30326                         f.zIndex = +zIndex;
30327                     }
30328                 };
30329             };
30330             /*
30331              * \ eve.f [ method ] * Returns function that will fire given event with
30332              * optional arguments. Arguments that will be passed to the result function
30333              * will be also concated to the list of final arguments. | el.onclick =
30334              * eve.f("click", 1, 2); | eve.on("click", function (a, b, c) { |
30335              * console.log(a, b, c); // 1, 2, [event object] | }); > Arguments - event
30336              * (string) event name - varargs (…) and any other arguments =
30337              * (function) possible event handler function \
30338              */
30339             eve.f = function(event) {
30340                 var attrs = [].slice.call(arguments, 1);
30341                 return function() {
30342                     eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
30343                 };
30344             };
30345             /*
30346              * \ eve.stop [ method ] * Is used inside an event handler to stop the
30347              * event, preventing any subsequent listeners from firing. \
30348              */
30349             eve.stop = function() {
30350                 stop = 1;
30351             };
30352             /*
30353              * \ eve.nt [ method ] * Could be used inside event handler to figure out
30354              * actual name of the event. * > Arguments * - subname (string) #optional
30355              * subname of the event * = (string) name of the event, if `subname` is not
30356              * specified or = (boolean) `true`, if current event’s name contains
30357              * `subname` \
30358              */
30359             eve.nt = function(subname) {
30360                 if (subname) {
30361                     return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
30362                 }
30363                 return current_event;
30364             };
30365             /*
30366              * \ eve.nts [ method ] * Could be used inside event handler to figure out
30367              * actual name of the event. * * = (array) names of the event \
30368              */
30369             eve.nts = function() {
30370                 return current_event.split(separator);
30371             };
30372             /*
30373              * \ eve.off [ method ] * Removes given function from the list of event
30374              * listeners assigned to given name. If no arguments specified all the
30375              * events will be cleared. * > Arguments * - name (string) name of the
30376              * event, dot (`.`) or slash (`/`) separated, with optional wildcards - f
30377              * (function) event handler function \
30378              */
30379             /*
30380              * \ eve.unbind [ method ] * See @eve.off \
30381              */
30382             eve.off = eve.unbind = function(name, f) {
30383                 if (!name) {
30384                     eve._events = events = {
30385                         n: {}
30386                     };
30387                     return;
30388                 }
30389                 var names = name.split(comaseparator);
30390                 if (names.length > 1) {
30391                     for (var i = 0, ii = names.length; i < ii; i++) {
30392                         eve.off(names[i], f);
30393                     }
30394                     return;
30395                 }
30396                 names = name.split(separator);
30397                 var e,
30398                     key,
30399                     splice,
30400                     i, ii, j, jj,
30401                     cur = [events];
30402                 for (i = 0, ii = names.length; i < ii; i++) {
30403                     for (j = 0; j < cur.length; j += splice.length - 2) {
30404                         splice = [j, 1];
30405                         e = cur[j].n;
30406                         if (names[i] != wildcard) {
30407                             if (e[names[i]]) {
30408                                 splice.push(e[names[i]]);
30409                             }
30410                         } else {
30411                             for (key in e)
30412                                 if (e[has](key)) {
30413                                     splice.push(e[key]);
30414                                 }
30415                         }
30416                         cur.splice.apply(cur, splice);
30417                     }
30418                 }
30419                 for (i = 0, ii = cur.length; i < ii; i++) {
30420                     e = cur[i];
30421                     while (e.n) {
30422                         if (f) {
30423                             if (e.f) {
30424                                 for (j = 0, jj = e.f.length; j < jj; j++)
30425                                     if (e.f[j] == f) {
30426                                         e.f.splice(j, 1);
30427                                         break;
30428                                     }!e.f.length && delete e.f;
30429                             }
30430                             for (key in e.n)
30431                                 if (e.n[has](key) && e.n[key].f) {
30432                                     var funcs = e.n[key].f;
30433                                     for (j = 0, jj = funcs.length; j < jj; j++)
30434                                         if (funcs[j] == f) {
30435                                             funcs.splice(j, 1);
30436                                             break;
30437                                         }!funcs.length && delete e.n[key].f;
30438                                 }
30439                         } else {
30440                             delete e.f;
30441                             for (key in e.n)
30442                                 if (e.n[has](key) && e.n[key].f) {
30443                                     delete e.n[key].f;
30444                                 }
30445                         }
30446                         e = e.n;
30447                     }
30448                 }
30449             };
30450             /*
30451              * \ eve.once [ method ] * Binds given event handler with a given name to
30452              * only run once then unbind itself. | eve.once("login", f); | eve("login"); //
30453              * triggers f | eve("login"); // no listeners Use @eve to trigger the
30454              * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30455              * slash (`/`) separated, with optional wildcards - f (function) event
30456              * handler function * = (function) same return function as @eve.on \
30457              */
30458             eve.once = function(name, f) {
30459                 var f2 = function() {
30460                     eve.unbind(name, f2);
30461                     return f.apply(this, arguments);
30462                 };
30463                 return eve.on(name, f2);
30464             };
30465             /*
30466              * \ eve.version [ property (string) ] * Current version of the library. \
30467              */
30468             eve.version = version;
30469             eve.toString = function() {
30470                 return "You are running Eve " + version;
30471             };
30472             (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() {
30473                 return eve;
30474             })) : (glob.eve = eve));
30475         })(this);
30476
30477     }, {}],
30478     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js": [function(require, module, exports) {
30479         /*
30480          * ! Hammer.JS - v2.0.4 - 2014-09-28 http://hammerjs.github.io/
30481          * 
30482          * Copyright (c) 2014 Jorik Tangelder; Licensed under the MIT license
30483          */
30484         (function(window, document, exportName, undefined) {
30485             'use strict';
30486
30487             var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
30488             var TEST_ELEMENT = document.createElement('div');
30489
30490             var TYPE_FUNCTION = 'function';
30491
30492             var round = Math.round;
30493             var abs = Math.abs;
30494             var now = Date.now;
30495
30496             /**
30497              * set a timeout with a given scope
30498              * 
30499              * @param {Function}
30500              *            fn
30501              * @param {Number}
30502              *            timeout
30503              * @param {Object}
30504              *            context
30505              * @returns {number}
30506              */
30507             function setTimeoutContext(fn, timeout, context) {
30508                 return setTimeout(bindFn(fn, context), timeout);
30509             }
30510
30511             /**
30512              * if the argument is an array, we want to execute the fn on each entry if it
30513              * aint an array we don't want to do a thing. this is used by all the methods
30514              * that accept a single and array argument.
30515              * 
30516              * @param {*|Array}
30517              *            arg
30518              * @param {String}
30519              *            fn
30520              * @param {Object}
30521              *            [context]
30522              * @returns {Boolean}
30523              */
30524             function invokeArrayArg(arg, fn, context) {
30525                 if (Array.isArray(arg)) {
30526                     each(arg, context[fn], context);
30527                     return true;
30528                 }
30529                 return false;
30530             }
30531
30532             /**
30533              * walk objects and arrays
30534              * 
30535              * @param {Object}
30536              *            obj
30537              * @param {Function}
30538              *            iterator
30539              * @param {Object}
30540              *            context
30541              */
30542             function each(obj, iterator, context) {
30543                 var i;
30544
30545                 if (!obj) {
30546                     return;
30547                 }
30548
30549                 if (obj.forEach) {
30550                     obj.forEach(iterator, context);
30551                 } else if (obj.length !== undefined) {
30552                     i = 0;
30553                     while (i < obj.length) {
30554                         iterator.call(context, obj[i], i, obj);
30555                         i++;
30556                     }
30557                 } else {
30558                     for (i in obj) {
30559                         obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
30560                     }
30561                 }
30562             }
30563
30564             /**
30565              * extend object. means that properties in dest will be overwritten by the ones
30566              * in src.
30567              * 
30568              * @param {Object}
30569              *            dest
30570              * @param {Object}
30571              *            src
30572              * @param {Boolean}
30573              *            [merge]
30574              * @returns {Object} dest
30575              */
30576             function extend(dest, src, merge) {
30577                 var keys = Object.keys(src);
30578                 var i = 0;
30579                 while (i < keys.length) {
30580                     if (!merge || (merge && dest[keys[i]] === undefined)) {
30581                         dest[keys[i]] = src[keys[i]];
30582                     }
30583                     i++;
30584                 }
30585                 return dest;
30586             }
30587
30588             /**
30589              * merge the values from src in the dest. means that properties that exist in
30590              * dest will not be overwritten by src
30591              * 
30592              * @param {Object}
30593              *            dest
30594              * @param {Object}
30595              *            src
30596              * @returns {Object} dest
30597              */
30598             function merge(dest, src) {
30599                 return extend(dest, src, true);
30600             }
30601
30602             /**
30603              * simple class inheritance
30604              * 
30605              * @param {Function}
30606              *            child
30607              * @param {Function}
30608              *            base
30609              * @param {Object}
30610              *            [properties]
30611              */
30612             function inherit(child, base, properties) {
30613                 var baseP = base.prototype,
30614                     childP;
30615
30616                 childP = child.prototype = Object.create(baseP);
30617                 childP.constructor = child;
30618                 childP._super = baseP;
30619
30620                 if (properties) {
30621                     extend(childP, properties);
30622                 }
30623             }
30624
30625             /**
30626              * simple function bind
30627              * 
30628              * @param {Function}
30629              *            fn
30630              * @param {Object}
30631              *            context
30632              * @returns {Function}
30633              */
30634             function bindFn(fn, context) {
30635                 return function boundFn() {
30636                     return fn.apply(context, arguments);
30637                 };
30638             }
30639
30640             /**
30641              * let a boolean value also be a function that must return a boolean this first
30642              * item in args will be used as the context
30643              * 
30644              * @param {Boolean|Function}
30645              *            val
30646              * @param {Array}
30647              *            [args]
30648              * @returns {Boolean}
30649              */
30650             function boolOrFn(val, args) {
30651                 if (typeof val == TYPE_FUNCTION) {
30652                     return val.apply(args ? args[0] || undefined : undefined, args);
30653                 }
30654                 return val;
30655             }
30656
30657             /**
30658              * use the val2 when val1 is undefined
30659              * 
30660              * @param {*}
30661              *            val1
30662              * @param {*}
30663              *            val2
30664              * @returns {*}
30665              */
30666             function ifUndefined(val1, val2) {
30667                 return (val1 === undefined) ? val2 : val1;
30668             }
30669
30670             /**
30671              * addEventListener with multiple events at once
30672              * 
30673              * @param {EventTarget}
30674              *            target
30675              * @param {String}
30676              *            types
30677              * @param {Function}
30678              *            handler
30679              */
30680             function addEventListeners(target, types, handler) {
30681                 each(splitStr(types), function(type) {
30682                     target.addEventListener(type, handler, false);
30683                 });
30684             }
30685
30686             /**
30687              * removeEventListener with multiple events at once
30688              * 
30689              * @param {EventTarget}
30690              *            target
30691              * @param {String}
30692              *            types
30693              * @param {Function}
30694              *            handler
30695              */
30696             function removeEventListeners(target, types, handler) {
30697                 each(splitStr(types), function(type) {
30698                     target.removeEventListener(type, handler, false);
30699                 });
30700             }
30701
30702             /**
30703              * find if a node is in the given parent
30704              * 
30705              * @method hasParent
30706              * @param {HTMLElement}
30707              *            node
30708              * @param {HTMLElement}
30709              *            parent
30710              * @return {Boolean} found
30711              */
30712             function hasParent(node, parent) {
30713                 while (node) {
30714                     if (node == parent) {
30715                         return true;
30716                     }
30717                     node = node.parentNode;
30718                 }
30719                 return false;
30720             }
30721
30722             /**
30723              * small indexOf wrapper
30724              * 
30725              * @param {String}
30726              *            str
30727              * @param {String}
30728              *            find
30729              * @returns {Boolean} found
30730              */
30731             function inStr(str, find) {
30732                 return str.indexOf(find) > -1;
30733             }
30734
30735             /**
30736              * split string on whitespace
30737              * 
30738              * @param {String}
30739              *            str
30740              * @returns {Array} words
30741              */
30742             function splitStr(str) {
30743                 return str.trim().split(/\s+/g);
30744             }
30745
30746             /**
30747              * find if a array contains the object using indexOf or a simple polyFill
30748              * 
30749              * @param {Array}
30750              *            src
30751              * @param {String}
30752              *            find
30753              * @param {String}
30754              *            [findByKey]
30755              * @return {Boolean|Number} false when not found, or the index
30756              */
30757             function inArray(src, find, findByKey) {
30758                 if (src.indexOf && !findByKey) {
30759                     return src.indexOf(find);
30760                 } else {
30761                     var i = 0;
30762                     while (i < src.length) {
30763                         if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
30764                             return i;
30765                         }
30766                         i++;
30767                     }
30768                     return -1;
30769                 }
30770             }
30771
30772             /**
30773              * convert array-like objects to real arrays
30774              * 
30775              * @param {Object}
30776              *            obj
30777              * @returns {Array}
30778              */
30779             function toArray(obj) {
30780                 return Array.prototype.slice.call(obj, 0);
30781             }
30782
30783             /**
30784              * unique array with objects based on a key (like 'id') or just by the array's
30785              * value
30786              * 
30787              * @param {Array}
30788              *            src [{id:1},{id:2},{id:1}]
30789              * @param {String}
30790              *            [key]
30791              * @param {Boolean}
30792              *            [sort=False]
30793              * @returns {Array} [{id:1},{id:2}]
30794              */
30795             function uniqueArray(src, key, sort) {
30796                 var results = [];
30797                 var values = [];
30798                 var i = 0;
30799
30800                 while (i < src.length) {
30801                     var val = key ? src[i][key] : src[i];
30802                     if (inArray(values, val) < 0) {
30803                         results.push(src[i]);
30804                     }
30805                     values[i] = val;
30806                     i++;
30807                 }
30808
30809                 if (sort) {
30810                     if (!key) {
30811                         results = results.sort();
30812                     } else {
30813                         results = results.sort(function sortUniqueArray(a, b) {
30814                             return a[key] > b[key];
30815                         });
30816                     }
30817                 }
30818
30819                 return results;
30820             }
30821
30822             /**
30823              * get the prefixed property
30824              * 
30825              * @param {Object}
30826              *            obj
30827              * @param {String}
30828              *            property
30829              * @returns {String|Undefined} prefixed
30830              */
30831             function prefixed(obj, property) {
30832                 var prefix, prop;
30833                 var camelProp = property[0].toUpperCase() + property.slice(1);
30834
30835                 var i = 0;
30836                 while (i < VENDOR_PREFIXES.length) {
30837                     prefix = VENDOR_PREFIXES[i];
30838                     prop = (prefix) ? prefix + camelProp : property;
30839
30840                     if (prop in obj) {
30841                         return prop;
30842                     }
30843                     i++;
30844                 }
30845                 return undefined;
30846             }
30847
30848             /**
30849              * get a unique id
30850              * 
30851              * @returns {number} uniqueId
30852              */
30853             var _uniqueId = 1;
30854
30855             function uniqueId() {
30856                 return _uniqueId++;
30857             }
30858
30859             /**
30860              * get the window object of an element
30861              * 
30862              * @param {HTMLElement}
30863              *            element
30864              * @returns {DocumentView|Window}
30865              */
30866             function getWindowForElement(element) {
30867                 var doc = element.ownerDocument;
30868                 return (doc.defaultView || doc.parentWindow);
30869             }
30870
30871             var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
30872
30873             var SUPPORT_TOUCH = ('ontouchstart' in window);
30874             var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
30875             var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
30876
30877             var INPUT_TYPE_TOUCH = 'touch';
30878             var INPUT_TYPE_PEN = 'pen';
30879             var INPUT_TYPE_MOUSE = 'mouse';
30880             var INPUT_TYPE_KINECT = 'kinect';
30881
30882             var COMPUTE_INTERVAL = 25;
30883
30884             var INPUT_START = 1;
30885             var INPUT_MOVE = 2;
30886             var INPUT_END = 4;
30887             var INPUT_CANCEL = 8;
30888
30889             var DIRECTION_NONE = 1;
30890             var DIRECTION_LEFT = 2;
30891             var DIRECTION_RIGHT = 4;
30892             var DIRECTION_UP = 8;
30893             var DIRECTION_DOWN = 16;
30894
30895             var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
30896             var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
30897             var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
30898
30899             var PROPS_XY = ['x', 'y'];
30900             var PROPS_CLIENT_XY = ['clientX', 'clientY'];
30901
30902             /**
30903              * create new input type manager
30904              * 
30905              * @param {Manager}
30906              *            manager
30907              * @param {Function}
30908              *            callback
30909              * @returns {Input}
30910              * @constructor
30911              */
30912             function Input(manager, callback) {
30913                 var self = this;
30914                 this.manager = manager;
30915                 this.callback = callback;
30916                 this.element = manager.element;
30917                 this.target = manager.options.inputTarget;
30918
30919                 // smaller wrapper around the handler, for the scope and the enabled state
30920                 // of the manager,
30921                 // so when disabled the input events are completely bypassed.
30922                 this.domHandler = function(ev) {
30923                     if (boolOrFn(manager.options.enable, [manager])) {
30924                         self.handler(ev);
30925                     }
30926                 };
30927
30928                 this.init();
30929
30930             }
30931
30932             Input.prototype = {
30933                 /**
30934                  * should handle the inputEvent data and trigger the callback
30935                  * 
30936                  * @virtual
30937                  */
30938                 handler: function() {},
30939
30940                 /**
30941                  * bind the events
30942                  */
30943                 init: function() {
30944                     this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
30945                     this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
30946                     this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
30947                 },
30948
30949                 /**
30950                  * unbind the events
30951                  */
30952                 destroy: function() {
30953                     this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
30954                     this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
30955                     this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
30956                 }
30957             };
30958
30959             /**
30960              * create new input type manager called by the Manager constructor
30961              * 
30962              * @param {Hammer}
30963              *            manager
30964              * @returns {Input}
30965              */
30966             function createInputInstance(manager) {
30967                 var Type;
30968                 var inputClass = manager.options.inputClass;
30969
30970                 if (inputClass) {
30971                     Type = inputClass;
30972                 } else if (SUPPORT_POINTER_EVENTS) {
30973                     Type = PointerEventInput;
30974                 } else if (SUPPORT_ONLY_TOUCH) {
30975                     Type = TouchInput;
30976                 } else if (!SUPPORT_TOUCH) {
30977                     Type = MouseInput;
30978                 } else {
30979                     Type = TouchMouseInput;
30980                 }
30981                 return new(Type)(manager, inputHandler);
30982             }
30983
30984             /**
30985              * handle input events
30986              * 
30987              * @param {Manager}
30988              *            manager
30989              * @param {String}
30990              *            eventType
30991              * @param {Object}
30992              *            input
30993              */
30994             function inputHandler(manager, eventType, input) {
30995                 var pointersLen = input.pointers.length;
30996                 var changedPointersLen = input.changedPointers.length;
30997                 var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
30998                 var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
30999
31000                 input.isFirst = !!isFirst;
31001                 input.isFinal = !!isFinal;
31002
31003                 if (isFirst) {
31004                     manager.session = {};
31005                 }
31006
31007                 // source event is the normalized value of the domEvents
31008                 // like 'touchstart, mouseup, pointerdown'
31009                 input.eventType = eventType;
31010
31011                 // compute scale, rotation etc
31012                 computeInputData(manager, input);
31013
31014                 // emit secret event
31015                 manager.emit('hammer.input', input);
31016
31017                 manager.recognize(input);
31018                 manager.session.prevInput = input;
31019             }
31020
31021             /**
31022              * extend the data with some usable properties like scale, rotate, velocity etc
31023              * 
31024              * @param {Object}
31025              *            manager
31026              * @param {Object}
31027              *            input
31028              */
31029             function computeInputData(manager, input) {
31030                 var session = manager.session;
31031                 var pointers = input.pointers;
31032                 var pointersLength = pointers.length;
31033
31034                 // store the first input to calculate the distance and direction
31035                 if (!session.firstInput) {
31036                     session.firstInput = simpleCloneInputData(input);
31037                 }
31038
31039                 // to compute scale and rotation we need to store the multiple touches
31040                 if (pointersLength > 1 && !session.firstMultiple) {
31041                     session.firstMultiple = simpleCloneInputData(input);
31042                 } else if (pointersLength === 1) {
31043                     session.firstMultiple = false;
31044                 }
31045
31046                 var firstInput = session.firstInput;
31047                 var firstMultiple = session.firstMultiple;
31048                 var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
31049
31050                 var center = input.center = getCenter(pointers);
31051                 input.timeStamp = now();
31052                 input.deltaTime = input.timeStamp - firstInput.timeStamp;
31053
31054                 input.angle = getAngle(offsetCenter, center);
31055                 input.distance = getDistance(offsetCenter, center);
31056
31057                 computeDeltaXY(session, input);
31058                 input.offsetDirection = getDirection(input.deltaX, input.deltaY);
31059
31060                 input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
31061                 input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
31062
31063                 computeIntervalInputData(session, input);
31064
31065                 // find the correct target
31066                 var target = manager.element;
31067                 if (hasParent(input.srcEvent.target, target)) {
31068                     target = input.srcEvent.target;
31069                 }
31070                 input.target = target;
31071             }
31072
31073             function computeDeltaXY(session, input) {
31074                 var center = input.center;
31075                 var offset = session.offsetDelta || {};
31076                 var prevDelta = session.prevDelta || {};
31077                 var prevInput = session.prevInput || {};
31078
31079                 if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
31080                     prevDelta = session.prevDelta = {
31081                         x: prevInput.deltaX || 0,
31082                         y: prevInput.deltaY || 0
31083                     };
31084
31085                     offset = session.offsetDelta = {
31086                         x: center.x,
31087                         y: center.y
31088                     };
31089                 }
31090
31091                 input.deltaX = prevDelta.x + (center.x - offset.x);
31092                 input.deltaY = prevDelta.y + (center.y - offset.y);
31093             }
31094
31095             /**
31096              * velocity is calculated every x ms
31097              * 
31098              * @param {Object}
31099              *            session
31100              * @param {Object}
31101              *            input
31102              */
31103             function computeIntervalInputData(session, input) {
31104                 var last = session.lastInterval || input,
31105                     deltaTime = input.timeStamp - last.timeStamp,
31106                     velocity, velocityX, velocityY, direction;
31107
31108                 if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
31109                     var deltaX = last.deltaX - input.deltaX;
31110                     var deltaY = last.deltaY - input.deltaY;
31111
31112                     var v = getVelocity(deltaTime, deltaX, deltaY);
31113                     velocityX = v.x;
31114                     velocityY = v.y;
31115                     velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
31116                     direction = getDirection(deltaX, deltaY);
31117
31118                     session.lastInterval = input;
31119                 } else {
31120                     // use latest velocity info if it doesn't overtake a minimum period
31121                     velocity = last.velocity;
31122                     velocityX = last.velocityX;
31123                     velocityY = last.velocityY;
31124                     direction = last.direction;
31125                 }
31126
31127                 input.velocity = velocity;
31128                 input.velocityX = velocityX;
31129                 input.velocityY = velocityY;
31130                 input.direction = direction;
31131             }
31132
31133             /**
31134              * create a simple clone from the input used for storage of firstInput and
31135              * firstMultiple
31136              * 
31137              * @param {Object}
31138              *            input
31139              * @returns {Object} clonedInputData
31140              */
31141             function simpleCloneInputData(input) {
31142                 // make a simple copy of the pointers because we will get a reference if we
31143                 // don't
31144                 // we only need clientXY for the calculations
31145                 var pointers = [];
31146                 var i = 0;
31147                 while (i < input.pointers.length) {
31148                     pointers[i] = {
31149                         clientX: round(input.pointers[i].clientX),
31150                         clientY: round(input.pointers[i].clientY)
31151                     };
31152                     i++;
31153                 }
31154
31155                 return {
31156                     timeStamp: now(),
31157                     pointers: pointers,
31158                     center: getCenter(pointers),
31159                     deltaX: input.deltaX,
31160                     deltaY: input.deltaY
31161                 };
31162             }
31163
31164             /**
31165              * get the center of all the pointers
31166              * 
31167              * @param {Array}
31168              *            pointers
31169              * @return {Object} center contains `x` and `y` properties
31170              */
31171             function getCenter(pointers) {
31172                 var pointersLength = pointers.length;
31173
31174                 // no need to loop when only one touch
31175                 if (pointersLength === 1) {
31176                     return {
31177                         x: round(pointers[0].clientX),
31178                         y: round(pointers[0].clientY)
31179                     };
31180                 }
31181
31182                 var x = 0,
31183                     y = 0,
31184                     i = 0;
31185                 while (i < pointersLength) {
31186                     x += pointers[i].clientX;
31187                     y += pointers[i].clientY;
31188                     i++;
31189                 }
31190
31191                 return {
31192                     x: round(x / pointersLength),
31193                     y: round(y / pointersLength)
31194                 };
31195             }
31196
31197             /**
31198              * calculate the velocity between two points. unit is in px per ms.
31199              * 
31200              * @param {Number}
31201              *            deltaTime
31202              * @param {Number}
31203              *            x
31204              * @param {Number}
31205              *            y
31206              * @return {Object} velocity `x` and `y`
31207              */
31208             function getVelocity(deltaTime, x, y) {
31209                 return {
31210                     x: x / deltaTime || 0,
31211                     y: y / deltaTime || 0
31212                 };
31213             }
31214
31215             /**
31216              * get the direction between two points
31217              * 
31218              * @param {Number}
31219              *            x
31220              * @param {Number}
31221              *            y
31222              * @return {Number} direction
31223              */
31224             function getDirection(x, y) {
31225                 if (x === y) {
31226                     return DIRECTION_NONE;
31227                 }
31228
31229                 if (abs(x) >= abs(y)) {
31230                     return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
31231                 }
31232                 return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
31233             }
31234
31235             /**
31236              * calculate the absolute distance between two points
31237              * 
31238              * @param {Object}
31239              *            p1 {x, y}
31240              * @param {Object}
31241              *            p2 {x, y}
31242              * @param {Array}
31243              *            [props] containing x and y keys
31244              * @return {Number} distance
31245              */
31246             function getDistance(p1, p2, props) {
31247                 if (!props) {
31248                     props = PROPS_XY;
31249                 }
31250                 var x = p2[props[0]] - p1[props[0]],
31251                     y = p2[props[1]] - p1[props[1]];
31252
31253                 return Math.sqrt((x * x) + (y * y));
31254             }
31255
31256             /**
31257              * calculate the angle between two coordinates
31258              * 
31259              * @param {Object}
31260              *            p1
31261              * @param {Object}
31262              *            p2
31263              * @param {Array}
31264              *            [props] containing x and y keys
31265              * @return {Number} angle
31266              */
31267             function getAngle(p1, p2, props) {
31268                 if (!props) {
31269                     props = PROPS_XY;
31270                 }
31271                 var x = p2[props[0]] - p1[props[0]],
31272                     y = p2[props[1]] - p1[props[1]];
31273                 return Math.atan2(y, x) * 180 / Math.PI;
31274             }
31275
31276             /**
31277              * calculate the rotation degrees between two pointersets
31278              * 
31279              * @param {Array}
31280              *            start array of pointers
31281              * @param {Array}
31282              *            end array of pointers
31283              * @return {Number} rotation
31284              */
31285             function getRotation(start, end) {
31286                 return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
31287             }
31288
31289             /**
31290              * calculate the scale factor between two pointersets no scale is 1, and goes
31291              * down to 0 when pinched together, and bigger when pinched out
31292              * 
31293              * @param {Array}
31294              *            start array of pointers
31295              * @param {Array}
31296              *            end array of pointers
31297              * @return {Number} scale
31298              */
31299             function getScale(start, end) {
31300                 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
31301             }
31302
31303             var MOUSE_INPUT_MAP = {
31304                 mousedown: INPUT_START,
31305                 mousemove: INPUT_MOVE,
31306                 mouseup: INPUT_END
31307             };
31308
31309             var MOUSE_ELEMENT_EVENTS = 'mousedown';
31310             var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
31311
31312             /**
31313              * Mouse events input
31314              * 
31315              * @constructor
31316              * @extends Input
31317              */
31318             function MouseInput() {
31319                 this.evEl = MOUSE_ELEMENT_EVENTS;
31320                 this.evWin = MOUSE_WINDOW_EVENTS;
31321
31322                 this.allow = true; // used by Input.TouchMouse to disable mouse events
31323                 this.pressed = false; // mousedown state
31324
31325                 Input.apply(this, arguments);
31326             }
31327
31328             inherit(MouseInput, Input, {
31329                 /**
31330                  * handle mouse events
31331                  * 
31332                  * @param {Object}
31333                  *            ev
31334                  */
31335                 handler: function MEhandler(ev) {
31336                     var eventType = MOUSE_INPUT_MAP[ev.type];
31337
31338                     // on start we want to have the left mouse button down
31339                     if (eventType & INPUT_START && ev.button === 0) {
31340                         this.pressed = true;
31341                     }
31342
31343                     if (eventType & INPUT_MOVE && ev.which !== 1) {
31344                         eventType = INPUT_END;
31345                     }
31346
31347                     // mouse must be down, and mouse events are allowed (see the TouchMouse
31348                     // input)
31349                     if (!this.pressed || !this.allow) {
31350                         return;
31351                     }
31352
31353                     if (eventType & INPUT_END) {
31354                         this.pressed = false;
31355                     }
31356
31357                     this.callback(this.manager, eventType, {
31358                         pointers: [ev],
31359                         changedPointers: [ev],
31360                         pointerType: INPUT_TYPE_MOUSE,
31361                         srcEvent: ev
31362                     });
31363                 }
31364             });
31365
31366             var POINTER_INPUT_MAP = {
31367                 pointerdown: INPUT_START,
31368                 pointermove: INPUT_MOVE,
31369                 pointerup: INPUT_END,
31370                 pointercancel: INPUT_CANCEL,
31371                 pointerout: INPUT_CANCEL
31372             };
31373
31374             // in IE10 the pointer types is defined as an enum
31375             var IE10_POINTER_TYPE_ENUM = {
31376                 2: INPUT_TYPE_TOUCH,
31377                 3: INPUT_TYPE_PEN,
31378                 4: INPUT_TYPE_MOUSE,
31379                 5: INPUT_TYPE_KINECT // see
31380                     // https://twitter.com/jacobrossi/status/480596438489890816
31381             };
31382
31383             var POINTER_ELEMENT_EVENTS = 'pointerdown';
31384             var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
31385
31386             // IE10 has prefixed support, and case-sensitive
31387             if (window.MSPointerEvent) {
31388                 POINTER_ELEMENT_EVENTS = 'MSPointerDown';
31389                 POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
31390             }
31391
31392             /**
31393              * Pointer events input
31394              * 
31395              * @constructor
31396              * @extends Input
31397              */
31398             function PointerEventInput() {
31399                 this.evEl = POINTER_ELEMENT_EVENTS;
31400                 this.evWin = POINTER_WINDOW_EVENTS;
31401
31402                 Input.apply(this, arguments);
31403
31404                 this.store = (this.manager.session.pointerEvents = []);
31405             }
31406
31407             inherit(PointerEventInput, Input, {
31408                 /**
31409                  * handle mouse events
31410                  * 
31411                  * @param {Object}
31412                  *            ev
31413                  */
31414                 handler: function PEhandler(ev) {
31415                     var store = this.store;
31416                     var removePointer = false;
31417
31418                     var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
31419                     var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
31420                     var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
31421
31422                     var isTouch = (pointerType == INPUT_TYPE_TOUCH);
31423
31424                     // get index of the event in the store
31425                     var storeIndex = inArray(store, ev.pointerId, 'pointerId');
31426
31427                     // start and mouse must be down
31428                     if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
31429                         if (storeIndex < 0) {
31430                             store.push(ev);
31431                             storeIndex = store.length - 1;
31432                         }
31433                     } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
31434                         removePointer = true;
31435                     }
31436
31437                     // it not found, so the pointer hasn't been down (so it's probably a
31438                     // hover)
31439                     if (storeIndex < 0) {
31440                         return;
31441                     }
31442
31443                     // update the event in the store
31444                     store[storeIndex] = ev;
31445
31446                     this.callback(this.manager, eventType, {
31447                         pointers: store,
31448                         changedPointers: [ev],
31449                         pointerType: pointerType,
31450                         srcEvent: ev
31451                     });
31452
31453                     if (removePointer) {
31454                         // remove from the store
31455                         store.splice(storeIndex, 1);
31456                     }
31457                 }
31458             });
31459
31460             var SINGLE_TOUCH_INPUT_MAP = {
31461                 touchstart: INPUT_START,
31462                 touchmove: INPUT_MOVE,
31463                 touchend: INPUT_END,
31464                 touchcancel: INPUT_CANCEL
31465             };
31466
31467             var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
31468             var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
31469
31470             /**
31471              * Touch events input
31472              * 
31473              * @constructor
31474              * @extends Input
31475              */
31476             function SingleTouchInput() {
31477                 this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
31478                 this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
31479                 this.started = false;
31480
31481                 Input.apply(this, arguments);
31482             }
31483
31484             inherit(SingleTouchInput, Input, {
31485                 handler: function TEhandler(ev) {
31486                     var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
31487
31488                     // should we handle the touch events?
31489                     if (type === INPUT_START) {
31490                         this.started = true;
31491                     }
31492
31493                     if (!this.started) {
31494                         return;
31495                     }
31496
31497                     var touches = normalizeSingleTouches.call(this, ev, type);
31498
31499                     // when done, reset the started state
31500                     if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
31501                         this.started = false;
31502                     }
31503
31504                     this.callback(this.manager, type, {
31505                         pointers: touches[0],
31506                         changedPointers: touches[1],
31507                         pointerType: INPUT_TYPE_TOUCH,
31508                         srcEvent: ev
31509                     });
31510                 }
31511             });
31512
31513             /**
31514              * @this {TouchInput}
31515              * @param {Object}
31516              *            ev
31517              * @param {Number}
31518              *            type flag
31519              * @returns {undefined|Array} [all, changed]
31520              */
31521             function normalizeSingleTouches(ev, type) {
31522                 var all = toArray(ev.touches);
31523                 var changed = toArray(ev.changedTouches);
31524
31525                 if (type & (INPUT_END | INPUT_CANCEL)) {
31526                     all = uniqueArray(all.concat(changed), 'identifier', true);
31527                 }
31528
31529                 return [all, changed];
31530             }
31531
31532             var TOUCH_INPUT_MAP = {
31533                 touchstart: INPUT_START,
31534                 touchmove: INPUT_MOVE,
31535                 touchend: INPUT_END,
31536                 touchcancel: INPUT_CANCEL
31537             };
31538
31539             var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
31540
31541             /**
31542              * Multi-user touch events input
31543              * 
31544              * @constructor
31545              * @extends Input
31546              */
31547             function TouchInput() {
31548                 this.evTarget = TOUCH_TARGET_EVENTS;
31549                 this.targetIds = {};
31550
31551                 Input.apply(this, arguments);
31552             }
31553
31554             inherit(TouchInput, Input, {
31555                 handler: function MTEhandler(ev) {
31556                     var type = TOUCH_INPUT_MAP[ev.type];
31557                     var touches = getTouches.call(this, ev, type);
31558                     if (!touches) {
31559                         return;
31560                     }
31561
31562                     this.callback(this.manager, type, {
31563                         pointers: touches[0],
31564                         changedPointers: touches[1],
31565                         pointerType: INPUT_TYPE_TOUCH,
31566                         srcEvent: ev
31567                     });
31568                 }
31569             });
31570
31571             /**
31572              * @this {TouchInput}
31573              * @param {Object}
31574              *            ev
31575              * @param {Number}
31576              *            type flag
31577              * @returns {undefined|Array} [all, changed]
31578              */
31579             function getTouches(ev, type) {
31580                 var allTouches = toArray(ev.touches);
31581                 var targetIds = this.targetIds;
31582
31583                 // when there is only one touch, the process can be simplified
31584                 if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
31585                     targetIds[allTouches[0].identifier] = true;
31586                     return [allTouches, allTouches];
31587                 }
31588
31589                 var i,
31590                     targetTouches,
31591                     changedTouches = toArray(ev.changedTouches),
31592                     changedTargetTouches = [],
31593                     target = this.target;
31594
31595                 // get target touches from touches
31596                 targetTouches = allTouches.filter(function(touch) {
31597                     return hasParent(touch.target, target);
31598                 });
31599
31600                 // collect touches
31601                 if (type === INPUT_START) {
31602                     i = 0;
31603                     while (i < targetTouches.length) {
31604                         targetIds[targetTouches[i].identifier] = true;
31605                         i++;
31606                     }
31607                 }
31608
31609                 // filter changed touches to only contain touches that exist in the
31610                 // collected target ids
31611                 i = 0;
31612                 while (i < changedTouches.length) {
31613                     if (targetIds[changedTouches[i].identifier]) {
31614                         changedTargetTouches.push(changedTouches[i]);
31615                     }
31616
31617                     // cleanup removed touches
31618                     if (type & (INPUT_END | INPUT_CANCEL)) {
31619                         delete targetIds[changedTouches[i].identifier];
31620                     }
31621                     i++;
31622                 }
31623
31624                 if (!changedTargetTouches.length) {
31625                     return;
31626                 }
31627
31628                 return [
31629                     // merge targetTouches with changedTargetTouches so it contains ALL
31630                     // touches, including 'end' and 'cancel'
31631                     uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
31632                     changedTargetTouches
31633                 ];
31634             }
31635
31636             /**
31637              * Combined touch and mouse input
31638              * 
31639              * Touch has a higher priority then mouse, and while touching no mouse events
31640              * are allowed. This because touch devices also emit mouse events while doing a
31641              * touch.
31642              * 
31643              * @constructor
31644              * @extends Input
31645              */
31646             function TouchMouseInput() {
31647                 Input.apply(this, arguments);
31648
31649                 var handler = bindFn(this.handler, this);
31650                 this.touch = new TouchInput(this.manager, handler);
31651                 this.mouse = new MouseInput(this.manager, handler);
31652             }
31653
31654             inherit(TouchMouseInput, Input, {
31655                 /**
31656                  * handle mouse and touch events
31657                  * 
31658                  * @param {Hammer}
31659                  *            manager
31660                  * @param {String}
31661                  *            inputEvent
31662                  * @param {Object}
31663                  *            inputData
31664                  */
31665                 handler: function TMEhandler(manager, inputEvent, inputData) {
31666                     var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
31667                         isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
31668
31669                     // when we're in a touch event, so block all upcoming mouse events
31670                     // most mobile browser also emit mouseevents, right after touchstart
31671                     if (isTouch) {
31672                         this.mouse.allow = false;
31673                     } else if (isMouse && !this.mouse.allow) {
31674                         return;
31675                     }
31676
31677                     // reset the allowMouse when we're done
31678                     if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
31679                         this.mouse.allow = true;
31680                     }
31681
31682                     this.callback(manager, inputEvent, inputData);
31683                 },
31684
31685                 /**
31686                  * remove the event listeners
31687                  */
31688                 destroy: function destroy() {
31689                     this.touch.destroy();
31690                     this.mouse.destroy();
31691                 }
31692             });
31693
31694             var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
31695             var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
31696
31697             // magical touchAction value
31698             var TOUCH_ACTION_COMPUTE = 'compute';
31699             var TOUCH_ACTION_AUTO = 'auto';
31700             var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
31701             var TOUCH_ACTION_NONE = 'none';
31702             var TOUCH_ACTION_PAN_X = 'pan-x';
31703             var TOUCH_ACTION_PAN_Y = 'pan-y';
31704
31705             /**
31706              * Touch Action sets the touchAction property or uses the js alternative
31707              * 
31708              * @param {Manager}
31709              *            manager
31710              * @param {String}
31711              *            value
31712              * @constructor
31713              */
31714             function TouchAction(manager, value) {
31715                 this.manager = manager;
31716                 this.set(value);
31717             }
31718
31719             TouchAction.prototype = {
31720                 /**
31721                  * set the touchAction value on the element or enable the polyfill
31722                  * 
31723                  * @param {String}
31724                  *            value
31725                  */
31726                 set: function(value) {
31727                     // find out the touch-action by the event handlers
31728                     if (value == TOUCH_ACTION_COMPUTE) {
31729                         value = this.compute();
31730                     }
31731
31732                     if (NATIVE_TOUCH_ACTION) {
31733                         this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
31734                     }
31735                     this.actions = value.toLowerCase().trim();
31736                 },
31737
31738                 /**
31739                  * just re-set the touchAction value
31740                  */
31741                 update: function() {
31742                     this.set(this.manager.options.touchAction);
31743                 },
31744
31745                 /**
31746                  * compute the value for the touchAction property based on the recognizer's
31747                  * settings
31748                  * 
31749                  * @returns {String} value
31750                  */
31751                 compute: function() {
31752                     var actions = [];
31753                     each(this.manager.recognizers, function(recognizer) {
31754                         if (boolOrFn(recognizer.options.enable, [recognizer])) {
31755                             actions = actions.concat(recognizer.getTouchAction());
31756                         }
31757                     });
31758                     return cleanTouchActions(actions.join(' '));
31759                 },
31760
31761                 /**
31762                  * this method is called on each input cycle and provides the preventing of
31763                  * the browser behavior
31764                  * 
31765                  * @param {Object}
31766                  *            input
31767                  */
31768                 preventDefaults: function(input) {
31769                     // not needed with native support for the touchAction property
31770                     if (NATIVE_TOUCH_ACTION) {
31771                         return;
31772                     }
31773
31774                     var srcEvent = input.srcEvent;
31775                     var direction = input.offsetDirection;
31776
31777                     // if the touch action did prevented once this session
31778                     if (this.manager.session.prevented) {
31779                         srcEvent.preventDefault();
31780                         return;
31781                     }
31782
31783                     var actions = this.actions;
31784                     var hasNone = inStr(actions, TOUCH_ACTION_NONE);
31785                     var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31786                     var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31787
31788                     if (hasNone ||
31789                         (hasPanY && direction & DIRECTION_HORIZONTAL) ||
31790                         (hasPanX && direction & DIRECTION_VERTICAL)) {
31791                         return this.preventSrc(srcEvent);
31792                     }
31793                 },
31794
31795                 /**
31796                  * call preventDefault to prevent the browser's default behavior (scrolling
31797                  * in most cases)
31798                  * 
31799                  * @param {Object}
31800                  *            srcEvent
31801                  */
31802                 preventSrc: function(srcEvent) {
31803                     this.manager.session.prevented = true;
31804                     srcEvent.preventDefault();
31805                 }
31806             };
31807
31808             /**
31809              * when the touchActions are collected they are not a valid value, so we need to
31810              * clean things up. *
31811              * 
31812              * @param {String}
31813              *            actions
31814              * @returns {*}
31815              */
31816             function cleanTouchActions(actions) {
31817                 // none
31818                 if (inStr(actions, TOUCH_ACTION_NONE)) {
31819                     return TOUCH_ACTION_NONE;
31820                 }
31821
31822                 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31823                 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31824
31825                 // pan-x and pan-y can be combined
31826                 if (hasPanX && hasPanY) {
31827                     return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
31828                 }
31829
31830                 // pan-x OR pan-y
31831                 if (hasPanX || hasPanY) {
31832                     return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
31833                 }
31834
31835                 // manipulation
31836                 if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
31837                     return TOUCH_ACTION_MANIPULATION;
31838                 }
31839
31840                 return TOUCH_ACTION_AUTO;
31841             }
31842
31843             /**
31844              * Recognizer flow explained; * All recognizers have the initial state of
31845              * POSSIBLE when a input session starts. The definition of a input session is
31846              * from the first input until the last input, with all it's movement in it. *
31847              * Example session for mouse-input: mousedown -> mousemove -> mouseup
31848              * 
31849              * On each recognizing cycle (see Manager.recognize) the .recognize() method is
31850              * executed which determines with state it should be.
31851              * 
31852              * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals
31853              * ENDED), it is reset to POSSIBLE to give it another change on the next cycle.
31854              * 
31855              * Possible | +-----+---------------+ | | +-----+-----+ | | | | Failed Cancelled |
31856              * +-------+------+ | | Recognized Began | Changed | Ended/Recognized
31857              */
31858             var STATE_POSSIBLE = 1;
31859             var STATE_BEGAN = 2;
31860             var STATE_CHANGED = 4;
31861             var STATE_ENDED = 8;
31862             var STATE_RECOGNIZED = STATE_ENDED;
31863             var STATE_CANCELLED = 16;
31864             var STATE_FAILED = 32;
31865
31866             /**
31867              * Recognizer Every recognizer needs to extend from this class.
31868              * 
31869              * @constructor
31870              * @param {Object}
31871              *            options
31872              */
31873             function Recognizer(options) {
31874                 this.id = uniqueId();
31875
31876                 this.manager = null;
31877                 this.options = merge(options || {}, this.defaults);
31878
31879                 // default is enable true
31880                 this.options.enable = ifUndefined(this.options.enable, true);
31881
31882                 this.state = STATE_POSSIBLE;
31883
31884                 this.simultaneous = {};
31885                 this.requireFail = [];
31886             }
31887
31888             Recognizer.prototype = {
31889                 /**
31890                  * @virtual
31891                  * @type {Object}
31892                  */
31893                 defaults: {},
31894
31895                 /**
31896                  * set options
31897                  * 
31898                  * @param {Object}
31899                  *            options
31900                  * @return {Recognizer}
31901                  */
31902                 set: function(options) {
31903                     extend(this.options, options);
31904
31905                     // also update the touchAction, in case something changed about the
31906                     // directions/enabled state
31907                     this.manager && this.manager.touchAction.update();
31908                     return this;
31909                 },
31910
31911                 /**
31912                  * recognize simultaneous with an other recognizer.
31913                  * 
31914                  * @param {Recognizer}
31915                  *            otherRecognizer
31916                  * @returns {Recognizer} this
31917                  */
31918                 recognizeWith: function(otherRecognizer) {
31919                     if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
31920                         return this;
31921                     }
31922
31923                     var simultaneous = this.simultaneous;
31924                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31925                     if (!simultaneous[otherRecognizer.id]) {
31926                         simultaneous[otherRecognizer.id] = otherRecognizer;
31927                         otherRecognizer.recognizeWith(this);
31928                     }
31929                     return this;
31930                 },
31931
31932                 /**
31933                  * drop the simultaneous link. it doesnt remove the link on the other
31934                  * recognizer.
31935                  * 
31936                  * @param {Recognizer}
31937                  *            otherRecognizer
31938                  * @returns {Recognizer} this
31939                  */
31940                 dropRecognizeWith: function(otherRecognizer) {
31941                     if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
31942                         return this;
31943                     }
31944
31945                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31946                     delete this.simultaneous[otherRecognizer.id];
31947                     return this;
31948                 },
31949
31950                 /**
31951                  * recognizer can only run when an other is failing
31952                  * 
31953                  * @param {Recognizer}
31954                  *            otherRecognizer
31955                  * @returns {Recognizer} this
31956                  */
31957                 requireFailure: function(otherRecognizer) {
31958                     if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
31959                         return this;
31960                     }
31961
31962                     var requireFail = this.requireFail;
31963                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31964                     if (inArray(requireFail, otherRecognizer) === -1) {
31965                         requireFail.push(otherRecognizer);
31966                         otherRecognizer.requireFailure(this);
31967                     }
31968                     return this;
31969                 },
31970
31971                 /**
31972                  * drop the requireFailure link. it does not remove the link on the other
31973                  * recognizer.
31974                  * 
31975                  * @param {Recognizer}
31976                  *            otherRecognizer
31977                  * @returns {Recognizer} this
31978                  */
31979                 dropRequireFailure: function(otherRecognizer) {
31980                     if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
31981                         return this;
31982                     }
31983
31984                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31985                     var index = inArray(this.requireFail, otherRecognizer);
31986                     if (index > -1) {
31987                         this.requireFail.splice(index, 1);
31988                     }
31989                     return this;
31990                 },
31991
31992                 /**
31993                  * has require failures boolean
31994                  * 
31995                  * @returns {boolean}
31996                  */
31997                 hasRequireFailures: function() {
31998                     return this.requireFail.length > 0;
31999                 },
32000
32001                 /**
32002                  * if the recognizer can recognize simultaneous with an other recognizer
32003                  * 
32004                  * @param {Recognizer}
32005                  *            otherRecognizer
32006                  * @returns {Boolean}
32007                  */
32008                 canRecognizeWith: function(otherRecognizer) {
32009                     return !!this.simultaneous[otherRecognizer.id];
32010                 },
32011
32012                 /**
32013                  * You should use `tryEmit` instead of `emit` directly to check that all the
32014                  * needed recognizers has failed before emitting.
32015                  * 
32016                  * @param {Object}
32017                  *            input
32018                  */
32019                 emit: function(input) {
32020                     var self = this;
32021                     var state = this.state;
32022
32023                     function emit(withState) {
32024                         self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
32025                     }
32026
32027                     // 'panstart' and 'panmove'
32028                     if (state < STATE_ENDED) {
32029                         emit(true);
32030                     }
32031
32032                     emit(); // simple 'eventName' events
32033
32034                     // panend and pancancel
32035                     if (state >= STATE_ENDED) {
32036                         emit(true);
32037                     }
32038                 },
32039
32040                 /**
32041                  * Check that all the require failure recognizers has failed, if true, it
32042                  * emits a gesture event, otherwise, setup the state to FAILED.
32043                  * 
32044                  * @param {Object}
32045                  *            input
32046                  */
32047                 tryEmit: function(input) {
32048                     if (this.canEmit()) {
32049                         return this.emit(input);
32050                     }
32051                     // it's failing anyway
32052                     this.state = STATE_FAILED;
32053                 },
32054
32055                 /**
32056                  * can we emit?
32057                  * 
32058                  * @returns {boolean}
32059                  */
32060                 canEmit: function() {
32061                     var i = 0;
32062                     while (i < this.requireFail.length) {
32063                         if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
32064                             return false;
32065                         }
32066                         i++;
32067                     }
32068                     return true;
32069                 },
32070
32071                 /**
32072                  * update the recognizer
32073                  * 
32074                  * @param {Object}
32075                  *            inputData
32076                  */
32077                 recognize: function(inputData) {
32078                     // make a new copy of the inputData
32079                     // so we can change the inputData without messing up the other
32080                     // recognizers
32081                     var inputDataClone = extend({}, inputData);
32082
32083                     // is is enabled and allow recognizing?
32084                     if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
32085                         this.reset();
32086                         this.state = STATE_FAILED;
32087                         return;
32088                     }
32089
32090                     // reset when we've reached the end
32091                     if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
32092                         this.state = STATE_POSSIBLE;
32093                     }
32094
32095                     this.state = this.process(inputDataClone);
32096
32097                     // the recognizer has recognized a gesture
32098                     // so trigger an event
32099                     if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
32100                         this.tryEmit(inputDataClone);
32101                     }
32102                 },
32103
32104                 /**
32105                  * return the state of the recognizer the actual recognizing happens in this
32106                  * method
32107                  * 
32108                  * @virtual
32109                  * @param {Object}
32110                  *            inputData
32111                  * @returns {Const} STATE
32112                  */
32113                 process: function(inputData) {}, // jshint ignore:line
32114
32115                 /**
32116                  * return the preferred touch-action
32117                  * 
32118                  * @virtual
32119                  * @returns {Array}
32120                  */
32121                 getTouchAction: function() {},
32122
32123                 /**
32124                  * called when the gesture isn't allowed to recognize like when another is
32125                  * being recognized or it is disabled
32126                  * 
32127                  * @virtual
32128                  */
32129                 reset: function() {}
32130             };
32131
32132             /**
32133              * get a usable string, used as event postfix
32134              * 
32135              * @param {Const}
32136              *            state
32137              * @returns {String} state
32138              */
32139             function stateStr(state) {
32140                 if (state & STATE_CANCELLED) {
32141                     return 'cancel';
32142                 } else if (state & STATE_ENDED) {
32143                     return 'end';
32144                 } else if (state & STATE_CHANGED) {
32145                     return 'move';
32146                 } else if (state & STATE_BEGAN) {
32147                     return 'start';
32148                 }
32149                 return '';
32150             }
32151
32152             /**
32153              * direction cons to string
32154              * 
32155              * @param {Const}
32156              *            direction
32157              * @returns {String}
32158              */
32159             function directionStr(direction) {
32160                 if (direction == DIRECTION_DOWN) {
32161                     return 'down';
32162                 } else if (direction == DIRECTION_UP) {
32163                     return 'up';
32164                 } else if (direction == DIRECTION_LEFT) {
32165                     return 'left';
32166                 } else if (direction == DIRECTION_RIGHT) {
32167                     return 'right';
32168                 }
32169                 return '';
32170             }
32171
32172             /**
32173              * get a recognizer by name if it is bound to a manager
32174              * 
32175              * @param {Recognizer|String}
32176              *            otherRecognizer
32177              * @param {Recognizer}
32178              *            recognizer
32179              * @returns {Recognizer}
32180              */
32181             function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
32182                 var manager = recognizer.manager;
32183                 if (manager) {
32184                     return manager.get(otherRecognizer);
32185                 }
32186                 return otherRecognizer;
32187             }
32188
32189             /**
32190              * This recognizer is just used as a base for the simple attribute recognizers.
32191              * 
32192              * @constructor
32193              * @extends Recognizer
32194              */
32195             function AttrRecognizer() {
32196                 Recognizer.apply(this, arguments);
32197             }
32198
32199             inherit(AttrRecognizer, Recognizer, {
32200                 /**
32201                  * @namespace
32202                  * @memberof AttrRecognizer
32203                  */
32204                 defaults: {
32205                     /**
32206                      * @type {Number}
32207                      * @default 1
32208                      */
32209                     pointers: 1
32210                 },
32211
32212                 /**
32213                  * Used to check if it the recognizer receives valid input, like
32214                  * input.distance > 10.
32215                  * 
32216                  * @memberof AttrRecognizer
32217                  * @param {Object}
32218                  *            input
32219                  * @returns {Boolean} recognized
32220                  */
32221                 attrTest: function(input) {
32222                     var optionPointers = this.options.pointers;
32223                     return optionPointers === 0 || input.pointers.length === optionPointers;
32224                 },
32225
32226                 /**
32227                  * Process the input and return the state for the recognizer
32228                  * 
32229                  * @memberof AttrRecognizer
32230                  * @param {Object}
32231                  *            input
32232                  * @returns {*} State
32233                  */
32234                 process: function(input) {
32235                     var state = this.state;
32236                     var eventType = input.eventType;
32237
32238                     var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
32239                     var isValid = this.attrTest(input);
32240
32241                     // on cancel input and we've recognized before, return STATE_CANCELLED
32242                     if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
32243                         return state | STATE_CANCELLED;
32244                     } else if (isRecognized || isValid) {
32245                         if (eventType & INPUT_END) {
32246                             return state | STATE_ENDED;
32247                         } else if (!(state & STATE_BEGAN)) {
32248                             return STATE_BEGAN;
32249                         }
32250                         return state | STATE_CHANGED;
32251                     }
32252                     return STATE_FAILED;
32253                 }
32254             });
32255
32256             /**
32257              * Pan Recognized when the pointer is down and moved in the allowed direction.
32258              * 
32259              * @constructor
32260              * @extends AttrRecognizer
32261              */
32262             function PanRecognizer() {
32263                 AttrRecognizer.apply(this, arguments);
32264
32265                 this.pX = null;
32266                 this.pY = null;
32267             }
32268
32269             inherit(PanRecognizer, AttrRecognizer, {
32270                 /**
32271                  * @namespace
32272                  * @memberof PanRecognizer
32273                  */
32274                 defaults: {
32275                     event: 'pan',
32276                     threshold: 10,
32277                     pointers: 1,
32278                     direction: DIRECTION_ALL
32279                 },
32280
32281                 getTouchAction: function() {
32282                     var direction = this.options.direction;
32283                     var actions = [];
32284                     if (direction & DIRECTION_HORIZONTAL) {
32285                         actions.push(TOUCH_ACTION_PAN_Y);
32286                     }
32287                     if (direction & DIRECTION_VERTICAL) {
32288                         actions.push(TOUCH_ACTION_PAN_X);
32289                     }
32290                     return actions;
32291                 },
32292
32293                 directionTest: function(input) {
32294                     var options = this.options;
32295                     var hasMoved = true;
32296                     var distance = input.distance;
32297                     var direction = input.direction;
32298                     var x = input.deltaX;
32299                     var y = input.deltaY;
32300
32301                     // lock to axis?
32302                     if (!(direction & options.direction)) {
32303                         if (options.direction & DIRECTION_HORIZONTAL) {
32304                             direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
32305                             hasMoved = x != this.pX;
32306                             distance = Math.abs(input.deltaX);
32307                         } else {
32308                             direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
32309                             hasMoved = y != this.pY;
32310                             distance = Math.abs(input.deltaY);
32311                         }
32312                     }
32313                     input.direction = direction;
32314                     return hasMoved && distance > options.threshold && direction & options.direction;
32315                 },
32316
32317                 attrTest: function(input) {
32318                     return AttrRecognizer.prototype.attrTest.call(this, input) &&
32319                         (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
32320                 },
32321
32322                 emit: function(input) {
32323                     this.pX = input.deltaX;
32324                     this.pY = input.deltaY;
32325
32326                     var direction = directionStr(input.direction);
32327                     if (direction) {
32328                         this.manager.emit(this.options.event + direction, input);
32329                     }
32330
32331                     this._super.emit.call(this, input);
32332                 }
32333             });
32334
32335             /**
32336              * Pinch Recognized when two or more pointers are moving toward (zoom-in) or
32337              * away from each other (zoom-out).
32338              * 
32339              * @constructor
32340              * @extends AttrRecognizer
32341              */
32342             function PinchRecognizer() {
32343                 AttrRecognizer.apply(this, arguments);
32344             }
32345
32346             inherit(PinchRecognizer, AttrRecognizer, {
32347                 /**
32348                  * @namespace
32349                  * @memberof PinchRecognizer
32350                  */
32351                 defaults: {
32352                     event: 'pinch',
32353                     threshold: 0,
32354                     pointers: 2
32355                 },
32356
32357                 getTouchAction: function() {
32358                     return [TOUCH_ACTION_NONE];
32359                 },
32360
32361                 attrTest: function(input) {
32362                     return this._super.attrTest.call(this, input) &&
32363                         (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
32364                 },
32365
32366                 emit: function(input) {
32367                     this._super.emit.call(this, input);
32368                     if (input.scale !== 1) {
32369                         var inOut = input.scale < 1 ? 'in' : 'out';
32370                         this.manager.emit(this.options.event + inOut, input);
32371                     }
32372                 }
32373             });
32374
32375             /**
32376              * Press Recognized when the pointer is down for x ms without any movement.
32377              * 
32378              * @constructor
32379              * @extends Recognizer
32380              */
32381             function PressRecognizer() {
32382                 Recognizer.apply(this, arguments);
32383
32384                 this._timer = null;
32385                 this._input = null;
32386             }
32387
32388             inherit(PressRecognizer, Recognizer, {
32389                 /**
32390                  * @namespace
32391                  * @memberof PressRecognizer
32392                  */
32393                 defaults: {
32394                     event: 'press',
32395                     pointers: 1,
32396                     time: 500, // minimal time of the pointer to be pressed
32397                     threshold: 5 // a minimal movement is ok, but keep it low
32398                 },
32399
32400                 getTouchAction: function() {
32401                     return [TOUCH_ACTION_AUTO];
32402                 },
32403
32404                 process: function(input) {
32405                     var options = this.options;
32406                     var validPointers = input.pointers.length === options.pointers;
32407                     var validMovement = input.distance < options.threshold;
32408                     var validTime = input.deltaTime > options.time;
32409
32410                     this._input = input;
32411
32412                     // we only allow little movement
32413                     // and we've reached an end event, so a tap is possible
32414                     if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
32415                         this.reset();
32416                     } else if (input.eventType & INPUT_START) {
32417                         this.reset();
32418                         this._timer = setTimeoutContext(function() {
32419                             this.state = STATE_RECOGNIZED;
32420                             this.tryEmit();
32421                         }, options.time, this);
32422                     } else if (input.eventType & INPUT_END) {
32423                         return STATE_RECOGNIZED;
32424                     }
32425                     return STATE_FAILED;
32426                 },
32427
32428                 reset: function() {
32429                     clearTimeout(this._timer);
32430                 },
32431
32432                 emit: function(input) {
32433                     if (this.state !== STATE_RECOGNIZED) {
32434                         return;
32435                     }
32436
32437                     if (input && (input.eventType & INPUT_END)) {
32438                         this.manager.emit(this.options.event + 'up', input);
32439                     } else {
32440                         this._input.timeStamp = now();
32441                         this.manager.emit(this.options.event, this._input);
32442                     }
32443                 }
32444             });
32445
32446             /**
32447              * Rotate Recognized when two or more pointer are moving in a circular motion.
32448              * 
32449              * @constructor
32450              * @extends AttrRecognizer
32451              */
32452             function RotateRecognizer() {
32453                 AttrRecognizer.apply(this, arguments);
32454             }
32455
32456             inherit(RotateRecognizer, AttrRecognizer, {
32457                 /**
32458                  * @namespace
32459                  * @memberof RotateRecognizer
32460                  */
32461                 defaults: {
32462                     event: 'rotate',
32463                     threshold: 0,
32464                     pointers: 2
32465                 },
32466
32467                 getTouchAction: function() {
32468                     return [TOUCH_ACTION_NONE];
32469                 },
32470
32471                 attrTest: function(input) {
32472                     return this._super.attrTest.call(this, input) &&
32473                         (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
32474                 }
32475             });
32476
32477             /**
32478              * Swipe Recognized when the pointer is moving fast (velocity), with enough
32479              * distance in the allowed direction.
32480              * 
32481              * @constructor
32482              * @extends AttrRecognizer
32483              */
32484             function SwipeRecognizer() {
32485                 AttrRecognizer.apply(this, arguments);
32486             }
32487
32488             inherit(SwipeRecognizer, AttrRecognizer, {
32489                 /**
32490                  * @namespace
32491                  * @memberof SwipeRecognizer
32492                  */
32493                 defaults: {
32494                     event: 'swipe',
32495                     threshold: 10,
32496                     velocity: 0.65,
32497                     direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
32498                     pointers: 1
32499                 },
32500
32501                 getTouchAction: function() {
32502                     return PanRecognizer.prototype.getTouchAction.call(this);
32503                 },
32504
32505                 attrTest: function(input) {
32506                     var direction = this.options.direction;
32507                     var velocity;
32508
32509                     if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
32510                         velocity = input.velocity;
32511                     } else if (direction & DIRECTION_HORIZONTAL) {
32512                         velocity = input.velocityX;
32513                     } else if (direction & DIRECTION_VERTICAL) {
32514                         velocity = input.velocityY;
32515                     }
32516
32517                     return this._super.attrTest.call(this, input) &&
32518                         direction & input.direction &&
32519                         input.distance > this.options.threshold &&
32520                         abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
32521                 },
32522
32523                 emit: function(input) {
32524                     var direction = directionStr(input.direction);
32525                     if (direction) {
32526                         this.manager.emit(this.options.event + direction, input);
32527                     }
32528
32529                     this.manager.emit(this.options.event, input);
32530                 }
32531             });
32532
32533             /**
32534              * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps
32535              * are recognized if they occur between the given interval and position. The
32536              * delay option can be used to recognize multi-taps without firing a single tap.
32537              * 
32538              * The eventData from the emitted event contains the property `tapCount`, which
32539              * contains the amount of multi-taps being recognized.
32540              * 
32541              * @constructor
32542              * @extends Recognizer
32543              */
32544             function TapRecognizer() {
32545                 Recognizer.apply(this, arguments);
32546
32547                 // previous time and center,
32548                 // used for tap counting
32549                 this.pTime = false;
32550                 this.pCenter = false;
32551
32552                 this._timer = null;
32553                 this._input = null;
32554                 this.count = 0;
32555             }
32556
32557             inherit(TapRecognizer, Recognizer, {
32558                 /**
32559                  * @namespace
32560                  * @memberof PinchRecognizer
32561                  */
32562                 defaults: {
32563                     event: 'tap',
32564                     pointers: 1,
32565                     taps: 1,
32566                     interval: 300, // max time between the multi-tap taps
32567                     time: 250, // max time of the pointer to be down (like finger on the
32568                     // screen)
32569                     threshold: 2, // a minimal movement is ok, but keep it low
32570                     posThreshold: 10 // a multi-tap can be a bit off the initial position
32571                 },
32572
32573                 getTouchAction: function() {
32574                     return [TOUCH_ACTION_MANIPULATION];
32575                 },
32576
32577                 process: function(input) {
32578                     var options = this.options;
32579
32580                     var validPointers = input.pointers.length === options.pointers;
32581                     var validMovement = input.distance < options.threshold;
32582                     var validTouchTime = input.deltaTime < options.time;
32583
32584                     this.reset();
32585
32586                     if ((input.eventType & INPUT_START) && (this.count === 0)) {
32587                         return this.failTimeout();
32588                     }
32589
32590                     // we only allow little movement
32591                     // and we've reached an end event, so a tap is possible
32592                     if (validMovement && validTouchTime && validPointers) {
32593                         if (input.eventType != INPUT_END) {
32594                             return this.failTimeout();
32595                         }
32596
32597                         var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
32598                         var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
32599
32600                         this.pTime = input.timeStamp;
32601                         this.pCenter = input.center;
32602
32603                         if (!validMultiTap || !validInterval) {
32604                             this.count = 1;
32605                         } else {
32606                             this.count += 1;
32607                         }
32608
32609                         this._input = input;
32610
32611                         // if tap count matches we have recognized it,
32612                         // else it has began recognizing...
32613                         var tapCount = this.count % options.taps;
32614                         if (tapCount === 0) {
32615                             // no failing requirements, immediately trigger the tap event
32616                             // or wait as long as the multitap interval to trigger
32617                             if (!this.hasRequireFailures()) {
32618                                 return STATE_RECOGNIZED;
32619                             } else {
32620                                 this._timer = setTimeoutContext(function() {
32621                                     this.state = STATE_RECOGNIZED;
32622                                     this.tryEmit();
32623                                 }, options.interval, this);
32624                                 return STATE_BEGAN;
32625                             }
32626                         }
32627                     }
32628                     return STATE_FAILED;
32629                 },
32630
32631                 failTimeout: function() {
32632                     this._timer = setTimeoutContext(function() {
32633                         this.state = STATE_FAILED;
32634                     }, this.options.interval, this);
32635                     return STATE_FAILED;
32636                 },
32637
32638                 reset: function() {
32639                     clearTimeout(this._timer);
32640                 },
32641
32642                 emit: function() {
32643                     if (this.state == STATE_RECOGNIZED) {
32644                         this._input.tapCount = this.count;
32645                         this.manager.emit(this.options.event, this._input);
32646                     }
32647                 }
32648             });
32649
32650             /**
32651              * Simple way to create an manager with a default set of recognizers.
32652              * 
32653              * @param {HTMLElement}
32654              *            element
32655              * @param {Object}
32656              *            [options]
32657              * @constructor
32658              */
32659             function Hammer(element, options) {
32660                 options = options || {};
32661                 options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
32662                 return new Manager(element, options);
32663             }
32664
32665             /**
32666              * @const {string}
32667              */
32668             Hammer.VERSION = '2.0.4';
32669
32670             /**
32671              * default settings
32672              * 
32673              * @namespace
32674              */
32675             Hammer.defaults = {
32676                 /**
32677                  * set if DOM events are being triggered. But this is slower and unused by
32678                  * simple implementations, so disabled by default.
32679                  * 
32680                  * @type {Boolean}
32681                  * @default false
32682                  */
32683                 domEvents: false,
32684
32685                 /**
32686                  * The value for the touchAction property/fallback. When set to `compute` it
32687                  * will magically set the correct value based on the added recognizers.
32688                  * 
32689                  * @type {String}
32690                  * @default compute
32691                  */
32692                 touchAction: TOUCH_ACTION_COMPUTE,
32693
32694                 /**
32695                  * @type {Boolean}
32696                  * @default true
32697                  */
32698                 enable: true,
32699
32700                 /**
32701                  * EXPERIMENTAL FEATURE -- can be removed/changed Change the parent input
32702                  * target element. If Null, then it is being set the to main element.
32703                  * 
32704                  * @type {Null|EventTarget}
32705                  * @default null
32706                  */
32707                 inputTarget: null,
32708
32709                 /**
32710                  * force an input class
32711                  * 
32712                  * @type {Null|Function}
32713                  * @default null
32714                  */
32715                 inputClass: null,
32716
32717                 /**
32718                  * Default recognizer setup when calling `Hammer()` When creating a new
32719                  * Manager these will be skipped.
32720                  * 
32721                  * @type {Array}
32722                  */
32723                 preset: [
32724                     // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
32725                     [RotateRecognizer, {
32726                         enable: false
32727                     }],
32728                     [PinchRecognizer, {
32729                             enable: false
32730                         },
32731                         ['rotate']
32732                     ],
32733                     [SwipeRecognizer, {
32734                         direction: DIRECTION_HORIZONTAL
32735                     }],
32736                     [PanRecognizer, {
32737                             direction: DIRECTION_HORIZONTAL
32738                         },
32739                         ['swipe']
32740                     ],
32741                     [TapRecognizer],
32742                     [TapRecognizer, {
32743                             event: 'doubletap',
32744                             taps: 2
32745                         },
32746                         ['tap']
32747                     ],
32748                     [PressRecognizer]
32749                 ],
32750
32751                 /**
32752                  * Some CSS properties can be used to improve the working of Hammer. Add
32753                  * them to this method and they will be set when creating a new Manager.
32754                  * 
32755                  * @namespace
32756                  */
32757                 cssProps: {
32758                     /**
32759                      * Disables text selection to improve the dragging gesture. Mainly for
32760                      * desktop browsers.
32761                      * 
32762                      * @type {String}
32763                      * @default 'none'
32764                      */
32765                     userSelect: 'none',
32766
32767                     /**
32768                      * Disable the Windows Phone grippers when pressing an element.
32769                      * 
32770                      * @type {String}
32771                      * @default 'none'
32772                      */
32773                     touchSelect: 'none',
32774
32775                     /**
32776                      * Disables the default callout shown when you touch and hold a touch
32777                      * target. On iOS, when you touch and hold a touch target such as a
32778                      * link, Safari displays a callout containing information about the
32779                      * link. This property allows you to disable that callout.
32780                      * 
32781                      * @type {String}
32782                      * @default 'none'
32783                      */
32784                     touchCallout: 'none',
32785
32786                     /**
32787                      * Specifies whether zooming is enabled. Used by IE10>
32788                      * 
32789                      * @type {String}
32790                      * @default 'none'
32791                      */
32792                     contentZooming: 'none',
32793
32794                     /**
32795                      * Specifies that an entire element should be draggable instead of its
32796                      * contents. Mainly for desktop browsers.
32797                      * 
32798                      * @type {String}
32799                      * @default 'none'
32800                      */
32801                     userDrag: 'none',
32802
32803                     /**
32804                      * Overrides the highlight color shown when the user taps a link or a
32805                      * JavaScript clickable element in iOS. This property obeys the alpha
32806                      * value, if specified.
32807                      * 
32808                      * @type {String}
32809                      * @default 'rgba(0,0,0,0)'
32810                      */
32811                     tapHighlightColor: 'rgba(0,0,0,0)'
32812                 }
32813             };
32814
32815             var STOP = 1;
32816             var FORCED_STOP = 2;
32817
32818             /**
32819              * Manager
32820              * 
32821              * @param {HTMLElement}
32822              *            element
32823              * @param {Object}
32824              *            [options]
32825              * @constructor
32826              */
32827             function Manager(element, options) {
32828                 options = options || {};
32829
32830                 this.options = merge(options, Hammer.defaults);
32831                 this.options.inputTarget = this.options.inputTarget || element;
32832
32833                 this.handlers = {};
32834                 this.session = {};
32835                 this.recognizers = [];
32836
32837                 this.element = element;
32838                 this.input = createInputInstance(this);
32839                 this.touchAction = new TouchAction(this, this.options.touchAction);
32840
32841                 toggleCssProps(this, true);
32842
32843                 each(options.recognizers, function(item) {
32844                     var recognizer = this.add(new(item[0])(item[1]));
32845                     item[2] && recognizer.recognizeWith(item[2]);
32846                     item[3] && recognizer.requireFailure(item[3]);
32847                 }, this);
32848             }
32849
32850             Manager.prototype = {
32851                 /**
32852                  * set options
32853                  * 
32854                  * @param {Object}
32855                  *            options
32856                  * @returns {Manager}
32857                  */
32858                 set: function(options) {
32859                     extend(this.options, options);
32860
32861                     // Options that need a little more setup
32862                     if (options.touchAction) {
32863                         this.touchAction.update();
32864                     }
32865                     if (options.inputTarget) {
32866                         // Clean up existing event listeners and reinitialize
32867                         this.input.destroy();
32868                         this.input.target = options.inputTarget;
32869                         this.input.init();
32870                     }
32871                     return this;
32872                 },
32873
32874                 /**
32875                  * stop recognizing for this session. This session will be discarded, when a
32876                  * new [input]start event is fired. When forced, the recognizer cycle is
32877                  * stopped immediately.
32878                  * 
32879                  * @param {Boolean}
32880                  *            [force]
32881                  */
32882                 stop: function(force) {
32883                     this.session.stopped = force ? FORCED_STOP : STOP;
32884                 },
32885
32886                 /**
32887                  * run the recognizers! called by the inputHandler function on every
32888                  * movement of the pointers (touches) it walks through all the recognizers
32889                  * and tries to detect the gesture that is being made
32890                  * 
32891                  * @param {Object}
32892                  *            inputData
32893                  */
32894                 recognize: function(inputData) {
32895                     var session = this.session;
32896                     if (session.stopped) {
32897                         return;
32898                     }
32899
32900                     // run the touch-action polyfill
32901                     this.touchAction.preventDefaults(inputData);
32902
32903                     var recognizer;
32904                     var recognizers = this.recognizers;
32905
32906                     // this holds the recognizer that is being recognized.
32907                     // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or
32908                     // RECOGNIZED
32909                     // if no recognizer is detecting a thing, it is set to `null`
32910                     var curRecognizer = session.curRecognizer;
32911
32912                     // reset when the last recognizer is recognized
32913                     // or when we're in a new session
32914                     if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
32915                         curRecognizer = session.curRecognizer = null;
32916                     }
32917
32918                     var i = 0;
32919                     while (i < recognizers.length) {
32920                         recognizer = recognizers[i];
32921
32922                         // find out if we are allowed try to recognize the input for this
32923                         // one.
32924                         // 1. allow if the session is NOT forced stopped (see the .stop()
32925                         // method)
32926                         // 2. allow if we still haven't recognized a gesture in this
32927                         // session, or the this recognizer is the one
32928                         // that is being recognized.
32929                         // 3. allow if the recognizer is allowed to run simultaneous with
32930                         // the current recognized recognizer.
32931                         // this can be setup with the `recognizeWith()` method on the
32932                         // recognizer.
32933                         if (session.stopped !== FORCED_STOP && ( // 1
32934                                 !curRecognizer || recognizer == curRecognizer || // 2
32935                                 recognizer.canRecognizeWith(curRecognizer))) { // 3
32936                             recognizer.recognize(inputData);
32937                         } else {
32938                             recognizer.reset();
32939                         }
32940
32941                         // if the recognizer has been recognizing the input as a valid
32942                         // gesture, we want to store this one as the
32943                         // current active recognizer. but only if we don't already have an
32944                         // active recognizer
32945                         if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
32946                             curRecognizer = session.curRecognizer = recognizer;
32947                         }
32948                         i++;
32949                     }
32950                 },
32951
32952                 /**
32953                  * get a recognizer by its event name.
32954                  * 
32955                  * @param {Recognizer|String}
32956                  *            recognizer
32957                  * @returns {Recognizer|Null}
32958                  */
32959                 get: function(recognizer) {
32960                     if (recognizer instanceof Recognizer) {
32961                         return recognizer;
32962                     }
32963
32964                     var recognizers = this.recognizers;
32965                     for (var i = 0; i < recognizers.length; i++) {
32966                         if (recognizers[i].options.event == recognizer) {
32967                             return recognizers[i];
32968                         }
32969                     }
32970                     return null;
32971                 },
32972
32973                 /**
32974                  * add a recognizer to the manager existing recognizers with the same event
32975                  * name will be removed
32976                  * 
32977                  * @param {Recognizer}
32978                  *            recognizer
32979                  * @returns {Recognizer|Manager}
32980                  */
32981                 add: function(recognizer) {
32982                     if (invokeArrayArg(recognizer, 'add', this)) {
32983                         return this;
32984                     }
32985
32986                     // remove existing
32987                     var existing = this.get(recognizer.options.event);
32988                     if (existing) {
32989                         this.remove(existing);
32990                     }
32991
32992                     this.recognizers.push(recognizer);
32993                     recognizer.manager = this;
32994
32995                     this.touchAction.update();
32996                     return recognizer;
32997                 },
32998
32999                 /**
33000                  * remove a recognizer by name or instance
33001                  * 
33002                  * @param {Recognizer|String}
33003                  *            recognizer
33004                  * @returns {Manager}
33005                  */
33006                 remove: function(recognizer) {
33007                     if (invokeArrayArg(recognizer, 'remove', this)) {
33008                         return this;
33009                     }
33010
33011                     var recognizers = this.recognizers;
33012                     recognizer = this.get(recognizer);
33013                     recognizers.splice(inArray(recognizers, recognizer), 1);
33014
33015                     this.touchAction.update();
33016                     return this;
33017                 },
33018
33019                 /**
33020                  * bind event
33021                  * 
33022                  * @param {String}
33023                  *            events
33024                  * @param {Function}
33025                  *            handler
33026                  * @returns {EventEmitter} this
33027                  */
33028                 on: function(events, handler) {
33029                     var handlers = this.handlers;
33030                     each(splitStr(events), function(event) {
33031                         handlers[event] = handlers[event] || [];
33032                         handlers[event].push(handler);
33033                     });
33034                     return this;
33035                 },
33036
33037                 /**
33038                  * unbind event, leave emit blank to remove all handlers
33039                  * 
33040                  * @param {String}
33041                  *            events
33042                  * @param {Function}
33043                  *            [handler]
33044                  * @returns {EventEmitter} this
33045                  */
33046                 off: function(events, handler) {
33047                     var handlers = this.handlers;
33048                     each(splitStr(events), function(event) {
33049                         if (!handler) {
33050                             delete handlers[event];
33051                         } else {
33052                             handlers[event].splice(inArray(handlers[event], handler), 1);
33053                         }
33054                     });
33055                     return this;
33056                 },
33057
33058                 /**
33059                  * emit event to the listeners
33060                  * 
33061                  * @param {String}
33062                  *            event
33063                  * @param {Object}
33064                  *            data
33065                  */
33066                 emit: function(event, data) {
33067                     // we also want to trigger dom events
33068                     if (this.options.domEvents) {
33069                         triggerDomEvent(event, data);
33070                     }
33071
33072                     // no handlers, so skip it all
33073                     var handlers = this.handlers[event] && this.handlers[event].slice();
33074                     if (!handlers || !handlers.length) {
33075                         return;
33076                     }
33077
33078                     data.type = event;
33079                     data.preventDefault = function() {
33080                         data.srcEvent.preventDefault();
33081                     };
33082
33083                     var i = 0;
33084                     while (i < handlers.length) {
33085                         handlers[i](data);
33086                         i++;
33087                     }
33088                 },
33089
33090                 /**
33091                  * destroy the manager and unbinds all events it doesn't unbind dom events,
33092                  * that is the user own responsibility
33093                  */
33094                 destroy: function() {
33095                     this.element && toggleCssProps(this, false);
33096
33097                     this.handlers = {};
33098                     this.session = {};
33099                     this.input.destroy();
33100                     this.element = null;
33101                 }
33102             };
33103
33104             /**
33105              * add/remove the css properties as defined in manager.options.cssProps
33106              * 
33107              * @param {Manager}
33108              *            manager
33109              * @param {Boolean}
33110              *            add
33111              */
33112             function toggleCssProps(manager, add) {
33113                 var element = manager.element;
33114                 each(manager.options.cssProps, function(value, name) {
33115                     element.style[prefixed(element.style, name)] = add ? value : '';
33116                 });
33117             }
33118
33119             /**
33120              * trigger dom event
33121              * 
33122              * @param {String}
33123              *            event
33124              * @param {Object}
33125              *            data
33126              */
33127             function triggerDomEvent(event, data) {
33128                 var gestureEvent = document.createEvent('Event');
33129                 gestureEvent.initEvent(event, true, true);
33130                 gestureEvent.gesture = data;
33131                 data.target.dispatchEvent(gestureEvent);
33132             }
33133
33134             extend(Hammer, {
33135                 INPUT_START: INPUT_START,
33136                 INPUT_MOVE: INPUT_MOVE,
33137                 INPUT_END: INPUT_END,
33138                 INPUT_CANCEL: INPUT_CANCEL,
33139
33140                 STATE_POSSIBLE: STATE_POSSIBLE,
33141                 STATE_BEGAN: STATE_BEGAN,
33142                 STATE_CHANGED: STATE_CHANGED,
33143                 STATE_ENDED: STATE_ENDED,
33144                 STATE_RECOGNIZED: STATE_RECOGNIZED,
33145                 STATE_CANCELLED: STATE_CANCELLED,
33146                 STATE_FAILED: STATE_FAILED,
33147
33148                 DIRECTION_NONE: DIRECTION_NONE,
33149                 DIRECTION_LEFT: DIRECTION_LEFT,
33150                 DIRECTION_RIGHT: DIRECTION_RIGHT,
33151                 DIRECTION_UP: DIRECTION_UP,
33152                 DIRECTION_DOWN: DIRECTION_DOWN,
33153                 DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
33154                 DIRECTION_VERTICAL: DIRECTION_VERTICAL,
33155                 DIRECTION_ALL: DIRECTION_ALL,
33156
33157                 Manager: Manager,
33158                 Input: Input,
33159                 TouchAction: TouchAction,
33160
33161                 TouchInput: TouchInput,
33162                 MouseInput: MouseInput,
33163                 PointerEventInput: PointerEventInput,
33164                 TouchMouseInput: TouchMouseInput,
33165                 SingleTouchInput: SingleTouchInput,
33166
33167                 Recognizer: Recognizer,
33168                 AttrRecognizer: AttrRecognizer,
33169                 Tap: TapRecognizer,
33170                 Pan: PanRecognizer,
33171                 Swipe: SwipeRecognizer,
33172                 Pinch: PinchRecognizer,
33173                 Rotate: RotateRecognizer,
33174                 Press: PressRecognizer,
33175
33176                 on: addEventListeners,
33177                 off: removeEventListeners,
33178                 each: each,
33179                 merge: merge,
33180                 extend: extend,
33181                 inherit: inherit,
33182                 bindFn: bindFn,
33183                 prefixed: prefixed
33184             });
33185
33186             if (typeof define == TYPE_FUNCTION && define.amd) {
33187                 define(function() {
33188                     return Hammer;
33189                 });
33190             } else if (typeof module != 'undefined' && module.exports) {
33191                 module.exports = Hammer;
33192             } else {
33193                 window[exportName] = Hammer;
33194             }
33195
33196         })(window, document, 'Hammer');
33197
33198     }, {}],
33199     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
33200         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"][0].apply(exports, arguments)
33201     }, {}],
33202     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js": [function(require, module, exports) {
33203         /**
33204          * Set attribute `name` to `val`, or get attr `name`.
33205          * 
33206          * @param {Element}
33207          *            el
33208          * @param {String}
33209          *            name
33210          * @param {String}
33211          *            [val]
33212          * @api public
33213          */
33214
33215         module.exports = function(el, name, val) {
33216             // get
33217             if (arguments.length == 2) {
33218                 return el.getAttribute(name);
33219             }
33220
33221             // remove
33222             if (val === null) {
33223                 return el.removeAttribute(name);
33224             }
33225
33226             // set
33227             el.setAttribute(name, val);
33228
33229             return el;
33230         };
33231     }, {}],
33232     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js": [function(require, module, exports) {
33233         module.exports = require('component-classes');
33234     }, {
33235         "component-classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js"
33236     }],
33237     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js": [function(require, module, exports) {
33238         module.exports = function(el) {
33239
33240             var c;
33241
33242             while (el.childNodes.length) {
33243                 c = el.childNodes[0];
33244                 el.removeChild(c);
33245             }
33246
33247             return el;
33248         };
33249     }, {}],
33250     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js": [function(require, module, exports) {
33251         module.exports = require('component-closest');
33252     }, {
33253         "component-closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js"
33254     }],
33255     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js": [function(require, module, exports) {
33256         module.exports = require('component-delegate');
33257     }, {
33258         "component-delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js"
33259     }],
33260     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
33261         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js"][0].apply(exports, arguments)
33262     }, {
33263         "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
33264     }],
33265     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
33266         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js"][0].apply(exports, arguments)
33267     }, {
33268         "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33269     }],
33270     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js": [function(require, module, exports) {
33271         module.exports = require('component-matches-selector');
33272     }, {
33273         "component-matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33274     }],
33275     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
33276         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js"][0].apply(exports, arguments)
33277     }, {
33278         "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33279     }],
33280     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
33281         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"][0].apply(exports, arguments)
33282     }, {}],
33283     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js": [function(require, module, exports) {
33284         /**
33285          * Module dependencies.
33286          */
33287
33288         var index = require('indexof');
33289
33290         /**
33291          * Whitespace regexp.
33292          */
33293
33294         var re = /\s+/;
33295
33296         /**
33297          * toString reference.
33298          */
33299
33300         var toString = Object.prototype.toString;
33301
33302         /**
33303          * Wrap `el` in a `ClassList`.
33304          * 
33305          * @param {Element}
33306          *            el
33307          * @return {ClassList}
33308          * @api public
33309          */
33310
33311         module.exports = function(el) {
33312             return new ClassList(el);
33313         };
33314
33315         /**
33316          * Initialize a new ClassList for `el`.
33317          * 
33318          * @param {Element}
33319          *            el
33320          * @api private
33321          */
33322
33323         function ClassList(el) {
33324             if (!el || !el.nodeType) {
33325                 throw new Error('A DOM element reference is required');
33326             }
33327             this.el = el;
33328             this.list = el.classList;
33329         }
33330
33331         /**
33332          * Add class `name` if not already present.
33333          * 
33334          * @param {String}
33335          *            name
33336          * @return {ClassList}
33337          * @api public
33338          */
33339
33340         ClassList.prototype.add = function(name) {
33341             // classList
33342             if (this.list) {
33343                 this.list.add(name);
33344                 return this;
33345             }
33346
33347             // fallback
33348             var arr = this.array();
33349             var i = index(arr, name);
33350             if (!~i) arr.push(name);
33351             this.el.className = arr.join(' ');
33352             return this;
33353         };
33354
33355         /**
33356          * Remove class `name` when present, or pass a regular expression to remove any
33357          * which match.
33358          * 
33359          * @param {String|RegExp}
33360          *            name
33361          * @return {ClassList}
33362          * @api public
33363          */
33364
33365         ClassList.prototype.remove = function(name) {
33366             if ('[object RegExp]' == toString.call(name)) {
33367                 return this.removeMatching(name);
33368             }
33369
33370             // classList
33371             if (this.list) {
33372                 this.list.remove(name);
33373                 return this;
33374             }
33375
33376             // fallback
33377             var arr = this.array();
33378             var i = index(arr, name);
33379             if (~i) arr.splice(i, 1);
33380             this.el.className = arr.join(' ');
33381             return this;
33382         };
33383
33384         /**
33385          * Remove all classes matching `re`.
33386          * 
33387          * @param {RegExp}
33388          *            re
33389          * @return {ClassList}
33390          * @api private
33391          */
33392
33393         ClassList.prototype.removeMatching = function(re) {
33394             var arr = this.array();
33395             for (var i = 0; i < arr.length; i++) {
33396                 if (re.test(arr[i])) {
33397                     this.remove(arr[i]);
33398                 }
33399             }
33400             return this;
33401         };
33402
33403         /**
33404          * Toggle class `name`, can force state via `force`.
33405          * 
33406          * For browsers that support classList, but do not support `force` yet, the
33407          * mistake will be detected and corrected.
33408          * 
33409          * @param {String}
33410          *            name
33411          * @param {Boolean}
33412          *            force
33413          * @return {ClassList}
33414          * @api public
33415          */
33416
33417         ClassList.prototype.toggle = function(name, force) {
33418             // classList
33419             if (this.list) {
33420                 if ("undefined" !== typeof force) {
33421                     if (force !== this.list.toggle(name, force)) {
33422                         this.list.toggle(name); // toggle again to correct
33423                     }
33424                 } else {
33425                     this.list.toggle(name);
33426                 }
33427                 return this;
33428             }
33429
33430             // fallback
33431             if ("undefined" !== typeof force) {
33432                 if (!force) {
33433                     this.remove(name);
33434                 } else {
33435                     this.add(name);
33436                 }
33437             } else {
33438                 if (this.has(name)) {
33439                     this.remove(name);
33440                 } else {
33441                     this.add(name);
33442                 }
33443             }
33444
33445             return this;
33446         };
33447
33448         /**
33449          * Return an array of classes.
33450          * 
33451          * @return {Array}
33452          * @api public
33453          */
33454
33455         ClassList.prototype.array = function() {
33456             var className = this.el.getAttribute('class') || '';
33457             var str = className.replace(/^\s+|\s+$/g, '');
33458             var arr = str.split(re);
33459             if ('' === arr[0]) arr.shift();
33460             return arr;
33461         };
33462
33463         /**
33464          * Check if class `name` is present.
33465          * 
33466          * @param {String}
33467          *            name
33468          * @return {ClassList}
33469          * @api public
33470          */
33471
33472         ClassList.prototype.has =
33473             ClassList.prototype.contains = function(name) {
33474                 return this.list ? this.list.contains(name) : !!~index(this.array(), name);
33475             };
33476
33477     }, {
33478         "indexof": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js"
33479     }],
33480     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js": [function(require, module, exports) {
33481         module.exports = function(arr, obj) {
33482             if (arr.indexOf) return arr.indexOf(obj);
33483             for (var i = 0; i < arr.length; ++i) {
33484                 if (arr[i] === obj) return i;
33485             }
33486             return -1;
33487         };
33488     }, {}],
33489     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js": [function(require, module, exports) {
33490         var matches = require('matches-selector')
33491
33492         module.exports = function(element, selector, checkYoSelf, root) {
33493             element = checkYoSelf ? {
33494                 parentNode: element
33495             } : element
33496
33497             root = root || document
33498
33499             // Make sure `element !== document` and `element != null`
33500             // otherwise we get an illegal invocation
33501             while ((element = element.parentNode) && element !== document) {
33502                 if (matches(element, selector))
33503                     return element
33504                         // After `matches` on the edge case that
33505                         // the selector matches the root
33506                         // (when the root is not the document)
33507                 if (element === root)
33508                     return
33509             }
33510         }
33511
33512     }, {
33513         "matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33514     }],
33515     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js": [function(require, module, exports) {
33516         /**
33517          * Module dependencies.
33518          */
33519
33520         var closest = require('closest'),
33521             event = require('event');
33522
33523         /**
33524          * Delegate event `type` to `selector` and invoke `fn(e)`. A callback function
33525          * is returned which may be passed to `.unbind()`.
33526          * 
33527          * @param {Element}
33528          *            el
33529          * @param {String}
33530          *            selector
33531          * @param {String}
33532          *            type
33533          * @param {Function}
33534          *            fn
33535          * @param {Boolean}
33536          *            capture
33537          * @return {Function}
33538          * @api public
33539          */
33540
33541         exports.bind = function(el, selector, type, fn, capture) {
33542             return event.bind(el, type, function(e) {
33543                 var target = e.target || e.srcElement;
33544                 e.delegateTarget = closest(target, selector, true, el);
33545                 if (e.delegateTarget) fn.call(el, e);
33546             }, capture);
33547         };
33548
33549         /**
33550          * Unbind event `type`'s callback `fn`.
33551          * 
33552          * @param {Element}
33553          *            el
33554          * @param {String}
33555          *            type
33556          * @param {Function}
33557          *            fn
33558          * @param {Boolean}
33559          *            capture
33560          * @api public
33561          */
33562
33563         exports.unbind = function(el, type, fn, capture) {
33564             event.unbind(el, type, fn, capture);
33565         };
33566
33567     }, {
33568         "closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js",
33569         "event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33570     }],
33571     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
33572         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"][0].apply(exports, arguments)
33573     }, {}],
33574     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js": [function(require, module, exports) {
33575         /**
33576          * Module dependencies.
33577          */
33578
33579         var query = require('query');
33580
33581         /**
33582          * Element prototype.
33583          */
33584
33585         var proto = Element.prototype;
33586
33587         /**
33588          * Vendor function.
33589          */
33590
33591         var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;
33592
33593         /**
33594          * Expose `match()`.
33595          */
33596
33597         module.exports = match;
33598
33599         /**
33600          * Match `el` to `selector`.
33601          * 
33602          * @param {Element}
33603          *            el
33604          * @param {String}
33605          *            selector
33606          * @return {Boolean}
33607          * @api public
33608          */
33609
33610         function match(el, selector) {
33611             if (!el || el.nodeType !== 1) return false;
33612             if (vendor) return vendor.call(el, selector);
33613             var nodes = query.all(selector, el.parentNode);
33614             for (var i = 0; i < nodes.length; ++i) {
33615                 if (nodes[i] == el) return true;
33616             }
33617             return false;
33618         }
33619
33620     }, {
33621         "query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33622     }],
33623     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
33624         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"][0].apply(exports, arguments)
33625     }, {}],
33626     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
33627         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"][0].apply(exports, arguments)
33628     }, {}],
33629     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
33630         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"][0].apply(exports, arguments)
33631     }, {
33632         "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js",
33633         "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js"
33634     }],
33635     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
33636         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"][0].apply(exports, arguments)
33637     }, {}],
33638     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
33639         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"][0].apply(exports, arguments)
33640     }, {
33641         "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js"
33642     }],
33643     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js": [function(require, module, exports) {
33644         // Snap.svg 0.3.0
33645         // 
33646         // Copyright (c) 2013 ÃƒÆ’¢â‚¬â€œ 2014 Adobe Systems Incorporated. All rights
33647         // reserved.
33648         // 
33649         // Licensed under the Apache License, Version 2.0 (the "License");
33650         // you may not use this file except in compliance with the License.
33651         // You may obtain a copy of the License at
33652         // 
33653         // http://www.apache.org/licenses/LICENSE-2.0
33654         // 
33655         // Unless required by applicable law or agreed to in writing, software
33656         // distributed under the License is distributed on an "AS IS" BASIS,
33657         // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33658         // See the License for the specific language governing permissions and
33659         // limitations under the License.
33660         // 
33661         // build: 2014-09-08
33662
33663         (function(glob, factory) {
33664             // AMD support
33665             if (typeof define === "function" && define.amd) {
33666                 // Define as an anonymous module
33667                 define(["eve"], function(eve) {
33668                     return factory(glob, eve);
33669                 });
33670             } else if (typeof exports !== 'undefined') {
33671                 // Next for Node.js or CommonJS
33672                 var eve = require('eve');
33673                 module.exports = factory(glob, eve);
33674             } else {
33675                 // Browser globals (glob is window)
33676                 // Snap adds itself to window
33677                 factory(glob, glob.eve);
33678             }
33679         }(window || this, function(window, eve) {
33680
33681             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33682             // 
33683             // Licensed under the Apache License, Version 2.0 (the "License");
33684             // you may not use this file except in compliance with the License.
33685             // You may obtain a copy of the License at
33686             // 
33687             // http://www.apache.org/licenses/LICENSE-2.0
33688             // 
33689             // Unless required by applicable law or agreed to in writing, software
33690             // distributed under the License is distributed on an "AS IS" BASIS,
33691             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33692             // See the License for the specific language governing permissions and
33693             // limitations under the License.
33694             var mina = (function(eve) {
33695                 var animations = {},
33696                     requestAnimFrame = window.requestAnimationFrame ||
33697                     window.webkitRequestAnimationFrame ||
33698                     window.mozRequestAnimationFrame ||
33699                     window.oRequestAnimationFrame ||
33700                     window.msRequestAnimationFrame ||
33701                     function(callback) {
33702                         setTimeout(callback, 16);
33703                     },
33704                     isArray = Array.isArray || function(a) {
33705                         return a instanceof Array ||
33706                             Object.prototype.toString.call(a) == "[object Array]";
33707                     },
33708                     idgen = 0,
33709                     idprefix = "M" + (+new Date).toString(36),
33710                     ID = function() {
33711                         return idprefix + (idgen++).toString(36);
33712                     },
33713                     diff = function(a, b, A, B) {
33714                         if (isArray(a)) {
33715                             res = [];
33716                             for (var i = 0, ii = a.length; i < ii; i++) {
33717                                 res[i] = diff(a[i], b, A[i], B);
33718                             }
33719                             return res;
33720                         }
33721                         var dif = (A - a) / (B - b);
33722                         return function(bb) {
33723                             return a + dif * (bb - b);
33724                         };
33725                     },
33726                     timer = Date.now || function() {
33727                         return +new Date;
33728                     },
33729                     sta = function(val) {
33730                         var a = this;
33731                         if (val == null) {
33732                             return a.s;
33733                         }
33734                         var ds = a.s - val;
33735                         a.b += a.dur * ds;
33736                         a.B += a.dur * ds;
33737                         a.s = val;
33738                     },
33739                     speed = function(val) {
33740                         var a = this;
33741                         if (val == null) {
33742                             return a.spd;
33743                         }
33744                         a.spd = val;
33745                     },
33746                     duration = function(val) {
33747                         var a = this;
33748                         if (val == null) {
33749                             return a.dur;
33750                         }
33751                         a.s = a.s * val / a.dur;
33752                         a.dur = val;
33753                     },
33754                     stopit = function() {
33755                         var a = this;
33756                         delete animations[a.id];
33757                         a.update();
33758                         eve("mina.stop." + a.id, a);
33759                     },
33760                     pause = function() {
33761                         var a = this;
33762                         if (a.pdif) {
33763                             return;
33764                         }
33765                         delete animations[a.id];
33766                         a.update();
33767                         a.pdif = a.get() - a.b;
33768                     },
33769                     resume = function() {
33770                         var a = this;
33771                         if (!a.pdif) {
33772                             return;
33773                         }
33774                         a.b = a.get() - a.pdif;
33775                         delete a.pdif;
33776                         animations[a.id] = a;
33777                     },
33778                     update = function() {
33779                         var a = this,
33780                             res;
33781                         if (isArray(a.start)) {
33782                             res = [];
33783                             for (var j = 0, jj = a.start.length; j < jj; j++) {
33784                                 res[j] = +a.start[j] +
33785                                     (a.end[j] - a.start[j]) * a.easing(a.s);
33786                             }
33787                         } else {
33788                             res = +a.start + (a.end - a.start) * a.easing(a.s);
33789                         }
33790                         a.set(res);
33791                     },
33792                     frame = function() {
33793                         var len = 0;
33794                         for (var i in animations)
33795                             if (animations.hasOwnProperty(i)) {
33796                                 var a = animations[i],
33797                                     b = a.get(),
33798                                     res;
33799                                 len++;
33800                                 a.s = (b - a.b) / (a.dur / a.spd);
33801                                 if (a.s >= 1) {
33802                                     delete animations[i];
33803                                     a.s = 1;
33804                                     len--;
33805                                     (function(a) {
33806                                         setTimeout(function() {
33807                                             eve("mina.finish." + a.id, a);
33808                                         });
33809                                     }(a));
33810                                 }
33811                                 a.update();
33812                             }
33813                         len && requestAnimFrame(frame);
33814                     },
33815                     /*
33816                      * \ mina [ method ] * Generic animation of numbers * - a (number) start
33817                      * _slave_ number - A (number) end _slave_ number - b (number) start
33818                      * _master_ number (start time in general case) - B (number) end _master_
33819                      * number (end time in gereal case) - get (function) getter of _master_
33820                      * number (see @mina.time) - set (function) setter of _slave_ number -
33821                      * easing (function) #optional easing function, default is @mina.linear =
33822                      * (object) animation descriptor o { o id (string) animation id, o start
33823                      * (number) start _slave_ number, o end (number) end _slave_ number, o b
33824                      * (number) start _master_ number, o s (number) animation status (0..1), o
33825                      * dur (number) animation duration, o spd (number) animation speed, o get
33826                      * (function) getter of _master_ number (see @mina.time), o set (function)
33827                      * setter of _slave_ number, o easing (function) easing function, default is
33828                      * @mina.linear, o status (function) status getter/setter, o speed
33829                      * (function) speed getter/setter, o duration (function) duration
33830                      * getter/setter, o stop (function) animation stopper o pause (function)
33831                      * pauses the animation o resume (function) resumes the animation o update
33832                      * (function) calles setter with the right value of the animation o } \
33833                      */
33834                     mina = function(a, A, b, B, get, set, easing) {
33835                         var anim = {
33836                             id: ID(),
33837                             start: a,
33838                             end: A,
33839                             b: b,
33840                             s: 0,
33841                             dur: B - b,
33842                             spd: 1,
33843                             get: get,
33844                             set: set,
33845                             easing: easing || mina.linear,
33846                             status: sta,
33847                             speed: speed,
33848                             duration: duration,
33849                             stop: stopit,
33850                             pause: pause,
33851                             resume: resume,
33852                             update: update
33853                         };
33854                         animations[anim.id] = anim;
33855                         var len = 0,
33856                             i;
33857                         for (i in animations)
33858                             if (animations.hasOwnProperty(i)) {
33859                                 len++;
33860                                 if (len == 2) {
33861                                     break;
33862                                 }
33863                             }
33864                         len == 1 && requestAnimFrame(frame);
33865                         return anim;
33866                     };
33867                 /*
33868                  * \ mina.time [ method ] * Returns the current time. Equivalent to: |
33869                  * function () { | return (new Date).getTime(); | } \
33870                  */
33871                 mina.time = timer;
33872                 /*
33873                  * \ mina.getById [ method ] * Returns an animation by its id - id (string)
33874                  * animation's id = (object) See @mina \
33875                  */
33876                 mina.getById = function(id) {
33877                     return animations[id] || null;
33878                 };
33879
33880                 /*
33881                  * \ mina.linear [ method ] * Default linear easing - n (number) input 0..1 =
33882                  * (number) output 0..1 \
33883                  */
33884                 mina.linear = function(n) {
33885                     return n;
33886                 };
33887                 /*
33888                  * \ mina.easeout [ method ] * Easeout easing - n (number) input 0..1 =
33889                  * (number) output 0..1 \
33890                  */
33891                 mina.easeout = function(n) {
33892                     return Math.pow(n, 1.7);
33893                 };
33894                 /*
33895                  * \ mina.easein [ method ] * Easein easing - n (number) input 0..1 =
33896                  * (number) output 0..1 \
33897                  */
33898                 mina.easein = function(n) {
33899                     return Math.pow(n, .48);
33900                 };
33901                 /*
33902                  * \ mina.easeinout [ method ] * Easeinout easing - n (number) input 0..1 =
33903                  * (number) output 0..1 \
33904                  */
33905                 mina.easeinout = function(n) {
33906                     if (n == 1) {
33907                         return 1;
33908                     }
33909                     if (n == 0) {
33910                         return 0;
33911                     }
33912                     var q = .48 - n / 1.04,
33913                         Q = Math.sqrt(.1734 + q * q),
33914                         x = Q - q,
33915                         X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
33916                         y = -Q - q,
33917                         Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
33918                         t = X + Y + .5;
33919                     return (1 - t) * 3 * t * t + t * t * t;
33920                 };
33921                 /*
33922                  * \ mina.backin [ method ] * Backin easing - n (number) input 0..1 =
33923                  * (number) output 0..1 \
33924                  */
33925                 mina.backin = function(n) {
33926                     if (n == 1) {
33927                         return 1;
33928                     }
33929                     var s = 1.70158;
33930                     return n * n * ((s + 1) * n - s);
33931                 };
33932                 /*
33933                  * \ mina.backout [ method ] * Backout easing - n (number) input 0..1 =
33934                  * (number) output 0..1 \
33935                  */
33936                 mina.backout = function(n) {
33937                     if (n == 0) {
33938                         return 0;
33939                     }
33940                     n = n - 1;
33941                     var s = 1.70158;
33942                     return n * n * ((s + 1) * n + s) + 1;
33943                 };
33944                 /*
33945                  * \ mina.elastic [ method ] * Elastic easing - n (number) input 0..1 =
33946                  * (number) output 0..1 \
33947                  */
33948                 mina.elastic = function(n) {
33949                     if (n == !!n) {
33950                         return n;
33951                     }
33952                     return Math.pow(2, -10 * n) * Math.sin((n - .075) *
33953                         (2 * Math.PI) / .3) + 1;
33954                 };
33955                 /*
33956                  * \ mina.bounce [ method ] * Bounce easing - n (number) input 0..1 =
33957                  * (number) output 0..1 \
33958                  */
33959                 mina.bounce = function(n) {
33960                     var s = 7.5625,
33961                         p = 2.75,
33962                         l;
33963                     if (n < (1 / p)) {
33964                         l = s * n * n;
33965                     } else {
33966                         if (n < (2 / p)) {
33967                             n -= (1.5 / p);
33968                             l = s * n * n + .75;
33969                         } else {
33970                             if (n < (2.5 / p)) {
33971                                 n -= (2.25 / p);
33972                                 l = s * n * n + .9375;
33973                             } else {
33974                                 n -= (2.625 / p);
33975                                 l = s * n * n + .984375;
33976                             }
33977                         }
33978                     }
33979                     return l;
33980                 };
33981                 window.mina = mina;
33982                 return mina;
33983             })(typeof eve == "undefined" ? function() {} : eve);
33984             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33985             //
33986             // Licensed under the Apache License, Version 2.0 (the "License");
33987             // you may not use this file except in compliance with the License.
33988             // You may obtain a copy of the License at
33989             //
33990             // http://www.apache.org/licenses/LICENSE-2.0
33991             //
33992             // Unless required by applicable law or agreed to in writing, software
33993             // distributed under the License is distributed on an "AS IS" BASIS,
33994             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33995             // See the License for the specific language governing permissions and
33996             // limitations under the License.
33997
33998             var Snap = (function(root) {
33999                 Snap.version = "0.3.0";
34000                 /*
34001                  * \ Snap [ method ] * Creates a drawing surface or wraps existing SVG element. * -
34002                  * width (number|string) width of surface - height (number|string) height of
34003                  * surface or - DOM (SVGElement) element to be wrapped into Snap structure or -
34004                  * array (array) array of elements (will return set of elements) or - query
34005                  * (string) CSS query selector = (object) @Element \
34006                  */
34007                 function Snap(w, h) {
34008                     if (w) {
34009                         if (w.tagName) {
34010                             return wrap(w);
34011                         }
34012                         if (is(w, "array") && Snap.set) {
34013                             return Snap.set.apply(Snap, w);
34014                         }
34015                         if (w instanceof Element) {
34016                             return w;
34017                         }
34018                         if (h == null) {
34019                             w = glob.doc.querySelector(w);
34020                             return wrap(w);
34021                         }
34022                     }
34023                     w = w == null ? "100%" : w;
34024                     h = h == null ? "100%" : h;
34025                     return new Paper(w, h);
34026                 }
34027                 Snap.toString = function() {
34028                     return "Snap v" + this.version;
34029                 };
34030                 Snap._ = {};
34031                 var glob = {
34032                     win: root.window,
34033                     doc: root.window.document
34034                 };
34035                 Snap._.glob = glob;
34036                 var has = "hasOwnProperty",
34037                     Str = String,
34038                     toFloat = parseFloat,
34039                     toInt = parseInt,
34040                     math = Math,
34041                     mmax = math.max,
34042                     mmin = math.min,
34043                     abs = math.abs,
34044                     pow = math.pow,
34045                     PI = math.PI,
34046                     round = math.round,
34047                     E = "",
34048                     S = " ",
34049                     objectToString = Object.prototype.toString,
34050                     ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
34051                     colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
34052                     bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
34053                     reURLValue = /^url\(#?([^)]+)\)$/,
34054                     separator = Snap._.separator = /[,\s]+/,
34055                     whitespace = /[\s]/g,
34056                     commaSpaces = /[\s]*,[\s]*/,
34057                     hsrg = {
34058                         hs: 1,
34059                         rg: 1
34060                     },
34061                     pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
34062                     tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
34063                     pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
34064                     idgen = 0,
34065                     idprefix = "S" + (+new Date).toString(36),
34066                     ID = function(el) {
34067                         return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
34068                     },
34069                     xlink = "http://www.w3.org/1999/xlink",
34070                     xmlns = "http://www.w3.org/2000/svg",
34071                     hub = {},
34072                     URL = Snap.url = function(url) {
34073                         return "url('#" + url + "')";
34074                     };
34075
34076                 function $(el, attr) {
34077                     if (attr) {
34078                         if (el == "#text") {
34079                             el = glob.doc.createTextNode(attr.text || "");
34080                         }
34081                         if (typeof el == "string") {
34082                             el = $(el);
34083                         }
34084                         if (typeof attr == "string") {
34085                             if (attr.substring(0, 6) == "xlink:") {
34086                                 return el.getAttributeNS(xlink, attr.substring(6));
34087                             }
34088                             if (attr.substring(0, 4) == "xml:") {
34089                                 return el.getAttributeNS(xmlns, attr.substring(4));
34090                             }
34091                             return el.getAttribute(attr);
34092                         }
34093                         for (var key in attr)
34094                             if (attr[has](key)) {
34095                                 var val = Str(attr[key]);
34096                                 if (val) {
34097                                     if (key.substring(0, 6) == "xlink:") {
34098                                         el.setAttributeNS(xlink, key.substring(6), val);
34099                                     } else if (key.substring(0, 4) == "xml:") {
34100                                         el.setAttributeNS(xmlns, key.substring(4), val);
34101                                     } else {
34102                                         el.setAttribute(key, val);
34103                                     }
34104                                 } else {
34105                                     el.removeAttribute(key);
34106                                 }
34107                             }
34108                     } else {
34109                         el = glob.doc.createElementNS(xmlns, el);
34110                     }
34111                     return el;
34112                 }
34113                 Snap._.$ = $;
34114                 Snap._.id = ID;
34115
34116                 function getAttrs(el) {
34117                     var attrs = el.attributes,
34118                         name,
34119                         out = {};
34120                     for (var i = 0; i < attrs.length; i++) {
34121                         if (attrs[i].namespaceURI == xlink) {
34122                             name = "xlink:";
34123                         } else {
34124                             name = "";
34125                         }
34126                         name += attrs[i].name;
34127                         out[name] = attrs[i].textContent;
34128                     }
34129                     return out;
34130                 }
34131
34132                 function is(o, type) {
34133                     type = Str.prototype.toLowerCase.call(type);
34134                     if (type == "finite") {
34135                         return isFinite(o);
34136                     }
34137                     if (type == "array" &&
34138                         (o instanceof Array || Array.isArray && Array.isArray(o))) {
34139                         return true;
34140                     }
34141                     return (type == "null" && o === null) ||
34142                         (type == typeof o && o !== null) ||
34143                         (type == "object" && o === Object(o)) ||
34144                         objectToString.call(o).slice(8, -1).toLowerCase() == type;
34145                 }
34146                 /*
34147                  * \ Snap.format [ method ] * Replaces construction of type `{<name>}` to the
34148                  * corresponding argument * - token (string) string to format - json (object)
34149                  * object which properties are used as a replacement = (string) formatted string >
34150                  * Usage | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" |
34151                  * paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative
34152                  * width']}z", { | x: 10, | y: 20, | dim: { | width: 40, | height: 50, |
34153                  * "negative width": -40 | } | })); \
34154                  */
34155                 Snap.format = (function() {
34156                     var tokenRegex = /\{([^\}]+)\}/g,
34157                         objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches
34158                         // .xxxxx
34159                         // or
34160                         // ["xxxxx"]
34161                         // to
34162                         // run
34163                         // over
34164                         // object
34165                         // properties
34166                         replacer = function(all, key, obj) {
34167                             var res = obj;
34168                             key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
34169                                 name = name || quotedName;
34170                                 if (res) {
34171                                     if (name in res) {
34172                                         res = res[name];
34173                                     }
34174                                     typeof res == "function" && isFunc && (res = res());
34175                                 }
34176                             });
34177                             res = (res == null || res == obj ? all : res) + "";
34178                             return res;
34179                         };
34180                     return function(str, obj) {
34181                         return Str(str).replace(tokenRegex, function(all, key) {
34182                             return replacer(all, key, obj);
34183                         });
34184                     };
34185                 })();
34186
34187                 function clone(obj) {
34188                     if (typeof obj == "function" || Object(obj) !== obj) {
34189                         return obj;
34190                     }
34191                     var res = new obj.constructor;
34192                     for (var key in obj)
34193                         if (obj[has](key)) {
34194                             res[key] = clone(obj[key]);
34195                         }
34196                     return res;
34197                 }
34198                 Snap._.clone = clone;
34199
34200                 function repush(array, item) {
34201                     for (var i = 0, ii = array.length; i < ii; i++)
34202                         if (array[i] === item) {
34203                             return array.push(array.splice(i, 1)[0]);
34204                         }
34205                 }
34206
34207                 function cacher(f, scope, postprocessor) {
34208                     function newf() {
34209                         var arg = Array.prototype.slice.call(arguments, 0),
34210                             args = arg.join("\u2400"),
34211                             cache = newf.cache = newf.cache || {},
34212                             count = newf.count = newf.count || [];
34213                         if (cache[has](args)) {
34214                             repush(count, args);
34215                             return postprocessor ? postprocessor(cache[args]) : cache[args];
34216                         }
34217                         count.length >= 1e3 && delete cache[count.shift()];
34218                         count.push(args);
34219                         cache[args] = f.apply(scope, arg);
34220                         return postprocessor ? postprocessor(cache[args]) : cache[args];
34221                     }
34222                     return newf;
34223                 }
34224                 Snap._.cacher = cacher;
34225
34226                 function angle(x1, y1, x2, y2, x3, y3) {
34227                     if (x3 == null) {
34228                         var x = x1 - x2,
34229                             y = y1 - y2;
34230                         if (!x && !y) {
34231                             return 0;
34232                         }
34233                         return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
34234                     } else {
34235                         return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
34236                     }
34237                 }
34238
34239                 function rad(deg) {
34240                     return deg % 360 * PI / 180;
34241                 }
34242
34243                 function deg(rad) {
34244                     return rad * 180 / PI % 360;
34245                 }
34246
34247                 function x_y() {
34248                     return this.x + S + this.y;
34249                 }
34250
34251                 function x_y_w_h() {
34252                     return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
34253                 }
34254
34255                 /*
34256                  * \ Snap.rad [ method ] * Transform angle to radians - deg (number) angle in
34257                  * degrees = (number) angle in radians \
34258                  */
34259                 Snap.rad = rad;
34260                 /*
34261                  * \ Snap.deg [ method ] * Transform angle to degrees - rad (number) angle in
34262                  * radians = (number) angle in degrees \
34263                  */
34264                 Snap.deg = deg;
34265                 /*
34266                  * \ Snap.angle [ method ] * Returns an angle between two or three points >
34267                  * Parameters - x1 (number) x coord of first point - y1 (number) y coord of
34268                  * first point - x2 (number) x coord of second point - y2 (number) y coord of
34269                  * second point - x3 (number) #optional x coord of third point - y3 (number)
34270                  * #optional y coord of third point = (number) angle in degrees \
34271                  */
34272                 Snap.angle = angle;
34273                 /*
34274                  * \ Snap.is [ method ] * Handy replacement for the `typeof` operator - o
34275                  * (…) any object or primitive - type (string) name of the type, e.g.,
34276                  * `string`, `function`, `number`, etc. = (boolean) `true` if given value is of
34277                  * given type \
34278                  */
34279                 Snap.is = is;
34280                 /*
34281                  * \ Snap.snapTo [ method ] * Snaps given value to given grid - values
34282                  * (array|number) given array of values or step of the grid - value (number)
34283                  * value to adjust - tolerance (number) #optional maximum distance to the target
34284                  * value that would trigger the snap. Default is `10`. = (number) adjusted value \
34285                  */
34286                 Snap.snapTo = function(values, value, tolerance) {
34287                     tolerance = is(tolerance, "finite") ? tolerance : 10;
34288                     if (is(values, "array")) {
34289                         var i = values.length;
34290                         while (i--)
34291                             if (abs(values[i] - value) <= tolerance) {
34292                                 return values[i];
34293                             }
34294                     } else {
34295                         values = +values;
34296                         var rem = value % values;
34297                         if (rem < tolerance) {
34298                             return value - rem;
34299                         }
34300                         if (rem > values - tolerance) {
34301                             return value - rem + values;
34302                         }
34303                     }
34304                     return value;
34305                 };
34306                 // Colour
34307                 /*
34308                  * \ Snap.getRGB [ method ] * Parses color string as RGB object - color (string)
34309                  * color string in one of the following formats: # <ul> # <li>Color name (<code>red</code>,
34310                  * <code>green</code>, <code>cornflowerblue</code>, etc)</li> # <li>#•••
34311                  * ÃƒÆ’¢â‚¬â€� shortened HTML color: (<code>#000</code>, <code>#fc0</code>,
34312                  * etc.)</li> # <li>#•••••• ÃƒÆ’¢â‚¬â€� full
34313                  * length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li> #
34314                  * <li>rgb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34315                  * ÃƒÆ’¢â‚¬â€� red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li> #
34316                  * <li>rgba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34317                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34318                  * <li>rgb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34319                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li> #
34320                  * <li>rgba(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34321                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34322                  * <li>hsb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34323                  * ÃƒÆ’¢â‚¬â€� hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li> #
34324                  * <li>hsba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34325                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34326                  * <li>hsb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34327                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsba(•••%,
34328                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34329                  * ÃƒÆ’¢â‚¬â€� also with opacity</li> # <li>hsl(•••,
34330                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� hue, saturation and
34331                  * luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li> #
34332                  * <li>hsla(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34333                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34334                  * <li>hsl(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34335                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsla(•••%,
34336                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34337                  * ÃƒÆ’¢â‚¬â€� also with opacity</li> # </ul> Note that `%` can be used any time:
34338                  * `rgb(20%, 255, 50%)`. = (object) RGB object in the following format: o { o r
34339                  * (number) red, o g (number) green, o b (number) blue, o hex (string) color in
34340                  * HTML/CSS format: #••••••, o error
34341                  * (boolean) true if string can't be parsed o } \
34342                  */
34343                 Snap.getRGB = cacher(function(colour) {
34344                     if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
34345                         return {
34346                             r: -1,
34347                             g: -1,
34348                             b: -1,
34349                             hex: "none",
34350                             error: 1,
34351                             toString: rgbtoString
34352                         };
34353                     }
34354                     if (colour == "none") {
34355                         return {
34356                             r: -1,
34357                             g: -1,
34358                             b: -1,
34359                             hex: "none",
34360                             toString: rgbtoString
34361                         };
34362                     }!(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
34363                     if (!colour) {
34364                         return {
34365                             r: -1,
34366                             g: -1,
34367                             b: -1,
34368                             hex: "none",
34369                             error: 1,
34370                             toString: rgbtoString
34371                         };
34372                     }
34373                     var res,
34374                         red,
34375                         green,
34376                         blue,
34377                         opacity,
34378                         t,
34379                         values,
34380                         rgb = colour.match(colourRegExp);
34381                     if (rgb) {
34382                         if (rgb[2]) {
34383                             blue = toInt(rgb[2].substring(5), 16);
34384                             green = toInt(rgb[2].substring(3, 5), 16);
34385                             red = toInt(rgb[2].substring(1, 3), 16);
34386                         }
34387                         if (rgb[3]) {
34388                             blue = toInt((t = rgb[3].charAt(3)) + t, 16);
34389                             green = toInt((t = rgb[3].charAt(2)) + t, 16);
34390                             red = toInt((t = rgb[3].charAt(1)) + t, 16);
34391                         }
34392                         if (rgb[4]) {
34393                             values = rgb[4].split(commaSpaces);
34394                             red = toFloat(values[0]);
34395                             values[0].slice(-1) == "%" && (red *= 2.55);
34396                             green = toFloat(values[1]);
34397                             values[1].slice(-1) == "%" && (green *= 2.55);
34398                             blue = toFloat(values[2]);
34399                             values[2].slice(-1) == "%" && (blue *= 2.55);
34400                             rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
34401                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34402                         }
34403                         if (rgb[5]) {
34404                             values = rgb[5].split(commaSpaces);
34405                             red = toFloat(values[0]);
34406                             values[0].slice(-1) == "%" && (red /= 100);
34407                             green = toFloat(values[1]);
34408                             values[1].slice(-1) == "%" && (green /= 100);
34409                             blue = toFloat(values[2]);
34410                             values[2].slice(-1) == "%" && (blue /= 100);
34411                             (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34412                             rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
34413                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34414                             return Snap.hsb2rgb(red, green, blue, opacity);
34415                         }
34416                         if (rgb[6]) {
34417                             values = rgb[6].split(commaSpaces);
34418                             red = toFloat(values[0]);
34419                             values[0].slice(-1) == "%" && (red /= 100);
34420                             green = toFloat(values[1]);
34421                             values[1].slice(-1) == "%" && (green /= 100);
34422                             blue = toFloat(values[2]);
34423                             values[2].slice(-1) == "%" && (blue /= 100);
34424                             (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34425                             rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
34426                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34427                             return Snap.hsl2rgb(red, green, blue, opacity);
34428                         }
34429                         red = mmin(math.round(red), 255);
34430                         green = mmin(math.round(green), 255);
34431                         blue = mmin(math.round(blue), 255);
34432                         opacity = mmin(mmax(opacity, 0), 1);
34433                         rgb = {
34434                             r: red,
34435                             g: green,
34436                             b: blue,
34437                             toString: rgbtoString
34438                         };
34439                         rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
34440                         rgb.opacity = is(opacity, "finite") ? opacity : 1;
34441                         return rgb;
34442                     }
34443                     return {
34444                         r: -1,
34445                         g: -1,
34446                         b: -1,
34447                         hex: "none",
34448                         error: 1,
34449                         toString: rgbtoString
34450                     };
34451                 }, Snap);
34452                 // SIERRA It seems odd that the following 3 conversion methods are not expressed
34453                 // as .this2that(), like the others.
34454                 /*
34455                  * \ Snap.hsb [ method ] * Converts HSB values to a hex representation of the
34456                  * color - h (number) hue - s (number) saturation - b (number) value or
34457                  * brightness = (string) hex representation of the color \
34458                  */
34459                 Snap.hsb = cacher(function(h, s, b) {
34460                     return Snap.hsb2rgb(h, s, b).hex;
34461                 });
34462                 /*
34463                  * \ Snap.hsl [ method ] * Converts HSL values to a hex representation of the
34464                  * color - h (number) hue - s (number) saturation - l (number) luminosity =
34465                  * (string) hex representation of the color \
34466                  */
34467                 Snap.hsl = cacher(function(h, s, l) {
34468                     return Snap.hsl2rgb(h, s, l).hex;
34469                 });
34470                 /*
34471                  * \ Snap.rgb [ method ] * Converts RGB values to a hex representation of the
34472                  * color - r (number) red - g (number) green - b (number) blue = (string) hex
34473                  * representation of the color \
34474                  */
34475                 Snap.rgb = cacher(function(r, g, b, o) {
34476                     if (is(o, "finite")) {
34477                         var round = math.round;
34478                         return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
34479                     }
34480                     return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
34481                 });
34482                 var toHex = function(color) {
34483                         var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
34484                             red = "rgb(255, 0, 0)";
34485                         toHex = cacher(function(color) {
34486                             if (color.toLowerCase() == "red") {
34487                                 return red;
34488                             }
34489                             i.style.color = red;
34490                             i.style.color = color;
34491                             var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
34492                             return out == red ? null : out;
34493                         });
34494                         return toHex(color);
34495                     },
34496                     hsbtoString = function() {
34497                         return "hsb(" + [this.h, this.s, this.b] + ")";
34498                     },
34499                     hsltoString = function() {
34500                         return "hsl(" + [this.h, this.s, this.l] + ")";
34501                     },
34502                     rgbtoString = function() {
34503                         return this.opacity == 1 || this.opacity == null ?
34504                             this.hex :
34505                             "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
34506                     },
34507                     prepareRGB = function(r, g, b) {
34508                         if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
34509                             b = r.b;
34510                             g = r.g;
34511                             r = r.r;
34512                         }
34513                         if (g == null && is(r, string)) {
34514                             var clr = Snap.getRGB(r);
34515                             r = clr.r;
34516                             g = clr.g;
34517                             b = clr.b;
34518                         }
34519                         if (r > 1 || g > 1 || b > 1) {
34520                             r /= 255;
34521                             g /= 255;
34522                             b /= 255;
34523                         }
34524
34525                         return [r, g, b];
34526                     },
34527                     packageRGB = function(r, g, b, o) {
34528                         r = math.round(r * 255);
34529                         g = math.round(g * 255);
34530                         b = math.round(b * 255);
34531                         var rgb = {
34532                             r: r,
34533                             g: g,
34534                             b: b,
34535                             opacity: is(o, "finite") ? o : 1,
34536                             hex: Snap.rgb(r, g, b),
34537                             toString: rgbtoString
34538                         };
34539                         is(o, "finite") && (rgb.opacity = o);
34540                         return rgb;
34541                     };
34542                 // SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g.,
34543                 // can you specify a semi-transparent value for Snap.filter.shadow()?
34544                 /*
34545                  * \ Snap.color [ method ] * Parses the color string and returns an object
34546                  * featuring the color's component values - clr (string) color string in one of
34547                  * the supported formats (see @Snap.getRGB) = (object) Combined RGB/HSB object
34548                  * in the following format: o { o r (number) red, o g (number) green, o b
34549                  * (number) blue, o hex (string) color in HTML/CSS format:
34550                  * #••••••, o error (boolean) `true` if
34551                  * string can't be parsed, o h (number) hue, o s (number) saturation, o v
34552                  * (number) value (brightness), o l (number) lightness o } \
34553                  */
34554                 Snap.color = function(clr) {
34555                     var rgb;
34556                     if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
34557                         rgb = Snap.hsb2rgb(clr);
34558                         clr.r = rgb.r;
34559                         clr.g = rgb.g;
34560                         clr.b = rgb.b;
34561                         clr.opacity = 1;
34562                         clr.hex = rgb.hex;
34563                     } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
34564                         rgb = Snap.hsl2rgb(clr);
34565                         clr.r = rgb.r;
34566                         clr.g = rgb.g;
34567                         clr.b = rgb.b;
34568                         clr.opacity = 1;
34569                         clr.hex = rgb.hex;
34570                     } else {
34571                         if (is(clr, "string")) {
34572                             clr = Snap.getRGB(clr);
34573                         }
34574                         if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
34575                             rgb = Snap.rgb2hsl(clr);
34576                             clr.h = rgb.h;
34577                             clr.s = rgb.s;
34578                             clr.l = rgb.l;
34579                             rgb = Snap.rgb2hsb(clr);
34580                             clr.v = rgb.b;
34581                         } else {
34582                             clr = {
34583                                 hex: "none"
34584                             };
34585                             clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
34586                             clr.error = 1;
34587                         }
34588                     }
34589                     clr.toString = rgbtoString;
34590                     return clr;
34591                 };
34592                 /*
34593                  * \ Snap.hsb2rgb [ method ] * Converts HSB values to an RGB object - h (number)
34594                  * hue - s (number) saturation - v (number) value or brightness = (object) RGB
34595                  * object in the following format: o { o r (number) red, o g (number) green, o b
34596                  * (number) blue, o hex (string) color in HTML/CSS format:
34597                  * #•••••• o } \
34598                  */
34599                 Snap.hsb2rgb = function(h, s, v, o) {
34600                     if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
34601                         v = h.b;
34602                         s = h.s;
34603                         h = h.h;
34604                         o = h.o;
34605                     }
34606                     h *= 360;
34607                     var R, G, B, X, C;
34608                     h = (h % 360) / 60;
34609                     C = v * s;
34610                     X = C * (1 - abs(h % 2 - 1));
34611                     R = G = B = v - C;
34612
34613                     h = ~~h;
34614                     R += [C, X, 0, 0, X, C][h];
34615                     G += [X, C, C, X, 0, 0][h];
34616                     B += [0, 0, X, C, C, X][h];
34617                     return packageRGB(R, G, B, o);
34618                 };
34619                 /*
34620                  * \ Snap.hsl2rgb [ method ] * Converts HSL values to an RGB object - h (number)
34621                  * hue - s (number) saturation - l (number) luminosity = (object) RGB object in
34622                  * the following format: o { o r (number) red, o g (number) green, o b (number)
34623                  * blue, o hex (string) color in HTML/CSS format:
34624                  * #•••••• o } \
34625                  */
34626                 Snap.hsl2rgb = function(h, s, l, o) {
34627                     if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
34628                         l = h.l;
34629                         s = h.s;
34630                         h = h.h;
34631                     }
34632                     if (h > 1 || s > 1 || l > 1) {
34633                         h /= 360;
34634                         s /= 100;
34635                         l /= 100;
34636                     }
34637                     h *= 360;
34638                     var R, G, B, X, C;
34639                     h = (h % 360) / 60;
34640                     C = 2 * s * (l < .5 ? l : 1 - l);
34641                     X = C * (1 - abs(h % 2 - 1));
34642                     R = G = B = l - C / 2;
34643
34644                     h = ~~h;
34645                     R += [C, X, 0, 0, X, C][h];
34646                     G += [X, C, C, X, 0, 0][h];
34647                     B += [0, 0, X, C, C, X][h];
34648                     return packageRGB(R, G, B, o);
34649                 };
34650                 /*
34651                  * \ Snap.rgb2hsb [ method ] * Converts RGB values to an HSB object - r (number)
34652                  * red - g (number) green - b (number) blue = (object) HSB object in the
34653                  * following format: o { o h (number) hue, o s (number) saturation, o b (number)
34654                  * brightness o } \
34655                  */
34656                 Snap.rgb2hsb = function(r, g, b) {
34657                     b = prepareRGB(r, g, b);
34658                     r = b[0];
34659                     g = b[1];
34660                     b = b[2];
34661
34662                     var H, S, V, C;
34663                     V = mmax(r, g, b);
34664                     C = V - mmin(r, g, b);
34665                     H = (C == 0 ? null :
34666                         V == r ? (g - b) / C :
34667                         V == g ? (b - r) / C + 2 :
34668                         (r - g) / C + 4
34669                     );
34670                     H = ((H + 360) % 6) * 60 / 360;
34671                     S = C == 0 ? 0 : C / V;
34672                     return {
34673                         h: H,
34674                         s: S,
34675                         b: V,
34676                         toString: hsbtoString
34677                     };
34678                 };
34679                 /*
34680                  * \ Snap.rgb2hsl [ method ] * Converts RGB values to an HSL object - r (number)
34681                  * red - g (number) green - b (number) blue = (object) HSL object in the
34682                  * following format: o { o h (number) hue, o s (number) saturation, o l (number)
34683                  * luminosity o } \
34684                  */
34685                 Snap.rgb2hsl = function(r, g, b) {
34686                     b = prepareRGB(r, g, b);
34687                     r = b[0];
34688                     g = b[1];
34689                     b = b[2];
34690
34691                     var H, S, L, M, m, C;
34692                     M = mmax(r, g, b);
34693                     m = mmin(r, g, b);
34694                     C = M - m;
34695                     H = (C == 0 ? null :
34696                         M == r ? (g - b) / C :
34697                         M == g ? (b - r) / C + 2 :
34698                         (r - g) / C + 4);
34699                     H = ((H + 360) % 6) * 60 / 360;
34700                     L = (M + m) / 2;
34701                     S = (C == 0 ? 0 :
34702                         L < .5 ? C / (2 * L) :
34703                         C / (2 - 2 * L));
34704                     return {
34705                         h: H,
34706                         s: S,
34707                         l: L,
34708                         toString: hsltoString
34709                     };
34710                 };
34711
34712                 // Transformations
34713                 // SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a
34714                 // format like this for two separate segments? [ ["M10,10","L90,90"],
34715                 // ["M90,10","L10,90"] ] Otherwise how is each command structured?
34716                 /*
34717                  * \ Snap.parsePathString [ method ] * Utility method * Parses given path string
34718                  * into an array of arrays of path segments - pathString (string|array) path
34719                  * string or array of segments (in the last case it is returned straight away) =
34720                  * (array) array of segments \
34721                  */
34722                 Snap.parsePathString = function(pathString) {
34723                     if (!pathString) {
34724                         return null;
34725                     }
34726                     var pth = Snap.path(pathString);
34727                     if (pth.arr) {
34728                         return Snap.path.clone(pth.arr);
34729                     }
34730
34731                     var paramCounts = {
34732                             a: 7,
34733                             c: 6,
34734                             o: 2,
34735                             h: 1,
34736                             l: 2,
34737                             m: 2,
34738                             r: 4,
34739                             q: 4,
34740                             s: 4,
34741                             t: 2,
34742                             v: 1,
34743                             u: 3,
34744                             z: 0
34745                         },
34746                         data = [];
34747                     if (is(pathString, "array") && is(pathString[0], "array")) { // rough
34748                         // assumption
34749                         data = Snap.path.clone(pathString);
34750                     }
34751                     if (!data.length) {
34752                         Str(pathString).replace(pathCommand, function(a, b, c) {
34753                             var params = [],
34754                                 name = b.toLowerCase();
34755                             c.replace(pathValues, function(a, b) {
34756                                 b && params.push(+b);
34757                             });
34758                             if (name == "m" && params.length > 2) {
34759                                 data.push([b].concat(params.splice(0, 2)));
34760                                 name = "l";
34761                                 b = b == "m" ? "l" : "L";
34762                             }
34763                             if (name == "o" && params.length == 1) {
34764                                 data.push([b, params[0]]);
34765                             }
34766                             if (name == "r") {
34767                                 data.push([b].concat(params));
34768                             } else
34769                                 while (params.length >= paramCounts[name]) {
34770                                     data.push([b].concat(params.splice(0, paramCounts[name])));
34771                                     if (!paramCounts[name]) {
34772                                         break;
34773                                     }
34774                                 }
34775                         });
34776                     }
34777                     data.toString = Snap.path.toString;
34778                     pth.arr = Snap.path.clone(data);
34779                     return data;
34780                 };
34781                 /*
34782                  * \ Snap.parseTransformString [ method ] * Utility method * Parses given
34783                  * transform string into an array of transformations - TString (string|array)
34784                  * transform string or array of transformations (in the last case it is returned
34785                  * straight away) = (array) array of transformations \
34786                  */
34787                 var parseTransformString = Snap.parseTransformString = function(TString) {
34788                     if (!TString) {
34789                         return null;
34790                     }
34791                     var paramCounts = {
34792                             r: 3,
34793                             s: 4,
34794                             t: 2,
34795                             m: 6
34796                         },
34797                         data = [];
34798                     if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
34799                         data = Snap.path.clone(TString);
34800                     }
34801                     if (!data.length) {
34802                         Str(TString).replace(tCommand, function(a, b, c) {
34803                             var params = [],
34804                                 name = b.toLowerCase();
34805                             c.replace(pathValues, function(a, b) {
34806                                 b && params.push(+b);
34807                             });
34808                             data.push([b].concat(params));
34809                         });
34810                     }
34811                     data.toString = Snap.path.toString;
34812                     return data;
34813                 };
34814
34815                 function svgTransform2string(tstr) {
34816                     var res = [];
34817                     tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function(all, name, params) {
34818                         params = params.split(/\s*,\s*|\s+/);
34819                         if (name == "rotate" && params.length == 1) {
34820                             params.push(0, 0);
34821                         }
34822                         if (name == "scale") {
34823                             if (params.length > 2) {
34824                                 params = params.slice(0, 2);
34825                             } else if (params.length == 2) {
34826                                 params.push(0, 0);
34827                             }
34828                             if (params.length == 1) {
34829                                 params.push(params[0], 0, 0);
34830                             }
34831                         }
34832                         if (name == "skewX") {
34833                             res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
34834                         } else if (name == "skewY") {
34835                             res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
34836                         } else {
34837                             res.push([name.charAt(0)].concat(params));
34838                         }
34839                         return all;
34840                     });
34841                     return res;
34842                 }
34843                 Snap._.svgTransform2string = svgTransform2string;
34844                 Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
34845
34846                 function transform2matrix(tstr, bbox) {
34847                     var tdata = parseTransformString(tstr),
34848                         m = new Snap.Matrix;
34849                     if (tdata) {
34850                         for (var i = 0, ii = tdata.length; i < ii; i++) {
34851                             var t = tdata[i],
34852                                 tlen = t.length,
34853                                 command = Str(t[0]).toLowerCase(),
34854                                 absolute = t[0] != command,
34855                                 inver = absolute ? m.invert() : 0,
34856                                 x1,
34857                                 y1,
34858                                 x2,
34859                                 y2,
34860                                 bb;
34861                             if (command == "t" && tlen == 2) {
34862                                 m.translate(t[1], 0);
34863                             } else if (command == "t" && tlen == 3) {
34864                                 if (absolute) {
34865                                     x1 = inver.x(0, 0);
34866                                     y1 = inver.y(0, 0);
34867                                     x2 = inver.x(t[1], t[2]);
34868                                     y2 = inver.y(t[1], t[2]);
34869                                     m.translate(x2 - x1, y2 - y1);
34870                                 } else {
34871                                     m.translate(t[1], t[2]);
34872                                 }
34873                             } else if (command == "r") {
34874                                 if (tlen == 2) {
34875                                     bb = bb || bbox;
34876                                     m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34877                                 } else if (tlen == 4) {
34878                                     if (absolute) {
34879                                         x2 = inver.x(t[2], t[3]);
34880                                         y2 = inver.y(t[2], t[3]);
34881                                         m.rotate(t[1], x2, y2);
34882                                     } else {
34883                                         m.rotate(t[1], t[2], t[3]);
34884                                     }
34885                                 }
34886                             } else if (command == "s") {
34887                                 if (tlen == 2 || tlen == 3) {
34888                                     bb = bb || bbox;
34889                                     m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34890                                 } else if (tlen == 4) {
34891                                     if (absolute) {
34892                                         x2 = inver.x(t[2], t[3]);
34893                                         y2 = inver.y(t[2], t[3]);
34894                                         m.scale(t[1], t[1], x2, y2);
34895                                     } else {
34896                                         m.scale(t[1], t[1], t[2], t[3]);
34897                                     }
34898                                 } else if (tlen == 5) {
34899                                     if (absolute) {
34900                                         x2 = inver.x(t[3], t[4]);
34901                                         y2 = inver.y(t[3], t[4]);
34902                                         m.scale(t[1], t[2], x2, y2);
34903                                     } else {
34904                                         m.scale(t[1], t[2], t[3], t[4]);
34905                                     }
34906                                 }
34907                             } else if (command == "m" && tlen == 7) {
34908                                 m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
34909                             }
34910                         }
34911                     }
34912                     return m;
34913                 }
34914                 Snap._.transform2matrix = transform2matrix;
34915                 Snap._unit2px = unit2px;
34916                 var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
34917                     function(a, b) {
34918                         var adown = a.nodeType == 9 ? a.documentElement : a,
34919                             bup = b && b.parentNode;
34920                         return a == bup || !!(bup && bup.nodeType == 1 && (
34921                             adown.contains ?
34922                             adown.contains(bup) :
34923                             a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
34924                         ));
34925                     } :
34926                     function(a, b) {
34927                         if (b) {
34928                             while (b) {
34929                                 b = b.parentNode;
34930                                 if (b == a) {
34931                                     return true;
34932                                 }
34933                             }
34934                         }
34935                         return false;
34936                     };
34937
34938                 function getSomeDefs(el) {
34939                     var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
34940                         (el.node.parentNode && wrap(el.node.parentNode)) ||
34941                         Snap.select("svg") ||
34942                         Snap(0, 0),
34943                         pdefs = p.select("defs"),
34944                         defs = pdefs == null ? false : pdefs.node;
34945                     if (!defs) {
34946                         defs = make("defs", p.node).node;
34947                     }
34948                     return defs;
34949                 }
34950
34951                 function getSomeSVG(el) {
34952                     return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
34953                 }
34954                 Snap._.getSomeDefs = getSomeDefs;
34955                 Snap._.getSomeSVG = getSomeSVG;
34956
34957                 function unit2px(el, name, value) {
34958                     var svg = getSomeSVG(el).node,
34959                         out = {},
34960                         mgr = svg.querySelector(".svg---mgr");
34961                     if (!mgr) {
34962                         mgr = $("rect");
34963                         $(mgr, {
34964                             x: -9e9,
34965                             y: -9e9,
34966                             width: 10,
34967                             height: 10,
34968                             "class": "svg---mgr",
34969                             fill: "none"
34970                         });
34971                         svg.appendChild(mgr);
34972                     }
34973
34974                     function getW(val) {
34975                         if (val == null) {
34976                             return E;
34977                         }
34978                         if (val == +val) {
34979                             return val;
34980                         }
34981                         $(mgr, {
34982                             width: val
34983                         });
34984                         try {
34985                             return mgr.getBBox().width;
34986                         } catch (e) {
34987                             return 0;
34988                         }
34989                     }
34990
34991                     function getH(val) {
34992                         if (val == null) {
34993                             return E;
34994                         }
34995                         if (val == +val) {
34996                             return val;
34997                         }
34998                         $(mgr, {
34999                             height: val
35000                         });
35001                         try {
35002                             return mgr.getBBox().height;
35003                         } catch (e) {
35004                             return 0;
35005                         }
35006                     }
35007
35008                     function set(nam, f) {
35009                         if (name == null) {
35010                             out[nam] = f(el.attr(nam) || 0);
35011                         } else if (nam == name) {
35012                             out = f(value == null ? el.attr(nam) || 0 : value);
35013                         }
35014                     }
35015                     switch (el.type) {
35016                         case "rect":
35017                             set("rx", getW);
35018                             set("ry", getH);
35019                         case "image":
35020                             set("width", getW);
35021                             set("height", getH);
35022                         case "text":
35023                             set("x", getW);
35024                             set("y", getH);
35025                             break;
35026                         case "circle":
35027                             set("cx", getW);
35028                             set("cy", getH);
35029                             set("r", getW);
35030                             break;
35031                         case "ellipse":
35032                             set("cx", getW);
35033                             set("cy", getH);
35034                             set("rx", getW);
35035                             set("ry", getH);
35036                             break;
35037                         case "line":
35038                             set("x1", getW);
35039                             set("x2", getW);
35040                             set("y1", getH);
35041                             set("y2", getH);
35042                             break;
35043                         case "marker":
35044                             set("refX", getW);
35045                             set("markerWidth", getW);
35046                             set("refY", getH);
35047                             set("markerHeight", getH);
35048                             break;
35049                         case "radialGradient":
35050                             set("fx", getW);
35051                             set("fy", getH);
35052                             break;
35053                         case "tspan":
35054                             set("dx", getW);
35055                             set("dy", getH);
35056                             break;
35057                         default:
35058                             set(name, getW);
35059                     }
35060                     svg.removeChild(mgr);
35061                     return out;
35062                 }
35063                 /*
35064                  * \ Snap.select [ method ] * Wraps a DOM element specified by CSS selector as
35065                  * @Element - query (string) CSS selector of the element = (Element) the current
35066                  * element \
35067                  */
35068                 Snap.select = function(query) {
35069                     query = Str(query).replace(/([^\\]):/g, "$1\\:");
35070                     return wrap(glob.doc.querySelector(query));
35071                 };
35072                 /*
35073                  * \ Snap.selectAll [ method ] * Wraps DOM elements specified by CSS selector as
35074                  * set or array of @Element - query (string) CSS selector of the element =
35075                  * (Element) the current element \
35076                  */
35077                 Snap.selectAll = function(query) {
35078                     var nodelist = glob.doc.querySelectorAll(query),
35079                         set = (Snap.set || Array)();
35080                     for (var i = 0; i < nodelist.length; i++) {
35081                         set.push(wrap(nodelist[i]));
35082                     }
35083                     return set;
35084                 };
35085
35086                 function add2group(list) {
35087                     if (!is(list, "array")) {
35088                         list = Array.prototype.slice.call(arguments, 0);
35089                     }
35090                     var i = 0,
35091                         j = 0,
35092                         node = this.node;
35093                     while (this[i]) delete this[i++];
35094                     for (i = 0; i < list.length; i++) {
35095                         if (list[i].type == "set") {
35096                             list[i].forEach(function(el) {
35097                                 node.appendChild(el.node);
35098                             });
35099                         } else {
35100                             node.appendChild(list[i].node);
35101                         }
35102                     }
35103                     var children = node.childNodes;
35104                     for (i = 0; i < children.length; i++) {
35105                         this[j++] = wrap(children[i]);
35106                     }
35107                     return this;
35108                 }
35109                 // Hub garbage collector every 10s
35110                 setInterval(function() {
35111                     for (var key in hub)
35112                         if (hub[has](key)) {
35113                             var el = hub[key],
35114                                 node = el.node;
35115                             if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
35116                                 delete hub[key];
35117                             }
35118                         }
35119                 }, 1e4);
35120
35121                 function Element(el) {
35122                     if (el.snap in hub) {
35123                         return hub[el.snap];
35124                     }
35125                     var svg;
35126                     try {
35127                         svg = el.ownerSVGElement;
35128                     } catch (e) {}
35129                     /*
35130                      * \ Element.node [ property (object) ] * Gives you a reference to the DOM
35131                      * object, so you can assign event handlers or just mess around. > Usage | //
35132                      * draw a circle at coordinate 10,10 with radius of 10 | var c =
35133                      * paper.circle(10, 10, 10); | c.node.onclick = function () { |
35134                      * c.attr("fill", "red"); | }; \
35135                      */
35136                     this.node = el;
35137                     if (svg) {
35138                         this.paper = new Paper(svg);
35139                     }
35140                     /*
35141                      * \ Element.type [ property (string) ] * SVG tag name of the given element. \
35142                      */
35143                     this.type = el.tagName;
35144                     var id = this.id = ID(this);
35145                     this.anims = {};
35146                     this._ = {
35147                         transform: []
35148                     };
35149                     el.snap = id;
35150                     hub[id] = this;
35151                     if (this.type == "g") {
35152                         this.add = add2group;
35153                     }
35154                     if (this.type in {
35155                             g: 1,
35156                             mask: 1,
35157                             pattern: 1,
35158                             symbol: 1
35159                         }) {
35160                         for (var method in Paper.prototype)
35161                             if (Paper.prototype[has](method)) {
35162                                 this[method] = Paper.prototype[method];
35163                             }
35164                     }
35165                 }
35166                 /*
35167                  * \ Element.attr [ method ] * Gets or sets given attributes of the element. * -
35168                  * params (object) contains key-value pairs of attributes you want to set or -
35169                  * param (string) name of the attribute = (Element) the current element or =
35170                  * (string) value of attribute > Usage | el.attr({ | fill: "#fc0", | stroke:
35171                  * "#000", | strokeWidth: 2, // CamelCase... | "fill-opacity": 0.5, // or
35172                  * dash-separated names | width: "*=2" // prefixed values | }); |
35173                  * console.log(el.attr("fill")); // #fc0 Prefixed values in format `"+=10"`
35174                  * supported. All four operations (`+`, `-`, `*` and `/`) could be used.
35175                  * Optionally you can use units for `+` and `-`: `"+=2em"`. \
35176                  */
35177                 Element.prototype.attr = function(params, value) {
35178                     var el = this,
35179                         node = el.node;
35180                     if (!params) {
35181                         return el;
35182                     }
35183                     if (is(params, "string")) {
35184                         if (arguments.length > 1) {
35185                             var json = {};
35186                             json[params] = value;
35187                             params = json;
35188                         } else {
35189                             return eve("snap.util.getattr." + params, el).firstDefined();
35190                         }
35191                     }
35192                     for (var att in params) {
35193                         if (params[has](att)) {
35194                             eve("snap.util.attr." + att, el, params[att]);
35195                         }
35196                     }
35197                     return el;
35198                 };
35199                 /*
35200                  * \ Snap.parse [ method ] * Parses SVG fragment and converts it into a
35201                  * @Fragment * - svg (string) SVG string = (Fragment) the @Fragment \
35202                  */
35203                 Snap.parse = function(svg) {
35204                     var f = glob.doc.createDocumentFragment(),
35205                         full = true,
35206                         div = glob.doc.createElement("div");
35207                     svg = Str(svg);
35208                     if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
35209                         svg = "<svg>" + svg + "</svg>";
35210                         full = false;
35211                     }
35212                     div.innerHTML = svg;
35213                     svg = div.getElementsByTagName("svg")[0];
35214                     if (svg) {
35215                         if (full) {
35216                             f = svg;
35217                         } else {
35218                             while (svg.firstChild) {
35219                                 f.appendChild(svg.firstChild);
35220                             }
35221                             div.innerHTML = E;
35222                         }
35223                     }
35224                     return new Fragment(f);
35225                 };
35226
35227                 function Fragment(frag) {
35228                     this.node = frag;
35229                 }
35230                 // SIERRA Snap.fragment() could especially use a code example
35231                 /*
35232                  * \ Snap.fragment [ method ] * Creates a DOM fragment from a given list of
35233                  * elements or strings * - varargs (…) SVG string = (Fragment) the
35234                  * @Fragment \
35235                  */
35236                 Snap.fragment = function() {
35237                     var args = Array.prototype.slice.call(arguments, 0),
35238                         f = glob.doc.createDocumentFragment();
35239                     for (var i = 0, ii = args.length; i < ii; i++) {
35240                         var item = args[i];
35241                         if (item.node && item.node.nodeType) {
35242                             f.appendChild(item.node);
35243                         }
35244                         if (item.nodeType) {
35245                             f.appendChild(item);
35246                         }
35247                         if (typeof item == "string") {
35248                             f.appendChild(Snap.parse(item).node);
35249                         }
35250                     }
35251                     return new Fragment(f);
35252                 };
35253
35254                 function make(name, parent) {
35255                     var res = $(name);
35256                     parent.appendChild(res);
35257                     var el = wrap(res);
35258                     return el;
35259                 }
35260
35261                 function Paper(w, h) {
35262                     var res,
35263                         desc,
35264                         defs,
35265                         proto = Paper.prototype;
35266                     if (w && w.tagName == "svg") {
35267                         if (w.snap in hub) {
35268                             return hub[w.snap];
35269                         }
35270                         var doc = w.ownerDocument;
35271                         res = new Element(w);
35272                         desc = w.getElementsByTagName("desc")[0];
35273                         defs = w.getElementsByTagName("defs")[0];
35274                         if (!desc) {
35275                             desc = $("desc");
35276                             desc.appendChild(doc.createTextNode("Created with Snap"));
35277                             res.node.appendChild(desc);
35278                         }
35279                         if (!defs) {
35280                             defs = $("defs");
35281                             res.node.appendChild(defs);
35282                         }
35283                         res.defs = defs;
35284                         for (var key in proto)
35285                             if (proto[has](key)) {
35286                                 res[key] = proto[key];
35287                             }
35288                         res.paper = res.root = res;
35289                     } else {
35290                         res = make("svg", glob.doc.body);
35291                         $(res.node, {
35292                             height: h,
35293                             version: 1.1,
35294                             width: w,
35295                             xmlns: xmlns
35296                         });
35297                     }
35298                     return res;
35299                 }
35300
35301                 function wrap(dom) {
35302                     if (!dom) {
35303                         return dom;
35304                     }
35305                     if (dom instanceof Element || dom instanceof Fragment) {
35306                         return dom;
35307                     }
35308                     if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
35309                         return new Paper(dom);
35310                     }
35311                     if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
35312                         return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
35313                     }
35314                     return new Element(dom);
35315                 }
35316
35317                 Snap._.make = make;
35318                 Snap._.wrap = wrap;
35319                 /*
35320                  * \ Paper.el [ method ] * Creates an element on paper with a given name and no
35321                  * attributes * - name (string) tag name - attr (object) attributes = (Element)
35322                  * the current element > Usage | var c = paper.circle(10, 10, 10); // is the
35323                  * same as... | var c = paper.el("circle").attr({ | cx: 10, | cy: 10, | r: 10 |
35324                  * }); | // and the same as | var c = paper.el("circle", { | cx: 10, | cy: 10, |
35325                  * r: 10 | }); \
35326                  */
35327                 Paper.prototype.el = function(name, attr) {
35328                     var el = make(name, this.node);
35329                     attr && el.attr(attr);
35330                     return el;
35331                 };
35332                 // default
35333                 eve.on("snap.util.getattr", function() {
35334                     var att = eve.nt();
35335                     att = att.substring(att.lastIndexOf(".") + 1);
35336                     var css = att.replace(/[A-Z]/g, function(letter) {
35337                         return "-" + letter.toLowerCase();
35338                     });
35339                     if (cssAttr[has](css)) {
35340                         return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
35341                     } else {
35342                         return $(this.node, att);
35343                     }
35344                 });
35345                 var cssAttr = {
35346                     "alignment-baseline": 0,
35347                     "baseline-shift": 0,
35348                     "clip": 0,
35349                     "clip-path": 0,
35350                     "clip-rule": 0,
35351                     "color": 0,
35352                     "color-interpolation": 0,
35353                     "color-interpolation-filters": 0,
35354                     "color-profile": 0,
35355                     "color-rendering": 0,
35356                     "cursor": 0,
35357                     "direction": 0,
35358                     "display": 0,
35359                     "dominant-baseline": 0,
35360                     "enable-background": 0,
35361                     "fill": 0,
35362                     "fill-opacity": 0,
35363                     "fill-rule": 0,
35364                     "filter": 0,
35365                     "flood-color": 0,
35366                     "flood-opacity": 0,
35367                     "font": 0,
35368                     "font-family": 0,
35369                     "font-size": 0,
35370                     "font-size-adjust": 0,
35371                     "font-stretch": 0,
35372                     "font-style": 0,
35373                     "font-variant": 0,
35374                     "font-weight": 0,
35375                     "glyph-orientation-horizontal": 0,
35376                     "glyph-orientation-vertical": 0,
35377                     "image-rendering": 0,
35378                     "kerning": 0,
35379                     "letter-spacing": 0,
35380                     "lighting-color": 0,
35381                     "marker": 0,
35382                     "marker-end": 0,
35383                     "marker-mid": 0,
35384                     "marker-start": 0,
35385                     "mask": 0,
35386                     "opacity": 0,
35387                     "overflow": 0,
35388                     "pointer-events": 0,
35389                     "shape-rendering": 0,
35390                     "stop-color": 0,
35391                     "stop-opacity": 0,
35392                     "stroke": 0,
35393                     "stroke-dasharray": 0,
35394                     "stroke-dashoffset": 0,
35395                     "stroke-linecap": 0,
35396                     "stroke-linejoin": 0,
35397                     "stroke-miterlimit": 0,
35398                     "stroke-opacity": 0,
35399                     "stroke-width": 0,
35400                     "text-anchor": 0,
35401                     "text-decoration": 0,
35402                     "text-rendering": 0,
35403                     "unicode-bidi": 0,
35404                     "visibility": 0,
35405                     "word-spacing": 0,
35406                     "writing-mode": 0
35407                 };
35408
35409                 eve.on("snap.util.attr", function(value) {
35410                     var att = eve.nt(),
35411                         attr = {};
35412                     att = att.substring(att.lastIndexOf(".") + 1);
35413                     attr[att] = value;
35414                     var style = att.replace(/-(\w)/gi, function(all, letter) {
35415                             return letter.toUpperCase();
35416                         }),
35417                         css = att.replace(/[A-Z]/g, function(letter) {
35418                             return "-" + letter.toLowerCase();
35419                         });
35420                     if (cssAttr[has](css)) {
35421                         this.node.style[style] = value == null ? E : value;
35422                     } else {
35423                         $(this.node, attr);
35424                     }
35425                 });
35426                 (function(proto) {}(Paper.prototype));
35427
35428                 // simple ajax
35429                 /*
35430                  * \ Snap.ajax [ method ] * Simple implementation of Ajax * - url (string) URL -
35431                  * postData (object|string) data for post request - callback (function) callback -
35432                  * scope (object) #optional scope of callback or - url (string) URL - callback
35433                  * (function) callback - scope (object) #optional scope of callback =
35434                  * (XMLHttpRequest) the XMLHttpRequest object, just in case \
35435                  */
35436                 Snap.ajax = function(url, postData, callback, scope) {
35437                     var req = new XMLHttpRequest,
35438                         id = ID();
35439                     if (req) {
35440                         if (is(postData, "function")) {
35441                             scope = callback;
35442                             callback = postData;
35443                             postData = null;
35444                         } else if (is(postData, "object")) {
35445                             var pd = [];
35446                             for (var key in postData)
35447                                 if (postData.hasOwnProperty(key)) {
35448                                     pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
35449                                 }
35450                             postData = pd.join("&");
35451                         }
35452                         req.open((postData ? "POST" : "GET"), url, true);
35453                         if (postData) {
35454                             req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
35455                             req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
35456                         }
35457                         if (callback) {
35458                             eve.once("snap.ajax." + id + ".0", callback);
35459                             eve.once("snap.ajax." + id + ".200", callback);
35460                             eve.once("snap.ajax." + id + ".304", callback);
35461                         }
35462                         req.onreadystatechange = function() {
35463                             if (req.readyState != 4) return;
35464                             eve("snap.ajax." + id + "." + req.status, scope, req);
35465                         };
35466                         if (req.readyState == 4) {
35467                             return req;
35468                         }
35469                         req.send(postData);
35470                         return req;
35471                     }
35472                 };
35473                 /*
35474                  * \ Snap.load [ method ] * Loads external SVG file as a @Fragment (see
35475                  * @Snap.ajax for more advanced AJAX) * - url (string) URL - callback (function)
35476                  * callback - scope (object) #optional scope of callback \
35477                  */
35478                 Snap.load = function(url, callback, scope) {
35479                     Snap.ajax(url, function(req) {
35480                         var f = Snap.parse(req.responseText);
35481                         scope ? callback.call(scope, f) : callback(f);
35482                     });
35483                 };
35484                 var getOffset = function(elem) {
35485                     var box = elem.getBoundingClientRect(),
35486                         doc = elem.ownerDocument,
35487                         body = doc.body,
35488                         docElem = doc.documentElement,
35489                         clientTop = docElem.clientTop || body.clientTop || 0,
35490                         clientLeft = docElem.clientLeft || body.clientLeft || 0,
35491                         top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,
35492                         left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
35493                     return {
35494                         y: top,
35495                         x: left
35496                     };
35497                 };
35498                 /*
35499                  * \ Snap.getElementByPoint [ method ] * Returns you topmost element under given
35500                  * point. * = (object) Snap element object - x (number) x coordinate from the
35501                  * top left corner of the window - y (number) y coordinate from the top left
35502                  * corner of the window > Usage | Snap.getElementByPoint(mouseX,
35503                  * mouseY).attr({stroke: "#f00"}); \
35504                  */
35505                 Snap.getElementByPoint = function(x, y) {
35506                     var paper = this,
35507                         svg = paper.canvas,
35508                         target = glob.doc.elementFromPoint(x, y);
35509                     if (glob.win.opera && target.tagName == "svg") {
35510                         var so = getOffset(target),
35511                             sr = target.createSVGRect();
35512                         sr.x = x - so.x;
35513                         sr.y = y - so.y;
35514                         sr.width = sr.height = 1;
35515                         var hits = target.getIntersectionList(sr, null);
35516                         if (hits.length) {
35517                             target = hits[hits.length - 1];
35518                         }
35519                     }
35520                     if (!target) {
35521                         return null;
35522                     }
35523                     return wrap(target);
35524                 };
35525                 /*
35526                  * \ Snap.plugin [ method ] * Let you write plugins. You pass in a function with
35527                  * four arguments, like this: | Snap.plugin(function (Snap, Element, Paper,
35528                  * global, Fragment) { | Snap.newmethod = function () {}; |
35529                  * Element.prototype.newmethod = function () {}; | Paper.prototype.newmethod =
35530                  * function () {}; | }); Inside the function you have access to all main objects
35531                  * (and their prototypes). This allow you to extend anything you want. * - f
35532                  * (function) your plugin body \
35533                  */
35534                 Snap.plugin = function(f) {
35535                     f(Snap, Element, Paper, glob, Fragment);
35536                 };
35537                 glob.win.Snap = Snap;
35538                 return Snap;
35539             }(window || this));
35540             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
35541             //
35542             // Licensed under the Apache License, Version 2.0 (the "License");
35543             // you may not use this file except in compliance with the License.
35544             // You may obtain a copy of the License at
35545             //
35546             // http://www.apache.org/licenses/LICENSE-2.0
35547             //
35548             // Unless required by applicable law or agreed to in writing, software
35549             // distributed under the License is distributed on an "AS IS" BASIS,
35550             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35551             // See the License for the specific language governing permissions and
35552             // limitations under the License.
35553             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
35554                 var elproto = Element.prototype,
35555                     is = Snap.is,
35556                     Str = String,
35557                     unit2px = Snap._unit2px,
35558                     $ = Snap._.$,
35559                     make = Snap._.make,
35560                     getSomeDefs = Snap._.getSomeDefs,
35561                     has = "hasOwnProperty",
35562                     wrap = Snap._.wrap;
35563                 /*
35564                  * \ Element.getBBox [ method ] * Returns the bounding box descriptor for
35565                  * the given element * = (object) bounding box descriptor: o { o cx:
35566                  * (number) x of the center, o cy: (number) x of the center, o h: (number)
35567                  * height, o height: (number) height, o path: (string) path command for the
35568                  * box, o r0: (number) radius of a circle that fully encloses the box, o r1:
35569                  * (number) radius of the smallest circle that can be enclosed, o r2:
35570                  * (number) radius of the largest circle that can be enclosed, o vb:
35571                  * (string) box as a viewbox command, o w: (number) width, o width: (number)
35572                  * width, o x2: (number) x of the right side, o x: (number) x of the left
35573                  * side, o y2: (number) y of the bottom edge, o y: (number) y of the top
35574                  * edge o } \
35575                  */
35576                 elproto.getBBox = function(isWithoutTransform) {
35577                     if (!Snap.Matrix || !Snap.path) {
35578                         return this.node.getBBox();
35579                     }
35580                     var el = this,
35581                         m = new Snap.Matrix;
35582                     if (el.removed) {
35583                         return Snap._.box();
35584                     }
35585                     while (el.type == "use") {
35586                         if (!isWithoutTransform) {
35587                             m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
35588                         }
35589                         if (el.original) {
35590                             el = el.original;
35591                         } else {
35592                             var href = el.attr("xlink:href");
35593                             el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
35594                         }
35595                     }
35596                     var _ = el._,
35597                         pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
35598                     try {
35599                         if (isWithoutTransform) {
35600                             _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
35601                             return Snap._.box(_.bboxwt);
35602                         } else {
35603                             el.realPath = pathfinder(el);
35604                             el.matrix = el.transform().localMatrix;
35605                             _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
35606                             return Snap._.box(_.bbox);
35607                         }
35608                     } catch (e) {
35609                         // Firefox doesn’t give you bbox of hidden element
35610                         return Snap._.box();
35611                     }
35612                 };
35613                 var propString = function() {
35614                     return this.string;
35615                 };
35616
35617                 function extractTransform(el, tstr) {
35618                     if (tstr == null) {
35619                         var doReturn = true;
35620                         if (el.type == "linearGradient" || el.type == "radialGradient") {
35621                             tstr = el.node.getAttribute("gradientTransform");
35622                         } else if (el.type == "pattern") {
35623                             tstr = el.node.getAttribute("patternTransform");
35624                         } else {
35625                             tstr = el.node.getAttribute("transform");
35626                         }
35627                         if (!tstr) {
35628                             return new Snap.Matrix;
35629                         }
35630                         tstr = Snap._.svgTransform2string(tstr);
35631                     } else {
35632                         if (!Snap._.rgTransform.test(tstr)) {
35633                             tstr = Snap._.svgTransform2string(tstr);
35634                         } else {
35635                             tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
35636                         }
35637                         if (is(tstr, "array")) {
35638                             tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
35639                         }
35640                         el._.transform = tstr;
35641                     }
35642                     var m = Snap._.transform2matrix(tstr, el.getBBox(1));
35643                     if (doReturn) {
35644                         return m;
35645                     } else {
35646                         el.matrix = m;
35647                     }
35648                 }
35649                 /*
35650                  * \ Element.transform [ method ] * Gets or sets transformation of the
35651                  * element * - tstr (string) transform string in Snap or SVG format =
35652                  * (Element) the current element or = (object) transformation descriptor: o {
35653                  * o string (string) transform string, o globalMatrix (Matrix) matrix of all
35654                  * transformations applied to element or its parents, o localMatrix (Matrix)
35655                  * matrix of transformations applied only to the element, o diffMatrix
35656                  * (Matrix) matrix of difference between global and local transformations, o
35657                  * global (string) global transformation as string, o local (string) local
35658                  * transformation as string, o toString (function) returns `string` property
35659                  * o } \
35660                  */
35661                 elproto.transform = function(tstr) {
35662                     var _ = this._;
35663                     if (tstr == null) {
35664                         var papa = this,
35665                             global = new Snap.Matrix(this.node.getCTM()),
35666                             local = extractTransform(this),
35667                             ms = [local],
35668                             m = new Snap.Matrix,
35669                             i,
35670                             localString = local.toTransformString(),
35671                             string = Str(local) == Str(this.matrix) ?
35672                             Str(_.transform) : localString;
35673                         while (papa.type != "svg" && (papa = papa.parent())) {
35674                             ms.push(extractTransform(papa));
35675                         }
35676                         i = ms.length;
35677                         while (i--) {
35678                             m.add(ms[i]);
35679                         }
35680                         return {
35681                             string: string,
35682                             globalMatrix: global,
35683                             totalMatrix: m,
35684                             localMatrix: local,
35685                             diffMatrix: global.clone().add(local.invert()),
35686                             global: global.toTransformString(),
35687                             total: m.toTransformString(),
35688                             local: localString,
35689                             toString: propString
35690                         };
35691                     }
35692                     if (tstr instanceof Snap.Matrix) {
35693                         this.matrix = tstr;
35694                         this._.transform = tstr.toTransformString();
35695                     } else {
35696                         extractTransform(this, tstr);
35697                     }
35698
35699                     if (this.node) {
35700                         if (this.type == "linearGradient" || this.type == "radialGradient") {
35701                             $(this.node, {
35702                                 gradientTransform: this.matrix
35703                             });
35704                         } else if (this.type == "pattern") {
35705                             $(this.node, {
35706                                 patternTransform: this.matrix
35707                             });
35708                         } else {
35709                             $(this.node, {
35710                                 transform: this.matrix
35711                             });
35712                         }
35713                     }
35714
35715                     return this;
35716                 };
35717                 /*
35718                  * \ Element.parent [ method ] * Returns the element's parent * = (Element)
35719                  * the parent element \
35720                  */
35721                 elproto.parent = function() {
35722                     return wrap(this.node.parentNode);
35723                 };
35724                 /*
35725                  * \ Element.append [ method ] * Appends the given element to current one * -
35726                  * el (Element|Set) element to append = (Element) the parent element \
35727                  */
35728                 /*
35729                  * \ Element.add [ method ] * See @Element.append \
35730                  */
35731                 elproto.append = elproto.add = function(el) {
35732                     if (el) {
35733                         if (el.type == "set") {
35734                             var it = this;
35735                             el.forEach(function(el) {
35736                                 it.add(el);
35737                             });
35738                             return this;
35739                         }
35740                         el = wrap(el);
35741                         this.node.appendChild(el.node);
35742                         el.paper = this.paper;
35743                     }
35744                     return this;
35745                 };
35746                 /*
35747                  * \ Element.appendTo [ method ] * Appends the current element to the given
35748                  * one * - el (Element) parent element to append to = (Element) the child
35749                  * element \
35750                  */
35751                 elproto.appendTo = function(el) {
35752                     if (el) {
35753                         el = wrap(el);
35754                         el.append(this);
35755                     }
35756                     return this;
35757                 };
35758                 /*
35759                  * \ Element.prepend [ method ] * Prepends the given element to the current
35760                  * one * - el (Element) element to prepend = (Element) the parent element \
35761                  */
35762                 elproto.prepend = function(el) {
35763                     if (el) {
35764                         if (el.type == "set") {
35765                             var it = this,
35766                                 first;
35767                             el.forEach(function(el) {
35768                                 if (first) {
35769                                     first.after(el);
35770                                 } else {
35771                                     it.prepend(el);
35772                                 }
35773                                 first = el;
35774                             });
35775                             return this;
35776                         }
35777                         el = wrap(el);
35778                         var parent = el.parent();
35779                         this.node.insertBefore(el.node, this.node.firstChild);
35780                         this.add && this.add();
35781                         el.paper = this.paper;
35782                         this.parent() && this.parent().add();
35783                         parent && parent.add();
35784                     }
35785                     return this;
35786                 };
35787                 /*
35788                  * \ Element.prependTo [ method ] * Prepends the current element to the
35789                  * given one * - el (Element) parent element to prepend to = (Element) the
35790                  * child element \
35791                  */
35792                 elproto.prependTo = function(el) {
35793                     el = wrap(el);
35794                     el.prepend(this);
35795                     return this;
35796                 };
35797                 /*
35798                  * \ Element.before [ method ] * Inserts given element before the current
35799                  * one * - el (Element) element to insert = (Element) the parent element \
35800                  */
35801                 elproto.before = function(el) {
35802                     if (el.type == "set") {
35803                         var it = this;
35804                         el.forEach(function(el) {
35805                             var parent = el.parent();
35806                             it.node.parentNode.insertBefore(el.node, it.node);
35807                             parent && parent.add();
35808                         });
35809                         this.parent().add();
35810                         return this;
35811                     }
35812                     el = wrap(el);
35813                     var parent = el.parent();
35814                     this.node.parentNode.insertBefore(el.node, this.node);
35815                     this.parent() && this.parent().add();
35816                     parent && parent.add();
35817                     el.paper = this.paper;
35818                     return this;
35819                 };
35820                 /*
35821                  * \ Element.after [ method ] * Inserts given element after the current one * -
35822                  * el (Element) element to insert = (Element) the parent element \
35823                  */
35824                 elproto.after = function(el) {
35825                     el = wrap(el);
35826                     var parent = el.parent();
35827                     if (this.node.nextSibling) {
35828                         this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
35829                     } else {
35830                         this.node.parentNode.appendChild(el.node);
35831                     }
35832                     this.parent() && this.parent().add();
35833                     parent && parent.add();
35834                     el.paper = this.paper;
35835                     return this;
35836                 };
35837                 /*
35838                  * \ Element.insertBefore [ method ] * Inserts the element after the given
35839                  * one * - el (Element) element next to whom insert to = (Element) the
35840                  * parent element \
35841                  */
35842                 elproto.insertBefore = function(el) {
35843                     el = wrap(el);
35844                     var parent = this.parent();
35845                     el.node.parentNode.insertBefore(this.node, el.node);
35846                     this.paper = el.paper;
35847                     parent && parent.add();
35848                     el.parent() && el.parent().add();
35849                     return this;
35850                 };
35851                 /*
35852                  * \ Element.insertAfter [ method ] * Inserts the element after the given
35853                  * one * - el (Element) element next to whom insert to = (Element) the
35854                  * parent element \
35855                  */
35856                 elproto.insertAfter = function(el) {
35857                     el = wrap(el);
35858                     var parent = this.parent();
35859                     el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
35860                     this.paper = el.paper;
35861                     parent && parent.add();
35862                     el.parent() && el.parent().add();
35863                     return this;
35864                 };
35865                 /*
35866                  * \ Element.remove [ method ] * Removes element from the DOM = (Element)
35867                  * the detached element \
35868                  */
35869                 elproto.remove = function() {
35870                     var parent = this.parent();
35871                     this.node.parentNode && this.node.parentNode.removeChild(this.node);
35872                     delete this.paper;
35873                     this.removed = true;
35874                     parent && parent.add();
35875                     return this;
35876                 };
35877                 /*
35878                  * \ Element.select [ method ] * Gathers the nested @Element matching the
35879                  * given set of CSS selectors * - query (string) CSS selector = (Element)
35880                  * result of query selection \
35881                  */
35882                 elproto.select = function(query) {
35883                     query = Str(query).replace(/([^\\]):/g, "$1\\:");
35884                     return wrap(this.node.querySelector(query));
35885                 };
35886                 /*
35887                  * \ Element.selectAll [ method ] * Gathers nested @Element objects matching
35888                  * the given set of CSS selectors * - query (string) CSS selector =
35889                  * (Set|array) result of query selection \
35890                  */
35891                 elproto.selectAll = function(query) {
35892                     var nodelist = this.node.querySelectorAll(query),
35893                         set = (Snap.set || Array)();
35894                     for (var i = 0; i < nodelist.length; i++) {
35895                         set.push(wrap(nodelist[i]));
35896                     }
35897                     return set;
35898                 };
35899                 /*
35900                  * \ Element.asPX [ method ] * Returns given attribute of the element as a
35901                  * `px` value (not %, em, etc.) * - attr (string) attribute name - value
35902                  * (string) #optional attribute value = (Element) result of query selection \
35903                  */
35904                 elproto.asPX = function(attr, value) {
35905                     if (value == null) {
35906                         value = this.attr(attr);
35907                     }
35908                     return +unit2px(this, attr, value);
35909                 };
35910                 // SIERRA Element.use(): I suggest adding a note about how to access the
35911                 // original element the returned <use> instantiates. It's a part of SVG with
35912                 // which ordinary web developers may be least familiar.
35913                 /*
35914                  * \ Element.use [ method ] * Creates a `<use>` element linked to the
35915                  * current element * = (Element) the `<use>` element \
35916                  */
35917                 elproto.use = function() {
35918                     var use,
35919                         id = this.node.id;
35920                     if (!id) {
35921                         id = this.id;
35922                         $(this.node, {
35923                             id: id
35924                         });
35925                     }
35926                     if (this.type == "linearGradient" || this.type == "radialGradient" ||
35927                         this.type == "pattern") {
35928                         use = make(this.type, this.node.parentNode);
35929                     } else {
35930                         use = make("use", this.node.parentNode);
35931                     }
35932                     $(use.node, {
35933                         "xlink:href": "#" + id
35934                     });
35935                     use.original = this;
35936                     return use;
35937                 };
35938
35939                 function fixids(el) {
35940                     var els = el.selectAll("*"),
35941                         it,
35942                         url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
35943                         ids = [],
35944                         uses = {};
35945
35946                     function urltest(it, name) {
35947                         var val = $(it.node, name);
35948                         val = val && val.match(url);
35949                         val = val && val[2];
35950                         if (val && val.charAt() == "#") {
35951                             val = val.substring(1);
35952                         } else {
35953                             return;
35954                         }
35955                         if (val) {
35956                             uses[val] = (uses[val] || []).concat(function(id) {
35957                                 var attr = {};
35958                                 attr[name] = URL(id);
35959                                 $(it.node, attr);
35960                             });
35961                         }
35962                     }
35963
35964                     function linktest(it) {
35965                         var val = $(it.node, "xlink:href");
35966                         if (val && val.charAt() == "#") {
35967                             val = val.substring(1);
35968                         } else {
35969                             return;
35970                         }
35971                         if (val) {
35972                             uses[val] = (uses[val] || []).concat(function(id) {
35973                                 it.attr("xlink:href", "#" + id);
35974                             });
35975                         }
35976                     }
35977                     for (var i = 0, ii = els.length; i < ii; i++) {
35978                         it = els[i];
35979                         urltest(it, "fill");
35980                         urltest(it, "stroke");
35981                         urltest(it, "filter");
35982                         urltest(it, "mask");
35983                         urltest(it, "clip-path");
35984                         linktest(it);
35985                         var oldid = $(it.node, "id");
35986                         if (oldid) {
35987                             $(it.node, {
35988                                 id: it.id
35989                             });
35990                             ids.push({
35991                                 old: oldid,
35992                                 id: it.id
35993                             });
35994                         }
35995                     }
35996                     for (i = 0, ii = ids.length; i < ii; i++) {
35997                         var fs = uses[ids[i].old];
35998                         if (fs) {
35999                             for (var j = 0, jj = fs.length; j < jj; j++) {
36000                                 fs[j](ids[i].id);
36001                             }
36002                         }
36003                     }
36004                 }
36005                 /*
36006                  * \ Element.clone [ method ] * Creates a clone of the element and inserts
36007                  * it after the element * = (Element) the clone \
36008                  */
36009                 elproto.clone = function() {
36010                     var clone = wrap(this.node.cloneNode(true));
36011                     if ($(clone.node, "id")) {
36012                         $(clone.node, {
36013                             id: clone.id
36014                         });
36015                     }
36016                     fixids(clone);
36017                     clone.insertAfter(this);
36018                     return clone;
36019                 };
36020                 /*
36021                  * \ Element.toDefs [ method ] * Moves element to the shared `<defs>` area * =
36022                  * (Element) the element \
36023                  */
36024                 elproto.toDefs = function() {
36025                     var defs = getSomeDefs(this);
36026                     defs.appendChild(this.node);
36027                     return this;
36028                 };
36029                 /*
36030                  * \ Element.toPattern [ method ] * Creates a `<pattern>` element from the
36031                  * current element * To create a pattern you have to specify the pattern
36032                  * rect: - x (string|number) - y (string|number) - width (string|number) -
36033                  * height (string|number) = (Element) the `<pattern>` element You can use
36034                  * pattern later on as an argument for `fill` attribute: | var p =
36035                  * paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({ | fill: "none", |
36036                  * stroke: "#bada55", | strokeWidth: 5 | }).pattern(0, 0, 10, 10), | c =
36037                  * paper.circle(200, 200, 100); | c.attr({ | fill: p | }); \
36038                  */
36039                 elproto.pattern = elproto.toPattern = function(x, y, width, height) {
36040                     var p = make("pattern", getSomeDefs(this));
36041                     if (x == null) {
36042                         x = this.getBBox();
36043                     }
36044                     if (is(x, "object") && "x" in x) {
36045                         y = x.y;
36046                         width = x.width;
36047                         height = x.height;
36048                         x = x.x;
36049                     }
36050                     $(p.node, {
36051                         x: x,
36052                         y: y,
36053                         width: width,
36054                         height: height,
36055                         patternUnits: "userSpaceOnUse",
36056                         id: p.id,
36057                         viewBox: [x, y, width, height].join(" ")
36058                     });
36059                     p.node.appendChild(this.node);
36060                     return p;
36061                 };
36062                 // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you
36063                 // offset the object from its edge such as when centering it over a path.
36064                 // SIERRA Element.marker(): I suggest the method should accept default reference
36065                 // point values. Perhaps centered with (refX = width/2) and (refY = height/2)?
36066                 // Also, couldn't it assume the element's current _width_ and _height_? And
36067                 // please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't
36068                 // they also be assigned default values?
36069                 /*
36070                  * \ Element.marker [ method ] * Creates a `<marker>` element from the
36071                  * current element * To create a marker you have to specify the bounding
36072                  * rect and reference point: - x (number) - y (number) - width (number) -
36073                  * height (number) - refX (number) - refY (number) = (Element) the `<marker>`
36074                  * element You can specify the marker later as an argument for
36075                  * `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The
36076                  * `marker` attribute places the marker at every point along the path, and
36077                  * `marker-mid` places them at every point except the start and end. \
36078                  */
36079                 // TODO add usage for markers
36080                 elproto.marker = function(x, y, width, height, refX, refY) {
36081                     var p = make("marker", getSomeDefs(this));
36082                     if (x == null) {
36083                         x = this.getBBox();
36084                     }
36085                     if (is(x, "object") && "x" in x) {
36086                         y = x.y;
36087                         width = x.width;
36088                         height = x.height;
36089                         refX = x.refX || x.cx;
36090                         refY = x.refY || x.cy;
36091                         x = x.x;
36092                     }
36093                     $(p.node, {
36094                         viewBox: [x, y, width, height].join(" "),
36095                         markerWidth: width,
36096                         markerHeight: height,
36097                         orient: "auto",
36098                         refX: refX || 0,
36099                         refY: refY || 0,
36100                         id: p.id
36101                     });
36102                     p.node.appendChild(this.node);
36103                     return p;
36104                 };
36105                 // animation
36106                 function slice(from, to, f) {
36107                     return function(arr) {
36108                         var res = arr.slice(from, to);
36109                         if (res.length == 1) {
36110                             res = res[0];
36111                         }
36112                         return f ? f(res) : res;
36113                     };
36114                 }
36115                 var Animation = function(attr, ms, easing, callback) {
36116                     if (typeof easing == "function" && !easing.length) {
36117                         callback = easing;
36118                         easing = mina.linear;
36119                     }
36120                     this.attr = attr;
36121                     this.dur = ms;
36122                     easing && (this.easing = easing);
36123                     callback && (this.callback = callback);
36124                 };
36125                 Snap._.Animation = Animation;
36126                 /*
36127                  * \ Snap.animation [ method ] * Creates an animation object * - attr
36128                  * (object) attributes of final destination - duration (number) duration of
36129                  * the animation, in milliseconds - easing (function) #optional one of
36130                  * easing functions of @mina or custom one - callback (function) #optional
36131                  * callback function that fires when animation ends = (object) animation
36132                  * object \
36133                  */
36134                 Snap.animation = function(attr, ms, easing, callback) {
36135                     return new Animation(attr, ms, easing, callback);
36136                 };
36137                 /*
36138                  * \ Element.inAnim [ method ] * Returns a set of animations that may be
36139                  * able to manipulate the current element * = (object) in format: o { o anim
36140                  * (object) animation object, o mina (object) @mina object, o curStatus
36141                  * (number) 0..1 ÃƒÆ’¢â‚¬â€� status of the animation: 0 ÃƒÆ’¢â‚¬â€� just started,
36142                  * 1 ÃƒÆ’¢â‚¬â€� just finished, o status (function) gets or sets the status of
36143                  * the animation, o stop (function) stops the animation o } \
36144                  */
36145                 elproto.inAnim = function() {
36146                     var el = this,
36147                         res = [];
36148                     for (var id in el.anims)
36149                         if (el.anims[has](id)) {
36150                             (function(a) {
36151                                 res.push({
36152                                     anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
36153                                     mina: a,
36154                                     curStatus: a.status(),
36155                                     status: function(val) {
36156                                         return a.status(val);
36157                                     },
36158                                     stop: function() {
36159                                         a.stop();
36160                                     }
36161                                 });
36162                             }(el.anims[id]));
36163                         }
36164                     return res;
36165                 };
36166                 /*
36167                  * \ Snap.animate [ method ] * Runs generic animation of one number into
36168                  * another with a caring function * - from (number|array) number or array of
36169                  * numbers - to (number|array) number or array of numbers - setter
36170                  * (function) caring function that accepts one number argument - duration
36171                  * (number) duration, in milliseconds - easing (function) #optional easing
36172                  * function from @mina or custom - callback (function) #optional callback
36173                  * function to execute when animation ends = (object) animation object in
36174                  * @mina format o { o id (string) animation id, consider it read-only, o
36175                  * duration (function) gets or sets the duration of the animation, o easing
36176                  * (function) easing, o speed (function) gets or sets the speed of the
36177                  * animation, o status (function) gets or sets the status of the animation,
36178                  * o stop (function) stops the animation o } | var rect = Snap().rect(0, 0,
36179                  * 10, 10); | Snap.animate(0, 10, function (val) { | rect.attr({ | x: val |
36180                  * }); | }, 1000); | // in given context is equivalent to | rect.animate({x:
36181                  * 10}, 1000); \
36182                  */
36183                 Snap.animate = function(from, to, setter, ms, easing, callback) {
36184                     if (typeof easing == "function" && !easing.length) {
36185                         callback = easing;
36186                         easing = mina.linear;
36187                     }
36188                     var now = mina.time(),
36189                         anim = mina(from, to, now, now + ms, mina.time, setter, easing);
36190                     callback && eve.once("mina.finish." + anim.id, callback);
36191                     return anim;
36192                 };
36193                 /*
36194                  * \ Element.stop [ method ] * Stops all the animations for the current
36195                  * element * = (Element) the current element \
36196                  */
36197                 elproto.stop = function() {
36198                     var anims = this.inAnim();
36199                     for (var i = 0, ii = anims.length; i < ii; i++) {
36200                         anims[i].stop();
36201                     }
36202                     return this;
36203                 };
36204                 /*
36205                  * \ Element.animate [ method ] * Animates the given attributes of the
36206                  * element * - attrs (object) key-value pairs of destination attributes -
36207                  * duration (number) duration of the animation in milliseconds - easing
36208                  * (function) #optional easing function from @mina or custom - callback
36209                  * (function) #optional callback function that executes when the animation
36210                  * ends = (Element) the current element \
36211                  */
36212                 elproto.animate = function(attrs, ms, easing, callback) {
36213                     if (typeof easing == "function" && !easing.length) {
36214                         callback = easing;
36215                         easing = mina.linear;
36216                     }
36217                     if (attrs instanceof Animation) {
36218                         callback = attrs.callback;
36219                         easing = attrs.easing;
36220                         ms = easing.dur;
36221                         attrs = attrs.attr;
36222                     }
36223                     var fkeys = [],
36224                         tkeys = [],
36225                         keys = {},
36226                         from, to, f, eq,
36227                         el = this;
36228                     for (var key in attrs)
36229                         if (attrs[has](key)) {
36230                             if (el.equal) {
36231                                 eq = el.equal(key, Str(attrs[key]));
36232                                 from = eq.from;
36233                                 to = eq.to;
36234                                 f = eq.f;
36235                             } else {
36236                                 from = +el.attr(key);
36237                                 to = +attrs[key];
36238                             }
36239                             var len = is(from, "array") ? from.length : 1;
36240                             keys[key] = slice(fkeys.length, fkeys.length + len, f);
36241                             fkeys = fkeys.concat(from);
36242                             tkeys = tkeys.concat(to);
36243                         }
36244                     var now = mina.time(),
36245                         anim = mina(fkeys, tkeys, now, now + ms, mina.time, function(val) {
36246                             var attr = {};
36247                             for (var key in keys)
36248                                 if (keys[has](key)) {
36249                                     attr[key] = keys[key](val);
36250                                 }
36251                             el.attr(attr);
36252                         }, easing);
36253                     el.anims[anim.id] = anim;
36254                     anim._attrs = attrs;
36255                     anim._callback = callback;
36256                     eve("snap.animcreated." + el.id, anim);
36257                     eve.once("mina.finish." + anim.id, function() {
36258                         delete el.anims[anim.id];
36259                         callback && callback.call(el);
36260                     });
36261                     eve.once("mina.stop." + anim.id, function() {
36262                         delete el.anims[anim.id];
36263                     });
36264                     return el;
36265                 };
36266                 var eldata = {};
36267                 /*
36268                  * \ Element.data [ method ] * Adds or retrieves given value associated with
36269                  * given key. (Don’t confuse with `data-` attributes)
36270                  * 
36271                  * See also @Element.removeData - key (string) key to store data - value
36272                  * (any) #optional value to store = (object) @Element or, if value is not
36273                  * specified: = (any) value > Usage | for (var i = 0, i < 5, i++) { |
36274                  * paper.circle(10 + 15 * i, 10, 10) | .attr({fill: "#000"}) | .data("i", i) |
36275                  * .click(function () { | alert(this.data("i")); | }); | } \
36276                  */
36277                 elproto.data = function(key, value) {
36278                     var data = eldata[this.id] = eldata[this.id] || {};
36279                     if (arguments.length == 0) {
36280                         eve("snap.data.get." + this.id, this, data, null);
36281                         return data;
36282                     }
36283                     if (arguments.length == 1) {
36284                         if (Snap.is(key, "object")) {
36285                             for (var i in key)
36286                                 if (key[has](i)) {
36287                                     this.data(i, key[i]);
36288                                 }
36289                             return this;
36290                         }
36291                         eve("snap.data.get." + this.id, this, data[key], key);
36292                         return data[key];
36293                     }
36294                     data[key] = value;
36295                     eve("snap.data.set." + this.id, this, value, key);
36296                     return this;
36297                 };
36298                 /*
36299                  * \ Element.removeData [ method ] * Removes value associated with an
36300                  * element by given key. If key is not provided, removes all the data of the
36301                  * element. - key (string) #optional key = (object) @Element \
36302                  */
36303                 elproto.removeData = function(key) {
36304                     if (key == null) {
36305                         eldata[this.id] = {};
36306                     } else {
36307                         eldata[this.id] && delete eldata[this.id][key];
36308                     }
36309                     return this;
36310                 };
36311                 /*
36312                  * \ Element.outerSVG [ method ] * Returns SVG code for the element,
36313                  * equivalent to HTML's `outerHTML`.
36314                  * 
36315                  * See also @Element.innerSVG = (string) SVG code for the element \
36316                  */
36317                 /*
36318                  * \ Element.toString [ method ] * See @Element.outerSVG \
36319                  */
36320                 elproto.outerSVG = elproto.toString = toString(1);
36321                 /*
36322                  * \ Element.innerSVG [ method ] * Returns SVG code for the element's
36323                  * contents, equivalent to HTML's `innerHTML` = (string) SVG code for the
36324                  * element \
36325                  */
36326                 elproto.innerSVG = toString();
36327
36328                 function toString(type) {
36329                     return function() {
36330                         var res = type ? "<" + this.type : "",
36331                             attr = this.node.attributes,
36332                             chld = this.node.childNodes;
36333                         if (type) {
36334                             for (var i = 0, ii = attr.length; i < ii; i++) {
36335                                 res += " " + attr[i].name + '="' +
36336                                     attr[i].value.replace(/"/g, '\\"') + '"';
36337                             }
36338                         }
36339                         if (chld.length) {
36340                             type && (res += ">");
36341                             for (i = 0, ii = chld.length; i < ii; i++) {
36342                                 if (chld[i].nodeType == 3) {
36343                                     res += chld[i].nodeValue;
36344                                 } else if (chld[i].nodeType == 1) {
36345                                     res += wrap(chld[i]).toString();
36346                                 }
36347                             }
36348                             type && (res += "</" + this.type + ">");
36349                         } else {
36350                             type && (res += "/>");
36351                         }
36352                         return res;
36353                     };
36354                 }
36355                 elproto.toDataURL = function() {
36356                     if (window && window.btoa) {
36357                         var bb = this.getBBox(),
36358                             svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
36359                                 x: +bb.x.toFixed(3),
36360                                 y: +bb.y.toFixed(3),
36361                                 width: +bb.width.toFixed(3),
36362                                 height: +bb.height.toFixed(3),
36363                                 contents: this.outerSVG()
36364                             });
36365                         return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
36366                     }
36367                 };
36368                 /*
36369                  * \ Fragment.select [ method ] * See @Element.select \
36370                  */
36371                 Fragment.prototype.select = elproto.select;
36372                 /*
36373                  * \ Fragment.selectAll [ method ] * See @Element.selectAll \
36374                  */
36375                 Fragment.prototype.selectAll = elproto.selectAll;
36376             });
36377
36378             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36379             // 
36380             // Licensed under the Apache License, Version 2.0 (the "License");
36381             // you may not use this file except in compliance with the License.
36382             // You may obtain a copy of the License at
36383             // 
36384             // http://www.apache.org/licenses/LICENSE-2.0
36385             // 
36386             // Unless required by applicable law or agreed to in writing, software
36387             // distributed under the License is distributed on an "AS IS" BASIS,
36388             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36389             // See the License for the specific language governing permissions and
36390             // limitations under the License.
36391             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36392                 var objectToString = Object.prototype.toString,
36393                     Str = String,
36394                     math = Math,
36395                     E = "";
36396
36397                 function Matrix(a, b, c, d, e, f) {
36398                     if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
36399                         this.a = a.a;
36400                         this.b = a.b;
36401                         this.c = a.c;
36402                         this.d = a.d;
36403                         this.e = a.e;
36404                         this.f = a.f;
36405                         return;
36406                     }
36407                     if (a != null) {
36408                         this.a = +a;
36409                         this.b = +b;
36410                         this.c = +c;
36411                         this.d = +d;
36412                         this.e = +e;
36413                         this.f = +f;
36414                     } else {
36415                         this.a = 1;
36416                         this.b = 0;
36417                         this.c = 0;
36418                         this.d = 1;
36419                         this.e = 0;
36420                         this.f = 0;
36421                     }
36422                 }
36423                 (function(matrixproto) {
36424                     /*
36425                      * \ Matrix.add [ method ] * Adds the given matrix to existing one - a
36426                      * (number) - b (number) - c (number) - d (number) - e (number) - f
36427                      * (number) or - matrix (object) @Matrix \
36428                      */
36429                     matrixproto.add = function(a, b, c, d, e, f) {
36430                         var out = [
36431                                 [],
36432                                 [],
36433                                 []
36434                             ],
36435                             m = [
36436                                 [this.a, this.c, this.e],
36437                                 [this.b, this.d, this.f],
36438                                 [0, 0, 1]
36439                             ],
36440                             matrix = [
36441                                 [a, c, e],
36442                                 [b, d, f],
36443                                 [0, 0, 1]
36444                             ],
36445                             x, y, z, res;
36446
36447                         if (a && a instanceof Matrix) {
36448                             matrix = [
36449                                 [a.a, a.c, a.e],
36450                                 [a.b, a.d, a.f],
36451                                 [0, 0, 1]
36452                             ];
36453                         }
36454
36455                         for (x = 0; x < 3; x++) {
36456                             for (y = 0; y < 3; y++) {
36457                                 res = 0;
36458                                 for (z = 0; z < 3; z++) {
36459                                     res += m[x][z] * matrix[z][y];
36460                                 }
36461                                 out[x][y] = res;
36462                             }
36463                         }
36464                         this.a = out[0][0];
36465                         this.b = out[1][0];
36466                         this.c = out[0][1];
36467                         this.d = out[1][1];
36468                         this.e = out[0][2];
36469                         this.f = out[1][2];
36470                         return this;
36471                     };
36472                     /*
36473                      * \ Matrix.invert [ method ] * Returns an inverted version of the
36474                      * matrix = (object) @Matrix \
36475                      */
36476                     matrixproto.invert = function() {
36477                         var me = this,
36478                             x = me.a * me.d - me.b * me.c;
36479                         return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
36480                     };
36481                     /*
36482                      * \ Matrix.clone [ method ] * Returns a copy of the matrix = (object)
36483                      * @Matrix \
36484                      */
36485                     matrixproto.clone = function() {
36486                         return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
36487                     };
36488                     /*
36489                      * \ Matrix.translate [ method ] * Translate the matrix - x (number)
36490                      * horizontal offset distance - y (number) vertical offset distance \
36491                      */
36492                     matrixproto.translate = function(x, y) {
36493                         return this.add(1, 0, 0, 1, x, y);
36494                     };
36495                     /*
36496                      * \ Matrix.scale [ method ] * Scales the matrix - x (number) amount to
36497                      * be scaled, with `1` resulting in no change - y (number) #optional
36498                      * amount to scale along the vertical axis. (Otherwise `x` applies to
36499                      * both axes.) - cx (number) #optional horizontal origin point from
36500                      * which to scale - cy (number) #optional vertical origin point from
36501                      * which to scale Default cx, cy is the middle point of the element. \
36502                      */
36503                     matrixproto.scale = function(x, y, cx, cy) {
36504                         y == null && (y = x);
36505                         (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
36506                         this.add(x, 0, 0, y, 0, 0);
36507                         (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
36508                         return this;
36509                     };
36510                     /*
36511                      * \ Matrix.rotate [ method ] * Rotates the matrix - a (number) angle of
36512                      * rotation, in degrees - x (number) horizontal origin point from which
36513                      * to rotate - y (number) vertical origin point from which to rotate \
36514                      */
36515                     matrixproto.rotate = function(a, x, y) {
36516                         a = Snap.rad(a);
36517                         x = x || 0;
36518                         y = y || 0;
36519                         var cos = +math.cos(a).toFixed(9),
36520                             sin = +math.sin(a).toFixed(9);
36521                         this.add(cos, sin, -sin, cos, x, y);
36522                         return this.add(1, 0, 0, 1, -x, -y);
36523                     };
36524                     /*
36525                      * \ Matrix.x [ method ] * Returns x coordinate for given point after
36526                      * transformation described by the matrix. See also @Matrix.y - x
36527                      * (number) - y (number) = (number) x \
36528                      */
36529                     matrixproto.x = function(x, y) {
36530                         return x * this.a + y * this.c + this.e;
36531                     };
36532                     /*
36533                      * \ Matrix.y [ method ] * Returns y coordinate for given point after
36534                      * transformation described by the matrix. See also @Matrix.x - x
36535                      * (number) - y (number) = (number) y \
36536                      */
36537                     matrixproto.y = function(x, y) {
36538                         return x * this.b + y * this.d + this.f;
36539                     };
36540                     matrixproto.get = function(i) {
36541                         return +this[Str.fromCharCode(97 + i)].toFixed(4);
36542                     };
36543                     matrixproto.toString = function() {
36544                         return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
36545                     };
36546                     matrixproto.offset = function() {
36547                         return [this.e.toFixed(4), this.f.toFixed(4)];
36548                     };
36549
36550                     function norm(a) {
36551                         return a[0] * a[0] + a[1] * a[1];
36552                     }
36553
36554                     function normalize(a) {
36555                         var mag = math.sqrt(norm(a));
36556                         a[0] && (a[0] /= mag);
36557                         a[1] && (a[1] /= mag);
36558                     }
36559                     /*
36560                      * \ Matrix.determinant [ method ] * Finds determinant of the given
36561                      * matrix. = (number) determinant \
36562                      */
36563                     matrixproto.determinant = function() {
36564                         return this.a * this.d - this.b * this.c;
36565                     };
36566                     /*
36567                      * \ Matrix.split [ method ] * Splits matrix into primitive
36568                      * transformations = (object) in format: o dx (number) translation by x
36569                      * o dy (number) translation by y o scalex (number) scale by x o scaley
36570                      * (number) scale by y o shear (number) shear o rotate (number) rotation
36571                      * in deg o isSimple (boolean) could it be represented via simple
36572                      * transformations \
36573                      */
36574                     matrixproto.split = function() {
36575                         var out = {};
36576                         // translation
36577                         out.dx = this.e;
36578                         out.dy = this.f;
36579
36580                         // scale and shear
36581                         var row = [
36582                             [this.a, this.c],
36583                             [this.b, this.d]
36584                         ];
36585                         out.scalex = math.sqrt(norm(row[0]));
36586                         normalize(row[0]);
36587
36588                         out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
36589                         row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
36590
36591                         out.scaley = math.sqrt(norm(row[1]));
36592                         normalize(row[1]);
36593                         out.shear /= out.scaley;
36594
36595                         if (this.determinant() < 0) {
36596                             out.scalex = -out.scalex;
36597                         }
36598
36599                         // rotation
36600                         var sin = -row[0][1],
36601                             cos = row[1][1];
36602                         if (cos < 0) {
36603                             out.rotate = Snap.deg(math.acos(cos));
36604                             if (sin < 0) {
36605                                 out.rotate = 360 - out.rotate;
36606                             }
36607                         } else {
36608                             out.rotate = Snap.deg(math.asin(sin));
36609                         }
36610
36611                         out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
36612                         out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
36613                         out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
36614                         return out;
36615                     };
36616                     /*
36617                      * \ Matrix.toTransformString [ method ] * Returns transform string that
36618                      * represents given matrix = (string) transform string \
36619                      */
36620                     matrixproto.toTransformString = function(shorter) {
36621                         var s = shorter || this.split();
36622                         if (!+s.shear.toFixed(9)) {
36623                             s.scalex = +s.scalex.toFixed(4);
36624                             s.scaley = +s.scaley.toFixed(4);
36625                             s.rotate = +s.rotate.toFixed(4);
36626                             return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
36627                                 (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
36628                                 (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
36629                         } else {
36630                             return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
36631                         }
36632                     };
36633                 })(Matrix.prototype);
36634                 /*
36635                  * \ Snap.Matrix [ method ] * Matrix constructor, extend on your own risk.
36636                  * To create matrices use @Snap.matrix. \
36637                  */
36638                 Snap.Matrix = Matrix;
36639                 /*
36640                  * \ Snap.matrix [ method ] * Utility method * Returns a matrix based on the
36641                  * given parameters - a (number) - b (number) - c (number) - d (number) - e
36642                  * (number) - f (number) or - svgMatrix (SVGMatrix) = (object) @Matrix \
36643                  */
36644                 Snap.matrix = function(a, b, c, d, e, f) {
36645                     return new Matrix(a, b, c, d, e, f);
36646                 };
36647             });
36648             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36649             // 
36650             // Licensed under the Apache License, Version 2.0 (the "License");
36651             // you may not use this file except in compliance with the License.
36652             // You may obtain a copy of the License at
36653             // 
36654             // http://www.apache.org/licenses/LICENSE-2.0
36655             // 
36656             // Unless required by applicable law or agreed to in writing, software
36657             // distributed under the License is distributed on an "AS IS" BASIS,
36658             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36659             // See the License for the specific language governing permissions and
36660             // limitations under the License.
36661             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36662                 var has = "hasOwnProperty",
36663                     make = Snap._.make,
36664                     wrap = Snap._.wrap,
36665                     is = Snap.is,
36666                     getSomeDefs = Snap._.getSomeDefs,
36667                     reURLValue = /^url\(#?([^)]+)\)$/,
36668                     $ = Snap._.$,
36669                     URL = Snap.url,
36670                     Str = String,
36671                     separator = Snap._.separator,
36672                     E = "";
36673                 // Attributes event handlers
36674                 eve.on("snap.util.attr.mask", function(value) {
36675                     if (value instanceof Element || value instanceof Fragment) {
36676                         eve.stop();
36677                         if (value instanceof Fragment && value.node.childNodes.length == 1) {
36678                             value = value.node.firstChild;
36679                             getSomeDefs(this).appendChild(value);
36680                             value = wrap(value);
36681                         }
36682                         if (value.type == "mask") {
36683                             var mask = value;
36684                         } else {
36685                             mask = make("mask", getSomeDefs(this));
36686                             mask.node.appendChild(value.node);
36687                         }!mask.node.id && $(mask.node, {
36688                             id: mask.id
36689                         });
36690                         $(this.node, {
36691                             mask: URL(mask.id)
36692                         });
36693                     }
36694                 });
36695                 (function(clipIt) {
36696                     eve.on("snap.util.attr.clip", clipIt);
36697                     eve.on("snap.util.attr.clip-path", clipIt);
36698                     eve.on("snap.util.attr.clipPath", clipIt);
36699                 }(function(value) {
36700                     if (value instanceof Element || value instanceof Fragment) {
36701                         eve.stop();
36702                         if (value.type == "clipPath") {
36703                             var clip = value;
36704                         } else {
36705                             clip = make("clipPath", getSomeDefs(this));
36706                             clip.node.appendChild(value.node);
36707                             !clip.node.id && $(clip.node, {
36708                                 id: clip.id
36709                             });
36710                         }
36711                         $(this.node, {
36712                             "clip-path": URL(clip.node.id || clip.id)
36713                         });
36714                     }
36715                 }));
36716
36717                 function fillStroke(name) {
36718                     return function(value) {
36719                         eve.stop();
36720                         if (value instanceof Fragment && value.node.childNodes.length == 1 &&
36721                             (value.node.firstChild.tagName == "radialGradient" ||
36722                                 value.node.firstChild.tagName == "linearGradient" ||
36723                                 value.node.firstChild.tagName == "pattern")) {
36724                             value = value.node.firstChild;
36725                             getSomeDefs(this).appendChild(value);
36726                             value = wrap(value);
36727                         }
36728                         if (value instanceof Element) {
36729                             if (value.type == "radialGradient" || value.type == "linearGradient" || value.type == "pattern") {
36730                                 if (!value.node.id) {
36731                                     $(value.node, {
36732                                         id: value.id
36733                                     });
36734                                 }
36735                                 var fill = URL(value.node.id);
36736                             } else {
36737                                 fill = value.attr(name);
36738                             }
36739                         } else {
36740                             fill = Snap.color(value);
36741                             if (fill.error) {
36742                                 var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
36743                                 if (grad) {
36744                                     if (!grad.node.id) {
36745                                         $(grad.node, {
36746                                             id: grad.id
36747                                         });
36748                                     }
36749                                     fill = URL(grad.node.id);
36750                                 } else {
36751                                     fill = value;
36752                                 }
36753                             } else {
36754                                 fill = Str(fill);
36755                             }
36756                         }
36757                         var attrs = {};
36758                         attrs[name] = fill;
36759                         $(this.node, attrs);
36760                         this.node.style[name] = E;
36761                     };
36762                 }
36763                 eve.on("snap.util.attr.fill", fillStroke("fill"));
36764                 eve.on("snap.util.attr.stroke", fillStroke("stroke"));
36765                 var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
36766                 eve.on("snap.util.grad.parse", function parseGrad(string) {
36767                     string = Str(string);
36768                     var tokens = string.match(gradrg);
36769                     if (!tokens) {
36770                         return null;
36771                     }
36772                     var type = tokens[1],
36773                         params = tokens[2],
36774                         stops = tokens[3];
36775                     params = params.split(/\s*,\s*/).map(function(el) {
36776                         return +el == el ? +el : el;
36777                     });
36778                     if (params.length == 1 && params[0] == 0) {
36779                         params = [];
36780                     }
36781                     stops = stops.split("-");
36782                     stops = stops.map(function(el) {
36783                         el = el.split(":");
36784                         var out = {
36785                             color: el[0]
36786                         };
36787                         if (el[1]) {
36788                             out.offset = parseFloat(el[1]);
36789                         }
36790                         return out;
36791                     });
36792                     return {
36793                         type: type,
36794                         params: params,
36795                         stops: stops
36796                     };
36797                 });
36798
36799                 eve.on("snap.util.attr.d", function(value) {
36800                     eve.stop();
36801                     if (is(value, "array") && is(value[0], "array")) {
36802                         value = Snap.path.toString.call(value);
36803                     }
36804                     value = Str(value);
36805                     if (value.match(/[ruo]/i)) {
36806                         value = Snap.path.toAbsolute(value);
36807                     }
36808                     $(this.node, {
36809                         d: value
36810                     });
36811                 })(-1);
36812                 eve.on("snap.util.attr.#text", function(value) {
36813                     eve.stop();
36814                     value = Str(value);
36815                     var txt = glob.doc.createTextNode(value);
36816                     while (this.node.firstChild) {
36817                         this.node.removeChild(this.node.firstChild);
36818                     }
36819                     this.node.appendChild(txt);
36820                 })(-1);
36821                 eve.on("snap.util.attr.path", function(value) {
36822                     eve.stop();
36823                     this.attr({
36824                         d: value
36825                     });
36826                 })(-1);
36827                 eve.on("snap.util.attr.class", function(value) {
36828                     eve.stop();
36829                     this.node.className.baseVal = value;
36830                 })(-1);
36831                 eve.on("snap.util.attr.viewBox", function(value) {
36832                     var vb;
36833                     if (is(value, "object") && "x" in value) {
36834                         vb = [value.x, value.y, value.width, value.height].join(" ");
36835                     } else if (is(value, "array")) {
36836                         vb = value.join(" ");
36837                     } else {
36838                         vb = value;
36839                     }
36840                     $(this.node, {
36841                         viewBox: vb
36842                     });
36843                     eve.stop();
36844                 })(-1);
36845                 eve.on("snap.util.attr.transform", function(value) {
36846                     this.transform(value);
36847                     eve.stop();
36848                 })(-1);
36849                 eve.on("snap.util.attr.r", function(value) {
36850                     if (this.type == "rect") {
36851                         eve.stop();
36852                         $(this.node, {
36853                             rx: value,
36854                             ry: value
36855                         });
36856                     }
36857                 })(-1);
36858                 eve.on("snap.util.attr.textpath", function(value) {
36859                     eve.stop();
36860                     if (this.type == "text") {
36861                         var id, tp, node;
36862                         if (!value && this.textPath) {
36863                             tp = this.textPath;
36864                             while (tp.node.firstChild) {
36865                                 this.node.appendChild(tp.node.firstChild);
36866                             }
36867                             tp.remove();
36868                             delete this.textPath;
36869                             return;
36870                         }
36871                         if (is(value, "string")) {
36872                             var defs = getSomeDefs(this),
36873                                 path = wrap(defs.parentNode).path(value);
36874                             defs.appendChild(path.node);
36875                             id = path.id;
36876                             path.attr({
36877                                 id: id
36878                             });
36879                         } else {
36880                             value = wrap(value);
36881                             if (value instanceof Element) {
36882                                 id = value.attr("id");
36883                                 if (!id) {
36884                                     id = value.id;
36885                                     value.attr({
36886                                         id: id
36887                                     });
36888                                 }
36889                             }
36890                         }
36891                         if (id) {
36892                             tp = this.textPath;
36893                             node = this.node;
36894                             if (tp) {
36895                                 tp.attr({
36896                                     "xlink:href": "#" + id
36897                                 });
36898                             } else {
36899                                 tp = $("textPath", {
36900                                     "xlink:href": "#" + id
36901                                 });
36902                                 while (node.firstChild) {
36903                                     tp.appendChild(node.firstChild);
36904                                 }
36905                                 node.appendChild(tp);
36906                                 this.textPath = wrap(tp);
36907                             }
36908                         }
36909                     }
36910                 })(-1);
36911                 eve.on("snap.util.attr.text", function(value) {
36912                     if (this.type == "text") {
36913                         var i = 0,
36914                             node = this.node,
36915                             tuner = function(chunk) {
36916                                 var out = $("tspan");
36917                                 if (is(chunk, "array")) {
36918                                     for (var i = 0; i < chunk.length; i++) {
36919                                         out.appendChild(tuner(chunk[i]));
36920                                     }
36921                                 } else {
36922                                     out.appendChild(glob.doc.createTextNode(chunk));
36923                                 }
36924                                 out.normalize && out.normalize();
36925                                 return out;
36926                             };
36927                         while (node.firstChild) {
36928                             node.removeChild(node.firstChild);
36929                         }
36930                         var tuned = tuner(value);
36931                         while (tuned.firstChild) {
36932                             node.appendChild(tuned.firstChild);
36933                         }
36934                     }
36935                     eve.stop();
36936                 })(-1);
36937
36938                 function setFontSize(value) {
36939                     eve.stop();
36940                     if (value == +value) {
36941                         value += "px";
36942                     }
36943                     this.node.style.fontSize = value;
36944                 }
36945                 eve.on("snap.util.attr.fontSize", setFontSize)(-1);
36946                 eve.on("snap.util.attr.font-size", setFontSize)(-1);
36947
36948
36949                 eve.on("snap.util.getattr.transform", function() {
36950                     eve.stop();
36951                     return this.transform();
36952                 })(-1);
36953                 eve.on("snap.util.getattr.textpath", function() {
36954                     eve.stop();
36955                     return this.textPath;
36956                 })(-1);
36957                 // Markers
36958                 (function() {
36959                     function getter(end) {
36960                         return function() {
36961                             eve.stop();
36962                             var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
36963                             if (style == "none") {
36964                                 return style;
36965                             } else {
36966                                 return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
36967                             }
36968                         };
36969                     }
36970
36971                     function setter(end) {
36972                         return function(value) {
36973                             eve.stop();
36974                             var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
36975                             if (value == "" || !value) {
36976                                 this.node.style[name] = "none";
36977                                 return;
36978                             }
36979                             if (value.type == "marker") {
36980                                 var id = value.node.id;
36981                                 if (!id) {
36982                                     $(value.node, {
36983                                         id: value.id
36984                                     });
36985                                 }
36986                                 this.node.style[name] = URL(id);
36987                                 return;
36988                             }
36989                         };
36990                     }
36991                     eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
36992                     eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
36993                     eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
36994                     eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
36995                     eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
36996                     eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
36997                     eve.on("snap.util.attr.marker-end", setter("end"))(-1);
36998                     eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
36999                     eve.on("snap.util.attr.marker-start", setter("start"))(-1);
37000                     eve.on("snap.util.attr.markerStart", setter("start"))(-1);
37001                     eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
37002                     eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
37003                 }());
37004                 eve.on("snap.util.getattr.r", function() {
37005                     if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
37006                         eve.stop();
37007                         return $(this.node, "rx");
37008                     }
37009                 })(-1);
37010
37011                 function textExtract(node) {
37012                     var out = [];
37013                     var children = node.childNodes;
37014                     for (var i = 0, ii = children.length; i < ii; i++) {
37015                         var chi = children[i];
37016                         if (chi.nodeType == 3) {
37017                             out.push(chi.nodeValue);
37018                         }
37019                         if (chi.tagName == "tspan") {
37020                             if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
37021                                 out.push(chi.firstChild.nodeValue);
37022                             } else {
37023                                 out.push(textExtract(chi));
37024                             }
37025                         }
37026                     }
37027                     return out;
37028                 }
37029                 eve.on("snap.util.getattr.text", function() {
37030                     if (this.type == "text" || this.type == "tspan") {
37031                         eve.stop();
37032                         var out = textExtract(this.node);
37033                         return out.length == 1 ? out[0] : out;
37034                     }
37035                 })(-1);
37036                 eve.on("snap.util.getattr.#text", function() {
37037                     return this.node.textContent;
37038                 })(-1);
37039                 eve.on("snap.util.getattr.viewBox", function() {
37040                     eve.stop();
37041                     var vb = $(this.node, "viewBox");
37042                     if (vb) {
37043                         vb = vb.split(separator);
37044                         return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
37045                     } else {
37046                         return;
37047                     }
37048                 })(-1);
37049                 eve.on("snap.util.getattr.points", function() {
37050                     var p = $(this.node, "points");
37051                     eve.stop();
37052                     if (p) {
37053                         return p.split(separator);
37054                     } else {
37055                         return;
37056                     }
37057                 })(-1);
37058                 eve.on("snap.util.getattr.path", function() {
37059                     var p = $(this.node, "d");
37060                     eve.stop();
37061                     return p;
37062                 })(-1);
37063                 eve.on("snap.util.getattr.class", function() {
37064                     return this.node.className.baseVal;
37065                 })(-1);
37066
37067                 function getFontSize() {
37068                     eve.stop();
37069                     return this.node.style.fontSize;
37070                 }
37071                 eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
37072                 eve.on("snap.util.getattr.font-size", getFontSize)(-1);
37073             });
37074
37075             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37076             // 
37077             // Licensed under the Apache License, Version 2.0 (the "License");
37078             // you may not use this file except in compliance with the License.
37079             // You may obtain a copy of the License at
37080             // 
37081             // http://www.apache.org/licenses/LICENSE-2.0
37082             // 
37083             // Unless required by applicable law or agreed to in writing, software
37084             // distributed under the License is distributed on an "AS IS" BASIS,
37085             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37086             // See the License for the specific language governing permissions and
37087             // limitations under the License.
37088             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
37089                 var proto = Paper.prototype,
37090                     is = Snap.is;
37091                 /*
37092                  * \ Paper.rect [ method ]
37093                  * 
37094                  * Draws a rectangle * - x (number) x coordinate of the top left corner - y
37095                  * (number) y coordinate of the top left corner - width (number) width -
37096                  * height (number) height - rx (number) #optional horizontal radius for
37097                  * rounded corners, default is 0 - ry (number) #optional vertical radius for
37098                  * rounded corners, default is rx or 0 = (object) the `rect` element * >
37099                  * Usage | // regular rectangle | var c = paper.rect(10, 10, 50, 50); | //
37100                  * rectangle with rounded corners | var c = paper.rect(40, 40, 50, 50, 10); \
37101                  */
37102                 proto.rect = function(x, y, w, h, rx, ry) {
37103                     var attr;
37104                     if (ry == null) {
37105                         ry = rx;
37106                     }
37107                     if (is(x, "object") && x == "[object Object]") {
37108                         attr = x;
37109                     } else if (x != null) {
37110                         attr = {
37111                             x: x,
37112                             y: y,
37113                             width: w,
37114                             height: h
37115                         };
37116                         if (rx != null) {
37117                             attr.rx = rx;
37118                             attr.ry = ry;
37119                         }
37120                     }
37121                     return this.el("rect", attr);
37122                 };
37123                 /*
37124                  * \ Paper.circle [ method ] * Draws a circle * - x (number) x coordinate of
37125                  * the centre - y (number) y coordinate of the centre - r (number) radius =
37126                  * (object) the `circle` element * > Usage | var c = paper.circle(50, 50,
37127                  * 40); \
37128                  */
37129                 proto.circle = function(cx, cy, r) {
37130                     var attr;
37131                     if (is(cx, "object") && cx == "[object Object]") {
37132                         attr = cx;
37133                     } else if (cx != null) {
37134                         attr = {
37135                             cx: cx,
37136                             cy: cy,
37137                             r: r
37138                         };
37139                     }
37140                     return this.el("circle", attr);
37141                 };
37142
37143                 var preload = (function() {
37144                     function onerror() {
37145                         this.parentNode.removeChild(this);
37146                     }
37147                     return function(src, f) {
37148                         var img = glob.doc.createElement("img"),
37149                             body = glob.doc.body;
37150                         img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
37151                         img.onload = function() {
37152                             f.call(img);
37153                             img.onload = img.onerror = null;
37154                             body.removeChild(img);
37155                         };
37156                         img.onerror = onerror;
37157                         body.appendChild(img);
37158                         img.src = src;
37159                     };
37160                 }());
37161
37162                 /*
37163                  * \ Paper.image [ method ] * Places an image on the surface * - src
37164                  * (string) URI of the source image - x (number) x offset position - y
37165                  * (number) y offset position - width (number) width of the image - height
37166                  * (number) height of the image = (object) the `image` element or = (object)
37167                  * Snap element object with type `image` * > Usage | var c =
37168                  * paper.image("apple.png", 10, 10, 80, 80); \
37169                  */
37170                 proto.image = function(src, x, y, width, height) {
37171                     var el = this.el("image");
37172                     if (is(src, "object") && "src" in src) {
37173                         el.attr(src);
37174                     } else if (src != null) {
37175                         var set = {
37176                             "xlink:href": src,
37177                             preserveAspectRatio: "none"
37178                         };
37179                         if (x != null && y != null) {
37180                             set.x = x;
37181                             set.y = y;
37182                         }
37183                         if (width != null && height != null) {
37184                             set.width = width;
37185                             set.height = height;
37186                         } else {
37187                             preload(src, function() {
37188                                 Snap._.$(el.node, {
37189                                     width: this.offsetWidth,
37190                                     height: this.offsetHeight
37191                                 });
37192                             });
37193                         }
37194                         Snap._.$(el.node, set);
37195                     }
37196                     return el;
37197                 };
37198                 /*
37199                  * \ Paper.ellipse [ method ] * Draws an ellipse * - x (number) x coordinate
37200                  * of the centre - y (number) y coordinate of the centre - rx (number)
37201                  * horizontal radius - ry (number) vertical radius = (object) the `ellipse`
37202                  * element * > Usage | var c = paper.ellipse(50, 50, 40, 20); \
37203                  */
37204                 proto.ellipse = function(cx, cy, rx, ry) {
37205                     var attr;
37206                     if (is(cx, "object") && cx == "[object Object]") {
37207                         attr = cx;
37208                     } else if (cx != null) {
37209                         attr = {
37210                             cx: cx,
37211                             cy: cy,
37212                             rx: rx,
37213                             ry: ry
37214                         };
37215                     }
37216                     return this.el("ellipse", attr);
37217                 };
37218                 // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is,
37219                 // and why it would make life any easier.
37220                 /*
37221                  * \ Paper.path [ method ] * Creates a `<path>` element using the given
37222                  * string as the path's definition - pathString (string) #optional path
37223                  * string in SVG format Path string consists of one-letter commands,
37224                  * followed by comma seprarated arguments in numerical form. Example: |
37225                  * "M10,20L30,40" This example features two commands: `M`, with arguments
37226                  * `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands
37227                  * express coordinates in absolute terms, while lowercase commands express
37228                  * them in relative terms from the most recently declared coordinates.
37229                  *  # <p>Here is short list of commands available, for more details see <a
37230                  * href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a
37231                  * path's data attribute's format are described in the SVG
37232                  * specification.">SVG path string format</a> or <a
37233                  * href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about
37234                  * path strings at MDN</a>.</p> # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody> #
37235                  * <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr> # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr> #
37236                  * <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr> # <tr><td>H</td><td>horizontal
37237                  * lineto</td><td>x+</td></tr> # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr> #
37238                  * <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr> #
37239                  * <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr> #
37240                  * <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x
37241                  * y)+</td></tr> # <tr><td>T</td><td>smooth quadratic Bézier
37242                  * curveto</td><td>(x y)+</td></tr> # <tr><td>A</td><td>elliptical
37243                  * arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr> #
37244                  * <tr><td>R</td><td><a
37245                  * href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom
37246                  * curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table> *
37247                  * _Catmull-Rom curveto_ is a not standard SVG command and added to make
37248                  * life easier. Note: there is a special case when a path consists of only
37249                  * three commands: `M10,10R…z`. In this case the path connects back to
37250                  * its starting point. > Usage | var c = paper.path("M10 10L90 90"); | //
37251                  * draw a diagonal line: | // move to 10,10, line to 90,90 \
37252                  */
37253                 proto.path = function(d) {
37254                     var attr;
37255                     if (is(d, "object") && !is(d, "array")) {
37256                         attr = d;
37257                     } else if (d) {
37258                         attr = {
37259                             d: d
37260                         };
37261                     }
37262                     return this.el("path", attr);
37263                 };
37264                 /*
37265                  * \ Paper.g [ method ] * Creates a group element * - varargs (…)
37266                  * #optional elements to nest within the group = (object) the `g` element * >
37267                  * Usage | var c1 = paper.circle(), | c2 = paper.rect(), | g = paper.g(c2,
37268                  * c1); // note that the order of elements is different or | var c1 =
37269                  * paper.circle(), | c2 = paper.rect(), | g = paper.g(); | g.add(c2, c1); \
37270                  */
37271                 /*
37272                  * \ Paper.group [ method ] * See @Paper.g \
37273                  */
37274                 proto.group = proto.g = function(first) {
37275                     var attr,
37276                         el = this.el("g");
37277                     if (arguments.length == 1 && first && !first.type) {
37278                         el.attr(first);
37279                     } else if (arguments.length) {
37280                         el.add(Array.prototype.slice.call(arguments, 0));
37281                     }
37282                     return el;
37283                 };
37284                 /*
37285                  * \ Paper.svg [ method ] * Creates a nested SVG element. - x (number)
37286                  * @optional X of the element - y (number) @optional Y of the element -
37287                  * width (number) @optional width of the element - height (number) @optional
37288                  * height of the element - vbx (number) @optional viewbox X - vby (number)
37289                  * @optional viewbox Y - vbw (number) @optional viewbox width - vbh (number)
37290                  * @optional viewbox height * = (object) the `svg` element * \
37291                  */
37292                 proto.svg = function(x, y, width, height, vbx, vby, vbw, vbh) {
37293                     var attrs = {};
37294                     if (is(x, "object") && y == null) {
37295                         attrs = x;
37296                     } else {
37297                         if (x != null) {
37298                             attrs.x = x;
37299                         }
37300                         if (y != null) {
37301                             attrs.y = y;
37302                         }
37303                         if (width != null) {
37304                             attrs.width = width;
37305                         }
37306                         if (height != null) {
37307                             attrs.height = height;
37308                         }
37309                         if (vbx != null && vby != null && vbw != null && vbh != null) {
37310                             attrs.viewBox = [vbx, vby, vbw, vbh];
37311                         }
37312                     }
37313                     return this.el("svg", attrs);
37314                 };
37315                 /*
37316                  * \ Paper.mask [ method ] * Equivalent in behaviour to @Paper.g, except
37317                  * it’s a mask. * = (object) the `mask` element * \
37318                  */
37319                 proto.mask = function(first) {
37320                     var attr,
37321                         el = this.el("mask");
37322                     if (arguments.length == 1 && first && !first.type) {
37323                         el.attr(first);
37324                     } else if (arguments.length) {
37325                         el.add(Array.prototype.slice.call(arguments, 0));
37326                     }
37327                     return el;
37328                 };
37329                 /*
37330                  * \ Paper.ptrn [ method ] * Equivalent in behaviour to @Paper.g, except
37331                  * it’s a pattern. - x (number) @optional X of the element - y
37332                  * (number) @optional Y of the element - width (number) @optional width of
37333                  * the element - height (number) @optional height of the element - vbx
37334                  * (number) @optional viewbox X - vby (number) @optional viewbox Y - vbw
37335                  * (number) @optional viewbox width - vbh (number) @optional viewbox height * =
37336                  * (object) the `pattern` element * \
37337                  */
37338                 proto.ptrn = function(x, y, width, height, vx, vy, vw, vh) {
37339                     if (is(x, "object")) {
37340                         var attr = x;
37341                     } else {
37342                         attr = {
37343                             patternUnits: "userSpaceOnUse"
37344                         };
37345                         if (x) {
37346                             attr.x = x;
37347                         }
37348                         if (y) {
37349                             attr.y = y;
37350                         }
37351                         if (width != null) {
37352                             attr.width = width;
37353                         }
37354                         if (height != null) {
37355                             attr.height = height;
37356                         }
37357                         if (vx != null && vy != null && vw != null && vh != null) {
37358                             attr.viewBox = [vx, vy, vw, vh];
37359                         }
37360                     }
37361                     return this.el("pattern", attr);
37362                 };
37363                 /*
37364                  * \ Paper.use [ method ] * Creates a <use> element. - id (string) @optional
37365                  * id of element to link or - id (Element) @optional element to link * =
37366                  * (object) the `use` element * \
37367                  */
37368                 proto.use = function(id) {
37369                     if (id != null) {
37370                         if (id instanceof Element) {
37371                             if (!id.attr("id")) {
37372                                 id.attr({
37373                                     id: Snap._.id(id)
37374                                 });
37375                             }
37376                             id = id.attr("id");
37377                         }
37378                         if (String(id).charAt() == "#") {
37379                             id = id.substring(1);
37380                         }
37381                         return this.el("use", {
37382                             "xlink:href": "#" + id
37383                         });
37384                     } else {
37385                         return Element.prototype.use.call(this);
37386                     }
37387                 };
37388                 /*
37389                  * \ Paper.symbol [ method ] * Creates a <symbol> element. - vbx (number)
37390                  * @optional viewbox X - vby (number) @optional viewbox Y - vbw (number)
37391                  * @optional viewbox width - vbh (number) @optional viewbox height =
37392                  * (object) the `symbol` element * \
37393                  */
37394                 proto.symbol = function(vx, vy, vw, vh) {
37395                     var attr = {};
37396                     if (vx != null && vy != null && vw != null && vh != null) {
37397                         attr.viewBox = [vx, vy, vw, vh];
37398                     }
37399
37400                     return this.el("symbol", attr);
37401                 };
37402                 /*
37403                  * \ Paper.text [ method ] * Draws a text string * - x (number) x coordinate
37404                  * position - y (number) y coordinate position - text (string|array) The
37405                  * text string to draw or array of strings to nest within separate `<tspan>`
37406                  * elements = (object) the `text` element * > Usage | var t1 =
37407                  * paper.text(50, 50, "Snap"); | var t2 = paper.text(50, 50,
37408                  * ["S","n","a","p"]); | // Text path usage | t1.attr({textpath:
37409                  * "M10,10L100,100"}); | // or | var pth = paper.path("M10,10L100,100"); |
37410                  * t1.attr({textpath: pth}); \
37411                  */
37412                 proto.text = function(x, y, text) {
37413                     var attr = {};
37414                     if (is(x, "object")) {
37415                         attr = x;
37416                     } else if (x != null) {
37417                         attr = {
37418                             x: x,
37419                             y: y,
37420                             text: text || ""
37421                         };
37422                     }
37423                     return this.el("text", attr);
37424                 };
37425                 /*
37426                  * \ Paper.line [ method ] * Draws a line * - x1 (number) x coordinate
37427                  * position of the start - y1 (number) y coordinate position of the start -
37428                  * x2 (number) x coordinate position of the end - y2 (number) y coordinate
37429                  * position of the end = (object) the `line` element * > Usage | var t1 =
37430                  * paper.line(50, 50, 100, 100); \
37431                  */
37432                 proto.line = function(x1, y1, x2, y2) {
37433                     var attr = {};
37434                     if (is(x1, "object")) {
37435                         attr = x1;
37436                     } else if (x1 != null) {
37437                         attr = {
37438                             x1: x1,
37439                             x2: x2,
37440                             y1: y1,
37441                             y2: y2
37442                         };
37443                     }
37444                     return this.el("line", attr);
37445                 };
37446                 /*
37447                  * \ Paper.polyline [ method ] * Draws a polyline * - points (array) array
37448                  * of points or - varargs (…) points = (object) the `polyline` element * >
37449                  * Usage | var p1 = paper.polyline([10, 10, 100, 100]); | var p2 =
37450                  * paper.polyline(10, 10, 100, 100); \
37451                  */
37452                 proto.polyline = function(points) {
37453                     if (arguments.length > 1) {
37454                         points = Array.prototype.slice.call(arguments, 0);
37455                     }
37456                     var attr = {};
37457                     if (is(points, "object") && !is(points, "array")) {
37458                         attr = points;
37459                     } else if (points != null) {
37460                         attr = {
37461                             points: points
37462                         };
37463                     }
37464                     return this.el("polyline", attr);
37465                 };
37466                 /*
37467                  * \ Paper.polygon [ method ] * Draws a polygon. See @Paper.polyline \
37468                  */
37469                 proto.polygon = function(points) {
37470                     if (arguments.length > 1) {
37471                         points = Array.prototype.slice.call(arguments, 0);
37472                     }
37473                     var attr = {};
37474                     if (is(points, "object") && !is(points, "array")) {
37475                         attr = points;
37476                     } else if (points != null) {
37477                         attr = {
37478                             points: points
37479                         };
37480                     }
37481                     return this.el("polygon", attr);
37482                 };
37483                 // gradients
37484                 (function() {
37485                     var $ = Snap._.$;
37486                     // gradients' helpers
37487                     function Gstops() {
37488                         return this.selectAll("stop");
37489                     }
37490
37491                     function GaddStop(color, offset) {
37492                         var stop = $("stop"),
37493                             attr = {
37494                                 offset: +offset + "%"
37495                             };
37496                         color = Snap.color(color);
37497                         attr["stop-color"] = color.hex;
37498                         if (color.opacity < 1) {
37499                             attr["stop-opacity"] = color.opacity;
37500                         }
37501                         $(stop, attr);
37502                         this.node.appendChild(stop);
37503                         return this;
37504                     }
37505
37506                     function GgetBBox() {
37507                         if (this.type == "linearGradient") {
37508                             var x1 = $(this.node, "x1") || 0,
37509                                 x2 = $(this.node, "x2") || 1,
37510                                 y1 = $(this.node, "y1") || 0,
37511                                 y2 = $(this.node, "y2") || 0;
37512                             return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
37513                         } else {
37514                             var cx = this.node.cx || .5,
37515                                 cy = this.node.cy || .5,
37516                                 r = this.node.r || 0;
37517                             return Snap._.box(cx - r, cy - r, r * 2, r * 2);
37518                         }
37519                     }
37520
37521                     function gradient(defs, str) {
37522                         var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
37523                             el;
37524                         if (!grad) {
37525                             return null;
37526                         }
37527                         grad.params.unshift(defs);
37528                         if (grad.type.toLowerCase() == "l") {
37529                             el = gradientLinear.apply(0, grad.params);
37530                         } else {
37531                             el = gradientRadial.apply(0, grad.params);
37532                         }
37533                         if (grad.type != grad.type.toLowerCase()) {
37534                             $(el.node, {
37535                                 gradientUnits: "userSpaceOnUse"
37536                             });
37537                         }
37538                         var stops = grad.stops,
37539                             len = stops.length,
37540                             start = 0,
37541                             j = 0;
37542
37543                         function seed(i, end) {
37544                             var step = (end - start) / (i - j);
37545                             for (var k = j; k < i; k++) {
37546                                 stops[k].offset = +(+start + step * (k - j)).toFixed(2);
37547                             }
37548                             j = i;
37549                             start = end;
37550                         }
37551                         len--;
37552                         for (var i = 0; i < len; i++)
37553                             if ("offset" in stops[i]) {
37554                                 seed(i, stops[i].offset);
37555                             }
37556                         stops[len].offset = stops[len].offset || 100;
37557                         seed(len, stops[len].offset);
37558                         for (i = 0; i <= len; i++) {
37559                             var stop = stops[i];
37560                             el.addStop(stop.color, stop.offset);
37561                         }
37562                         return el;
37563                     }
37564
37565                     function gradientLinear(defs, x1, y1, x2, y2) {
37566                         var el = Snap._.make("linearGradient", defs);
37567                         el.stops = Gstops;
37568                         el.addStop = GaddStop;
37569                         el.getBBox = GgetBBox;
37570                         if (x1 != null) {
37571                             $(el.node, {
37572                                 x1: x1,
37573                                 y1: y1,
37574                                 x2: x2,
37575                                 y2: y2
37576                             });
37577                         }
37578                         return el;
37579                     }
37580
37581                     function gradientRadial(defs, cx, cy, r, fx, fy) {
37582                         var el = Snap._.make("radialGradient", defs);
37583                         el.stops = Gstops;
37584                         el.addStop = GaddStop;
37585                         el.getBBox = GgetBBox;
37586                         if (cx != null) {
37587                             $(el.node, {
37588                                 cx: cx,
37589                                 cy: cy,
37590                                 r: r
37591                             });
37592                         }
37593                         if (fx != null && fy != null) {
37594                             $(el.node, {
37595                                 fx: fx,
37596                                 fy: fy
37597                             });
37598                         }
37599                         return el;
37600                     }
37601                     /*
37602                      * \ Paper.gradient [ method ] * Creates a gradient element * - gradient
37603                      * (string) gradient descriptor > Gradient Descriptor The gradient
37604                      * descriptor is an expression formatted as follows: `<type>(<coords>)<colors>`.
37605                      * The `<type>` can be either linear or radial. The uppercase `L` or
37606                      * `R` letters indicate absolute coordinates offset from the SVG
37607                      * surface. Lowercase `l` or `r` letters indicate coordinates calculated
37608                      * relative to the element to which the gradient is applied. Coordinates
37609                      * specify a linear gradient vector as `x1`, `y1`, `x2`, `y2`, or a
37610                      * radial gradient as `cx`, `cy`, `r` and optional `fx`, `fy` specifying
37611                      * a focal point away from the center of the circle. Specify `<colors>`
37612                      * as a list of dash-separated CSS color values. Each color may be
37613                      * followed by a custom offset value, separated with a colon character. >
37614                      * Examples Linear gradient, relative from top-left corner to
37615                      * bottom-right corner, from black through red to white: | var g =
37616                      * paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); Linear gradient,
37617                      * absolute from (0, 0) to (100, 100), from black through red at 25% to
37618                      * white: | var g = paper.gradient("L(0, 0, 100,
37619                      * 100)#000-#f00:25-#fff"); Radial gradient, relative from the center of
37620                      * the element with radius half the width, from black to white: | var g =
37621                      * paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); To apply the gradient: |
37622                      * paper.circle(50, 50, 40).attr({ | fill: g | }); = (object) the
37623                      * `gradient` element \
37624                      */
37625                     proto.gradient = function(str) {
37626                         return gradient(this.defs, str);
37627                     };
37628                     proto.gradientLinear = function(x1, y1, x2, y2) {
37629                         return gradientLinear(this.defs, x1, y1, x2, y2);
37630                     };
37631                     proto.gradientRadial = function(cx, cy, r, fx, fy) {
37632                         return gradientRadial(this.defs, cx, cy, r, fx, fy);
37633                     };
37634                     /*
37635                      * \ Paper.toString [ method ] * Returns SVG code for the @Paper =
37636                      * (string) SVG code for the @Paper \
37637                      */
37638                     proto.toString = function() {
37639                         var doc = this.node.ownerDocument,
37640                             f = doc.createDocumentFragment(),
37641                             d = doc.createElement("div"),
37642                             svg = this.node.cloneNode(true),
37643                             res;
37644                         f.appendChild(d);
37645                         d.appendChild(svg);
37646                         Snap._.$(svg, {
37647                             xmlns: "http://www.w3.org/2000/svg"
37648                         });
37649                         res = d.innerHTML;
37650                         f.removeChild(f.firstChild);
37651                         return res;
37652                     };
37653                     /*
37654                      * \ Paper.toDataURL [ method ] * Returns SVG code for the @Paper as
37655                      * Data URI string. = (string) Data URI string \
37656                      */
37657                     proto.toDataURL = function() {
37658                         if (window && window.btoa) {
37659                             return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
37660                         }
37661                     };
37662                     /*
37663                      * \ Paper.clear [ method ] * Removes all child nodes of the paper,
37664                      * except <defs>. \
37665                      */
37666                     proto.clear = function() {
37667                         var node = this.node.firstChild,
37668                             next;
37669                         while (node) {
37670                             next = node.nextSibling;
37671                             if (node.tagName != "defs") {
37672                                 node.parentNode.removeChild(node);
37673                             } else {
37674                                 proto.clear.call({
37675                                     node: node
37676                                 });
37677                             }
37678                             node = next;
37679                         }
37680                     };
37681                 }());
37682             });
37683
37684             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37685             // 
37686             // Licensed under the Apache License, Version 2.0 (the "License");
37687             // you may not use this file except in compliance with the License.
37688             // You may obtain a copy of the License at
37689             // 
37690             // http://www.apache.org/licenses/LICENSE-2.0
37691             // 
37692             // Unless required by applicable law or agreed to in writing, software
37693             // distributed under the License is distributed on an "AS IS" BASIS,
37694             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37695             // See the License for the specific language governing permissions and
37696             // limitations under the License.
37697             Snap.plugin(function(Snap, Element, Paper, glob) {
37698                 var elproto = Element.prototype,
37699                     is = Snap.is,
37700                     clone = Snap._.clone,
37701                     has = "hasOwnProperty",
37702                     p2s = /,?([a-z]),?/gi,
37703                     toFloat = parseFloat,
37704                     math = Math,
37705                     PI = math.PI,
37706                     mmin = math.min,
37707                     mmax = math.max,
37708                     pow = math.pow,
37709                     abs = math.abs;
37710
37711                 function paths(ps) {
37712                     var p = paths.ps = paths.ps || {};
37713                     if (p[ps]) {
37714                         p[ps].sleep = 100;
37715                     } else {
37716                         p[ps] = {
37717                             sleep: 100
37718                         };
37719                     }
37720                     setTimeout(function() {
37721                         for (var key in p)
37722                             if (p[has](key) && key != ps) {
37723                                 p[key].sleep--;
37724                                 !p[key].sleep && delete p[key];
37725                             }
37726                     });
37727                     return p[ps];
37728                 }
37729
37730                 function box(x, y, width, height) {
37731                     if (x == null) {
37732                         x = y = width = height = 0;
37733                     }
37734                     if (y == null) {
37735                         y = x.y;
37736                         width = x.width;
37737                         height = x.height;
37738                         x = x.x;
37739                     }
37740                     return {
37741                         x: x,
37742                         y: y,
37743                         width: width,
37744                         w: width,
37745                         height: height,
37746                         h: height,
37747                         x2: x + width,
37748                         y2: y + height,
37749                         cx: x + width / 2,
37750                         cy: y + height / 2,
37751                         r1: math.min(width, height) / 2,
37752                         r2: math.max(width, height) / 2,
37753                         r0: math.sqrt(width * width + height * height) / 2,
37754                         path: rectPath(x, y, width, height),
37755                         vb: [x, y, width, height].join(" ")
37756                     };
37757                 }
37758
37759                 function toString() {
37760                     return this.join(",").replace(p2s, "$1");
37761                 }
37762
37763                 function pathClone(pathArray) {
37764                     var res = clone(pathArray);
37765                     res.toString = toString;
37766                     return res;
37767                 }
37768
37769                 function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
37770                     if (length == null) {
37771                         return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
37772                     } else {
37773                         return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
37774                             getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
37775                     }
37776                 }
37777
37778                 function getLengthFactory(istotal, subpath) {
37779                     function O(val) {
37780                         return +(+val).toFixed(3);
37781                     }
37782                     return Snap._.cacher(function(path, length, onlystart) {
37783                         if (path instanceof Element) {
37784                             path = path.attr("d");
37785                         }
37786                         path = path2curve(path);
37787                         var x, y, p, l, sp = "",
37788                             subpaths = {},
37789                             point,
37790                             len = 0;
37791                         for (var i = 0, ii = path.length; i < ii; i++) {
37792                             p = path[i];
37793                             if (p[0] == "M") {
37794                                 x = +p[1];
37795                                 y = +p[2];
37796                             } else {
37797                                 l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
37798                                 if (len + l > length) {
37799                                     if (subpath && !subpaths.start) {
37800                                         point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37801                                         sp += [
37802                                             "C" + O(point.start.x),
37803                                             O(point.start.y),
37804                                             O(point.m.x),
37805                                             O(point.m.y),
37806                                             O(point.x),
37807                                             O(point.y)
37808                                         ];
37809                                         if (onlystart) {
37810                                             return sp;
37811                                         }
37812                                         subpaths.start = sp;
37813                                         sp = [
37814                                             "M" + O(point.x),
37815                                             O(point.y) + "C" + O(point.n.x),
37816                                             O(point.n.y),
37817                                             O(point.end.x),
37818                                             O(point.end.y),
37819                                             O(p[5]),
37820                                             O(p[6])
37821                                         ].join();
37822                                         len += l;
37823                                         x = +p[5];
37824                                         y = +p[6];
37825                                         continue;
37826                                     }
37827                                     if (!istotal && !subpath) {
37828                                         point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37829                                         return point;
37830                                     }
37831                                 }
37832                                 len += l;
37833                                 x = +p[5];
37834                                 y = +p[6];
37835                             }
37836                             sp += p.shift() + p;
37837                         }
37838                         subpaths.end = sp;
37839                         point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
37840                         return point;
37841                     }, null, Snap._.clone);
37842                 }
37843                 var getTotalLength = getLengthFactory(1),
37844                     getPointAtLength = getLengthFactory(),
37845                     getSubpathsAtLength = getLengthFactory(0, 1);
37846
37847                 function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
37848                     var t1 = 1 - t,
37849                         t13 = pow(t1, 3),
37850                         t12 = pow(t1, 2),
37851                         t2 = t * t,
37852                         t3 = t2 * t,
37853                         x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
37854                         y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
37855                         mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
37856                         my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
37857                         nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
37858                         ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
37859                         ax = t1 * p1x + t * c1x,
37860                         ay = t1 * p1y + t * c1y,
37861                         cx = t1 * c2x + t * p2x,
37862                         cy = t1 * c2y + t * p2y,
37863                         alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
37864                     // (mx > nx || my < ny) && (alpha += 180);
37865                     return {
37866                         x: x,
37867                         y: y,
37868                         m: {
37869                             x: mx,
37870                             y: my
37871                         },
37872                         n: {
37873                             x: nx,
37874                             y: ny
37875                         },
37876                         start: {
37877                             x: ax,
37878                             y: ay
37879                         },
37880                         end: {
37881                             x: cx,
37882                             y: cy
37883                         },
37884                         alpha: alpha
37885                     };
37886                 }
37887
37888                 function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
37889                     if (!Snap.is(p1x, "array")) {
37890                         p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
37891                     }
37892                     var bbox = curveDim.apply(null, p1x);
37893                     return box(
37894                         bbox.min.x,
37895                         bbox.min.y,
37896                         bbox.max.x - bbox.min.x,
37897                         bbox.max.y - bbox.min.y
37898                     );
37899                 }
37900
37901                 function isPointInsideBBox(bbox, x, y) {
37902                     return x >= bbox.x &&
37903                         x <= bbox.x + bbox.width &&
37904                         y >= bbox.y &&
37905                         y <= bbox.y + bbox.height;
37906                 }
37907
37908                 function isBBoxIntersect(bbox1, bbox2) {
37909                     bbox1 = box(bbox1);
37910                     bbox2 = box(bbox2);
37911                     return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
37912                 }
37913
37914                 function base3(t, p1, p2, p3, p4) {
37915                     var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
37916                         t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
37917                     return t * t2 - 3 * p1 + 3 * p2;
37918                 }
37919
37920                 function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
37921                     if (z == null) {
37922                         z = 1;
37923                     }
37924                     z = z > 1 ? 1 : z < 0 ? 0 : z;
37925                     var z2 = z / 2,
37926                         n = 12,
37927                         Tvalues = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816],
37928                         Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472],
37929                         sum = 0;
37930                     for (var i = 0; i < n; i++) {
37931                         var ct = z2 * Tvalues[i] + z2,
37932                             xbase = base3(ct, x1, x2, x3, x4),
37933                             ybase = base3(ct, y1, y2, y3, y4),
37934                             comb = xbase * xbase + ybase * ybase;
37935                         sum += Cvalues[i] * math.sqrt(comb);
37936                     }
37937                     return z2 * sum;
37938                 }
37939
37940                 function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
37941                     if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
37942                         return;
37943                     }
37944                     var t = 1,
37945                         step = t / 2,
37946                         t2 = t - step,
37947                         l,
37948                         e = .01;
37949                     l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
37950                     while (abs(l - ll) > e) {
37951                         step /= 2;
37952                         t2 += (l < ll ? 1 : -1) * step;
37953                         l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
37954                     }
37955                     return t2;
37956                 }
37957
37958                 function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
37959                     if (
37960                         mmax(x1, x2) < mmin(x3, x4) ||
37961                         mmin(x1, x2) > mmax(x3, x4) ||
37962                         mmax(y1, y2) < mmin(y3, y4) ||
37963                         mmin(y1, y2) > mmax(y3, y4)
37964                     ) {
37965                         return;
37966                     }
37967                     var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
37968                         ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
37969                         denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
37970
37971                     if (!denominator) {
37972                         return;
37973                     }
37974                     var px = nx / denominator,
37975                         py = ny / denominator,
37976                         px2 = +px.toFixed(2),
37977                         py2 = +py.toFixed(2);
37978                     if (
37979                         px2 < +mmin(x1, x2).toFixed(2) ||
37980                         px2 > +mmax(x1, x2).toFixed(2) ||
37981                         px2 < +mmin(x3, x4).toFixed(2) ||
37982                         px2 > +mmax(x3, x4).toFixed(2) ||
37983                         py2 < +mmin(y1, y2).toFixed(2) ||
37984                         py2 > +mmax(y1, y2).toFixed(2) ||
37985                         py2 < +mmin(y3, y4).toFixed(2) ||
37986                         py2 > +mmax(y3, y4).toFixed(2)
37987                     ) {
37988                         return;
37989                     }
37990                     return {
37991                         x: px,
37992                         y: py
37993                     };
37994                 }
37995
37996                 function inter(bez1, bez2) {
37997                     return interHelper(bez1, bez2);
37998                 }
37999
38000                 function interCount(bez1, bez2) {
38001                     return interHelper(bez1, bez2, 1);
38002                 }
38003
38004                 function interHelper(bez1, bez2, justCount) {
38005                     var bbox1 = bezierBBox(bez1),
38006                         bbox2 = bezierBBox(bez2);
38007                     if (!isBBoxIntersect(bbox1, bbox2)) {
38008                         return justCount ? 0 : [];
38009                     }
38010                     var l1 = bezlen.apply(0, bez1),
38011                         l2 = bezlen.apply(0, bez2),
38012                         n1 = ~~(l1 / 8),
38013                         n2 = ~~(l2 / 8),
38014                         dots1 = [],
38015                         dots2 = [],
38016                         xy = {},
38017                         res = justCount ? 0 : [];
38018                     for (var i = 0; i < n1 + 1; i++) {
38019                         var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
38020                         dots1.push({
38021                             x: p.x,
38022                             y: p.y,
38023                             t: i / n1
38024                         });
38025                     }
38026                     for (i = 0; i < n2 + 1; i++) {
38027                         p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
38028                         dots2.push({
38029                             x: p.x,
38030                             y: p.y,
38031                             t: i / n2
38032                         });
38033                     }
38034                     for (i = 0; i < n1; i++) {
38035                         for (var j = 0; j < n2; j++) {
38036                             var di = dots1[i],
38037                                 di1 = dots1[i + 1],
38038                                 dj = dots2[j],
38039                                 dj1 = dots2[j + 1],
38040                                 ci = abs(di1.x - di.x) < .001 ? "y" : "x",
38041                                 cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
38042                                 is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
38043                             if (is) {
38044                                 if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
38045                                     continue;
38046                                 }
38047                                 xy[is.x.toFixed(4)] = is.y.toFixed(4);
38048                                 var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
38049                                     t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
38050                                 if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
38051                                     if (justCount) {
38052                                         res++;
38053                                     } else {
38054                                         res.push({
38055                                             x: is.x,
38056                                             y: is.y,
38057                                             t1: t1,
38058                                             t2: t2
38059                                         });
38060                                     }
38061                                 }
38062                             }
38063                         }
38064                     }
38065                     return res;
38066                 }
38067
38068                 function pathIntersection(path1, path2) {
38069                     return interPathHelper(path1, path2);
38070                 }
38071
38072                 function pathIntersectionNumber(path1, path2) {
38073                     return interPathHelper(path1, path2, 1);
38074                 }
38075
38076                 function interPathHelper(path1, path2, justCount) {
38077                     path1 = path2curve(path1);
38078                     path2 = path2curve(path2);
38079                     var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
38080                         res = justCount ? 0 : [];
38081                     for (var i = 0, ii = path1.length; i < ii; i++) {
38082                         var pi = path1[i];
38083                         if (pi[0] == "M") {
38084                             x1 = x1m = pi[1];
38085                             y1 = y1m = pi[2];
38086                         } else {
38087                             if (pi[0] == "C") {
38088                                 bez1 = [x1, y1].concat(pi.slice(1));
38089                                 x1 = bez1[6];
38090                                 y1 = bez1[7];
38091                             } else {
38092                                 bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
38093                                 x1 = x1m;
38094                                 y1 = y1m;
38095                             }
38096                             for (var j = 0, jj = path2.length; j < jj; j++) {
38097                                 var pj = path2[j];
38098                                 if (pj[0] == "M") {
38099                                     x2 = x2m = pj[1];
38100                                     y2 = y2m = pj[2];
38101                                 } else {
38102                                     if (pj[0] == "C") {
38103                                         bez2 = [x2, y2].concat(pj.slice(1));
38104                                         x2 = bez2[6];
38105                                         y2 = bez2[7];
38106                                     } else {
38107                                         bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
38108                                         x2 = x2m;
38109                                         y2 = y2m;
38110                                     }
38111                                     var intr = interHelper(bez1, bez2, justCount);
38112                                     if (justCount) {
38113                                         res += intr;
38114                                     } else {
38115                                         for (var k = 0, kk = intr.length; k < kk; k++) {
38116                                             intr[k].segment1 = i;
38117                                             intr[k].segment2 = j;
38118                                             intr[k].bez1 = bez1;
38119                                             intr[k].bez2 = bez2;
38120                                         }
38121                                         res = res.concat(intr);
38122                                     }
38123                                 }
38124                             }
38125                         }
38126                     }
38127                     return res;
38128                 }
38129
38130                 function isPointInsidePath(path, x, y) {
38131                     var bbox = pathBBox(path);
38132                     return isPointInsideBBox(bbox, x, y) &&
38133                         interPathHelper(path, [
38134                             ["M", x, y],
38135                             ["H", bbox.x2 + 10]
38136                         ], 1) % 2 == 1;
38137                 }
38138
38139                 function pathBBox(path) {
38140                     var pth = paths(path);
38141                     if (pth.bbox) {
38142                         return clone(pth.bbox);
38143                     }
38144                     if (!path) {
38145                         return box();
38146                     }
38147                     path = path2curve(path);
38148                     var x = 0,
38149                         y = 0,
38150                         X = [],
38151                         Y = [],
38152                         p;
38153                     for (var i = 0, ii = path.length; i < ii; i++) {
38154                         p = path[i];
38155                         if (p[0] == "M") {
38156                             x = p[1];
38157                             y = p[2];
38158                             X.push(x);
38159                             Y.push(y);
38160                         } else {
38161                             var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
38162                             X = X.concat(dim.min.x, dim.max.x);
38163                             Y = Y.concat(dim.min.y, dim.max.y);
38164                             x = p[5];
38165                             y = p[6];
38166                         }
38167                     }
38168                     var xmin = mmin.apply(0, X),
38169                         ymin = mmin.apply(0, Y),
38170                         xmax = mmax.apply(0, X),
38171                         ymax = mmax.apply(0, Y),
38172                         bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
38173                     pth.bbox = clone(bb);
38174                     return bb;
38175                 }
38176
38177                 function rectPath(x, y, w, h, r) {
38178                     if (r) {
38179                         return [
38180                             ["M", +x + (+r), y],
38181                             ["l", w - r * 2, 0],
38182                             ["a", r, r, 0, 0, 1, r, r],
38183                             ["l", 0, h - r * 2],
38184                             ["a", r, r, 0, 0, 1, -r, r],
38185                             ["l", r * 2 - w, 0],
38186                             ["a", r, r, 0, 0, 1, -r, -r],
38187                             ["l", 0, r * 2 - h],
38188                             ["a", r, r, 0, 0, 1, r, -r],
38189                             ["z"]
38190                         ];
38191                     }
38192                     var res = [
38193                         ["M", x, y],
38194                         ["l", w, 0],
38195                         ["l", 0, h],
38196                         ["l", -w, 0],
38197                         ["z"]
38198                     ];
38199                     res.toString = toString;
38200                     return res;
38201                 }
38202
38203                 function ellipsePath(x, y, rx, ry, a) {
38204                     if (a == null && ry == null) {
38205                         ry = rx;
38206                     }
38207                     x = +x;
38208                     y = +y;
38209                     rx = +rx;
38210                     ry = +ry;
38211                     if (a != null) {
38212                         var rad = Math.PI / 180,
38213                             x1 = x + rx * Math.cos(-ry * rad),
38214                             x2 = x + rx * Math.cos(-a * rad),
38215                             y1 = y + rx * Math.sin(-ry * rad),
38216                             y2 = y + rx * Math.sin(-a * rad),
38217                             res = [
38218                                 ["M", x1, y1],
38219                                 ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]
38220                             ];
38221                     } else {
38222                         res = [
38223                             ["M", x, y],
38224                             ["m", 0, -ry],
38225                             ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
38226                             ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
38227                             ["z"]
38228                         ];
38229                     }
38230                     res.toString = toString;
38231                     return res;
38232                 }
38233                 var unit2px = Snap._unit2px,
38234                     getPath = {
38235                         path: function(el) {
38236                             return el.attr("path");
38237                         },
38238                         circle: function(el) {
38239                             var attr = unit2px(el);
38240                             return ellipsePath(attr.cx, attr.cy, attr.r);
38241                         },
38242                         ellipse: function(el) {
38243                             var attr = unit2px(el);
38244                             return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
38245                         },
38246                         rect: function(el) {
38247                             var attr = unit2px(el);
38248                             return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
38249                         },
38250                         image: function(el) {
38251                             var attr = unit2px(el);
38252                             return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
38253                         },
38254                         line: function(el) {
38255                             return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
38256                         },
38257                         polyline: function(el) {
38258                             return "M" + el.attr("points");
38259                         },
38260                         polygon: function(el) {
38261                             return "M" + el.attr("points") + "z";
38262                         },
38263                         deflt: function(el) {
38264                             var bbox = el.node.getBBox();
38265                             return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
38266                         }
38267                     };
38268
38269                 function pathToRelative(pathArray) {
38270                     var pth = paths(pathArray),
38271                         lowerCase = String.prototype.toLowerCase;
38272                     if (pth.rel) {
38273                         return pathClone(pth.rel);
38274                     }
38275                     if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
38276                         pathArray = Snap.parsePathString(pathArray);
38277                     }
38278                     var res = [],
38279                         x = 0,
38280                         y = 0,
38281                         mx = 0,
38282                         my = 0,
38283                         start = 0;
38284                     if (pathArray[0][0] == "M") {
38285                         x = pathArray[0][1];
38286                         y = pathArray[0][2];
38287                         mx = x;
38288                         my = y;
38289                         start++;
38290                         res.push(["M", x, y]);
38291                     }
38292                     for (var i = start, ii = pathArray.length; i < ii; i++) {
38293                         var r = res[i] = [],
38294                             pa = pathArray[i];
38295                         if (pa[0] != lowerCase.call(pa[0])) {
38296                             r[0] = lowerCase.call(pa[0]);
38297                             switch (r[0]) {
38298                                 case "a":
38299                                     r[1] = pa[1];
38300                                     r[2] = pa[2];
38301                                     r[3] = pa[3];
38302                                     r[4] = pa[4];
38303                                     r[5] = pa[5];
38304                                     r[6] = +(pa[6] - x).toFixed(3);
38305                                     r[7] = +(pa[7] - y).toFixed(3);
38306                                     break;
38307                                 case "v":
38308                                     r[1] = +(pa[1] - y).toFixed(3);
38309                                     break;
38310                                 case "m":
38311                                     mx = pa[1];
38312                                     my = pa[2];
38313                                 default:
38314                                     for (var j = 1, jj = pa.length; j < jj; j++) {
38315                                         r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
38316                                     }
38317                             }
38318                         } else {
38319                             r = res[i] = [];
38320                             if (pa[0] == "m") {
38321                                 mx = pa[1] + x;
38322                                 my = pa[2] + y;
38323                             }
38324                             for (var k = 0, kk = pa.length; k < kk; k++) {
38325                                 res[i][k] = pa[k];
38326                             }
38327                         }
38328                         var len = res[i].length;
38329                         switch (res[i][0]) {
38330                             case "z":
38331                                 x = mx;
38332                                 y = my;
38333                                 break;
38334                             case "h":
38335                                 x += +res[i][len - 1];
38336                                 break;
38337                             case "v":
38338                                 y += +res[i][len - 1];
38339                                 break;
38340                             default:
38341                                 x += +res[i][len - 2];
38342                                 y += +res[i][len - 1];
38343                         }
38344                     }
38345                     res.toString = toString;
38346                     pth.rel = pathClone(res);
38347                     return res;
38348                 }
38349
38350                 function pathToAbsolute(pathArray) {
38351                     var pth = paths(pathArray);
38352                     if (pth.abs) {
38353                         return pathClone(pth.abs);
38354                     }
38355                     if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough
38356                         // assumption
38357                         pathArray = Snap.parsePathString(pathArray);
38358                     }
38359                     if (!pathArray || !pathArray.length) {
38360                         return [
38361                             ["M", 0, 0]
38362                         ];
38363                     }
38364                     var res = [],
38365                         x = 0,
38366                         y = 0,
38367                         mx = 0,
38368                         my = 0,
38369                         start = 0,
38370                         pa0;
38371                     if (pathArray[0][0] == "M") {
38372                         x = +pathArray[0][1];
38373                         y = +pathArray[0][2];
38374                         mx = x;
38375                         my = y;
38376                         start++;
38377                         res[0] = ["M", x, y];
38378                     }
38379                     var crz = pathArray.length == 3 &&
38380                         pathArray[0][0] == "M" &&
38381                         pathArray[1][0].toUpperCase() == "R" &&
38382                         pathArray[2][0].toUpperCase() == "Z";
38383                     for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
38384                         res.push(r = []);
38385                         pa = pathArray[i];
38386                         pa0 = pa[0];
38387                         if (pa0 != pa0.toUpperCase()) {
38388                             r[0] = pa0.toUpperCase();
38389                             switch (r[0]) {
38390                                 case "A":
38391                                     r[1] = pa[1];
38392                                     r[2] = pa[2];
38393                                     r[3] = pa[3];
38394                                     r[4] = pa[4];
38395                                     r[5] = pa[5];
38396                                     r[6] = +pa[6] + x;
38397                                     r[7] = +pa[7] + y;
38398                                     break;
38399                                 case "V":
38400                                     r[1] = +pa[1] + y;
38401                                     break;
38402                                 case "H":
38403                                     r[1] = +pa[1] + x;
38404                                     break;
38405                                 case "R":
38406                                     var dots = [x, y].concat(pa.slice(1));
38407                                     for (var j = 2, jj = dots.length; j < jj; j++) {
38408                                         dots[j] = +dots[j] + x;
38409                                         dots[++j] = +dots[j] + y;
38410                                     }
38411                                     res.pop();
38412                                     res = res.concat(catmullRom2bezier(dots, crz));
38413                                     break;
38414                                 case "O":
38415                                     res.pop();
38416                                     dots = ellipsePath(x, y, pa[1], pa[2]);
38417                                     dots.push(dots[0]);
38418                                     res = res.concat(dots);
38419                                     break;
38420                                 case "U":
38421                                     res.pop();
38422                                     res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38423                                     r = ["U"].concat(res[res.length - 1].slice(-2));
38424                                     break;
38425                                 case "M":
38426                                     mx = +pa[1] + x;
38427                                     my = +pa[2] + y;
38428                                 default:
38429                                     for (j = 1, jj = pa.length; j < jj; j++) {
38430                                         r[j] = +pa[j] + ((j % 2) ? x : y);
38431                                     }
38432                             }
38433                         } else if (pa0 == "R") {
38434                             dots = [x, y].concat(pa.slice(1));
38435                             res.pop();
38436                             res = res.concat(catmullRom2bezier(dots, crz));
38437                             r = ["R"].concat(pa.slice(-2));
38438                         } else if (pa0 == "O") {
38439                             res.pop();
38440                             dots = ellipsePath(x, y, pa[1], pa[2]);
38441                             dots.push(dots[0]);
38442                             res = res.concat(dots);
38443                         } else if (pa0 == "U") {
38444                             res.pop();
38445                             res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38446                             r = ["U"].concat(res[res.length - 1].slice(-2));
38447                         } else {
38448                             for (var k = 0, kk = pa.length; k < kk; k++) {
38449                                 r[k] = pa[k];
38450                             }
38451                         }
38452                         pa0 = pa0.toUpperCase();
38453                         if (pa0 != "O") {
38454                             switch (r[0]) {
38455                                 case "Z":
38456                                     x = +mx;
38457                                     y = +my;
38458                                     break;
38459                                 case "H":
38460                                     x = r[1];
38461                                     break;
38462                                 case "V":
38463                                     y = r[1];
38464                                     break;
38465                                 case "M":
38466                                     mx = r[r.length - 2];
38467                                     my = r[r.length - 1];
38468                                 default:
38469                                     x = r[r.length - 2];
38470                                     y = r[r.length - 1];
38471                             }
38472                         }
38473                     }
38474                     res.toString = toString;
38475                     pth.abs = pathClone(res);
38476                     return res;
38477                 }
38478
38479                 function l2c(x1, y1, x2, y2) {
38480                     return [x1, y1, x2, y2, x2, y2];
38481                 }
38482
38483                 function q2c(x1, y1, ax, ay, x2, y2) {
38484                     var _13 = 1 / 3,
38485                         _23 = 2 / 3;
38486                     return [
38487                         _13 * x1 + _23 * ax,
38488                         _13 * y1 + _23 * ay,
38489                         _13 * x2 + _23 * ax,
38490                         _13 * y2 + _23 * ay,
38491                         x2,
38492                         y2
38493                     ];
38494                 }
38495
38496                 function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
38497                     // for more information of where this math came from visit:
38498                     // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
38499                     var _120 = PI * 120 / 180,
38500                         rad = PI / 180 * (+angle || 0),
38501                         res = [],
38502                         xy,
38503                         rotate = Snap._.cacher(function(x, y, rad) {
38504                             var X = x * math.cos(rad) - y * math.sin(rad),
38505                                 Y = x * math.sin(rad) + y * math.cos(rad);
38506                             return {
38507                                 x: X,
38508                                 y: Y
38509                             };
38510                         });
38511                     if (!recursive) {
38512                         xy = rotate(x1, y1, -rad);
38513                         x1 = xy.x;
38514                         y1 = xy.y;
38515                         xy = rotate(x2, y2, -rad);
38516                         x2 = xy.x;
38517                         y2 = xy.y;
38518                         var cos = math.cos(PI / 180 * angle),
38519                             sin = math.sin(PI / 180 * angle),
38520                             x = (x1 - x2) / 2,
38521                             y = (y1 - y2) / 2;
38522                         var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
38523                         if (h > 1) {
38524                             h = math.sqrt(h);
38525                             rx = h * rx;
38526                             ry = h * ry;
38527                         }
38528                         var rx2 = rx * rx,
38529                             ry2 = ry * ry,
38530                             k = (large_arc_flag == sweep_flag ? -1 : 1) *
38531                             math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
38532                             cx = k * rx * y / ry + (x1 + x2) / 2,
38533                             cy = k * -ry * x / rx + (y1 + y2) / 2,
38534                             f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
38535                             f2 = math.asin(((y2 - cy) / ry).toFixed(9));
38536
38537                         f1 = x1 < cx ? PI - f1 : f1;
38538                         f2 = x2 < cx ? PI - f2 : f2;
38539                         f1 < 0 && (f1 = PI * 2 + f1);
38540                         f2 < 0 && (f2 = PI * 2 + f2);
38541                         if (sweep_flag && f1 > f2) {
38542                             f1 = f1 - PI * 2;
38543                         }
38544                         if (!sweep_flag && f2 > f1) {
38545                             f2 = f2 - PI * 2;
38546                         }
38547                     } else {
38548                         f1 = recursive[0];
38549                         f2 = recursive[1];
38550                         cx = recursive[2];
38551                         cy = recursive[3];
38552                     }
38553                     var df = f2 - f1;
38554                     if (abs(df) > _120) {
38555                         var f2old = f2,
38556                             x2old = x2,
38557                             y2old = y2;
38558                         f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
38559                         x2 = cx + rx * math.cos(f2);
38560                         y2 = cy + ry * math.sin(f2);
38561                         res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
38562                     }
38563                     df = f2 - f1;
38564                     var c1 = math.cos(f1),
38565                         s1 = math.sin(f1),
38566                         c2 = math.cos(f2),
38567                         s2 = math.sin(f2),
38568                         t = math.tan(df / 4),
38569                         hx = 4 / 3 * rx * t,
38570                         hy = 4 / 3 * ry * t,
38571                         m1 = [x1, y1],
38572                         m2 = [x1 + hx * s1, y1 - hy * c1],
38573                         m3 = [x2 + hx * s2, y2 - hy * c2],
38574                         m4 = [x2, y2];
38575                     m2[0] = 2 * m1[0] - m2[0];
38576                     m2[1] = 2 * m1[1] - m2[1];
38577                     if (recursive) {
38578                         return [m2, m3, m4].concat(res);
38579                     } else {
38580                         res = [m2, m3, m4].concat(res).join().split(",");
38581                         var newres = [];
38582                         for (var i = 0, ii = res.length; i < ii; i++) {
38583                             newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
38584                         }
38585                         return newres;
38586                     }
38587                 }
38588
38589                 function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
38590                     var t1 = 1 - t;
38591                     return {
38592                         x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
38593                         y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
38594                     };
38595                 }
38596
38597                 // Returns bounding box of cubic bezier curve.
38598                 // Source:
38599                 // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
38600                 // Original version: NISHIO Hirokazu
38601                 // Modifications: https://github.com/timo22345
38602                 function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
38603                     var tvalues = [],
38604                         bounds = [
38605                             [],
38606                             []
38607                         ],
38608                         a, b, c, t, t1, t2, b2ac, sqrtb2ac;
38609                     for (var i = 0; i < 2; ++i) {
38610                         if (i == 0) {
38611                             b = 6 * x0 - 12 * x1 + 6 * x2;
38612                             a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
38613                             c = 3 * x1 - 3 * x0;
38614                         } else {
38615                             b = 6 * y0 - 12 * y1 + 6 * y2;
38616                             a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
38617                             c = 3 * y1 - 3 * y0;
38618                         }
38619                         if (abs(a) < 1e-12) {
38620                             if (abs(b) < 1e-12) {
38621                                 continue;
38622                             }
38623                             t = -c / b;
38624                             if (0 < t && t < 1) {
38625                                 tvalues.push(t);
38626                             }
38627                             continue;
38628                         }
38629                         b2ac = b * b - 4 * c * a;
38630                         sqrtb2ac = math.sqrt(b2ac);
38631                         if (b2ac < 0) {
38632                             continue;
38633                         }
38634                         t1 = (-b + sqrtb2ac) / (2 * a);
38635                         if (0 < t1 && t1 < 1) {
38636                             tvalues.push(t1);
38637                         }
38638                         t2 = (-b - sqrtb2ac) / (2 * a);
38639                         if (0 < t2 && t2 < 1) {
38640                             tvalues.push(t2);
38641                         }
38642                     }
38643
38644                     var x, y, j = tvalues.length,
38645                         jlen = j,
38646                         mt;
38647                     while (j--) {
38648                         t = tvalues[j];
38649                         mt = 1 - t;
38650                         bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
38651                         bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
38652                     }
38653
38654                     bounds[0][jlen] = x0;
38655                     bounds[1][jlen] = y0;
38656                     bounds[0][jlen + 1] = x3;
38657                     bounds[1][jlen + 1] = y3;
38658                     bounds[0].length = bounds[1].length = jlen + 2;
38659
38660
38661                     return {
38662                         min: {
38663                             x: mmin.apply(0, bounds[0]),
38664                             y: mmin.apply(0, bounds[1])
38665                         },
38666                         max: {
38667                             x: mmax.apply(0, bounds[0]),
38668                             y: mmax.apply(0, bounds[1])
38669                         }
38670                     };
38671                 }
38672
38673                 function path2curve(path, path2) {
38674                     var pth = !path2 && paths(path);
38675                     if (!path2 && pth.curve) {
38676                         return pathClone(pth.curve);
38677                     }
38678                     var p = pathToAbsolute(path),
38679                         p2 = path2 && pathToAbsolute(path2),
38680                         attrs = {
38681                             x: 0,
38682                             y: 0,
38683                             bx: 0,
38684                             by: 0,
38685                             X: 0,
38686                             Y: 0,
38687                             qx: null,
38688                             qy: null
38689                         },
38690                         attrs2 = {
38691                             x: 0,
38692                             y: 0,
38693                             bx: 0,
38694                             by: 0,
38695                             X: 0,
38696                             Y: 0,
38697                             qx: null,
38698                             qy: null
38699                         },
38700                         processPath = function(path, d, pcom) {
38701                             var nx, ny;
38702                             if (!path) {
38703                                 return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
38704                             }!(path[0] in {
38705                                 T: 1,
38706                                 Q: 1
38707                             }) && (d.qx = d.qy = null);
38708                             switch (path[0]) {
38709                                 case "M":
38710                                     d.X = path[1];
38711                                     d.Y = path[2];
38712                                     break;
38713                                 case "A":
38714                                     path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
38715                                     break;
38716                                 case "S":
38717                                     if (pcom == "C" || pcom == "S") { // In "S" case we
38718                                         // have to take into
38719                                         // account, if the
38720                                         // previous command
38721                                         // is C/S.
38722                                         nx = d.x * 2 - d.bx; // And reflect the
38723                                         // previous
38724                                         ny = d.y * 2 - d.by; // command's control
38725                                         // point relative to
38726                                         // the current
38727                                         // point.
38728                                     } else { // or some else or
38729                                         // nothing
38730                                         nx = d.x;
38731                                         ny = d.y;
38732                                     }
38733                                     path = ["C", nx, ny].concat(path.slice(1));
38734                                     break;
38735                                 case "T":
38736                                     if (pcom == "Q" || pcom == "T") { // In "T" case we
38737                                         // have to take into
38738                                         // account, if the
38739                                         // previous command
38740                                         // is Q/T.
38741                                         d.qx = d.x * 2 - d.qx; // And make a
38742                                         // reflection
38743                                         // similar
38744                                         d.qy = d.y * 2 - d.qy; // to case "S".
38745                                     } else { // or something else
38746                                         // or nothing
38747                                         d.qx = d.x;
38748                                         d.qy = d.y;
38749                                     }
38750                                     path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
38751                                     break;
38752                                 case "Q":
38753                                     d.qx = path[1];
38754                                     d.qy = path[2];
38755                                     path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
38756                                     break;
38757                                 case "L":
38758                                     path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
38759                                     break;
38760                                 case "H":
38761                                     path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
38762                                     break;
38763                                 case "V":
38764                                     path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
38765                                     break;
38766                                 case "Z":
38767                                     path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
38768                                     break;
38769                             }
38770                             return path;
38771                         },
38772                         fixArc = function(pp, i) {
38773                             if (pp[i].length > 7) {
38774                                 pp[i].shift();
38775                                 var pi = pp[i];
38776                                 while (pi.length) {
38777                                     pcoms1[i] = "A"; // if created multiple C:s, their
38778                                     // original seg is saved
38779                                     p2 && (pcoms2[i] = "A"); // the same as above
38780                                     pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
38781                                 }
38782                                 pp.splice(i, 1);
38783                                 ii = mmax(p.length, p2 && p2.length || 0);
38784                             }
38785                         },
38786                         fixM = function(path1, path2, a1, a2, i) {
38787                             if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
38788                                 path2.splice(i, 0, ["M", a2.x, a2.y]);
38789                                 a1.bx = 0;
38790                                 a1.by = 0;
38791                                 a1.x = path1[i][1];
38792                                 a1.y = path1[i][2];
38793                                 ii = mmax(p.length, p2 && p2.length || 0);
38794                             }
38795                         },
38796                         pcoms1 = [], // path commands of original path p
38797                         pcoms2 = [], // path commands of original path p2
38798                         pfirst = "", // temporary holder for original path command
38799                         pcom = ""; // holder for previous path command of original path
38800                     for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
38801                         p[i] && (pfirst = p[i][0]); // save current path command
38802
38803                         if (pfirst != "C") // C is not saved yet, because it may be result
38804                         // of conversion
38805                         {
38806                             pcoms1[i] = pfirst; // Save current path command
38807                             i && (pcom = pcoms1[i - 1]); // Get previous path command
38808                             // pcom
38809                         }
38810                         p[i] = processPath(p[i], attrs, pcom); // Previous path command is
38811                         // inputted to processPath
38812
38813                         if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the
38814                         // only
38815                         // command
38816                         // which may produce multiple C:s
38817                         // so we have to make sure that C is also C in original path
38818
38819                         fixArc(p, i); // fixArc adds also the right amount of A:s to
38820                         // pcoms1
38821
38822                         if (p2) { // the same procedures is done to p2
38823                             p2[i] && (pfirst = p2[i][0]);
38824                             if (pfirst != "C") {
38825                                 pcoms2[i] = pfirst;
38826                                 i && (pcom = pcoms2[i - 1]);
38827                             }
38828                             p2[i] = processPath(p2[i], attrs2, pcom);
38829
38830                             if (pcoms2[i] != "A" && pfirst == "C") {
38831                                 pcoms2[i] = "C";
38832                             }
38833
38834                             fixArc(p2, i);
38835                         }
38836                         fixM(p, p2, attrs, attrs2, i);
38837                         fixM(p2, p, attrs2, attrs, i);
38838                         var seg = p[i],
38839                             seg2 = p2 && p2[i],
38840                             seglen = seg.length,
38841                             seg2len = p2 && seg2.length;
38842                         attrs.x = seg[seglen - 2];
38843                         attrs.y = seg[seglen - 1];
38844                         attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
38845                         attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
38846                         attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
38847                         attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
38848                         attrs2.x = p2 && seg2[seg2len - 2];
38849                         attrs2.y = p2 && seg2[seg2len - 1];
38850                     }
38851                     if (!p2) {
38852                         pth.curve = pathClone(p);
38853                     }
38854                     return p2 ? [p, p2] : p;
38855                 }
38856
38857                 function mapPath(path, matrix) {
38858                     if (!matrix) {
38859                         return path;
38860                     }
38861                     var x, y, i, j, ii, jj, pathi;
38862                     path = path2curve(path);
38863                     for (i = 0, ii = path.length; i < ii; i++) {
38864                         pathi = path[i];
38865                         for (j = 1, jj = pathi.length; j < jj; j += 2) {
38866                             x = matrix.x(pathi[j], pathi[j + 1]);
38867                             y = matrix.y(pathi[j], pathi[j + 1]);
38868                             pathi[j] = x;
38869                             pathi[j + 1] = y;
38870                         }
38871                     }
38872                     return path;
38873                 }
38874
38875                 // http://schepers.cc/getting-to-the-point
38876                 function catmullRom2bezier(crp, z) {
38877                     var d = [];
38878                     for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
38879                         var p = [{
38880                             x: +crp[i - 2],
38881                             y: +crp[i - 1]
38882                         }, {
38883                             x: +crp[i],
38884                             y: +crp[i + 1]
38885                         }, {
38886                             x: +crp[i + 2],
38887                             y: +crp[i + 3]
38888                         }, {
38889                             x: +crp[i + 4],
38890                             y: +crp[i + 5]
38891                         }];
38892                         if (z) {
38893                             if (!i) {
38894                                 p[0] = {
38895                                     x: +crp[iLen - 2],
38896                                     y: +crp[iLen - 1]
38897                                 };
38898                             } else if (iLen - 4 == i) {
38899                                 p[3] = {
38900                                     x: +crp[0],
38901                                     y: +crp[1]
38902                                 };
38903                             } else if (iLen - 2 == i) {
38904                                 p[2] = {
38905                                     x: +crp[0],
38906                                     y: +crp[1]
38907                                 };
38908                                 p[3] = {
38909                                     x: +crp[2],
38910                                     y: +crp[3]
38911                                 };
38912                             }
38913                         } else {
38914                             if (iLen - 4 == i) {
38915                                 p[3] = p[2];
38916                             } else if (!i) {
38917                                 p[0] = {
38918                                     x: +crp[i],
38919                                     y: +crp[i + 1]
38920                                 };
38921                             }
38922                         }
38923                         d.push(["C", (-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6 * p[2].y - p[3].y) / 6,
38924                             p[2].x,
38925                             p[2].y
38926                         ]);
38927                     }
38928
38929                     return d;
38930                 }
38931
38932                 // export
38933                 Snap.path = paths;
38934
38935                 /*
38936                  * \ Snap.path.getTotalLength [ method ] * Returns the length of the given
38937                  * path in pixels * - path (string) SVG path string * = (number) length \
38938                  */
38939                 Snap.path.getTotalLength = getTotalLength;
38940                 /*
38941                  * \ Snap.path.getPointAtLength [ method ] * Returns the coordinates of the
38942                  * point located at the given length along the given path * - path (string)
38943                  * SVG path string - length (number) length, in pixels, from the start of
38944                  * the path, excluding non-rendering jumps * = (object) representation of
38945                  * the point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
38946                  * alpha: (number) angle of derivative o } \
38947                  */
38948                 Snap.path.getPointAtLength = getPointAtLength;
38949                 /*
38950                  * \ Snap.path.getSubpath [ method ] * Returns the subpath of a given path
38951                  * between given start and end lengths * - path (string) SVG path string -
38952                  * from (number) length, in pixels, from the start of the path to the start
38953                  * of the segment - to (number) length, in pixels, from the start of the
38954                  * path to the end of the segment * = (string) path string definition for
38955                  * the segment \
38956                  */
38957                 Snap.path.getSubpath = function(path, from, to) {
38958                     if (this.getTotalLength(path) - to < 1e-6) {
38959                         return getSubpathsAtLength(path, from).end;
38960                     }
38961                     var a = getSubpathsAtLength(path, to, 1);
38962                     return from ? getSubpathsAtLength(a, from).end : a;
38963                 };
38964                 /*
38965                  * \ Element.getTotalLength [ method ] * Returns the length of the path in
38966                  * pixels (only works for `path` elements) = (number) length \
38967                  */
38968                 elproto.getTotalLength = function() {
38969                     if (this.node.getTotalLength) {
38970                         return this.node.getTotalLength();
38971                     }
38972                 };
38973                 // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path>
38974                 // is broken into different segments, is the jump distance to the new
38975                 // coordinates set by the _M_ or _m_ commands calculated as part of the
38976                 // path's total length?
38977                 /*
38978                  * \ Element.getPointAtLength [ method ] * Returns coordinates of the point
38979                  * located at the given length on the given path (only works for `path`
38980                  * elements) * - length (number) length, in pixels, from the start of the
38981                  * path, excluding non-rendering jumps * = (object) representation of the
38982                  * point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
38983                  * alpha: (number) angle of derivative o } \
38984                  */
38985                 elproto.getPointAtLength = function(length) {
38986                     return getPointAtLength(this.attr("d"), length);
38987                 };
38988                 // SIERRA Element.getSubpath(): Similar to the problem for
38989                 // Element.getPointAtLength(). Unclear how this would work for a segmented
38990                 // path. Overall, the concept of _subpath_ and what I'm calling a _segment_
38991                 // (series of non-_M_ or _Z_ commands) is unclear.
38992                 /*
38993                  * \ Element.getSubpath [ method ] * Returns subpath of a given element from
38994                  * given start and end lengths (only works for `path` elements) * - from
38995                  * (number) length, in pixels, from the start of the path to the start of
38996                  * the segment - to (number) length, in pixels, from the start of the path
38997                  * to the end of the segment * = (string) path string definition for the
38998                  * segment \
38999                  */
39000                 elproto.getSubpath = function(from, to) {
39001                     return Snap.path.getSubpath(this.attr("d"), from, to);
39002                 };
39003                 Snap._.box = box;
39004                 /*
39005                  * \ Snap.path.findDotsAtSegment [ method ] * Utility method * Finds dot
39006                  * coordinates on the given cubic beziér curve at the given t - p1x
39007                  * (number) x of the first point of the curve - p1y (number) y of the first
39008                  * point of the curve - c1x (number) x of the first anchor of the curve -
39009                  * c1y (number) y of the first anchor of the curve - c2x (number) x of the
39010                  * second anchor of the curve - c2y (number) y of the second anchor of the
39011                  * curve - p2x (number) x of the second point of the curve - p2y (number) y
39012                  * of the second point of the curve - t (number) position on the curve
39013                  * (0..1) = (object) point information in format: o { o x: (number) x
39014                  * coordinate of the point, o y: (number) y coordinate of the point, o m: {
39015                  * o x: (number) x coordinate of the left anchor, o y: (number) y coordinate
39016                  * of the left anchor o }, o n: { o x: (number) x coordinate of the right
39017                  * anchor, o y: (number) y coordinate of the right anchor o }, o start: { o
39018                  * x: (number) x coordinate of the start of the curve, o y: (number) y
39019                  * coordinate of the start of the curve o }, o end: { o x: (number) x
39020                  * coordinate of the end of the curve, o y: (number) y coordinate of the end
39021                  * of the curve o }, o alpha: (number) angle of the curve derivative at the
39022                  * point o } \
39023                  */
39024                 Snap.path.findDotsAtSegment = findDotsAtSegment;
39025                 /*
39026                  * \ Snap.path.bezierBBox [ method ] * Utility method * Returns the bounding
39027                  * box of a given cubic beziér curve - p1x (number) x of the first point
39028                  * of the curve - p1y (number) y of the first point of the curve - c1x
39029                  * (number) x of the first anchor of the curve - c1y (number) y of the first
39030                  * anchor of the curve - c2x (number) x of the second anchor of the curve -
39031                  * c2y (number) y of the second anchor of the curve - p2x (number) x of the
39032                  * second point of the curve - p2y (number) y of the second point of the
39033                  * curve or - bez (array) array of six points for beziér curve = (object)
39034                  * bounding box o { o x: (number) x coordinate of the left top point of the
39035                  * box, o y: (number) y coordinate of the left top point of the box, o x2:
39036                  * (number) x coordinate of the right bottom point of the box, o y2:
39037                  * (number) y coordinate of the right bottom point of the box, o width:
39038                  * (number) width of the box, o height: (number) height of the box o } \
39039                  */
39040                 Snap.path.bezierBBox = bezierBBox;
39041                 /*
39042                  * \ Snap.path.isPointInsideBBox [ method ] * Utility method * Returns
39043                  * `true` if given point is inside bounding box - bbox (string) bounding box -
39044                  * x (string) x coordinate of the point - y (string) y coordinate of the
39045                  * point = (boolean) `true` if point is inside \
39046                  */
39047                 Snap.path.isPointInsideBBox = isPointInsideBBox;
39048                 /*
39049                  * \ Snap.path.isBBoxIntersect [ method ] * Utility method * Returns `true`
39050                  * if two bounding boxes intersect - bbox1 (string) first bounding box -
39051                  * bbox2 (string) second bounding box = (boolean) `true` if bounding boxes
39052                  * intersect \
39053                  */
39054                 Snap.path.isBBoxIntersect = isBBoxIntersect;
39055                 /*
39056                  * \ Snap.path.intersection [ method ] * Utility method * Finds
39057                  * intersections of two paths - path1 (string) path string - path2 (string)
39058                  * path string = (array) dots of intersection o [ o { o x: (number) x
39059                  * coordinate of the point, o y: (number) y coordinate of the point, o t1:
39060                  * (number) t value for segment of path1, o t2: (number) t value for segment
39061                  * of path2, o segment1: (number) order number for segment of path1, o
39062                  * segment2: (number) order number for segment of path2, o bez1: (array)
39063                  * eight coordinates representing beziér curve for the segment of path1,
39064                  * o bez2: (array) eight coordinates representing beziér curve for the
39065                  * segment of path2 o } o ] \
39066                  */
39067                 Snap.path.intersection = pathIntersection;
39068                 Snap.path.intersectionNumber = pathIntersectionNumber;
39069                 /*
39070                  * \ Snap.path.isPointInside [ method ] * Utility method * Returns `true` if
39071                  * given point is inside a given closed path.
39072                  * 
39073                  * Note: fill mode doesn’t affect the result of this method. - path
39074                  * (string) path string - x (number) x of the point - y (number) y of the
39075                  * point = (boolean) `true` if point is inside the path \
39076                  */
39077                 Snap.path.isPointInside = isPointInsidePath;
39078                 /*
39079                  * \ Snap.path.getBBox [ method ] * Utility method * Returns the bounding
39080                  * box of a given path - path (string) path string = (object) bounding box o {
39081                  * o x: (number) x coordinate of the left top point of the box, o y:
39082                  * (number) y coordinate of the left top point of the box, o x2: (number) x
39083                  * coordinate of the right bottom point of the box, o y2: (number) y
39084                  * coordinate of the right bottom point of the box, o width: (number) width
39085                  * of the box, o height: (number) height of the box o } \
39086                  */
39087                 Snap.path.getBBox = pathBBox;
39088                 Snap.path.get = getPath;
39089                 /*
39090                  * \ Snap.path.toRelative [ method ] * Utility method * Converts path
39091                  * coordinates into relative values - path (string) path string = (array)
39092                  * path string \
39093                  */
39094                 Snap.path.toRelative = pathToRelative;
39095                 /*
39096                  * \ Snap.path.toAbsolute [ method ] * Utility method * Converts path
39097                  * coordinates into absolute values - path (string) path string = (array)
39098                  * path string \
39099                  */
39100                 Snap.path.toAbsolute = pathToAbsolute;
39101                 /*
39102                  * \ Snap.path.toCubic [ method ] * Utility method * Converts path to a new
39103                  * path where all segments are cubic beziér curves - pathString
39104                  * (string|array) path string or array of segments = (array) array of
39105                  * segments \
39106                  */
39107                 Snap.path.toCubic = path2curve;
39108                 /*
39109                  * \ Snap.path.map [ method ] * Transform the path string with the given
39110                  * matrix - path (string) path string - matrix (object) see @Matrix =
39111                  * (string) transformed path string \
39112                  */
39113                 Snap.path.map = mapPath;
39114                 Snap.path.toString = toString;
39115                 Snap.path.clone = pathClone;
39116             });
39117             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39118             // 
39119             // Licensed under the Apache License, Version 2.0 (the "License");
39120             // you may not use this file except in compliance with the License.
39121             // You may obtain a copy of the License at
39122             // 
39123             // http://www.apache.org/licenses/LICENSE-2.0
39124             // 
39125             // Unless required by applicable law or agreed to in writing, software
39126             // distributed under the License is distributed on an "AS IS" BASIS,
39127             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39128             // See the License for the specific language governing permissions and
39129             // limitations under the License.
39130             Snap.plugin(function(Snap, Element, Paper, glob) {
39131                 var elproto = Element.prototype,
39132                     has = "hasOwnProperty",
39133                     supportsTouch = "createTouch" in glob.doc,
39134                     events = [
39135                         "click", "dblclick", "mousedown", "mousemove", "mouseout",
39136                         "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
39137                         "touchcancel", "keyup"
39138                     ],
39139                     touchMap = {
39140                         mousedown: "touchstart",
39141                         mousemove: "touchmove",
39142                         mouseup: "touchend"
39143                     },
39144                     getScroll = function(xy, el) {
39145                         var name = xy == "y" ? "scrollTop" : "scrollLeft",
39146                             doc = el && el.node ? el.node.ownerDocument : glob.doc;
39147                         return doc[name in doc.documentElement ? "documentElement" : "body"][name];
39148                     },
39149                     preventDefault = function() {
39150                         this.returnValue = false;
39151                     },
39152                     preventTouch = function() {
39153                         return this.originalEvent.preventDefault();
39154                     },
39155                     stopPropagation = function() {
39156                         this.cancelBubble = true;
39157                     },
39158                     stopTouch = function() {
39159                         return this.originalEvent.stopPropagation();
39160                     },
39161                     addEvent = (function() {
39162                         if (glob.doc.addEventListener) {
39163                             return function(obj, type, fn, element) {
39164                                 var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
39165                                     f = function(e) {
39166                                         var scrollY = getScroll("y", element),
39167                                             scrollX = getScroll("x", element);
39168                                         if (supportsTouch && touchMap[has](type)) {
39169                                             for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
39170                                                 if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
39171                                                     var olde = e;
39172                                                     e = e.targetTouches[i];
39173                                                     e.originalEvent = olde;
39174                                                     e.preventDefault = preventTouch;
39175                                                     e.stopPropagation = stopTouch;
39176                                                     break;
39177                                                 }
39178                                             }
39179                                         }
39180                                         var x = e.clientX + scrollX,
39181                                             y = e.clientY + scrollY;
39182                                         return fn.call(element, e, x, y);
39183                                     };
39184
39185                                 if (type !== realName) {
39186                                     obj.addEventListener(type, f, false);
39187                                 }
39188
39189                                 obj.addEventListener(realName, f, false);
39190
39191                                 return function() {
39192                                     if (type !== realName) {
39193                                         obj.removeEventListener(type, f, false);
39194                                     }
39195
39196                                     obj.removeEventListener(realName, f, false);
39197                                     return true;
39198                                 };
39199                             };
39200                         } else if (glob.doc.attachEvent) {
39201                             return function(obj, type, fn, element) {
39202                                 var f = function(e) {
39203                                     e = e || element.node.ownerDocument.window.event;
39204                                     var scrollY = getScroll("y", element),
39205                                         scrollX = getScroll("x", element),
39206                                         x = e.clientX + scrollX,
39207                                         y = e.clientY + scrollY;
39208                                     e.preventDefault = e.preventDefault || preventDefault;
39209                                     e.stopPropagation = e.stopPropagation || stopPropagation;
39210                                     return fn.call(element, e, x, y);
39211                                 };
39212                                 obj.attachEvent("on" + type, f);
39213                                 var detacher = function() {
39214                                     obj.detachEvent("on" + type, f);
39215                                     return true;
39216                                 };
39217                                 return detacher;
39218                             };
39219                         }
39220                     })(),
39221                     drag = [],
39222                     dragMove = function(e) {
39223                         var x = e.clientX,
39224                             y = e.clientY,
39225                             scrollY = getScroll("y"),
39226                             scrollX = getScroll("x"),
39227                             dragi,
39228                             j = drag.length;
39229                         while (j--) {
39230                             dragi = drag[j];
39231                             if (supportsTouch) {
39232                                 var i = e.touches && e.touches.length,
39233                                     touch;
39234                                 while (i--) {
39235                                     touch = e.touches[i];
39236                                     if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
39237                                         x = touch.clientX;
39238                                         y = touch.clientY;
39239                                         (e.originalEvent ? e.originalEvent : e).preventDefault();
39240                                         break;
39241                                     }
39242                                 }
39243                             } else {
39244                                 e.preventDefault();
39245                             }
39246                             var node = dragi.el.node,
39247                                 o,
39248                                 next = node.nextSibling,
39249                                 parent = node.parentNode,
39250                                 display = node.style.display;
39251                             // glob.win.opera && parent.removeChild(node);
39252                             // node.style.display = "none";
39253                             // o = dragi.el.paper.getElementByPoint(x, y);
39254                             // node.style.display = display;
39255                             // glob.win.opera && (next ? parent.insertBefore(node, next) :
39256                             // parent.appendChild(node));
39257                             // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
39258                             x += scrollX;
39259                             y += scrollY;
39260                             eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
39261                         }
39262                     },
39263                     dragUp = function(e) {
39264                         Snap.unmousemove(dragMove).unmouseup(dragUp);
39265                         var i = drag.length,
39266                             dragi;
39267                         while (i--) {
39268                             dragi = drag[i];
39269                             dragi.el._drag = {};
39270                             eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
39271                         }
39272                         drag = [];
39273                     };
39274                 /*
39275                  * \ Element.click [ method ] * Adds a click event handler to the element -
39276                  * handler (function) handler for the event = (object) @Element \
39277                  */
39278                 /*
39279                  * \ Element.unclick [ method ] * Removes a click event handler from the
39280                  * element - handler (function) handler for the event = (object) @Element \
39281                  */
39282
39283                 /*
39284                  * \ Element.dblclick [ method ] * Adds a double click event handler to the
39285                  * element - handler (function) handler for the event = (object) @Element \
39286                  */
39287                 /*
39288                  * \ Element.undblclick [ method ] * Removes a double click event handler
39289                  * from the element - handler (function) handler for the event = (object)
39290                  * @Element \
39291                  */
39292
39293                 /*
39294                  * \ Element.mousedown [ method ] * Adds a mousedown event handler to the
39295                  * element - handler (function) handler for the event = (object) @Element \
39296                  */
39297                 /*
39298                  * \ Element.unmousedown [ method ] * Removes a mousedown event handler from
39299                  * the element - handler (function) handler for the event = (object)
39300                  * @Element \
39301                  */
39302
39303                 /*
39304                  * \ Element.mousemove [ method ] * Adds a mousemove event handler to the
39305                  * element - handler (function) handler for the event = (object) @Element \
39306                  */
39307                 /*
39308                  * \ Element.unmousemove [ method ] * Removes a mousemove event handler from
39309                  * the element - handler (function) handler for the event = (object)
39310                  * @Element \
39311                  */
39312
39313                 /*
39314                  * \ Element.mouseout [ method ] * Adds a mouseout event handler to the
39315                  * element - handler (function) handler for the event = (object) @Element \
39316                  */
39317                 /*
39318                  * \ Element.unmouseout [ method ] * Removes a mouseout event handler from
39319                  * the element - handler (function) handler for the event = (object)
39320                  * @Element \
39321                  */
39322
39323                 /*
39324                  * \ Element.mouseover [ method ] * Adds a mouseover event handler to the
39325                  * element - handler (function) handler for the event = (object) @Element \
39326                  */
39327                 /*
39328                  * \ Element.unmouseover [ method ] * Removes a mouseover event handler from
39329                  * the element - handler (function) handler for the event = (object)
39330                  * @Element \
39331                  */
39332
39333                 /*
39334                  * \ Element.mouseup [ method ] * Adds a mouseup event handler to the
39335                  * element - handler (function) handler for the event = (object) @Element \
39336                  */
39337                 /*
39338                  * \ Element.unmouseup [ method ] * Removes a mouseup event handler from the
39339                  * element - handler (function) handler for the event = (object) @Element \
39340                  */
39341
39342                 /*
39343                  * \ Element.touchstart [ method ] * Adds a touchstart event handler to the
39344                  * element - handler (function) handler for the event = (object) @Element \
39345                  */
39346                 /*
39347                  * \ Element.untouchstart [ method ] * Removes a touchstart event handler
39348                  * from the element - handler (function) handler for the event = (object)
39349                  * @Element \
39350                  */
39351
39352                 /*
39353                  * \ Element.touchmove [ method ] * Adds a touchmove event handler to the
39354                  * element - handler (function) handler for the event = (object) @Element \
39355                  */
39356                 /*
39357                  * \ Element.untouchmove [ method ] * Removes a touchmove event handler from
39358                  * the element - handler (function) handler for the event = (object)
39359                  * @Element \
39360                  */
39361
39362                 /*
39363                  * \ Element.touchend [ method ] * Adds a touchend event handler to the
39364                  * element - handler (function) handler for the event = (object) @Element \
39365                  */
39366                 /*
39367                  * \ Element.untouchend [ method ] * Removes a touchend event handler from
39368                  * the element - handler (function) handler for the event = (object)
39369                  * @Element \
39370                  */
39371
39372                 /*
39373                  * \ Element.touchcancel [ method ] * Adds a touchcancel event handler to
39374                  * the element - handler (function) handler for the event = (object)
39375                  * @Element \
39376                  */
39377                 /*
39378                  * \ Element.untouchcancel [ method ] * Removes a touchcancel event handler
39379                  * from the element - handler (function) handler for the event = (object)
39380                  * @Element \
39381                  */
39382                 for (var i = events.length; i--;) {
39383                     (function(eventName) {
39384                         Snap[eventName] = elproto[eventName] = function(fn, scope) {
39385                             if (Snap.is(fn, "function")) {
39386                                 this.events = this.events || [];
39387                                 this.events.push({
39388                                     name: eventName,
39389                                     f: fn,
39390                                     unbind: addEvent(this.node || document, eventName, fn, scope || this)
39391                                 });
39392                             }
39393                             return this;
39394                         };
39395                         Snap["un" + eventName] =
39396                             elproto["un" + eventName] = function(fn) {
39397                                 var events = this.events || [],
39398                                     l = events.length;
39399                                 while (l--)
39400                                     if (events[l].name == eventName &&
39401                                         (events[l].f == fn || !fn)) {
39402                                         events[l].unbind();
39403                                         events.splice(l, 1);
39404                                         !events.length && delete this.events;
39405                                         return this;
39406                                     }
39407                                 return this;
39408                             };
39409                     })(events[i]);
39410                 }
39411                 /*
39412                  * \ Element.hover [ method ] * Adds hover event handlers to the element -
39413                  * f_in (function) handler for hover in - f_out (function) handler for hover
39414                  * out - icontext (object) #optional context for hover in handler - ocontext
39415                  * (object) #optional context for hover out handler = (object) @Element \
39416                  */
39417                 elproto.hover = function(f_in, f_out, scope_in, scope_out) {
39418                     return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
39419                 };
39420                 /*
39421                  * \ Element.unhover [ method ] * Removes hover event handlers from the
39422                  * element - f_in (function) handler for hover in - f_out (function) handler
39423                  * for hover out = (object) @Element \
39424                  */
39425                 elproto.unhover = function(f_in, f_out) {
39426                     return this.unmouseover(f_in).unmouseout(f_out);
39427                 };
39428                 var draggable = [];
39429                 // SIERRA unclear what _context_ refers to for starting, ending, moving the
39430                 // drag gesture.
39431                 // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y
39432                 // values offset from?
39433                 // SIERRA Element.drag(): much of this member's doc appears to be duplicated
39434                 // for some reason.
39435                 // SIERRA Unclear about this sentence: _Additionally following drag events
39436                 // will be triggered: drag.start.<id> on start, drag.end.<id> on end and
39437                 // drag.move.<id> on every move._ Is there a global _drag_ object to which
39438                 // you can assign handlers keyed by an element's ID?
39439                 /*
39440                  * \ Element.drag [ method ] * Adds event handlers for an element's drag
39441                  * gesture * - onmove (function) handler for moving - onstart (function)
39442                  * handler for drag start - onend (function) handler for drag end - mcontext
39443                  * (object) #optional context for moving handler - scontext (object)
39444                  * #optional context for drag start handler - econtext (object) #optional
39445                  * context for drag end handler Additionaly following `drag` events are
39446                  * triggered: `drag.start.<id>` on start, `drag.end.<id>` on end and
39447                  * `drag.move.<id>` on every move. When element is dragged over another
39448                  * element `drag.over.<id>` fires as well.
39449                  * 
39450                  * Start event and start handler are called in specified context or in
39451                  * context of the element with following parameters: o x (number) x position
39452                  * of the mouse o y (number) y position of the mouse o event (object) DOM
39453                  * event object Move event and move handler are called in specified context
39454                  * or in context of the element with following parameters: o dx (number)
39455                  * shift by x from the start point o dy (number) shift by y from the start
39456                  * point o x (number) x position of the mouse o y (number) y position of the
39457                  * mouse o event (object) DOM event object End event and end handler are
39458                  * called in specified context or in context of the element with following
39459                  * parameters: o event (object) DOM event object = (object) @Element \
39460                  */
39461                 elproto.drag = function(onmove, onstart, onend, move_scope, start_scope, end_scope) {
39462                     if (!arguments.length) {
39463                         var origTransform;
39464                         return this.drag(function(dx, dy) {
39465                             this.attr({
39466                                 transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
39467                             });
39468                         }, function() {
39469                             origTransform = this.transform().local;
39470                         });
39471                     }
39472
39473                     function start(e, x, y) {
39474                         (e.originalEvent || e).preventDefault();
39475                         this._drag.x = x;
39476                         this._drag.y = y;
39477                         this._drag.id = e.identifier;
39478                         !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
39479                         drag.push({
39480                             el: this,
39481                             move_scope: move_scope,
39482                             start_scope: start_scope,
39483                             end_scope: end_scope
39484                         });
39485                         onstart && eve.on("snap.drag.start." + this.id, onstart);
39486                         onmove && eve.on("snap.drag.move." + this.id, onmove);
39487                         onend && eve.on("snap.drag.end." + this.id, onend);
39488                         eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
39489                     }
39490                     this._drag = {};
39491                     draggable.push({
39492                         el: this,
39493                         start: start
39494                     });
39495                     this.mousedown(start);
39496                     return this;
39497                 };
39498                 /*
39499                  * Element.onDragOver [ method ] * Shortcut to assign event handler for
39500                  * `drag.over.<id>` event, where `id` is the element's `id` (see
39501                  * @Element.id) - f (function) handler for event, first argument would be
39502                  * the element you are dragging over \
39503                  */
39504                 // elproto.onDragOver = function (f) {
39505                 // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over."
39506                 // + this.id);
39507                 // };
39508                 /*
39509                  * \ Element.undrag [ method ] * Removes all drag event handlers from the
39510                  * given element \
39511                  */
39512                 elproto.undrag = function() {
39513                     var i = draggable.length;
39514                     while (i--)
39515                         if (draggable[i].el == this) {
39516                             this.unmousedown(draggable[i].start);
39517                             draggable.splice(i, 1);
39518                             eve.unbind("snap.drag.*." + this.id);
39519                         }!draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
39520                     return this;
39521                 };
39522             });
39523             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39524             // 
39525             // Licensed under the Apache License, Version 2.0 (the "License");
39526             // you may not use this file except in compliance with the License.
39527             // You may obtain a copy of the License at
39528             // 
39529             // http://www.apache.org/licenses/LICENSE-2.0
39530             // 
39531             // Unless required by applicable law or agreed to in writing, software
39532             // distributed under the License is distributed on an "AS IS" BASIS,
39533             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39534             // See the License for the specific language governing permissions and
39535             // limitations under the License.
39536             Snap.plugin(function(Snap, Element, Paper, glob) {
39537                 var elproto = Element.prototype,
39538                     pproto = Paper.prototype,
39539                     rgurl = /^\s*url\((.+)\)/,
39540                     Str = String,
39541                     $ = Snap._.$;
39542                 Snap.filter = {};
39543                 /*
39544                  * \ Paper.filter [ method ] * Creates a `<filter>` element * - filstr
39545                  * (string) SVG fragment of filter provided as a string = (object) @Element
39546                  * Note: It is recommended to use filters embedded into the page inside an
39547                  * empty SVG element. > Usage | var f = paper.filter('<feGaussianBlur
39548                  * stdDeviation="2"/>'), | c = paper.circle(10, 10, 10).attr({ | filter: f |
39549                  * }); \
39550                  */
39551                 pproto.filter = function(filstr) {
39552                     var paper = this;
39553                     if (paper.type != "svg") {
39554                         paper = paper.paper;
39555                     }
39556                     var f = Snap.parse(Str(filstr)),
39557                         id = Snap._.id(),
39558                         width = paper.node.offsetWidth,
39559                         height = paper.node.offsetHeight,
39560                         filter = $("filter");
39561                     $(filter, {
39562                         id: id,
39563                         filterUnits: "userSpaceOnUse"
39564                     });
39565                     filter.appendChild(f.node);
39566                     paper.defs.appendChild(filter);
39567                     return new Element(filter);
39568                 };
39569
39570                 eve.on("snap.util.getattr.filter", function() {
39571                     eve.stop();
39572                     var p = $(this.node, "filter");
39573                     if (p) {
39574                         var match = Str(p).match(rgurl);
39575                         return match && Snap.select(match[1]);
39576                     }
39577                 });
39578                 eve.on("snap.util.attr.filter", function(value) {
39579                     if (value instanceof Element && value.type == "filter") {
39580                         eve.stop();
39581                         var id = value.node.id;
39582                         if (!id) {
39583                             $(value.node, {
39584                                 id: value.id
39585                             });
39586                             id = value.id;
39587                         }
39588                         $(this.node, {
39589                             filter: Snap.url(id)
39590                         });
39591                     }
39592                     if (!value || value == "none") {
39593                         eve.stop();
39594                         this.node.removeAttribute("filter");
39595                     }
39596                 });
39597                 /*
39598                  * \ Snap.filter.blur [ method ] * Returns an SVG markup string for the blur
39599                  * filter * - x (number) amount of horizontal blur, in pixels - y (number)
39600                  * #optional amount of vertical blur, in pixels = (string) filter
39601                  * representation > Usage | var f = paper.filter(Snap.filter.blur(5, 10)), |
39602                  * c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39603                  */
39604                 Snap.filter.blur = function(x, y) {
39605                     if (x == null) {
39606                         x = 2;
39607                     }
39608                     var def = y == null ? x : [x, y];
39609                     return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
39610                         def: def
39611                     });
39612                 };
39613                 Snap.filter.blur.toString = function() {
39614                     return this();
39615                 };
39616                 /*
39617                  * \ Snap.filter.shadow [ method ] * Returns an SVG markup string for the
39618                  * shadow filter * - dx (number) #optional horizontal shift of the shadow,
39619                  * in pixels - dy (number) #optional vertical shift of the shadow, in pixels -
39620                  * blur (number) #optional amount of blur - color (string) #optional color
39621                  * of the shadow - opacity (number) #optional `0..1` opacity of the shadow
39622                  * or - dx (number) #optional horizontal shift of the shadow, in pixels - dy
39623                  * (number) #optional vertical shift of the shadow, in pixels - color
39624                  * (string) #optional color of the shadow - opacity (number) #optional
39625                  * `0..1` opacity of the shadow which makes blur default to `4`. Or - dx
39626                  * (number) #optional horizontal shift of the shadow, in pixels - dy
39627                  * (number) #optional vertical shift of the shadow, in pixels - opacity
39628                  * (number) #optional `0..1` opacity of the shadow = (string) filter
39629                  * representation > Usage | var f = paper.filter(Snap.filter.shadow(0, 2,
39630                  * 3)), | c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39631                  */
39632                 Snap.filter.shadow = function(dx, dy, blur, color, opacity) {
39633                     if (typeof blur == "string") {
39634                         color = blur;
39635                         opacity = color;
39636                         blur = 4;
39637                     }
39638                     if (typeof color != "string") {
39639                         opacity = color;
39640                         color = "#000";
39641                     }
39642                     color = color || "#000";
39643                     if (blur == null) {
39644                         blur = 4;
39645                     }
39646                     if (opacity == null) {
39647                         opacity = 1;
39648                     }
39649                     if (dx == null) {
39650                         dx = 0;
39651                         dy = 2;
39652                     }
39653                     if (dy == null) {
39654                         dy = dx;
39655                     }
39656                     color = Snap.color(color);
39657                     return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
39658                         color: color,
39659                         dx: dx,
39660                         dy: dy,
39661                         blur: blur,
39662                         opacity: opacity
39663                     });
39664                 };
39665                 Snap.filter.shadow.toString = function() {
39666                     return this();
39667                 };
39668                 /*
39669                  * \ Snap.filter.grayscale [ method ] * Returns an SVG markup string for the
39670                  * grayscale filter * - amount (number) amount of filter (`0..1`) = (string)
39671                  * filter representation \
39672                  */
39673                 Snap.filter.grayscale = function(amount) {
39674                     if (amount == null) {
39675                         amount = 1;
39676                     }
39677                     return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
39678                         a: 0.2126 + 0.7874 * (1 - amount),
39679                         b: 0.7152 - 0.7152 * (1 - amount),
39680                         c: 0.0722 - 0.0722 * (1 - amount),
39681                         d: 0.2126 - 0.2126 * (1 - amount),
39682                         e: 0.7152 + 0.2848 * (1 - amount),
39683                         f: 0.0722 - 0.0722 * (1 - amount),
39684                         g: 0.2126 - 0.2126 * (1 - amount),
39685                         h: 0.0722 + 0.9278 * (1 - amount)
39686                     });
39687                 };
39688                 Snap.filter.grayscale.toString = function() {
39689                     return this();
39690                 };
39691                 /*
39692                  * \ Snap.filter.sepia [ method ] * Returns an SVG markup string for the
39693                  * sepia filter * - amount (number) amount of filter (`0..1`) = (string)
39694                  * filter representation \
39695                  */
39696                 Snap.filter.sepia = function(amount) {
39697                     if (amount == null) {
39698                         amount = 1;
39699                     }
39700                     return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
39701                         a: 0.393 + 0.607 * (1 - amount),
39702                         b: 0.769 - 0.769 * (1 - amount),
39703                         c: 0.189 - 0.189 * (1 - amount),
39704                         d: 0.349 - 0.349 * (1 - amount),
39705                         e: 0.686 + 0.314 * (1 - amount),
39706                         f: 0.168 - 0.168 * (1 - amount),
39707                         g: 0.272 - 0.272 * (1 - amount),
39708                         h: 0.534 - 0.534 * (1 - amount),
39709                         i: 0.131 + 0.869 * (1 - amount)
39710                     });
39711                 };
39712                 Snap.filter.sepia.toString = function() {
39713                     return this();
39714                 };
39715                 /*
39716                  * \ Snap.filter.saturate [ method ] * Returns an SVG markup string for the
39717                  * saturate filter * - amount (number) amount of filter (`0..1`) = (string)
39718                  * filter representation \
39719                  */
39720                 Snap.filter.saturate = function(amount) {
39721                     if (amount == null) {
39722                         amount = 1;
39723                     }
39724                     return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
39725                         amount: 1 - amount
39726                     });
39727                 };
39728                 Snap.filter.saturate.toString = function() {
39729                     return this();
39730                 };
39731                 /*
39732                  * \ Snap.filter.hueRotate [ method ] * Returns an SVG markup string for the
39733                  * hue-rotate filter * - angle (number) angle of rotation = (string) filter
39734                  * representation \
39735                  */
39736                 Snap.filter.hueRotate = function(angle) {
39737                     angle = angle || 0;
39738                     return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
39739                         angle: angle
39740                     });
39741                 };
39742                 Snap.filter.hueRotate.toString = function() {
39743                     return this();
39744                 };
39745                 /*
39746                  * \ Snap.filter.invert [ method ] * Returns an SVG markup string for the
39747                  * invert filter * - amount (number) amount of filter (`0..1`) = (string)
39748                  * filter representation \
39749                  */
39750                 Snap.filter.invert = function(amount) {
39751                     if (amount == null) {
39752                         amount = 1;
39753                     }
39754                     return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
39755                         amount: amount,
39756                         amount2: 1 - amount
39757                     });
39758                 };
39759                 Snap.filter.invert.toString = function() {
39760                     return this();
39761                 };
39762                 /*
39763                  * \ Snap.filter.brightness [ method ] * Returns an SVG markup string for
39764                  * the brightness filter * - amount (number) amount of filter (`0..1`) =
39765                  * (string) filter representation \
39766                  */
39767                 Snap.filter.brightness = function(amount) {
39768                     if (amount == null) {
39769                         amount = 1;
39770                     }
39771                     return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
39772                         amount: amount
39773                     });
39774                 };
39775                 Snap.filter.brightness.toString = function() {
39776                     return this();
39777                 };
39778                 /*
39779                  * \ Snap.filter.contrast [ method ] * Returns an SVG markup string for the
39780                  * contrast filter * - amount (number) amount of filter (`0..1`) = (string)
39781                  * filter representation \
39782                  */
39783                 Snap.filter.contrast = function(amount) {
39784                     if (amount == null) {
39785                         amount = 1;
39786                     }
39787                     return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
39788                         amount: amount,
39789                         amount2: .5 - amount / 2
39790                     });
39791                 };
39792                 Snap.filter.contrast.toString = function() {
39793                     return this();
39794                 };
39795             });
39796
39797             return Snap;
39798         }));
39799     }, {
39800         "eve": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js"
39801     }],
39802     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js": [function(require, module, exports) {
39803         'use strict';
39804
39805         var snapsvg = module.exports = require('snapsvg');
39806
39807         snapsvg.plugin(function(Snap, Element) {
39808
39809             /*
39810              * \ Element.children [ method ] * Returns array of all the children of the
39811              * element. = (array) array of Elements \
39812              */
39813             Element.prototype.children = function() {
39814                 var out = [],
39815                     ch = this.node.childNodes;
39816                 for (var i = 0, ii = ch.length; i < ii; i++) {
39817                     out[i] = new Snap(ch[i]);
39818                 }
39819                 return out;
39820             };
39821         });
39822
39823
39824         /**
39825          * @class ClassPlugin
39826          * 
39827          * Extends snapsvg with methods to add and remove classes
39828          */
39829         snapsvg.plugin(function(Snap, Element, Paper, global) {
39830
39831             function split(str) {
39832                 return str.split(/\s+/);
39833             }
39834
39835             function join(array) {
39836                 return array.join(' ');
39837             }
39838
39839             function getClasses(e) {
39840                 return split(e.attr('class') || '');
39841             }
39842
39843             function setClasses(e, classes) {
39844                 e.attr('class', join(classes));
39845             }
39846
39847             /**
39848              * @method snapsvg.Element#addClass
39849              * 
39850              * @example
39851              * 
39852              * e.attr('class', 'selector');
39853              * 
39854              * e.addClass('foo bar'); // adds classes foo and bar e.attr('class'); // ->
39855              * 'selector foo bar'
39856              * 
39857              * e.addClass('fooBar'); e.attr('class'); // -> 'selector foo bar fooBar'
39858              * 
39859              * @param {String}
39860              *            cls classes to be added to the element
39861              * 
39862              * @return {snapsvg.Element} the element (this)
39863              */
39864             Element.prototype.addClass = function(cls) {
39865                 var current = getClasses(this),
39866                     add = split(cls),
39867                     i, e;
39868
39869                 for (i = 0, e; !!(e = add[i]); i++) {
39870                     if (current.indexOf(e) === -1) {
39871                         current.push(e);
39872                     }
39873                 }
39874
39875                 setClasses(this, current);
39876
39877                 return this;
39878             };
39879
39880             /**
39881              * @method snapsvg.Element#hasClass
39882              * 
39883              * @param {String}
39884              *            cls the class to query for
39885              * @return {Boolean} returns true if the element has the given class
39886              */
39887             Element.prototype.hasClass = function(cls) {
39888                 if (!cls) {
39889                     throw new Error('[snapsvg] syntax: hasClass(clsStr)');
39890                 }
39891
39892                 return getClasses(this).indexOf(cls) !== -1;
39893             };
39894
39895             /**
39896              * @method snapsvg.Element#removeClass
39897              * 
39898              * @example
39899              * 
39900              * e.attr('class', 'foo bar');
39901              * 
39902              * e.removeClass('foo'); e.attr('class'); // -> 'bar'
39903              * 
39904              * e.removeClass('foo bar'); // removes classes foo and bar e.attr('class'); // -> ''
39905              * 
39906              * @param {String}
39907              *            cls classes to be removed from element
39908              * 
39909              * @return {snapsvg.Element} the element (this)
39910              */
39911             Element.prototype.removeClass = function(cls) {
39912                 var current = getClasses(this),
39913                     remove = split(cls),
39914                     i, e, idx;
39915
39916                 for (i = 0, e; !!(e = remove[i]); i++) {
39917                     idx = current.indexOf(e);
39918
39919                     if (idx !== -1) {
39920                         // remove element from array
39921                         current.splice(idx, 1);
39922                     }
39923                 }
39924
39925                 setClasses(this, current);
39926
39927                 return this;
39928             };
39929
39930         });
39931
39932         /**
39933          * @class TranslatePlugin
39934          * 
39935          * Extends snapsvg with methods to translate elements
39936          */
39937         snapsvg.plugin(function(Snap, Element, Paper, global) {
39938
39939             /*
39940              * @method snapsvg.Element#translate
39941              * 
39942              * @example
39943              * 
39944              * e.translate(10, 20);
39945              *  // sets transform matrix to translate(10, 20)
39946              * 
39947              * @param {Number} x translation @param {Number} y translation
39948              * 
39949              * @return {snapsvg.Element} the element (this)
39950              */
39951             Element.prototype.translate = function(x, y) {
39952                 var matrix = new Snap.Matrix();
39953                 matrix.translate(x, y);
39954                 return this.transform(matrix);
39955             };
39956         });
39957
39958
39959         /**
39960          * @class CreatePlugin
39961          * 
39962          * Create an svg element without attaching it to the dom
39963          */
39964         snapsvg.plugin(function(Snap) {
39965
39966             Snap.create = function(name, attrs) {
39967                 return Snap._.wrap(Snap._.$(name, attrs));
39968             };
39969         });
39970
39971
39972         /**
39973          * @class CreatSnapAtPlugin
39974          * 
39975          * Extends snap.svg with a method to create a SVG element at a specific position
39976          * in the DOM.
39977          */
39978         snapsvg.plugin(function(Snap, Element, Paper, global) {
39979
39980             /*
39981              * @method snapsvg.createSnapAt
39982              * 
39983              * @example
39984              * 
39985              * snapsvg.createSnapAt(parentNode, 200, 200);
39986              * 
39987              * @param {Number} width of svg @param {Number} height of svg @param
39988              * {Object} parentNode svg Element will be child of this
39989              * 
39990              * @return {snapsvg.Element} the newly created wrapped SVG element instance
39991              */
39992             Snap.createSnapAt = function(width, height, parentNode) {
39993
39994                 var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
39995                 svg.setAttribute('width', width);
39996                 svg.setAttribute('height', height);
39997                 if (!parentNode) {
39998                     parentNode = document.body;
39999                 }
40000                 parentNode.appendChild(svg);
40001
40002                 return new Snap(svg);
40003             };
40004         });
40005     }, {
40006         "snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js"
40007     }],
40008     "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js": [function(require, module, exports) {
40009         /*
40010          * ! jQuery JavaScript Library v2.1.4 http://jquery.com/
40011          * 
40012          * Includes Sizzle.js http://sizzlejs.com/
40013          * 
40014          * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors Released
40015          * under the MIT license http://jquery.org/license
40016          * 
40017          * Date: 2015-04-28T16:01Z
40018          */
40019
40020         (function(global, factory) {
40021
40022             if (typeof module === "object" && typeof module.exports === "object") {
40023                 // For CommonJS and CommonJS-like environments where a proper `window`
40024                 // is present, execute the factory and get jQuery.
40025                 // For environments that do not have a `window` with a `document`
40026                 // (such as Node.js), expose a factory as module.exports.
40027                 // This accentuates the need for the creation of a real `window`.
40028                 // e.g. var jQuery = require("jquery")(window);
40029                 // See ticket #14549 for more info.
40030                 module.exports = global.document ?
40031                     factory(global, true) :
40032                     function(w) {
40033                         if (!w.document) {
40034                             throw new Error("jQuery requires a window with a document");
40035                         }
40036                         return factory(w);
40037                     };
40038             } else {
40039                 factory(global);
40040             }
40041
40042             // Pass this if window is not defined yet
40043         }(typeof window !== "undefined" ? window : this, function(window, noGlobal) {
40044
40045             // Support: Firefox 18+
40046             // Can't be in strict mode, several libs including ASP.NET trace
40047             // the stack via arguments.caller.callee and Firefox dies if
40048             // you try to trace through "use strict" call chains. (#13335)
40049             //
40050
40051             var arr = [];
40052
40053             var slice = arr.slice;
40054
40055             var concat = arr.concat;
40056
40057             var push = arr.push;
40058
40059             var indexOf = arr.indexOf;
40060
40061             var class2type = {};
40062
40063             var toString = class2type.toString;
40064
40065             var hasOwn = class2type.hasOwnProperty;
40066
40067             var support = {};
40068
40069
40070
40071             var
40072             // Use the correct document accordingly with window argument (sandbox)
40073                 document = window.document,
40074
40075                 version = "2.1.4",
40076
40077                 // Define a local copy of jQuery
40078                 jQuery = function(selector, context) {
40079                     // The jQuery object is actually just the init constructor 'enhanced'
40080                     // Need init if jQuery is called (just allow error to be thrown if not
40081                     // included)
40082                     return new jQuery.fn.init(selector, context);
40083                 },
40084
40085                 // Support: Android<4.1
40086                 // Make sure we trim BOM and NBSP
40087                 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
40088
40089                 // Matches dashed string for camelizing
40090                 rmsPrefix = /^-ms-/,
40091                 rdashAlpha = /-([\da-z])/gi,
40092
40093                 // Used by jQuery.camelCase as callback to replace()
40094                 fcamelCase = function(all, letter) {
40095                     return letter.toUpperCase();
40096                 };
40097
40098             jQuery.fn = jQuery.prototype = {
40099                 // The current version of jQuery being used
40100                 jquery: version,
40101
40102                 constructor: jQuery,
40103
40104                 // Start with an empty selector
40105                 selector: "",
40106
40107                 // The default length of a jQuery object is 0
40108                 length: 0,
40109
40110                 toArray: function() {
40111                     return slice.call(this);
40112                 },
40113
40114                 // Get the Nth element in the matched element set OR
40115                 // Get the whole matched element set as a clean array
40116                 get: function(num) {
40117                     return num != null ?
40118
40119                         // Return just the one element from the set
40120                         (num < 0 ? this[num + this.length] : this[num]) :
40121
40122                         // Return all the elements in a clean array
40123                         slice.call(this);
40124                 },
40125
40126                 // Take an array of elements and push it onto the stack
40127                 // (returning the new matched element set)
40128                 pushStack: function(elems) {
40129
40130                     // Build a new jQuery matched element set
40131                     var ret = jQuery.merge(this.constructor(), elems);
40132
40133                     // Add the old object onto the stack (as a reference)
40134                     ret.prevObject = this;
40135                     ret.context = this.context;
40136
40137                     // Return the newly-formed element set
40138                     return ret;
40139                 },
40140
40141                 // Execute a callback for every element in the matched set.
40142                 // (You can seed the arguments with an array of args, but this is
40143                 // only used internally.)
40144                 each: function(callback, args) {
40145                     return jQuery.each(this, callback, args);
40146                 },
40147
40148                 map: function(callback) {
40149                     return this.pushStack(jQuery.map(this, function(elem, i) {
40150                         return callback.call(elem, i, elem);
40151                     }));
40152                 },
40153
40154                 slice: function() {
40155                     return this.pushStack(slice.apply(this, arguments));
40156                 },
40157
40158                 first: function() {
40159                     return this.eq(0);
40160                 },
40161
40162                 last: function() {
40163                     return this.eq(-1);
40164                 },
40165
40166                 eq: function(i) {
40167                     var len = this.length,
40168                         j = +i + (i < 0 ? len : 0);
40169                     return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
40170                 },
40171
40172                 end: function() {
40173                     return this.prevObject || this.constructor(null);
40174                 },
40175
40176                 // For internal use only.
40177                 // Behaves like an Array's method, not like a jQuery method.
40178                 push: push,
40179                 sort: arr.sort,
40180                 splice: arr.splice
40181             };
40182
40183             jQuery.extend = jQuery.fn.extend = function() {
40184                 var options, name, src, copy, copyIsArray, clone,
40185                     target = arguments[0] || {},
40186                     i = 1,
40187                     length = arguments.length,
40188                     deep = false;
40189
40190                 // Handle a deep copy situation
40191                 if (typeof target === "boolean") {
40192                     deep = target;
40193
40194                     // Skip the boolean and the target
40195                     target = arguments[i] || {};
40196                     i++;
40197                 }
40198
40199                 // Handle case when target is a string or something (possible in deep copy)
40200                 if (typeof target !== "object" && !jQuery.isFunction(target)) {
40201                     target = {};
40202                 }
40203
40204                 // Extend jQuery itself if only one argument is passed
40205                 if (i === length) {
40206                     target = this;
40207                     i--;
40208                 }
40209
40210                 for (; i < length; i++) {
40211                     // Only deal with non-null/undefined values
40212                     if ((options = arguments[i]) != null) {
40213                         // Extend the base object
40214                         for (name in options) {
40215                             src = target[name];
40216                             copy = options[name];
40217
40218                             // Prevent never-ending loop
40219                             if (target === copy) {
40220                                 continue;
40221                             }
40222
40223                             // Recurse if we're merging plain objects or arrays
40224                             if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
40225                                 if (copyIsArray) {
40226                                     copyIsArray = false;
40227                                     clone = src && jQuery.isArray(src) ? src : [];
40228
40229                                 } else {
40230                                     clone = src && jQuery.isPlainObject(src) ? src : {};
40231                                 }
40232
40233                                 // Never move original objects, clone them
40234                                 target[name] = jQuery.extend(deep, clone, copy);
40235
40236                                 // Don't bring in undefined values
40237                             } else if (copy !== undefined) {
40238                                 target[name] = copy;
40239                             }
40240                         }
40241                     }
40242                 }
40243
40244                 // Return the modified object
40245                 return target;
40246             };
40247
40248             jQuery.extend({
40249                 // Unique for each copy of jQuery on the page
40250                 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
40251
40252                 // Assume jQuery is ready without the ready module
40253                 isReady: true,
40254
40255                 error: function(msg) {
40256                     throw new Error(msg);
40257                 },
40258
40259                 noop: function() {},
40260
40261                 isFunction: function(obj) {
40262                     return jQuery.type(obj) === "function";
40263                 },
40264
40265                 isArray: Array.isArray,
40266
40267                 isWindow: function(obj) {
40268                     return obj != null && obj === obj.window;
40269                 },
40270
40271                 isNumeric: function(obj) {
40272                     // parseFloat NaNs numeric-cast false positives (null|true|false|"")
40273                     // ...but misinterprets leading-number strings, particularly hex
40274                     // literals ("0x...")
40275                     // subtraction forces infinities to NaN
40276                     // adding 1 corrects loss of precision from parseFloat (#15100)
40277                     return !jQuery.isArray(obj) && (obj - parseFloat(obj) + 1) >= 0;
40278                 },
40279
40280                 isPlainObject: function(obj) {
40281                     // Not plain objects:
40282                     // - Any object or value whose internal [[Class]] property is not
40283                     // "[object Object]"
40284                     // - DOM nodes
40285                     // - window
40286                     if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
40287                         return false;
40288                     }
40289
40290                     if (obj.constructor &&
40291                         !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
40292                         return false;
40293                     }
40294
40295                     // If the function hasn't returned already, we're confident that
40296                     // |obj| is a plain object, created by {} or constructed with new Object
40297                     return true;
40298                 },
40299
40300                 isEmptyObject: function(obj) {
40301                     var name;
40302                     for (name in obj) {
40303                         return false;
40304                     }
40305                     return true;
40306                 },
40307
40308                 type: function(obj) {
40309                     if (obj == null) {
40310                         return obj + "";
40311                     }
40312                     // Support: Android<4.0, iOS<6 (functionish RegExp)
40313                     return typeof obj === "object" || typeof obj === "function" ?
40314                         class2type[toString.call(obj)] || "object" :
40315                         typeof obj;
40316                 },
40317
40318                 // Evaluates a script in a global context
40319                 globalEval: function(code) {
40320                     var script,
40321                         indirect = eval;
40322
40323                     code = jQuery.trim(code);
40324
40325                     if (code) {
40326                         // If the code includes a valid, prologue position
40327                         // strict mode pragma, execute code by injecting a
40328                         // script tag into the document.
40329                         if (code.indexOf("use strict") === 1) {
40330                             script = document.createElement("script");
40331                             script.text = code;
40332                             document.head.appendChild(script).parentNode.removeChild(script);
40333                         } else {
40334                             // Otherwise, avoid the DOM node creation, insertion
40335                             // and removal by using an indirect global eval
40336                             indirect(code);
40337                         }
40338                     }
40339                 },
40340
40341                 // Convert dashed to camelCase; used by the css and data modules
40342                 // Support: IE9-11+
40343                 // Microsoft forgot to hump their vendor prefix (#9572)
40344                 camelCase: function(string) {
40345                     return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
40346                 },
40347
40348                 nodeName: function(elem, name) {
40349                     return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
40350                 },
40351
40352                 // args is for internal usage only
40353                 each: function(obj, callback, args) {
40354                     var value,
40355                         i = 0,
40356                         length = obj.length,
40357                         isArray = isArraylike(obj);
40358
40359                     if (args) {
40360                         if (isArray) {
40361                             for (; i < length; i++) {
40362                                 value = callback.apply(obj[i], args);
40363
40364                                 if (value === false) {
40365                                     break;
40366                                 }
40367                             }
40368                         } else {
40369                             for (i in obj) {
40370                                 value = callback.apply(obj[i], args);
40371
40372                                 if (value === false) {
40373                                     break;
40374                                 }
40375                             }
40376                         }
40377
40378                         // A special, fast, case for the most common use of each
40379                     } else {
40380                         if (isArray) {
40381                             for (; i < length; i++) {
40382                                 value = callback.call(obj[i], i, obj[i]);
40383
40384                                 if (value === false) {
40385                                     break;
40386                                 }
40387                             }
40388                         } else {
40389                             for (i in obj) {
40390                                 value = callback.call(obj[i], i, obj[i]);
40391
40392                                 if (value === false) {
40393                                     break;
40394                                 }
40395                             }
40396                         }
40397                     }
40398
40399                     return obj;
40400                 },
40401
40402                 // Support: Android<4.1
40403                 trim: function(text) {
40404                     return text == null ?
40405                         "" :
40406                         (text + "").replace(rtrim, "");
40407                 },
40408
40409                 // results is for internal usage only
40410                 makeArray: function(arr, results) {
40411                     var ret = results || [];
40412
40413                     if (arr != null) {
40414                         if (isArraylike(Object(arr))) {
40415                             jQuery.merge(ret,
40416                                 typeof arr === "string" ? [arr] : arr
40417                             );
40418                         } else {
40419                             push.call(ret, arr);
40420                         }
40421                     }
40422
40423                     return ret;
40424                 },
40425
40426                 inArray: function(elem, arr, i) {
40427                     return arr == null ? -1 : indexOf.call(arr, elem, i);
40428                 },
40429
40430                 merge: function(first, second) {
40431                     var len = +second.length,
40432                         j = 0,
40433                         i = first.length;
40434
40435                     for (; j < len; j++) {
40436                         first[i++] = second[j];
40437                     }
40438
40439                     first.length = i;
40440
40441                     return first;
40442                 },
40443
40444                 grep: function(elems, callback, invert) {
40445                     var callbackInverse,
40446                         matches = [],
40447                         i = 0,
40448                         length = elems.length,
40449                         callbackExpect = !invert;
40450
40451                     // Go through the array, only saving the items
40452                     // that pass the validator function
40453                     for (; i < length; i++) {
40454                         callbackInverse = !callback(elems[i], i);
40455                         if (callbackInverse !== callbackExpect) {
40456                             matches.push(elems[i]);
40457                         }
40458                     }
40459
40460                     return matches;
40461                 },
40462
40463                 // arg is for internal usage only
40464                 map: function(elems, callback, arg) {
40465                     var value,
40466                         i = 0,
40467                         length = elems.length,
40468                         isArray = isArraylike(elems),
40469                         ret = [];
40470
40471                     // Go through the array, translating each of the items to their new
40472                     // values
40473                     if (isArray) {
40474                         for (; i < length; i++) {
40475                             value = callback(elems[i], i, arg);
40476
40477                             if (value != null) {
40478                                 ret.push(value);
40479                             }
40480                         }
40481
40482                         // Go through every key on the object,
40483                     } else {
40484                         for (i in elems) {
40485                             value = callback(elems[i], i, arg);
40486
40487                             if (value != null) {
40488                                 ret.push(value);
40489                             }
40490                         }
40491                     }
40492
40493                     // Flatten any nested arrays
40494                     return concat.apply([], ret);
40495                 },
40496
40497                 // A global GUID counter for objects
40498                 guid: 1,
40499
40500                 // Bind a function to a context, optionally partially applying any
40501                 // arguments.
40502                 proxy: function(fn, context) {
40503                     var tmp, args, proxy;
40504
40505                     if (typeof context === "string") {
40506                         tmp = fn[context];
40507                         context = fn;
40508                         fn = tmp;
40509                     }
40510
40511                     // Quick check to determine if target is callable, in the spec
40512                     // this throws a TypeError, but we will just return undefined.
40513                     if (!jQuery.isFunction(fn)) {
40514                         return undefined;
40515                     }
40516
40517                     // Simulated bind
40518                     args = slice.call(arguments, 2);
40519                     proxy = function() {
40520                         return fn.apply(context || this, args.concat(slice.call(arguments)));
40521                     };
40522
40523                     // Set the guid of unique handler to the same of original handler, so it
40524                     // can be removed
40525                     proxy.guid = fn.guid = fn.guid || jQuery.guid++;
40526
40527                     return proxy;
40528                 },
40529
40530                 now: Date.now,
40531
40532                 // jQuery.support is not used in Core but other projects attach their
40533                 // properties to it so it needs to exist.
40534                 support: support
40535             });
40536
40537             // Populate the class2type map
40538             jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
40539                 class2type["[object " + name + "]"] = name.toLowerCase();
40540             });
40541
40542             function isArraylike(obj) {
40543
40544                 // Support: iOS 8.2 (not reproducible in simulator)
40545                 // `in` check used to prevent JIT error (gh-2145)
40546                 // hasOwn isn't used here due to false negatives
40547                 // regarding Nodelist length in IE
40548                 var length = "length" in obj && obj.length,
40549                     type = jQuery.type(obj);
40550
40551                 if (type === "function" || jQuery.isWindow(obj)) {
40552                     return false;
40553                 }
40554
40555                 if (obj.nodeType === 1 && length) {
40556                     return true;
40557                 }
40558
40559                 return type === "array" || length === 0 ||
40560                     typeof length === "number" && length > 0 && (length - 1) in obj;
40561             }
40562             var Sizzle =
40563                 /*
40564                  * ! Sizzle CSS Selector Engine v2.2.0-pre http://sizzlejs.com/
40565                  * 
40566                  * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors Released
40567                  * under the MIT license http://jquery.org/license
40568                  * 
40569                  * Date: 2014-12-16
40570                  */
40571                 (function(window) {
40572
40573                     var i,
40574                         support,
40575                         Expr,
40576                         getText,
40577                         isXML,
40578                         tokenize,
40579                         compile,
40580                         select,
40581                         outermostContext,
40582                         sortInput,
40583                         hasDuplicate,
40584
40585                         // Local document vars
40586                         setDocument,
40587                         document,
40588                         docElem,
40589                         documentIsHTML,
40590                         rbuggyQSA,
40591                         rbuggyMatches,
40592                         matches,
40593                         contains,
40594
40595                         // Instance-specific data
40596                         expando = "sizzle" + 1 * new Date(),
40597                         preferredDoc = window.document,
40598                         dirruns = 0,
40599                         done = 0,
40600                         classCache = createCache(),
40601                         tokenCache = createCache(),
40602                         compilerCache = createCache(),
40603                         sortOrder = function(a, b) {
40604                             if (a === b) {
40605                                 hasDuplicate = true;
40606                             }
40607                             return 0;
40608                         },
40609
40610                         // General-purpose constants
40611                         MAX_NEGATIVE = 1 << 31,
40612
40613                         // Instance methods
40614                         hasOwn = ({}).hasOwnProperty,
40615                         arr = [],
40616                         pop = arr.pop,
40617                         push_native = arr.push,
40618                         push = arr.push,
40619                         slice = arr.slice,
40620                         // Use a stripped-down indexOf as it's faster than native
40621                         // http://jsperf.com/thor-indexof-vs-for/5
40622                         indexOf = function(list, elem) {
40623                             var i = 0,
40624                                 len = list.length;
40625                             for (; i < len; i++) {
40626                                 if (list[i] === elem) {
40627                                     return i;
40628                                 }
40629                             }
40630                             return -1;
40631                         },
40632
40633                         booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
40634
40635                         // Regular expressions
40636
40637                         // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
40638                         whitespace = "[\\x20\\t\\r\\n\\f]",
40639                         // http://www.w3.org/TR/css3-syntax/#characters
40640                         characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
40641
40642                         // Loosely modeled on CSS identifier characters
40643                         // An unquoted value should be a CSS identifier
40644                         // http://www.w3.org/TR/css3-selectors/#attribute-selectors
40645                         // Proper syntax:
40646                         // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
40647                         identifier = characterEncoding.replace("w", "w#"),
40648
40649                         // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
40650                         attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
40651                         // Operator (capture 2)
40652                         "*([*^$|!~]?=)" + whitespace +
40653                         // "Attribute values must be CSS identifiers [capture 5] or strings
40654                         // [capture 3 or capture 4]"
40655                         "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
40656                         "*\\]",
40657
40658                         pseudos = ":(" + characterEncoding + ")(?:\\((" +
40659                         // To reduce the number of selectors needing tokenize in the preFilter,
40660                         // prefer arguments:
40661                         // 1. quoted (capture 3; capture 4 or capture 5)
40662                         "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
40663                         // 2. simple (capture 6)
40664                         "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
40665                         // 3. anything else (capture 2)
40666                         ".*" +
40667                         ")\\)|)",
40668
40669                         // Leading and non-escaped trailing whitespace, capturing some
40670                         // non-whitespace characters preceding the latter
40671                         rwhitespace = new RegExp(whitespace + "+", "g"),
40672                         rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
40673
40674                         rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
40675                         rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
40676
40677                         rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"),
40678
40679                         rpseudo = new RegExp(pseudos),
40680                         ridentifier = new RegExp("^" + identifier + "$"),
40681
40682                         matchExpr = {
40683                             "ID": new RegExp("^#(" + characterEncoding + ")"),
40684                             "CLASS": new RegExp("^\\.(" + characterEncoding + ")"),
40685                             "TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
40686                             "ATTR": new RegExp("^" + attributes),
40687                             "PSEUDO": new RegExp("^" + pseudos),
40688                             "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
40689                                 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
40690                                 "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
40691                             "bool": new RegExp("^(?:" + booleans + ")$", "i"),
40692                             // For use in libraries implementing .is()
40693                             // We use this for POS matching in `select`
40694                             "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
40695                                 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
40696                         },
40697
40698                         rinputs = /^(?:input|select|textarea|button)$/i,
40699                         rheader = /^h\d$/i,
40700
40701                         rnative = /^[^{]+\{\s*\[native \w/,
40702
40703                         // Easily-parseable/retrievable ID or TAG or CLASS selectors
40704                         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
40705
40706                         rsibling = /[+~]/,
40707                         rescape = /'|\\/g,
40708
40709                         // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
40710                         runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"),
40711                         funescape = function(_, escaped, escapedWhitespace) {
40712                             var high = "0x" + escaped - 0x10000;
40713                             // NaN means non-codepoint
40714                             // Support: Firefox<24
40715                             // Workaround erroneous numeric interpretation of +"0x"
40716                             return high !== high || escapedWhitespace ?
40717                                 escaped :
40718                                 high < 0 ?
40719                                 // BMP codepoint
40720                                 String.fromCharCode(high + 0x10000) :
40721                                 // Supplemental Plane codepoint (surrogate pair)
40722                                 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
40723                         },
40724
40725                         // Used for iframes
40726                         // See setDocument()
40727                         // Removing the function wrapper causes a "Permission Denied"
40728                         // error in IE
40729                         unloadHandler = function() {
40730                             setDocument();
40731                         };
40732
40733                     // Optimize for push.apply( _, NodeList )
40734                     try {
40735                         push.apply(
40736                             (arr = slice.call(preferredDoc.childNodes)),
40737                             preferredDoc.childNodes
40738                         );
40739                         // Support: Android<4.0
40740                         // Detect silently failing push.apply
40741                         arr[preferredDoc.childNodes.length].nodeType;
40742                     } catch (e) {
40743                         push = {
40744                             apply: arr.length ?
40745
40746                                 // Leverage slice if possible
40747                                 function(target, els) {
40748                                     push_native.apply(target, slice.call(els));
40749                                 } :
40750
40751                                 // Support: IE<9
40752                                 // Otherwise append directly
40753                                 function(target, els) {
40754                                     var j = target.length,
40755                                         i = 0;
40756                                     // Can't trust NodeList.length
40757                                     while ((target[j++] = els[i++])) {}
40758                                     target.length = j - 1;
40759                                 }
40760                         };
40761                     }
40762
40763                     function Sizzle(selector, context, results, seed) {
40764                         var match, elem, m, nodeType,
40765                             // QSA vars
40766                             i, groups, old, nid, newContext, newSelector;
40767
40768                         if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
40769                             setDocument(context);
40770                         }
40771
40772                         context = context || document;
40773                         results = results || [];
40774                         nodeType = context.nodeType;
40775
40776                         if (typeof selector !== "string" || !selector ||
40777                             nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
40778
40779                             return results;
40780                         }
40781
40782                         if (!seed && documentIsHTML) {
40783
40784                             // Try to shortcut find operations when possible (e.g., not under
40785                             // DocumentFragment)
40786                             if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
40787                                 // Speed-up: Sizzle("#ID")
40788                                 if ((m = match[1])) {
40789                                     if (nodeType === 9) {
40790                                         elem = context.getElementById(m);
40791                                         // Check parentNode to catch when Blackberry 4.6 returns
40792                                         // nodes that are no longer in the document (jQuery #6963)
40793                                         if (elem && elem.parentNode) {
40794                                             // Handle the case where IE, Opera, and Webkit return
40795                                             // items
40796                                             // by name instead of ID
40797                                             if (elem.id === m) {
40798                                                 results.push(elem);
40799                                                 return results;
40800                                             }
40801                                         } else {
40802                                             return results;
40803                                         }
40804                                     } else {
40805                                         // Context is not a document
40806                                         if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
40807                                             contains(context, elem) && elem.id === m) {
40808                                             results.push(elem);
40809                                             return results;
40810                                         }
40811                                     }
40812
40813                                     // Speed-up: Sizzle("TAG")
40814                                 } else if (match[2]) {
40815                                     push.apply(results, context.getElementsByTagName(selector));
40816                                     return results;
40817
40818                                     // Speed-up: Sizzle(".CLASS")
40819                                 } else if ((m = match[3]) && support.getElementsByClassName) {
40820                                     push.apply(results, context.getElementsByClassName(m));
40821                                     return results;
40822                                 }
40823                             }
40824
40825                             // QSA path
40826                             if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
40827                                 nid = old = expando;
40828                                 newContext = context;
40829                                 newSelector = nodeType !== 1 && selector;
40830
40831                                 // qSA works strangely on Element-rooted queries
40832                                 // We can work around this by specifying an extra ID on the root
40833                                 // and working up from there (Thanks to Andrew Dupont for the
40834                                 // technique)
40835                                 // IE 8 doesn't work on object elements
40836                                 if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
40837                                     groups = tokenize(selector);
40838
40839                                     if ((old = context.getAttribute("id"))) {
40840                                         nid = old.replace(rescape, "\\$&");
40841                                     } else {
40842                                         context.setAttribute("id", nid);
40843                                     }
40844                                     nid = "[id='" + nid + "'] ";
40845
40846                                     i = groups.length;
40847                                     while (i--) {
40848                                         groups[i] = nid + toSelector(groups[i]);
40849                                     }
40850                                     newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
40851                                     newSelector = groups.join(",");
40852                                 }
40853
40854                                 if (newSelector) {
40855                                     try {
40856                                         push.apply(results,
40857                                             newContext.querySelectorAll(newSelector)
40858                                         );
40859                                         return results;
40860                                     } catch (qsaError) {} finally {
40861                                         if (!old) {
40862                                             context.removeAttribute("id");
40863                                         }
40864                                     }
40865                                 }
40866                             }
40867                         }
40868
40869                         // All others
40870                         return select(selector.replace(rtrim, "$1"), context, results, seed);
40871                     }
40872
40873                     /**
40874                      * Create key-value caches of limited size
40875                      * 
40876                      * @returns {Function(string, Object)} Returns the Object data after storing it
40877                      *          on itself with property name the (space-suffixed) string and (if the
40878                      *          cache is larger than Expr.cacheLength) deleting the oldest entry
40879                      */
40880                     function createCache() {
40881                         var keys = [];
40882
40883                         function cache(key, value) {
40884                             // Use (key + " ") to avoid collision with native prototype properties
40885                             // (see Issue #157)
40886                             if (keys.push(key + " ") > Expr.cacheLength) {
40887                                 // Only keep the most recent entries
40888                                 delete cache[keys.shift()];
40889                             }
40890                             return (cache[key + " "] = value);
40891                         }
40892                         return cache;
40893                     }
40894
40895                     /**
40896                      * Mark a function for special use by Sizzle
40897                      * 
40898                      * @param {Function}
40899                      *            fn The function to mark
40900                      */
40901                     function markFunction(fn) {
40902                         fn[expando] = true;
40903                         return fn;
40904                     }
40905
40906                     /**
40907                      * Support testing using an element
40908                      * 
40909                      * @param {Function}
40910                      *            fn Passed the created div and expects a boolean result
40911                      */
40912                     function assert(fn) {
40913                         var div = document.createElement("div");
40914
40915                         try {
40916                             return !!fn(div);
40917                         } catch (e) {
40918                             return false;
40919                         } finally {
40920                             // Remove from its parent by default
40921                             if (div.parentNode) {
40922                                 div.parentNode.removeChild(div);
40923                             }
40924                             // release memory in IE
40925                             div = null;
40926                         }
40927                     }
40928
40929                     /**
40930                      * Adds the same handler for all of the specified attrs
40931                      * 
40932                      * @param {String}
40933                      *            attrs Pipe-separated list of attributes
40934                      * @param {Function}
40935                      *            handler The method that will be applied
40936                      */
40937                     function addHandle(attrs, handler) {
40938                         var arr = attrs.split("|"),
40939                             i = attrs.length;
40940
40941                         while (i--) {
40942                             Expr.attrHandle[arr[i]] = handler;
40943                         }
40944                     }
40945
40946                     /**
40947                      * Checks document order of two siblings
40948                      * 
40949                      * @param {Element}
40950                      *            a
40951                      * @param {Element}
40952                      *            b
40953                      * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a
40954                      *          follows b
40955                      */
40956                     function siblingCheck(a, b) {
40957                         var cur = b && a,
40958                             diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
40959                             (~b.sourceIndex || MAX_NEGATIVE) -
40960                             (~a.sourceIndex || MAX_NEGATIVE);
40961
40962                         // Use IE sourceIndex if available on both nodes
40963                         if (diff) {
40964                             return diff;
40965                         }
40966
40967                         // Check if b follows a
40968                         if (cur) {
40969                             while ((cur = cur.nextSibling)) {
40970                                 if (cur === b) {
40971                                     return -1;
40972                                 }
40973                             }
40974                         }
40975
40976                         return a ? 1 : -1;
40977                     }
40978
40979                     /**
40980                      * Returns a function to use in pseudos for input types
40981                      * 
40982                      * @param {String}
40983                      *            type
40984                      */
40985                     function createInputPseudo(type) {
40986                         return function(elem) {
40987                             var name = elem.nodeName.toLowerCase();
40988                             return name === "input" && elem.type === type;
40989                         };
40990                     }
40991
40992                     /**
40993                      * Returns a function to use in pseudos for buttons
40994                      * 
40995                      * @param {String}
40996                      *            type
40997                      */
40998                     function createButtonPseudo(type) {
40999                         return function(elem) {
41000                             var name = elem.nodeName.toLowerCase();
41001                             return (name === "input" || name === "button") && elem.type === type;
41002                         };
41003                     }
41004
41005                     /**
41006                      * Returns a function to use in pseudos for positionals
41007                      * 
41008                      * @param {Function}
41009                      *            fn
41010                      */
41011                     function createPositionalPseudo(fn) {
41012                         return markFunction(function(argument) {
41013                             argument = +argument;
41014                             return markFunction(function(seed, matches) {
41015                                 var j,
41016                                     matchIndexes = fn([], seed.length, argument),
41017                                     i = matchIndexes.length;
41018
41019                                 // Match elements found at the specified indexes
41020                                 while (i--) {
41021                                     if (seed[(j = matchIndexes[i])]) {
41022                                         seed[j] = !(matches[j] = seed[j]);
41023                                     }
41024                                 }
41025                             });
41026                         });
41027                     }
41028
41029                     /**
41030                      * Checks a node for validity as a Sizzle context
41031                      * 
41032                      * @param {Element|Object=}
41033                      *            context
41034                      * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a
41035                      *          falsy value
41036                      */
41037                     function testContext(context) {
41038                         return context && typeof context.getElementsByTagName !== "undefined" && context;
41039                     }
41040
41041                     // Expose support vars for convenience
41042                     support = Sizzle.support = {};
41043
41044                     /**
41045                      * Detects XML nodes
41046                      * 
41047                      * @param {Element|Object}
41048                      *            elem An element or a document
41049                      * @returns {Boolean} True iff elem is a non-HTML XML node
41050                      */
41051                     isXML = Sizzle.isXML = function(elem) {
41052                         // documentElement is verified for cases where it doesn't yet exist
41053                         // (such as loading iframes in IE - #4833)
41054                         var documentElement = elem && (elem.ownerDocument || elem).documentElement;
41055                         return documentElement ? documentElement.nodeName !== "HTML" : false;
41056                     };
41057
41058                     /**
41059                      * Sets document-related variables once based on the current document
41060                      * 
41061                      * @param {Element|Object}
41062                      *            [doc] An element or document object to use to set the document
41063                      * @returns {Object} Returns the current document
41064                      */
41065                     setDocument = Sizzle.setDocument = function(node) {
41066                         var hasCompare, parent,
41067                             doc = node ? node.ownerDocument || node : preferredDoc;
41068
41069                         // If no document and documentElement is available, return
41070                         if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
41071                             return document;
41072                         }
41073
41074                         // Set our document
41075                         document = doc;
41076                         docElem = doc.documentElement;
41077                         parent = doc.defaultView;
41078
41079                         // Support: IE>8
41080                         // If iframe document is assigned to "document" variable and if iframe has
41081                         // been reloaded,
41082                         // IE will throw "permission denied" error when accessing "document"
41083                         // variable, see jQuery #13936
41084                         // IE6-8 do not support the defaultView property so parent will be undefined
41085                         if (parent && parent !== parent.top) {
41086                             // IE11 does not have attachEvent, so all must suffer
41087                             if (parent.addEventListener) {
41088                                 parent.addEventListener("unload", unloadHandler, false);
41089                             } else if (parent.attachEvent) {
41090                                 parent.attachEvent("onunload", unloadHandler);
41091                             }
41092                         }
41093
41094                         /*
41095                          * Support tests
41096                          * ----------------------------------------------------------------------
41097                          */
41098                         documentIsHTML = !isXML(doc);
41099
41100                         /*
41101                          * Attributes
41102                          * ----------------------------------------------------------------------
41103                          */
41104
41105                         // Support: IE<8
41106                         // Verify that getAttribute really returns attributes and not properties
41107                         // (excepting IE8 booleans)
41108                         support.attributes = assert(function(div) {
41109                             div.className = "i";
41110                             return !div.getAttribute("className");
41111                         });
41112
41113                         /***************************************************************************
41114                          * getElement(s)By
41115                          * ----------------------------------------------------------------------
41116                          */
41117
41118                         // Check if getElementsByTagName("*") returns only elements
41119                         support.getElementsByTagName = assert(function(div) {
41120                             div.appendChild(doc.createComment(""));
41121                             return !div.getElementsByTagName("*").length;
41122                         });
41123
41124                         // Support: IE<9
41125                         support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
41126
41127                         // Support: IE<10
41128                         // Check if getElementById returns elements by name
41129                         // The broken getElementById methods don't pick up programatically-set
41130                         // names,
41131                         // so use a roundabout getElementsByName test
41132                         support.getById = assert(function(div) {
41133                             docElem.appendChild(div).id = expando;
41134                             return !doc.getElementsByName || !doc.getElementsByName(expando).length;
41135                         });
41136
41137                         // ID find and filter
41138                         if (support.getById) {
41139                             Expr.find["ID"] = function(id, context) {
41140                                 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
41141                                     var m = context.getElementById(id);
41142                                     // Check parentNode to catch when Blackberry 4.6 returns
41143                                     // nodes that are no longer in the document #6963
41144                                     return m && m.parentNode ? [m] : [];
41145                                 }
41146                             };
41147                             Expr.filter["ID"] = function(id) {
41148                                 var attrId = id.replace(runescape, funescape);
41149                                 return function(elem) {
41150                                     return elem.getAttribute("id") === attrId;
41151                                 };
41152                             };
41153                         } else {
41154                             // Support: IE6/7
41155                             // getElementById is not reliable as a find shortcut
41156                             delete Expr.find["ID"];
41157
41158                             Expr.filter["ID"] = function(id) {
41159                                 var attrId = id.replace(runescape, funescape);
41160                                 return function(elem) {
41161                                     var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
41162                                     return node && node.value === attrId;
41163                                 };
41164                             };
41165                         }
41166
41167                         // Tag
41168                         Expr.find["TAG"] = support.getElementsByTagName ?
41169                             function(tag, context) {
41170                                 if (typeof context.getElementsByTagName !== "undefined") {
41171                                     return context.getElementsByTagName(tag);
41172
41173                                     // DocumentFragment nodes don't have gEBTN
41174                                 } else if (support.qsa) {
41175                                     return context.querySelectorAll(tag);
41176                                 }
41177                             } :
41178
41179                             function(tag, context) {
41180                                 var elem,
41181                                     tmp = [],
41182                                     i = 0,
41183                                     // By happy coincidence, a (broken) gEBTN appears on
41184                                     // DocumentFragment nodes too
41185                                     results = context.getElementsByTagName(tag);
41186
41187                                 // Filter out possible comments
41188                                 if (tag === "*") {
41189                                     while ((elem = results[i++])) {
41190                                         if (elem.nodeType === 1) {
41191                                             tmp.push(elem);
41192                                         }
41193                                     }
41194
41195                                     return tmp;
41196                                 }
41197                                 return results;
41198                             };
41199
41200                         // Class
41201                         Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
41202                             if (documentIsHTML) {
41203                                 return context.getElementsByClassName(className);
41204                             }
41205                         };
41206
41207                         /*
41208                          * QSA/matchesSelector
41209                          * ----------------------------------------------------------------------
41210                          */
41211
41212                         // QSA and matchesSelector support
41213
41214                         // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
41215                         rbuggyMatches = [];
41216
41217                         // qSa(:focus) reports false when true (Chrome 21)
41218                         // We allow this because of a bug in IE8/9 that throws an error
41219                         // whenever `document.activeElement` is accessed on an iframe
41220                         // So, we allow :focus to pass through QSA all the time to avoid the IE
41221                         // error
41222                         // See http://bugs.jquery.com/ticket/13378
41223                         rbuggyQSA = [];
41224
41225                         if ((support.qsa = rnative.test(doc.querySelectorAll))) {
41226                             // Build QSA regex
41227                             // Regex strategy adopted from Diego Perini
41228                             assert(function(div) {
41229                                 // Select is set to empty string on purpose
41230                                 // This is to test IE's treatment of not explicitly
41231                                 // setting a boolean content attribute,
41232                                 // since its presence should be enough
41233                                 // http://bugs.jquery.com/ticket/12359
41234                                 docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a>" +
41235                                     "<select id='" + expando + "-\f]' msallowcapture=''>" +
41236                                     "<option selected=''></option></select>";
41237
41238                                 // Support: IE8, Opera 11-12.16
41239                                 // Nothing should be selected when empty strings follow ^= or $= or
41240                                 // *=
41241                                 // The test attribute must be unknown in Opera but "safe" for WinRT
41242                                 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
41243                                 if (div.querySelectorAll("[msallowcapture^='']").length) {
41244                                     rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
41245                                 }
41246
41247                                 // Support: IE8
41248                                 // Boolean attributes and "value" are not treated correctly
41249                                 if (!div.querySelectorAll("[selected]").length) {
41250                                     rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
41251                                 }
41252
41253                                 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+,
41254                                 // PhantomJS<1.9.7+
41255                                 if (!div.querySelectorAll("[id~=" + expando + "-]").length) {
41256                                     rbuggyQSA.push("~=");
41257                                 }
41258
41259                                 // Webkit/Opera - :checked should return selected option elements
41260                                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41261                                 // IE8 throws error here and will not see later tests
41262                                 if (!div.querySelectorAll(":checked").length) {
41263                                     rbuggyQSA.push(":checked");
41264                                 }
41265
41266                                 // Support: Safari 8+, iOS 8+
41267                                 // https://bugs.webkit.org/show_bug.cgi?id=136851
41268                                 // In-page `selector#id sibing-combinator selector` fails
41269                                 if (!div.querySelectorAll("a#" + expando + "+*").length) {
41270                                     rbuggyQSA.push(".#.+[+~]");
41271                                 }
41272                             });
41273
41274                             assert(function(div) {
41275                                 // Support: Windows 8 Native Apps
41276                                 // The type and name attributes are restricted during .innerHTML
41277                                 // assignment
41278                                 var input = doc.createElement("input");
41279                                 input.setAttribute("type", "hidden");
41280                                 div.appendChild(input).setAttribute("name", "D");
41281
41282                                 // Support: IE8
41283                                 // Enforce case-sensitivity of name attribute
41284                                 if (div.querySelectorAll("[name=d]").length) {
41285                                     rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
41286                                 }
41287
41288                                 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements
41289                                 // are still enabled)
41290                                 // IE8 throws error here and will not see later tests
41291                                 if (!div.querySelectorAll(":enabled").length) {
41292                                     rbuggyQSA.push(":enabled", ":disabled");
41293                                 }
41294
41295                                 // Opera 10-11 does not throw on post-comma invalid pseudos
41296                                 div.querySelectorAll("*,:x");
41297                                 rbuggyQSA.push(",.*:");
41298                             });
41299                         }
41300
41301                         if ((support.matchesSelector = rnative.test((matches = docElem.matches ||
41302                                 docElem.webkitMatchesSelector ||
41303                                 docElem.mozMatchesSelector ||
41304                                 docElem.oMatchesSelector ||
41305                                 docElem.msMatchesSelector)))) {
41306
41307                             assert(function(div) {
41308                                 // Check to see if it's possible to do matchesSelector
41309                                 // on a disconnected node (IE 9)
41310                                 support.disconnectedMatch = matches.call(div, "div");
41311
41312                                 // This should fail with an exception
41313                                 // Gecko does not error, returns false instead
41314                                 matches.call(div, "[s!='']:x");
41315                                 rbuggyMatches.push("!=", pseudos);
41316                             });
41317                         }
41318
41319                         rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
41320                         rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
41321
41322                         /*
41323                          * Contains
41324                          * ----------------------------------------------------------------------
41325                          */
41326                         hasCompare = rnative.test(docElem.compareDocumentPosition);
41327
41328                         // Element contains another
41329                         // Purposefully does not implement inclusive descendent
41330                         // As in, an element does not contain itself
41331                         contains = hasCompare || rnative.test(docElem.contains) ?
41332                             function(a, b) {
41333                                 var adown = a.nodeType === 9 ? a.documentElement : a,
41334                                     bup = b && b.parentNode;
41335                                 return a === bup || !!(bup && bup.nodeType === 1 && (
41336                                     adown.contains ?
41337                                     adown.contains(bup) :
41338                                     a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
41339                                 ));
41340                             } :
41341                             function(a, b) {
41342                                 if (b) {
41343                                     while ((b = b.parentNode)) {
41344                                         if (b === a) {
41345                                             return true;
41346                                         }
41347                                     }
41348                                 }
41349                                 return false;
41350                             };
41351
41352                         /*
41353                          * Sorting
41354                          * ----------------------------------------------------------------------
41355                          */
41356
41357                         // Document order sorting
41358                         sortOrder = hasCompare ?
41359                             function(a, b) {
41360
41361                                 // Flag for duplicate removal
41362                                 if (a === b) {
41363                                     hasDuplicate = true;
41364                                     return 0;
41365                                 }
41366
41367                                 // Sort on method existence if only one input has
41368                                 // compareDocumentPosition
41369                                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
41370                                 if (compare) {
41371                                     return compare;
41372                                 }
41373
41374                                 // Calculate position if both inputs belong to the same document
41375                                 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ?
41376                                     a.compareDocumentPosition(b) :
41377
41378                                     // Otherwise we know they are disconnected
41379                                     1;
41380
41381                                 // Disconnected nodes
41382                                 if (compare & 1 ||
41383                                     (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
41384
41385                                     // Choose the first element that is related to our preferred
41386                                     // document
41387                                     if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
41388                                         return -1;
41389                                     }
41390                                     if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
41391                                         return 1;
41392                                     }
41393
41394                                     // Maintain original order
41395                                     return sortInput ?
41396                                         (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41397                                         0;
41398                                 }
41399
41400                                 return compare & 4 ? -1 : 1;
41401                             } :
41402                             function(a, b) {
41403                                 // Exit early if the nodes are identical
41404                                 if (a === b) {
41405                                     hasDuplicate = true;
41406                                     return 0;
41407                                 }
41408
41409                                 var cur,
41410                                     i = 0,
41411                                     aup = a.parentNode,
41412                                     bup = b.parentNode,
41413                                     ap = [a],
41414                                     bp = [b];
41415
41416                                 // Parentless nodes are either documents or disconnected
41417                                 if (!aup || !bup) {
41418                                     return a === doc ? -1 :
41419                                         b === doc ? 1 :
41420                                         aup ? -1 :
41421                                         bup ? 1 :
41422                                         sortInput ?
41423                                         (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41424                                         0;
41425
41426                                     // If the nodes are siblings, we can do a quick check
41427                                 } else if (aup === bup) {
41428                                     return siblingCheck(a, b);
41429                                 }
41430
41431                                 // Otherwise we need full lists of their ancestors for comparison
41432                                 cur = a;
41433                                 while ((cur = cur.parentNode)) {
41434                                     ap.unshift(cur);
41435                                 }
41436                                 cur = b;
41437                                 while ((cur = cur.parentNode)) {
41438                                     bp.unshift(cur);
41439                                 }
41440
41441                                 // Walk down the tree looking for a discrepancy
41442                                 while (ap[i] === bp[i]) {
41443                                     i++;
41444                                 }
41445
41446                                 return i ?
41447                                     // Do a sibling check if the nodes have a common ancestor
41448                                     siblingCheck(ap[i], bp[i]) :
41449
41450                                     // Otherwise nodes in our document sort first
41451                                     ap[i] === preferredDoc ? -1 :
41452                                     bp[i] === preferredDoc ? 1 :
41453                                     0;
41454                             };
41455
41456                         return doc;
41457                     };
41458
41459                     Sizzle.matches = function(expr, elements) {
41460                         return Sizzle(expr, null, null, elements);
41461                     };
41462
41463                     Sizzle.matchesSelector = function(elem, expr) {
41464                         // Set document vars if needed
41465                         if ((elem.ownerDocument || elem) !== document) {
41466                             setDocument(elem);
41467                         }
41468
41469                         // Make sure that attribute selectors are quoted
41470                         expr = expr.replace(rattributeQuotes, "='$1']");
41471
41472                         if (support.matchesSelector && documentIsHTML &&
41473                             (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
41474                             (!rbuggyQSA || !rbuggyQSA.test(expr))) {
41475
41476                             try {
41477                                 var ret = matches.call(elem, expr);
41478
41479                                 // IE 9's matchesSelector returns false on disconnected nodes
41480                                 if (ret || support.disconnectedMatch ||
41481                                     // As well, disconnected nodes are said to be in a document
41482                                     // fragment in IE 9
41483                                     elem.document && elem.document.nodeType !== 11) {
41484                                     return ret;
41485                                 }
41486                             } catch (e) {}
41487                         }
41488
41489                         return Sizzle(expr, document, null, [elem]).length > 0;
41490                     };
41491
41492                     Sizzle.contains = function(context, elem) {
41493                         // Set document vars if needed
41494                         if ((context.ownerDocument || context) !== document) {
41495                             setDocument(context);
41496                         }
41497                         return contains(context, elem);
41498                     };
41499
41500                     Sizzle.attr = function(elem, name) {
41501                         // Set document vars if needed
41502                         if ((elem.ownerDocument || elem) !== document) {
41503                             setDocument(elem);
41504                         }
41505
41506                         var fn = Expr.attrHandle[name.toLowerCase()],
41507                             // Don't get fooled by Object.prototype properties (jQuery #13807)
41508                             val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ?
41509                             fn(elem, name, !documentIsHTML) :
41510                             undefined;
41511
41512                         return val !== undefined ?
41513                             val :
41514                             support.attributes || !documentIsHTML ?
41515                             elem.getAttribute(name) :
41516                             (val = elem.getAttributeNode(name)) && val.specified ?
41517                             val.value :
41518                             null;
41519                     };
41520
41521                     Sizzle.error = function(msg) {
41522                         throw new Error("Syntax error, unrecognized expression: " + msg);
41523                     };
41524
41525                     /**
41526                      * Document sorting and removing duplicates
41527                      * 
41528                      * @param {ArrayLike}
41529                      *            results
41530                      */
41531                     Sizzle.uniqueSort = function(results) {
41532                         var elem,
41533                             duplicates = [],
41534                             j = 0,
41535                             i = 0;
41536
41537                         // Unless we *know* we can detect duplicates, assume their presence
41538                         hasDuplicate = !support.detectDuplicates;
41539                         sortInput = !support.sortStable && results.slice(0);
41540                         results.sort(sortOrder);
41541
41542                         if (hasDuplicate) {
41543                             while ((elem = results[i++])) {
41544                                 if (elem === results[i]) {
41545                                     j = duplicates.push(i);
41546                                 }
41547                             }
41548                             while (j--) {
41549                                 results.splice(duplicates[j], 1);
41550                             }
41551                         }
41552
41553                         // Clear input after sorting to release objects
41554                         // See https://github.com/jquery/sizzle/pull/225
41555                         sortInput = null;
41556
41557                         return results;
41558                     };
41559
41560                     /**
41561                      * Utility function for retrieving the text value of an array of DOM nodes
41562                      * 
41563                      * @param {Array|Element}
41564                      *            elem
41565                      */
41566                     getText = Sizzle.getText = function(elem) {
41567                         var node,
41568                             ret = "",
41569                             i = 0,
41570                             nodeType = elem.nodeType;
41571
41572                         if (!nodeType) {
41573                             // If no nodeType, this is expected to be an array
41574                             while ((node = elem[i++])) {
41575                                 // Do not traverse comment nodes
41576                                 ret += getText(node);
41577                             }
41578                         } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
41579                             // Use textContent for elements
41580                             // innerText usage removed for consistency of new lines (jQuery #11153)
41581                             if (typeof elem.textContent === "string") {
41582                                 return elem.textContent;
41583                             } else {
41584                                 // Traverse its children
41585                                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41586                                     ret += getText(elem);
41587                                 }
41588                             }
41589                         } else if (nodeType === 3 || nodeType === 4) {
41590                             return elem.nodeValue;
41591                         }
41592                         // Do not include comment or processing instruction nodes
41593
41594                         return ret;
41595                     };
41596
41597                     Expr = Sizzle.selectors = {
41598
41599                         // Can be adjusted by the user
41600                         cacheLength: 50,
41601
41602                         createPseudo: markFunction,
41603
41604                         match: matchExpr,
41605
41606                         attrHandle: {},
41607
41608                         find: {},
41609
41610                         relative: {
41611                             ">": {
41612                                 dir: "parentNode",
41613                                 first: true
41614                             },
41615                             " ": {
41616                                 dir: "parentNode"
41617                             },
41618                             "+": {
41619                                 dir: "previousSibling",
41620                                 first: true
41621                             },
41622                             "~": {
41623                                 dir: "previousSibling"
41624                             }
41625                         },
41626
41627                         preFilter: {
41628                             "ATTR": function(match) {
41629                                 match[1] = match[1].replace(runescape, funescape);
41630
41631                                 // Move the given value to match[3] whether quoted or unquoted
41632                                 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
41633
41634                                 if (match[2] === "~=") {
41635                                     match[3] = " " + match[3] + " ";
41636                                 }
41637
41638                                 return match.slice(0, 4);
41639                             },
41640
41641                             "CHILD": function(match) {
41642                                 /*
41643                                  * matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what
41644                                  * (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4
41645                                  * xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component
41646                                  * 6 x of xn-component 7 sign of y-component 8 y of y-component
41647                                  */
41648                                 match[1] = match[1].toLowerCase();
41649
41650                                 if (match[1].slice(0, 3) === "nth") {
41651                                     // nth-* requires argument
41652                                     if (!match[3]) {
41653                                         Sizzle.error(match[0]);
41654                                     }
41655
41656                                     // numeric x and y parameters for Expr.filter.CHILD
41657                                     // remember that false/true cast respectively to 0/1
41658                                     match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
41659                                     match[5] = +((match[7] + match[8]) || match[3] === "odd");
41660
41661                                     // other types prohibit arguments
41662                                 } else if (match[3]) {
41663                                     Sizzle.error(match[0]);
41664                                 }
41665
41666                                 return match;
41667                             },
41668
41669                             "PSEUDO": function(match) {
41670                                 var excess,
41671                                     unquoted = !match[6] && match[2];
41672
41673                                 if (matchExpr["CHILD"].test(match[0])) {
41674                                     return null;
41675                                 }
41676
41677                                 // Accept quoted arguments as-is
41678                                 if (match[3]) {
41679                                     match[2] = match[4] || match[5] || "";
41680
41681                                     // Strip excess characters from unquoted arguments
41682                                 } else if (unquoted && rpseudo.test(unquoted) &&
41683                                     // Get excess from tokenize (recursively)
41684                                     (excess = tokenize(unquoted, true)) &&
41685                                     // advance to the next closing parenthesis
41686                                     (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
41687
41688                                     // excess is a negative index
41689                                     match[0] = match[0].slice(0, excess);
41690                                     match[2] = unquoted.slice(0, excess);
41691                                 }
41692
41693                                 // Return only captures needed by the pseudo filter method (type and
41694                                 // argument)
41695                                 return match.slice(0, 3);
41696                             }
41697                         },
41698
41699                         filter: {
41700
41701                             "TAG": function(nodeNameSelector) {
41702                                 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
41703                                 return nodeNameSelector === "*" ?
41704                                     function() {
41705                                         return true;
41706                                     } :
41707                                     function(elem) {
41708                                         return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
41709                                     };
41710                             },
41711
41712                             "CLASS": function(className) {
41713                                 var pattern = classCache[className + " "];
41714
41715                                 return pattern ||
41716                                     (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&
41717                                     classCache(className, function(elem) {
41718                                         return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
41719                                     });
41720                             },
41721
41722                             "ATTR": function(name, operator, check) {
41723                                 return function(elem) {
41724                                     var result = Sizzle.attr(elem, name);
41725
41726                                     if (result == null) {
41727                                         return operator === "!=";
41728                                     }
41729                                     if (!operator) {
41730                                         return true;
41731                                     }
41732
41733                                     result += "";
41734
41735                                     return operator === "=" ? result === check :
41736                                         operator === "!=" ? result !== check :
41737                                         operator === "^=" ? check && result.indexOf(check) === 0 :
41738                                         operator === "*=" ? check && result.indexOf(check) > -1 :
41739                                         operator === "$=" ? check && result.slice(-check.length) === check :
41740                                         operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 :
41741                                         operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :
41742                                         false;
41743                                 };
41744                             },
41745
41746                             "CHILD": function(type, what, argument, first, last) {
41747                                 var simple = type.slice(0, 3) !== "nth",
41748                                     forward = type.slice(-4) !== "last",
41749                                     ofType = what === "of-type";
41750
41751                                 return first === 1 && last === 0 ?
41752
41753                                     // Shortcut for :nth-*(n)
41754                                     function(elem) {
41755                                         return !!elem.parentNode;
41756                                     } :
41757
41758                                     function(elem, context, xml) {
41759                                         var cache, outerCache, node, diff, nodeIndex, start,
41760                                             dir = simple !== forward ? "nextSibling" : "previousSibling",
41761                                             parent = elem.parentNode,
41762                                             name = ofType && elem.nodeName.toLowerCase(),
41763                                             useCache = !xml && !ofType;
41764
41765                                         if (parent) {
41766
41767                                             // :(first|last|only)-(child|of-type)
41768                                             if (simple) {
41769                                                 while (dir) {
41770                                                     node = elem;
41771                                                     while ((node = node[dir])) {
41772                                                         if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
41773                                                             return false;
41774                                                         }
41775                                                     }
41776                                                     // Reverse direction for :only-* (if we haven't
41777                                                     // yet done so)
41778                                                     start = dir = type === "only" && !start && "nextSibling";
41779                                                 }
41780                                                 return true;
41781                                             }
41782
41783                                             start = [forward ? parent.firstChild : parent.lastChild];
41784
41785                                             // non-xml :nth-child(...) stores cache data on `parent`
41786                                             if (forward && useCache) {
41787                                                 // Seek `elem` from a previously-cached index
41788                                                 outerCache = parent[expando] || (parent[expando] = {});
41789                                                 cache = outerCache[type] || [];
41790                                                 nodeIndex = cache[0] === dirruns && cache[1];
41791                                                 diff = cache[0] === dirruns && cache[2];
41792                                                 node = nodeIndex && parent.childNodes[nodeIndex];
41793
41794                                                 while ((node = ++nodeIndex && node && node[dir] ||
41795
41796                                                         // Fallback to seeking `elem` from the start
41797                                                         (diff = nodeIndex = 0) || start.pop())) {
41798
41799                                                     // When found, cache indexes on `parent` and
41800                                                     // break
41801                                                     if (node.nodeType === 1 && ++diff && node === elem) {
41802                                                         outerCache[type] = [dirruns, nodeIndex, diff];
41803                                                         break;
41804                                                     }
41805                                                 }
41806
41807                                                 // Use previously-cached element index if available
41808                                             } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
41809                                                 diff = cache[1];
41810
41811                                                 // xml :nth-child(...) or :nth-last-child(...) or
41812                                                 // :nth(-last)?-of-type(...)
41813                                             } else {
41814                                                 // Use the same loop as above to seek `elem` from
41815                                                 // the start
41816                                                 while ((node = ++nodeIndex && node && node[dir] ||
41817                                                         (diff = nodeIndex = 0) || start.pop())) {
41818
41819                                                     if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
41820                                                         // Cache the index of each encountered
41821                                                         // element
41822                                                         if (useCache) {
41823                                                             (node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
41824                                                         }
41825
41826                                                         if (node === elem) {
41827                                                             break;
41828                                                         }
41829                                                     }
41830                                                 }
41831                                             }
41832
41833                                             // Incorporate the offset, then check against cycle size
41834                                             diff -= last;
41835                                             return diff === first || (diff % first === 0 && diff / first >= 0);
41836                                         }
41837                                     };
41838                             },
41839
41840                             "PSEUDO": function(pseudo, argument) {
41841                                 // pseudo-class names are case-insensitive
41842                                 // http://www.w3.org/TR/selectors/#pseudo-classes
41843                                 // Prioritize by case sensitivity in case custom pseudos are added
41844                                 // with uppercase letters
41845                                 // Remember that setFilters inherits from pseudos
41846                                 var args,
41847                                     fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] ||
41848                                     Sizzle.error("unsupported pseudo: " + pseudo);
41849
41850                                 // The user may use createPseudo to indicate that
41851                                 // arguments are needed to create the filter function
41852                                 // just as Sizzle does
41853                                 if (fn[expando]) {
41854                                     return fn(argument);
41855                                 }
41856
41857                                 // But maintain support for old signatures
41858                                 if (fn.length > 1) {
41859                                     args = [pseudo, pseudo, "", argument];
41860                                     return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ?
41861                                         markFunction(function(seed, matches) {
41862                                             var idx,
41863                                                 matched = fn(seed, argument),
41864                                                 i = matched.length;
41865                                             while (i--) {
41866                                                 idx = indexOf(seed, matched[i]);
41867                                                 seed[idx] = !(matches[idx] = matched[i]);
41868                                             }
41869                                         }) :
41870                                         function(elem) {
41871                                             return fn(elem, 0, args);
41872                                         };
41873                                 }
41874
41875                                 return fn;
41876                             }
41877                         },
41878
41879                         pseudos: {
41880                             // Potentially complex pseudos
41881                             "not": markFunction(function(selector) {
41882                                 // Trim the selector passed to compile
41883                                 // to avoid treating leading and trailing
41884                                 // spaces as combinators
41885                                 var input = [],
41886                                     results = [],
41887                                     matcher = compile(selector.replace(rtrim, "$1"));
41888
41889                                 return matcher[expando] ?
41890                                     markFunction(function(seed, matches, context, xml) {
41891                                         var elem,
41892                                             unmatched = matcher(seed, null, xml, []),
41893                                             i = seed.length;
41894
41895                                         // Match elements unmatched by `matcher`
41896                                         while (i--) {
41897                                             if ((elem = unmatched[i])) {
41898                                                 seed[i] = !(matches[i] = elem);
41899                                             }
41900                                         }
41901                                     }) :
41902                                     function(elem, context, xml) {
41903                                         input[0] = elem;
41904                                         matcher(input, null, xml, results);
41905                                         // Don't keep the element (issue #299)
41906                                         input[0] = null;
41907                                         return !results.pop();
41908                                     };
41909                             }),
41910
41911                             "has": markFunction(function(selector) {
41912                                 return function(elem) {
41913                                     return Sizzle(selector, elem).length > 0;
41914                                 };
41915                             }),
41916
41917                             "contains": markFunction(function(text) {
41918                                 text = text.replace(runescape, funescape);
41919                                 return function(elem) {
41920                                     return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
41921                                 };
41922                             }),
41923
41924                             // "Whether an element is represented by a :lang() selector
41925                             // is based solely on the element's language value
41926                             // being equal to the identifier C,
41927                             // or beginning with the identifier C immediately followed by "-".
41928                             // The matching of C against the element's language value is performed
41929                             // case-insensitively.
41930                             // The identifier C does not have to be a valid language name."
41931                             // http://www.w3.org/TR/selectors/#lang-pseudo
41932                             "lang": markFunction(function(lang) {
41933                                 // lang value must be a valid identifier
41934                                 if (!ridentifier.test(lang || "")) {
41935                                     Sizzle.error("unsupported lang: " + lang);
41936                                 }
41937                                 lang = lang.replace(runescape, funescape).toLowerCase();
41938                                 return function(elem) {
41939                                     var elemLang;
41940                                     do {
41941                                         if ((elemLang = documentIsHTML ?
41942                                                 elem.lang :
41943                                                 elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
41944
41945                                             elemLang = elemLang.toLowerCase();
41946                                             return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
41947                                         }
41948                                     } while ((elem = elem.parentNode) && elem.nodeType === 1);
41949                                     return false;
41950                                 };
41951                             }),
41952
41953                             // Miscellaneous
41954                             "target": function(elem) {
41955                                 var hash = window.location && window.location.hash;
41956                                 return hash && hash.slice(1) === elem.id;
41957                             },
41958
41959                             "root": function(elem) {
41960                                 return elem === docElem;
41961                             },
41962
41963                             "focus": function(elem) {
41964                                 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
41965                             },
41966
41967                             // Boolean properties
41968                             "enabled": function(elem) {
41969                                 return elem.disabled === false;
41970                             },
41971
41972                             "disabled": function(elem) {
41973                                 return elem.disabled === true;
41974                             },
41975
41976                             "checked": function(elem) {
41977                                 // In CSS3, :checked should return both checked and selected
41978                                 // elements
41979                                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41980                                 var nodeName = elem.nodeName.toLowerCase();
41981                                 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
41982                             },
41983
41984                             "selected": function(elem) {
41985                                 // Accessing this property makes selected-by-default
41986                                 // options in Safari work properly
41987                                 if (elem.parentNode) {
41988                                     elem.parentNode.selectedIndex;
41989                                 }
41990
41991                                 return elem.selected === true;
41992                             },
41993
41994                             // Contents
41995                             "empty": function(elem) {
41996                                 // http://www.w3.org/TR/selectors/#empty-pseudo
41997                                 // :empty is negated by element (1) or content nodes (text: 3;
41998                                 // cdata: 4; entity ref: 5),
41999                                 // but not by others (comment: 8; processing instruction: 7; etc.)
42000                                 // nodeType < 6 works because attributes (2) do not appear as
42001                                 // children
42002                                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
42003                                     if (elem.nodeType < 6) {
42004                                         return false;
42005                                     }
42006                                 }
42007                                 return true;
42008                             },
42009
42010                             "parent": function(elem) {
42011                                 return !Expr.pseudos["empty"](elem);
42012                             },
42013
42014                             // Element/input types
42015                             "header": function(elem) {
42016                                 return rheader.test(elem.nodeName);
42017                             },
42018
42019                             "input": function(elem) {
42020                                 return rinputs.test(elem.nodeName);
42021                             },
42022
42023                             "button": function(elem) {
42024                                 var name = elem.nodeName.toLowerCase();
42025                                 return name === "input" && elem.type === "button" || name === "button";
42026                             },
42027
42028                             "text": function(elem) {
42029                                 var attr;
42030                                 return elem.nodeName.toLowerCase() === "input" &&
42031                                     elem.type === "text" &&
42032
42033                                     // Support: IE<8
42034                                     // New HTML5 attribute values (e.g., "search") appear with
42035                                     // elem.type === "text"
42036                                     ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
42037                             },
42038
42039                             // Position-in-collection
42040                             "first": createPositionalPseudo(function() {
42041                                 return [0];
42042                             }),
42043
42044                             "last": createPositionalPseudo(function(matchIndexes, length) {
42045                                 return [length - 1];
42046                             }),
42047
42048                             "eq": createPositionalPseudo(function(matchIndexes, length, argument) {
42049                                 return [argument < 0 ? argument + length : argument];
42050                             }),
42051
42052                             "even": createPositionalPseudo(function(matchIndexes, length) {
42053                                 var i = 0;
42054                                 for (; i < length; i += 2) {
42055                                     matchIndexes.push(i);
42056                                 }
42057                                 return matchIndexes;
42058                             }),
42059
42060                             "odd": createPositionalPseudo(function(matchIndexes, length) {
42061                                 var i = 1;
42062                                 for (; i < length; i += 2) {
42063                                     matchIndexes.push(i);
42064                                 }
42065                                 return matchIndexes;
42066                             }),
42067
42068                             "lt": createPositionalPseudo(function(matchIndexes, length, argument) {
42069                                 var i = argument < 0 ? argument + length : argument;
42070                                 for (; --i >= 0;) {
42071                                     matchIndexes.push(i);
42072                                 }
42073                                 return matchIndexes;
42074                             }),
42075
42076                             "gt": createPositionalPseudo(function(matchIndexes, length, argument) {
42077                                 var i = argument < 0 ? argument + length : argument;
42078                                 for (; ++i < length;) {
42079                                     matchIndexes.push(i);
42080                                 }
42081                                 return matchIndexes;
42082                             })
42083                         }
42084                     };
42085
42086                     Expr.pseudos["nth"] = Expr.pseudos["eq"];
42087
42088                     // Add button/input type pseudos
42089                     for (i in {
42090                             radio: true,
42091                             checkbox: true,
42092                             file: true,
42093                             password: true,
42094                             image: true
42095                         }) {
42096                         Expr.pseudos[i] = createInputPseudo(i);
42097                     }
42098                     for (i in {
42099                             submit: true,
42100                             reset: true
42101                         }) {
42102                         Expr.pseudos[i] = createButtonPseudo(i);
42103                     }
42104
42105                     // Easy API for creating new setFilters
42106                     function setFilters() {}
42107                     setFilters.prototype = Expr.filters = Expr.pseudos;
42108                     Expr.setFilters = new setFilters();
42109
42110                     tokenize = Sizzle.tokenize = function(selector, parseOnly) {
42111                         var matched, match, tokens, type,
42112                             soFar, groups, preFilters,
42113                             cached = tokenCache[selector + " "];
42114
42115                         if (cached) {
42116                             return parseOnly ? 0 : cached.slice(0);
42117                         }
42118
42119                         soFar = selector;
42120                         groups = [];
42121                         preFilters = Expr.preFilter;
42122
42123                         while (soFar) {
42124
42125                             // Comma and first run
42126                             if (!matched || (match = rcomma.exec(soFar))) {
42127                                 if (match) {
42128                                     // Don't consume trailing commas as valid
42129                                     soFar = soFar.slice(match[0].length) || soFar;
42130                                 }
42131                                 groups.push((tokens = []));
42132                             }
42133
42134                             matched = false;
42135
42136                             // Combinators
42137                             if ((match = rcombinators.exec(soFar))) {
42138                                 matched = match.shift();
42139                                 tokens.push({
42140                                     value: matched,
42141                                     // Cast descendant combinators to space
42142                                     type: match[0].replace(rtrim, " ")
42143                                 });
42144                                 soFar = soFar.slice(matched.length);
42145                             }
42146
42147                             // Filters
42148                             for (type in Expr.filter) {
42149                                 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] ||
42150                                         (match = preFilters[type](match)))) {
42151                                     matched = match.shift();
42152                                     tokens.push({
42153                                         value: matched,
42154                                         type: type,
42155                                         matches: match
42156                                     });
42157                                     soFar = soFar.slice(matched.length);
42158                                 }
42159                             }
42160
42161                             if (!matched) {
42162                                 break;
42163                             }
42164                         }
42165
42166                         // Return the length of the invalid excess
42167                         // if we're just parsing
42168                         // Otherwise, throw an error or return tokens
42169                         return parseOnly ?
42170                             soFar.length :
42171                             soFar ?
42172                             Sizzle.error(selector) :
42173                             // Cache the tokens
42174                             tokenCache(selector, groups).slice(0);
42175                     };
42176
42177                     function toSelector(tokens) {
42178                         var i = 0,
42179                             len = tokens.length,
42180                             selector = "";
42181                         for (; i < len; i++) {
42182                             selector += tokens[i].value;
42183                         }
42184                         return selector;
42185                     }
42186
42187                     function addCombinator(matcher, combinator, base) {
42188                         var dir = combinator.dir,
42189                             checkNonElements = base && dir === "parentNode",
42190                             doneName = done++;
42191
42192                         return combinator.first ?
42193                             // Check against closest ancestor/preceding element
42194                             function(elem, context, xml) {
42195                                 while ((elem = elem[dir])) {
42196                                     if (elem.nodeType === 1 || checkNonElements) {
42197                                         return matcher(elem, context, xml);
42198                                     }
42199                                 }
42200                             } :
42201
42202                             // Check against all ancestor/preceding elements
42203                             function(elem, context, xml) {
42204                                 var oldCache, outerCache,
42205                                     newCache = [dirruns, doneName];
42206
42207                                 // We can't set arbitrary data on XML nodes, so they don't benefit
42208                                 // from dir caching
42209                                 if (xml) {
42210                                     while ((elem = elem[dir])) {
42211                                         if (elem.nodeType === 1 || checkNonElements) {
42212                                             if (matcher(elem, context, xml)) {
42213                                                 return true;
42214                                             }
42215                                         }
42216                                     }
42217                                 } else {
42218                                     while ((elem = elem[dir])) {
42219                                         if (elem.nodeType === 1 || checkNonElements) {
42220                                             outerCache = elem[expando] || (elem[expando] = {});
42221                                             if ((oldCache = outerCache[dir]) &&
42222                                                 oldCache[0] === dirruns && oldCache[1] === doneName) {
42223
42224                                                 // Assign to newCache so results back-propagate to
42225                                                 // previous elements
42226                                                 return (newCache[2] = oldCache[2]);
42227                                             } else {
42228                                                 // Reuse newcache so results back-propagate to
42229                                                 // previous elements
42230                                                 outerCache[dir] = newCache;
42231
42232                                                 // A match means we're done; a fail means we have to
42233                                                 // keep checking
42234                                                 if ((newCache[2] = matcher(elem, context, xml))) {
42235                                                     return true;
42236                                                 }
42237                                             }
42238                                         }
42239                                     }
42240                                 }
42241                             };
42242                     }
42243
42244                     function elementMatcher(matchers) {
42245                         return matchers.length > 1 ?
42246                             function(elem, context, xml) {
42247                                 var i = matchers.length;
42248                                 while (i--) {
42249                                     if (!matchers[i](elem, context, xml)) {
42250                                         return false;
42251                                     }
42252                                 }
42253                                 return true;
42254                             } :
42255                             matchers[0];
42256                     }
42257
42258                     function multipleContexts(selector, contexts, results) {
42259                         var i = 0,
42260                             len = contexts.length;
42261                         for (; i < len; i++) {
42262                             Sizzle(selector, contexts[i], results);
42263                         }
42264                         return results;
42265                     }
42266
42267                     function condense(unmatched, map, filter, context, xml) {
42268                         var elem,
42269                             newUnmatched = [],
42270                             i = 0,
42271                             len = unmatched.length,
42272                             mapped = map != null;
42273
42274                         for (; i < len; i++) {
42275                             if ((elem = unmatched[i])) {
42276                                 if (!filter || filter(elem, context, xml)) {
42277                                     newUnmatched.push(elem);
42278                                     if (mapped) {
42279                                         map.push(i);
42280                                     }
42281                                 }
42282                             }
42283                         }
42284
42285                         return newUnmatched;
42286                     }
42287
42288                     function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
42289                         if (postFilter && !postFilter[expando]) {
42290                             postFilter = setMatcher(postFilter);
42291                         }
42292                         if (postFinder && !postFinder[expando]) {
42293                             postFinder = setMatcher(postFinder, postSelector);
42294                         }
42295                         return markFunction(function(seed, results, context, xml) {
42296                             var temp, i, elem,
42297                                 preMap = [],
42298                                 postMap = [],
42299                                 preexisting = results.length,
42300
42301                                 // Get initial elements from seed or context
42302                                 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
42303
42304                                 // Prefilter to get matcher input, preserving a map for seed-results
42305                                 // synchronization
42306                                 matcherIn = preFilter && (seed || !selector) ?
42307                                 condense(elems, preMap, preFilter, context, xml) :
42308                                 elems,
42309
42310                                 matcherOut = matcher ?
42311                                 // If we have a postFinder, or filtered seed, or non-seed
42312                                 // postFilter or preexisting results,
42313                                 postFinder || (seed ? preFilter : preexisting || postFilter) ?
42314
42315                                 // ...intermediate processing is necessary
42316                                 [] :
42317
42318                                 // ...otherwise use results directly
42319                                 results :
42320                                 matcherIn;
42321
42322                             // Find primary matches
42323                             if (matcher) {
42324                                 matcher(matcherIn, matcherOut, context, xml);
42325                             }
42326
42327                             // Apply postFilter
42328                             if (postFilter) {
42329                                 temp = condense(matcherOut, postMap);
42330                                 postFilter(temp, [], context, xml);
42331
42332                                 // Un-match failing elements by moving them back to matcherIn
42333                                 i = temp.length;
42334                                 while (i--) {
42335                                     if ((elem = temp[i])) {
42336                                         matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
42337                                     }
42338                                 }
42339                             }
42340
42341                             if (seed) {
42342                                 if (postFinder || preFilter) {
42343                                     if (postFinder) {
42344                                         // Get the final matcherOut by condensing this intermediate
42345                                         // into postFinder contexts
42346                                         temp = [];
42347                                         i = matcherOut.length;
42348                                         while (i--) {
42349                                             if ((elem = matcherOut[i])) {
42350                                                 // Restore matcherIn since elem is not yet a final
42351                                                 // match
42352                                                 temp.push((matcherIn[i] = elem));
42353                                             }
42354                                         }
42355                                         postFinder(null, (matcherOut = []), temp, xml);
42356                                     }
42357
42358                                     // Move matched elements from seed to results to keep them
42359                                     // synchronized
42360                                     i = matcherOut.length;
42361                                     while (i--) {
42362                                         if ((elem = matcherOut[i]) &&
42363                                             (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
42364
42365                                             seed[temp] = !(results[temp] = elem);
42366                                         }
42367                                     }
42368                                 }
42369
42370                                 // Add elements to results, through postFinder if defined
42371                             } else {
42372                                 matcherOut = condense(
42373                                     matcherOut === results ?
42374                                     matcherOut.splice(preexisting, matcherOut.length) :
42375                                     matcherOut
42376                                 );
42377                                 if (postFinder) {
42378                                     postFinder(null, results, matcherOut, xml);
42379                                 } else {
42380                                     push.apply(results, matcherOut);
42381                                 }
42382                             }
42383                         });
42384                     }
42385
42386                     function matcherFromTokens(tokens) {
42387                         var checkContext, matcher, j,
42388                             len = tokens.length,
42389                             leadingRelative = Expr.relative[tokens[0].type],
42390                             implicitRelative = leadingRelative || Expr.relative[" "],
42391                             i = leadingRelative ? 1 : 0,
42392
42393                             // The foundational matcher ensures that elements are reachable from
42394                             // top-level context(s)
42395                             matchContext = addCombinator(function(elem) {
42396                                 return elem === checkContext;
42397                             }, implicitRelative, true),
42398                             matchAnyContext = addCombinator(function(elem) {
42399                                 return indexOf(checkContext, elem) > -1;
42400                             }, implicitRelative, true),
42401                             matchers = [function(elem, context, xml) {
42402                                 var ret = (!leadingRelative && (xml || context !== outermostContext)) || (
42403                                     (checkContext = context).nodeType ?
42404                                     matchContext(elem, context, xml) :
42405                                     matchAnyContext(elem, context, xml));
42406                                 // Avoid hanging onto element (issue #299)
42407                                 checkContext = null;
42408                                 return ret;
42409                             }];
42410
42411                         for (; i < len; i++) {
42412                             if ((matcher = Expr.relative[tokens[i].type])) {
42413                                 matchers = [addCombinator(elementMatcher(matchers), matcher)];
42414                             } else {
42415                                 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
42416
42417                                 // Return special upon seeing a positional matcher
42418                                 if (matcher[expando]) {
42419                                     // Find the next relative operator (if any) for proper handling
42420                                     j = ++i;
42421                                     for (; j < len; j++) {
42422                                         if (Expr.relative[tokens[j].type]) {
42423                                             break;
42424                                         }
42425                                     }
42426                                     return setMatcher(
42427                                         i > 1 && elementMatcher(matchers),
42428                                         i > 1 && toSelector(
42429                                             // If the preceding token was a descendant combinator,
42430                                             // insert an implicit any-element `*`
42431                                             tokens.slice(0, i - 1).concat({
42432                                                 value: tokens[i - 2].type === " " ? "*" : ""
42433                                             })
42434                                         ).replace(rtrim, "$1"),
42435                                         matcher,
42436                                         i < j && matcherFromTokens(tokens.slice(i, j)),
42437                                         j < len && matcherFromTokens((tokens = tokens.slice(j))),
42438                                         j < len && toSelector(tokens)
42439                                     );
42440                                 }
42441                                 matchers.push(matcher);
42442                             }
42443                         }
42444
42445                         return elementMatcher(matchers);
42446                     }
42447
42448                     function matcherFromGroupMatchers(elementMatchers, setMatchers) {
42449                         var bySet = setMatchers.length > 0,
42450                             byElement = elementMatchers.length > 0,
42451                             superMatcher = function(seed, context, xml, results, outermost) {
42452                                 var elem, j, matcher,
42453                                     matchedCount = 0,
42454                                     i = "0",
42455                                     unmatched = seed && [],
42456                                     setMatched = [],
42457                                     contextBackup = outermostContext,
42458                                     // We must always have either seed elements or outermost context
42459                                     elems = seed || byElement && Expr.find["TAG"]("*", outermost),
42460                                     // Use integer dirruns iff this is the outermost matcher
42461                                     dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
42462                                     len = elems.length;
42463
42464                                 if (outermost) {
42465                                     outermostContext = context !== document && context;
42466                                 }
42467
42468                                 // Add elements passing elementMatchers directly to results
42469                                 // Keep `i` a string if there are no elements so `matchedCount` will
42470                                 // be "00" below
42471                                 // Support: IE<9, Safari
42472                                 // Tolerate NodeList properties (IE: "length"; Safari: <number>)
42473                                 // matching elements by id
42474                                 for (; i !== len && (elem = elems[i]) != null; i++) {
42475                                     if (byElement && elem) {
42476                                         j = 0;
42477                                         while ((matcher = elementMatchers[j++])) {
42478                                             if (matcher(elem, context, xml)) {
42479                                                 results.push(elem);
42480                                                 break;
42481                                             }
42482                                         }
42483                                         if (outermost) {
42484                                             dirruns = dirrunsUnique;
42485                                         }
42486                                     }
42487
42488                                     // Track unmatched elements for set filters
42489                                     if (bySet) {
42490                                         // They will have gone through all possible matchers
42491                                         if ((elem = !matcher && elem)) {
42492                                             matchedCount--;
42493                                         }
42494
42495                                         // Lengthen the array for every element, matched or not
42496                                         if (seed) {
42497                                             unmatched.push(elem);
42498                                         }
42499                                     }
42500                                 }
42501
42502                                 // Apply set filters to unmatched elements
42503                                 matchedCount += i;
42504                                 if (bySet && i !== matchedCount) {
42505                                     j = 0;
42506                                     while ((matcher = setMatchers[j++])) {
42507                                         matcher(unmatched, setMatched, context, xml);
42508                                     }
42509
42510                                     if (seed) {
42511                                         // Reintegrate element matches to eliminate the need for
42512                                         // sorting
42513                                         if (matchedCount > 0) {
42514                                             while (i--) {
42515                                                 if (!(unmatched[i] || setMatched[i])) {
42516                                                     setMatched[i] = pop.call(results);
42517                                                 }
42518                                             }
42519                                         }
42520
42521                                         // Discard index placeholder values to get only actual
42522                                         // matches
42523                                         setMatched = condense(setMatched);
42524                                     }
42525
42526                                     // Add matches to results
42527                                     push.apply(results, setMatched);
42528
42529                                     // Seedless set matches succeeding multiple successful matchers
42530                                     // stipulate sorting
42531                                     if (outermost && !seed && setMatched.length > 0 &&
42532                                         (matchedCount + setMatchers.length) > 1) {
42533
42534                                         Sizzle.uniqueSort(results);
42535                                     }
42536                                 }
42537
42538                                 // Override manipulation of globals by nested matchers
42539                                 if (outermost) {
42540                                     dirruns = dirrunsUnique;
42541                                     outermostContext = contextBackup;
42542                                 }
42543
42544                                 return unmatched;
42545                             };
42546
42547                         return bySet ?
42548                             markFunction(superMatcher) :
42549                             superMatcher;
42550                     }
42551
42552                     compile = Sizzle.compile = function(selector, match /* Internal Use Only */ ) {
42553                         var i,
42554                             setMatchers = [],
42555                             elementMatchers = [],
42556                             cached = compilerCache[selector + " "];
42557
42558                         if (!cached) {
42559                             // Generate a function of recursive functions that can be used to check
42560                             // each element
42561                             if (!match) {
42562                                 match = tokenize(selector);
42563                             }
42564                             i = match.length;
42565                             while (i--) {
42566                                 cached = matcherFromTokens(match[i]);
42567                                 if (cached[expando]) {
42568                                     setMatchers.push(cached);
42569                                 } else {
42570                                     elementMatchers.push(cached);
42571                                 }
42572                             }
42573
42574                             // Cache the compiled function
42575                             cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
42576
42577                             // Save selector and tokenization
42578                             cached.selector = selector;
42579                         }
42580                         return cached;
42581                     };
42582
42583                     /**
42584                      * A low-level selection function that works with Sizzle's compiled selector
42585                      * functions
42586                      * 
42587                      * @param {String|Function}
42588                      *            selector A selector or a pre-compiled selector function built with
42589                      *            Sizzle.compile
42590                      * @param {Element}
42591                      *            context
42592                      * @param {Array}
42593                      *            [results]
42594                      * @param {Array}
42595                      *            [seed] A set of elements to match against
42596                      */
42597                     select = Sizzle.select = function(selector, context, results, seed) {
42598                         var i, tokens, token, type, find,
42599                             compiled = typeof selector === "function" && selector,
42600                             match = !seed && tokenize((selector = compiled.selector || selector));
42601
42602                         results = results || [];
42603
42604                         // Try to minimize operations if there is no seed and only one group
42605                         if (match.length === 1) {
42606
42607                             // Take a shortcut and set the context if the root selector is an ID
42608                             tokens = match[0] = match[0].slice(0);
42609                             if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&
42610                                 support.getById && context.nodeType === 9 && documentIsHTML &&
42611                                 Expr.relative[tokens[1].type]) {
42612
42613                                 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
42614                                 if (!context) {
42615                                     return results;
42616
42617                                     // Precompiled matchers will still verify ancestry, so step up a
42618                                     // level
42619                                 } else if (compiled) {
42620                                     context = context.parentNode;
42621                                 }
42622
42623                                 selector = selector.slice(tokens.shift().value.length);
42624                             }
42625
42626                             // Fetch a seed set for right-to-left matching
42627                             i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
42628                             while (i--) {
42629                                 token = tokens[i];
42630
42631                                 // Abort if we hit a combinator
42632                                 if (Expr.relative[(type = token.type)]) {
42633                                     break;
42634                                 }
42635                                 if ((find = Expr.find[type])) {
42636                                     // Search, expanding context for leading sibling combinators
42637                                     if ((seed = find(
42638                                             token.matches[0].replace(runescape, funescape),
42639                                             rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
42640                                         ))) {
42641
42642                                         // If seed is empty or no tokens remain, we can return early
42643                                         tokens.splice(i, 1);
42644                                         selector = seed.length && toSelector(tokens);
42645                                         if (!selector) {
42646                                             push.apply(results, seed);
42647                                             return results;
42648                                         }
42649
42650                                         break;
42651                                     }
42652                                 }
42653                             }
42654                         }
42655
42656                         // Compile and execute a filtering function if one is not provided
42657                         // Provide `match` to avoid retokenization if we modified the selector above
42658                         (compiled || compile(selector, match))(
42659                             seed,
42660                             context, !documentIsHTML,
42661                             results,
42662                             rsibling.test(selector) && testContext(context.parentNode) || context
42663                         );
42664                         return results;
42665                     };
42666
42667                     // One-time assignments
42668
42669                     // Sort stability
42670                     support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
42671
42672                     // Support: Chrome 14-35+
42673                     // Always assume duplicates if they aren't passed to the comparison function
42674                     support.detectDuplicates = !!hasDuplicate;
42675
42676                     // Initialize against the default document
42677                     setDocument();
42678
42679                     // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
42680                     // Detached nodes confoundingly follow *each other*
42681                     support.sortDetached = assert(function(div1) {
42682                         // Should return 1, but returns 4 (following)
42683                         return div1.compareDocumentPosition(document.createElement("div")) & 1;
42684                     });
42685
42686                     // Support: IE<8
42687                     // Prevent attribute/property "interpolation"
42688                     // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
42689                     if (!assert(function(div) {
42690                             div.innerHTML = "<a href='#'></a>";
42691                             return div.firstChild.getAttribute("href") === "#";
42692                         })) {
42693                         addHandle("type|href|height|width", function(elem, name, isXML) {
42694                             if (!isXML) {
42695                                 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
42696                             }
42697                         });
42698                     }
42699
42700                     // Support: IE<9
42701                     // Use defaultValue in place of getAttribute("value")
42702                     if (!support.attributes || !assert(function(div) {
42703                             div.innerHTML = "<input/>";
42704                             div.firstChild.setAttribute("value", "");
42705                             return div.firstChild.getAttribute("value") === "";
42706                         })) {
42707                         addHandle("value", function(elem, name, isXML) {
42708                             if (!isXML && elem.nodeName.toLowerCase() === "input") {
42709                                 return elem.defaultValue;
42710                             }
42711                         });
42712                     }
42713
42714                     // Support: IE<9
42715                     // Use getAttributeNode to fetch booleans when getAttribute lies
42716                     if (!assert(function(div) {
42717                             return div.getAttribute("disabled") == null;
42718                         })) {
42719                         addHandle(booleans, function(elem, name, isXML) {
42720                             var val;
42721                             if (!isXML) {
42722                                 return elem[name] === true ? name.toLowerCase() :
42723                                     (val = elem.getAttributeNode(name)) && val.specified ?
42724                                     val.value :
42725                                     null;
42726                             }
42727                         });
42728                     }
42729
42730                     return Sizzle;
42731
42732                 })(window);
42733
42734
42735
42736             jQuery.find = Sizzle;
42737             jQuery.expr = Sizzle.selectors;
42738             jQuery.expr[":"] = jQuery.expr.pseudos;
42739             jQuery.unique = Sizzle.uniqueSort;
42740             jQuery.text = Sizzle.getText;
42741             jQuery.isXMLDoc = Sizzle.isXML;
42742             jQuery.contains = Sizzle.contains;
42743
42744
42745
42746             var rneedsContext = jQuery.expr.match.needsContext;
42747
42748             var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
42749
42750
42751
42752             var risSimple = /^.[^:#\[\.,]*$/;
42753
42754             // Implement the identical functionality for filter and not
42755             function winnow(elements, qualifier, not) {
42756                 if (jQuery.isFunction(qualifier)) {
42757                     return jQuery.grep(elements, function(elem, i) {
42758                         /* jshint -W018 */
42759                         return !!qualifier.call(elem, i, elem) !== not;
42760                     });
42761
42762                 }
42763
42764                 if (qualifier.nodeType) {
42765                     return jQuery.grep(elements, function(elem) {
42766                         return (elem === qualifier) !== not;
42767                     });
42768
42769                 }
42770
42771                 if (typeof qualifier === "string") {
42772                     if (risSimple.test(qualifier)) {
42773                         return jQuery.filter(qualifier, elements, not);
42774                     }
42775
42776                     qualifier = jQuery.filter(qualifier, elements);
42777                 }
42778
42779                 return jQuery.grep(elements, function(elem) {
42780                     return (indexOf.call(qualifier, elem) >= 0) !== not;
42781                 });
42782             }
42783
42784             jQuery.filter = function(expr, elems, not) {
42785                 var elem = elems[0];
42786
42787                 if (not) {
42788                     expr = ":not(" + expr + ")";
42789                 }
42790
42791                 return elems.length === 1 && elem.nodeType === 1 ?
42792                     jQuery.find.matchesSelector(elem, expr) ? [elem] : [] :
42793                     jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
42794                         return elem.nodeType === 1;
42795                     }));
42796             };
42797
42798             jQuery.fn.extend({
42799                 find: function(selector) {
42800                     var i,
42801                         len = this.length,
42802                         ret = [],
42803                         self = this;
42804
42805                     if (typeof selector !== "string") {
42806                         return this.pushStack(jQuery(selector).filter(function() {
42807                             for (i = 0; i < len; i++) {
42808                                 if (jQuery.contains(self[i], this)) {
42809                                     return true;
42810                                 }
42811                             }
42812                         }));
42813                     }
42814
42815                     for (i = 0; i < len; i++) {
42816                         jQuery.find(selector, self[i], ret);
42817                     }
42818
42819                     // Needed because $( selector, context ) becomes $( context ).find(
42820                     // selector )
42821                     ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
42822                     ret.selector = this.selector ? this.selector + " " + selector : selector;
42823                     return ret;
42824                 },
42825                 filter: function(selector) {
42826                     return this.pushStack(winnow(this, selector || [], false));
42827                 },
42828                 not: function(selector) {
42829                     return this.pushStack(winnow(this, selector || [], true));
42830                 },
42831                 is: function(selector) {
42832                     return !!winnow(
42833                         this,
42834
42835                         // If this is a positional/relative selector, check membership in
42836                         // the returned set
42837                         // so $("p:first").is("p:last") won't return true for a doc with two
42838                         // "p".
42839                         typeof selector === "string" && rneedsContext.test(selector) ?
42840                         jQuery(selector) :
42841                         selector || [],
42842                         false
42843                     ).length;
42844                 }
42845             });
42846
42847
42848             // Initialize a jQuery object
42849
42850
42851             // A central reference to the root jQuery(document)
42852             var rootjQuery,
42853
42854                 // A simple way to check for HTML strings
42855                 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
42856                 // Strict HTML recognition (#11290: must start with <)
42857                 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
42858
42859                 init = jQuery.fn.init = function(selector, context) {
42860                     var match, elem;
42861
42862                     // HANDLE: $(""), $(null), $(undefined), $(false)
42863                     if (!selector) {
42864                         return this;
42865                     }
42866
42867                     // Handle HTML strings
42868                     if (typeof selector === "string") {
42869                         if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
42870                             // Assume that strings that start and end with <> are HTML and
42871                             // skip the regex check
42872                             match = [null, selector, null];
42873
42874                         } else {
42875                             match = rquickExpr.exec(selector);
42876                         }
42877
42878                         // Match html or make sure no context is specified for #id
42879                         if (match && (match[1] || !context)) {
42880
42881                             // HANDLE: $(html) -> $(array)
42882                             if (match[1]) {
42883                                 context = context instanceof jQuery ? context[0] : context;
42884
42885                                 // Option to run scripts is true for back-compat
42886                                 // Intentionally let the error be thrown if parseHTML is not
42887                                 // present
42888                                 jQuery.merge(this, jQuery.parseHTML(
42889                                     match[1],
42890                                     context && context.nodeType ? context.ownerDocument || context : document,
42891                                     true
42892                                 ));
42893
42894                                 // HANDLE: $(html, props)
42895                                 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
42896                                     for (match in context) {
42897                                         // Properties of context are called as methods if
42898                                         // possible
42899                                         if (jQuery.isFunction(this[match])) {
42900                                             this[match](context[match]);
42901
42902                                             // ...and otherwise set as attributes
42903                                         } else {
42904                                             this.attr(match, context[match]);
42905                                         }
42906                                     }
42907                                 }
42908
42909                                 return this;
42910
42911                                 // HANDLE: $(#id)
42912                             } else {
42913                                 elem = document.getElementById(match[2]);
42914
42915                                 // Support: Blackberry 4.6
42916                                 // gEBID returns nodes no longer in the document (#6963)
42917                                 if (elem && elem.parentNode) {
42918                                     // Inject the element directly into the jQuery object
42919                                     this.length = 1;
42920                                     this[0] = elem;
42921                                 }
42922
42923                                 this.context = document;
42924                                 this.selector = selector;
42925                                 return this;
42926                             }
42927
42928                             // HANDLE: $(expr, $(...))
42929                         } else if (!context || context.jquery) {
42930                             return (context || rootjQuery).find(selector);
42931
42932                             // HANDLE: $(expr, context)
42933                             // (which is just equivalent to: $(context).find(expr)
42934                         } else {
42935                             return this.constructor(context).find(selector);
42936                         }
42937
42938                         // HANDLE: $(DOMElement)
42939                     } else if (selector.nodeType) {
42940                         this.context = this[0] = selector;
42941                         this.length = 1;
42942                         return this;
42943
42944                         // HANDLE: $(function)
42945                         // Shortcut for document ready
42946                     } else if (jQuery.isFunction(selector)) {
42947                         return typeof rootjQuery.ready !== "undefined" ?
42948                             rootjQuery.ready(selector) :
42949                             // Execute immediately if ready is not present
42950                             selector(jQuery);
42951                     }
42952
42953                     if (selector.selector !== undefined) {
42954                         this.selector = selector.selector;
42955                         this.context = selector.context;
42956                     }
42957
42958                     return jQuery.makeArray(selector, this);
42959                 };
42960
42961             // Give the init function the jQuery prototype for later instantiation
42962             init.prototype = jQuery.fn;
42963
42964             // Initialize central reference
42965             rootjQuery = jQuery(document);
42966
42967
42968             var rparentsprev = /^(?:parents|prev(?:Until|All))/,
42969                 // Methods guaranteed to produce a unique set when starting from a unique
42970                 // set
42971                 guaranteedUnique = {
42972                     children: true,
42973                     contents: true,
42974                     next: true,
42975                     prev: true
42976                 };
42977
42978             jQuery.extend({
42979                 dir: function(elem, dir, until) {
42980                     var matched = [],
42981                         truncate = until !== undefined;
42982
42983                     while ((elem = elem[dir]) && elem.nodeType !== 9) {
42984                         if (elem.nodeType === 1) {
42985                             if (truncate && jQuery(elem).is(until)) {
42986                                 break;
42987                             }
42988                             matched.push(elem);
42989                         }
42990                     }
42991                     return matched;
42992                 },
42993
42994                 sibling: function(n, elem) {
42995                     var matched = [];
42996
42997                     for (; n; n = n.nextSibling) {
42998                         if (n.nodeType === 1 && n !== elem) {
42999                             matched.push(n);
43000                         }
43001                     }
43002
43003                     return matched;
43004                 }
43005             });
43006
43007             jQuery.fn.extend({
43008                 has: function(target) {
43009                     var targets = jQuery(target, this),
43010                         l = targets.length;
43011
43012                     return this.filter(function() {
43013                         var i = 0;
43014                         for (; i < l; i++) {
43015                             if (jQuery.contains(this, targets[i])) {
43016                                 return true;
43017                             }
43018                         }
43019                     });
43020                 },
43021
43022                 closest: function(selectors, context) {
43023                     var cur,
43024                         i = 0,
43025                         l = this.length,
43026                         matched = [],
43027                         pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?
43028                         jQuery(selectors, context || this.context) :
43029                         0;
43030
43031                     for (; i < l; i++) {
43032                         for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
43033                             // Always skip document fragments
43034                             if (cur.nodeType < 11 && (pos ?
43035                                     pos.index(cur) > -1 :
43036
43037                                     // Don't pass non-elements to Sizzle
43038                                     cur.nodeType === 1 &&
43039                                     jQuery.find.matchesSelector(cur, selectors))) {
43040
43041                                 matched.push(cur);
43042                                 break;
43043                             }
43044                         }
43045                     }
43046
43047                     return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
43048                 },
43049
43050                 // Determine the position of an element within the set
43051                 index: function(elem) {
43052
43053                     // No argument, return index in parent
43054                     if (!elem) {
43055                         return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
43056                     }
43057
43058                     // Index in selector
43059                     if (typeof elem === "string") {
43060                         return indexOf.call(jQuery(elem), this[0]);
43061                     }
43062
43063                     // Locate the position of the desired element
43064                     return indexOf.call(this,
43065
43066                         // If it receives a jQuery object, the first element is used
43067                         elem.jquery ? elem[0] : elem
43068                     );
43069                 },
43070
43071                 add: function(selector, context) {
43072                     return this.pushStack(
43073                         jQuery.unique(
43074                             jQuery.merge(this.get(), jQuery(selector, context))
43075                         )
43076                     );
43077                 },
43078
43079                 addBack: function(selector) {
43080                     return this.add(selector == null ?
43081                         this.prevObject : this.prevObject.filter(selector)
43082                     );
43083                 }
43084             });
43085
43086             function sibling(cur, dir) {
43087                 while ((cur = cur[dir]) && cur.nodeType !== 1) {}
43088                 return cur;
43089             }
43090
43091             jQuery.each({
43092                 parent: function(elem) {
43093                     var parent = elem.parentNode;
43094                     return parent && parent.nodeType !== 11 ? parent : null;
43095                 },
43096                 parents: function(elem) {
43097                     return jQuery.dir(elem, "parentNode");
43098                 },
43099                 parentsUntil: function(elem, i, until) {
43100                     return jQuery.dir(elem, "parentNode", until);
43101                 },
43102                 next: function(elem) {
43103                     return sibling(elem, "nextSibling");
43104                 },
43105                 prev: function(elem) {
43106                     return sibling(elem, "previousSibling");
43107                 },
43108                 nextAll: function(elem) {
43109                     return jQuery.dir(elem, "nextSibling");
43110                 },
43111                 prevAll: function(elem) {
43112                     return jQuery.dir(elem, "previousSibling");
43113                 },
43114                 nextUntil: function(elem, i, until) {
43115                     return jQuery.dir(elem, "nextSibling", until);
43116                 },
43117                 prevUntil: function(elem, i, until) {
43118                     return jQuery.dir(elem, "previousSibling", until);
43119                 },
43120                 siblings: function(elem) {
43121                     return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
43122                 },
43123                 children: function(elem) {
43124                     return jQuery.sibling(elem.firstChild);
43125                 },
43126                 contents: function(elem) {
43127                     return elem.contentDocument || jQuery.merge([], elem.childNodes);
43128                 }
43129             }, function(name, fn) {
43130                 jQuery.fn[name] = function(until, selector) {
43131                     var matched = jQuery.map(this, fn, until);
43132
43133                     if (name.slice(-5) !== "Until") {
43134                         selector = until;
43135                     }
43136
43137                     if (selector && typeof selector === "string") {
43138                         matched = jQuery.filter(selector, matched);
43139                     }
43140
43141                     if (this.length > 1) {
43142                         // Remove duplicates
43143                         if (!guaranteedUnique[name]) {
43144                             jQuery.unique(matched);
43145                         }
43146
43147                         // Reverse order for parents* and prev-derivatives
43148                         if (rparentsprev.test(name)) {
43149                             matched.reverse();
43150                         }
43151                     }
43152
43153                     return this.pushStack(matched);
43154                 };
43155             });
43156             var rnotwhite = (/\S+/g);
43157
43158
43159
43160             // String to Object options format cache
43161             var optionsCache = {};
43162
43163             // Convert String-formatted options into Object-formatted ones and store in
43164             // cache
43165             function createOptions(options) {
43166                 var object = optionsCache[options] = {};
43167                 jQuery.each(options.match(rnotwhite) || [], function(_, flag) {
43168                     object[flag] = true;
43169                 });
43170                 return object;
43171             }
43172
43173             /*
43174              * Create a callback list using the following parameters:
43175              * 
43176              * options: an optional list of space-separated options that will change how the
43177              * callback list behaves or a more traditional option object
43178              * 
43179              * By default a callback list will act like an event callback list and can be
43180              * "fired" multiple times.
43181              * 
43182              * Possible options:
43183              * 
43184              * once: will ensure the callback list can only be fired once (like a Deferred)
43185              * 
43186              * memory: will keep track of previous values and will call any callback added
43187              * after the list has been fired right away with the latest "memorized" values
43188              * (like a Deferred)
43189              * 
43190              * unique: will ensure a callback can only be added once (no duplicate in the
43191              * list)
43192              * 
43193              * stopOnFalse: interrupt callings when a callback returns false
43194              * 
43195              */
43196             jQuery.Callbacks = function(options) {
43197
43198                 // Convert options from String-formatted to Object-formatted if needed
43199                 // (we check in cache first)
43200                 options = typeof options === "string" ?
43201                     (optionsCache[options] || createOptions(options)) :
43202                     jQuery.extend({}, options);
43203
43204                 var // Last fire value (for non-forgettable lists)
43205                     memory,
43206                     // Flag to know if list was already fired
43207                     fired,
43208                     // Flag to know if list is currently firing
43209                     firing,
43210                     // First callback to fire (used internally by add and fireWith)
43211                     firingStart,
43212                     // End of the loop when firing
43213                     firingLength,
43214                     // Index of currently firing callback (modified by remove if needed)
43215                     firingIndex,
43216                     // Actual callback list
43217                     list = [],
43218                     // Stack of fire calls for repeatable lists
43219                     stack = !options.once && [],
43220                     // Fire callbacks
43221                     fire = function(data) {
43222                         memory = options.memory && data;
43223                         fired = true;
43224                         firingIndex = firingStart || 0;
43225                         firingStart = 0;
43226                         firingLength = list.length;
43227                         firing = true;
43228                         for (; list && firingIndex < firingLength; firingIndex++) {
43229                             if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
43230                                 memory = false; // To prevent further calls using add
43231                                 break;
43232                             }
43233                         }
43234                         firing = false;
43235                         if (list) {
43236                             if (stack) {
43237                                 if (stack.length) {
43238                                     fire(stack.shift());
43239                                 }
43240                             } else if (memory) {
43241                                 list = [];
43242                             } else {
43243                                 self.disable();
43244                             }
43245                         }
43246                     },
43247                     // Actual Callbacks object
43248                     self = {
43249                         // Add a callback or a collection of callbacks to the list
43250                         add: function() {
43251                             if (list) {
43252                                 // First, we save the current length
43253                                 var start = list.length;
43254                                 (function add(args) {
43255                                     jQuery.each(args, function(_, arg) {
43256                                         var type = jQuery.type(arg);
43257                                         if (type === "function") {
43258                                             if (!options.unique || !self.has(arg)) {
43259                                                 list.push(arg);
43260                                             }
43261                                         } else if (arg && arg.length && type !== "string") {
43262                                             // Inspect recursively
43263                                             add(arg);
43264                                         }
43265                                     });
43266                                 })(arguments);
43267                                 // Do we need to add the callbacks to the
43268                                 // current firing batch?
43269                                 if (firing) {
43270                                     firingLength = list.length;
43271                                     // With memory, if we're not firing then
43272                                     // we should call right away
43273                                 } else if (memory) {
43274                                     firingStart = start;
43275                                     fire(memory);
43276                                 }
43277                             }
43278                             return this;
43279                         },
43280                         // Remove a callback from the list
43281                         remove: function() {
43282                             if (list) {
43283                                 jQuery.each(arguments, function(_, arg) {
43284                                     var index;
43285                                     while ((index = jQuery.inArray(arg, list, index)) > -1) {
43286                                         list.splice(index, 1);
43287                                         // Handle firing indexes
43288                                         if (firing) {
43289                                             if (index <= firingLength) {
43290                                                 firingLength--;
43291                                             }
43292                                             if (index <= firingIndex) {
43293                                                 firingIndex--;
43294                                             }
43295                                         }
43296                                     }
43297                                 });
43298                             }
43299                             return this;
43300                         },
43301                         // Check if a given callback is in the list.
43302                         // If no argument is given, return whether or not list has callbacks
43303                         // attached.
43304                         has: function(fn) {
43305                             return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
43306                         },
43307                         // Remove all callbacks from the list
43308                         empty: function() {
43309                             list = [];
43310                             firingLength = 0;
43311                             return this;
43312                         },
43313                         // Have the list do nothing anymore
43314                         disable: function() {
43315                             list = stack = memory = undefined;
43316                             return this;
43317                         },
43318                         // Is it disabled?
43319                         disabled: function() {
43320                             return !list;
43321                         },
43322                         // Lock the list in its current state
43323                         lock: function() {
43324                             stack = undefined;
43325                             if (!memory) {
43326                                 self.disable();
43327                             }
43328                             return this;
43329                         },
43330                         // Is it locked?
43331                         locked: function() {
43332                             return !stack;
43333                         },
43334                         // Call all callbacks with the given context and arguments
43335                         fireWith: function(context, args) {
43336                             if (list && (!fired || stack)) {
43337                                 args = args || [];
43338                                 args = [context, args.slice ? args.slice() : args];
43339                                 if (firing) {
43340                                     stack.push(args);
43341                                 } else {
43342                                     fire(args);
43343                                 }
43344                             }
43345                             return this;
43346                         },
43347                         // Call all the callbacks with the given arguments
43348                         fire: function() {
43349                             self.fireWith(this, arguments);
43350                             return this;
43351                         },
43352                         // To know if the callbacks have already been called at least once
43353                         fired: function() {
43354                             return !!fired;
43355                         }
43356                     };
43357
43358                 return self;
43359             };
43360
43361
43362             jQuery.extend({
43363
43364                 Deferred: function(func) {
43365                     var tuples = [
43366                             // action, add listener, listener list, final state
43367                             ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
43368                             ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
43369                             ["notify", "progress", jQuery.Callbacks("memory")]
43370                         ],
43371                         state = "pending",
43372                         promise = {
43373                             state: function() {
43374                                 return state;
43375                             },
43376                             always: function() {
43377                                 deferred.done(arguments).fail(arguments);
43378                                 return this;
43379                             },
43380                             then: function( /* fnDone, fnFail, fnProgress */ ) {
43381                                 var fns = arguments;
43382                                 return jQuery.Deferred(function(newDefer) {
43383                                     jQuery.each(tuples, function(i, tuple) {
43384                                         var fn = jQuery.isFunction(fns[i]) && fns[i];
43385                                         // deferred[ done | fail | progress ] for forwarding
43386                                         // actions to newDefer
43387                                         deferred[tuple[1]](function() {
43388                                             var returned = fn && fn.apply(this, arguments);
43389                                             if (returned && jQuery.isFunction(returned.promise)) {
43390                                                 returned.promise()
43391                                                     .done(newDefer.resolve)
43392                                                     .fail(newDefer.reject)
43393                                                     .progress(newDefer.notify);
43394                                             } else {
43395                                                 newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
43396                                             }
43397                                         });
43398                                     });
43399                                     fns = null;
43400                                 }).promise();
43401                             },
43402                             // Get a promise for this deferred
43403                             // If obj is provided, the promise aspect is added to the object
43404                             promise: function(obj) {
43405                                 return obj != null ? jQuery.extend(obj, promise) : promise;
43406                             }
43407                         },
43408                         deferred = {};
43409
43410                     // Keep pipe for back-compat
43411                     promise.pipe = promise.then;
43412
43413                     // Add list-specific methods
43414                     jQuery.each(tuples, function(i, tuple) {
43415                         var list = tuple[2],
43416                             stateString = tuple[3];
43417
43418                         // promise[ done | fail | progress ] = list.add
43419                         promise[tuple[1]] = list.add;
43420
43421                         // Handle state
43422                         if (stateString) {
43423                             list.add(function() {
43424                                 // state = [ resolved | rejected ]
43425                                 state = stateString;
43426
43427                                 // [ reject_list | resolve_list ].disable; progress_list.lock
43428                             }, tuples[i ^ 1][2].disable, tuples[2][2].lock);
43429                         }
43430
43431                         // deferred[ resolve | reject | notify ]
43432                         deferred[tuple[0]] = function() {
43433                             deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
43434                             return this;
43435                         };
43436                         deferred[tuple[0] + "With"] = list.fireWith;
43437                     });
43438
43439                     // Make the deferred a promise
43440                     promise.promise(deferred);
43441
43442                     // Call given func if any
43443                     if (func) {
43444                         func.call(deferred, deferred);
43445                     }
43446
43447                     // All done!
43448                     return deferred;
43449                 },
43450
43451                 // Deferred helper
43452                 when: function(subordinate /* , ..., subordinateN */ ) {
43453                     var i = 0,
43454                         resolveValues = slice.call(arguments),
43455                         length = resolveValues.length,
43456
43457                         // the count of uncompleted subordinates
43458                         remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0,
43459
43460                         // the master Deferred. If resolveValues consist of only a single
43461                         // Deferred, just use that.
43462                         deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
43463
43464                         // Update function for both resolve and progress values
43465                         updateFunc = function(i, contexts, values) {
43466                             return function(value) {
43467                                 contexts[i] = this;
43468                                 values[i] = arguments.length > 1 ? slice.call(arguments) : value;
43469                                 if (values === progressValues) {
43470                                     deferred.notifyWith(contexts, values);
43471                                 } else if (!(--remaining)) {
43472                                     deferred.resolveWith(contexts, values);
43473                                 }
43474                             };
43475                         },
43476
43477                         progressValues, progressContexts, resolveContexts;
43478
43479                     // Add listeners to Deferred subordinates; treat others as resolved
43480                     if (length > 1) {
43481                         progressValues = new Array(length);
43482                         progressContexts = new Array(length);
43483                         resolveContexts = new Array(length);
43484                         for (; i < length; i++) {
43485                             if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
43486                                 resolveValues[i].promise()
43487                                     .done(updateFunc(i, resolveContexts, resolveValues))
43488                                     .fail(deferred.reject)
43489                                     .progress(updateFunc(i, progressContexts, progressValues));
43490                             } else {
43491                                 --remaining;
43492                             }
43493                         }
43494                     }
43495
43496                     // If we're not waiting on anything, resolve the master
43497                     if (!remaining) {
43498                         deferred.resolveWith(resolveContexts, resolveValues);
43499                     }
43500
43501                     return deferred.promise();
43502                 }
43503             });
43504
43505
43506             // The deferred used on DOM ready
43507             var readyList;
43508
43509             jQuery.fn.ready = function(fn) {
43510                 // Add the callback
43511                 jQuery.ready.promise().done(fn);
43512
43513                 return this;
43514             };
43515
43516             jQuery.extend({
43517                 // Is the DOM ready to be used? Set to true once it occurs.
43518                 isReady: false,
43519
43520                 // A counter to track how many items to wait for before
43521                 // the ready event fires. See #6781
43522                 readyWait: 1,
43523
43524                 // Hold (or release) the ready event
43525                 holdReady: function(hold) {
43526                     if (hold) {
43527                         jQuery.readyWait++;
43528                     } else {
43529                         jQuery.ready(true);
43530                     }
43531                 },
43532
43533                 // Handle when the DOM is ready
43534                 ready: function(wait) {
43535
43536                     // Abort if there are pending holds or we're already ready
43537                     if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
43538                         return;
43539                     }
43540
43541                     // Remember that the DOM is ready
43542                     jQuery.isReady = true;
43543
43544                     // If a normal DOM Ready event fired, decrement, and wait if need be
43545                     if (wait !== true && --jQuery.readyWait > 0) {
43546                         return;
43547                     }
43548
43549                     // If there are functions bound, to execute
43550                     readyList.resolveWith(document, [jQuery]);
43551
43552                     // Trigger any bound ready events
43553                     if (jQuery.fn.triggerHandler) {
43554                         jQuery(document).triggerHandler("ready");
43555                         jQuery(document).off("ready");
43556                     }
43557                 }
43558             });
43559
43560             /**
43561              * The ready event handler and self cleanup method
43562              */
43563             function completed() {
43564                 document.removeEventListener("DOMContentLoaded", completed, false);
43565                 window.removeEventListener("load", completed, false);
43566                 jQuery.ready();
43567             }
43568
43569             jQuery.ready.promise = function(obj) {
43570                 if (!readyList) {
43571
43572                     readyList = jQuery.Deferred();
43573
43574                     // Catch cases where $(document).ready() is called after the browser
43575                     // event has already occurred.
43576                     // We once tried to use readyState "interactive" here, but it caused
43577                     // issues like the one
43578                     // discovered by ChrisS here:
43579                     // http://bugs.jquery.com/ticket/12282#comment:15
43580                     if (document.readyState === "complete") {
43581                         // Handle it asynchronously to allow scripts the opportunity to
43582                         // delay ready
43583                         setTimeout(jQuery.ready);
43584
43585                     } else {
43586
43587                         // Use the handy event callback
43588                         document.addEventListener("DOMContentLoaded", completed, false);
43589
43590                         // A fallback to window.onload, that will always work
43591                         window.addEventListener("load", completed, false);
43592                     }
43593                 }
43594                 return readyList.promise(obj);
43595             };
43596
43597             // Kick off the DOM ready check even if the user does not
43598             jQuery.ready.promise();
43599
43600
43601
43602
43603             // Multifunctional method to get and set values of a collection
43604             // The value/s can optionally be executed if it's a function
43605             var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
43606                 var i = 0,
43607                     len = elems.length,
43608                     bulk = key == null;
43609
43610                 // Sets many values
43611                 if (jQuery.type(key) === "object") {
43612                     chainable = true;
43613                     for (i in key) {
43614                         jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
43615                     }
43616
43617                     // Sets one value
43618                 } else if (value !== undefined) {
43619                     chainable = true;
43620
43621                     if (!jQuery.isFunction(value)) {
43622                         raw = true;
43623                     }
43624
43625                     if (bulk) {
43626                         // Bulk operations run against the entire set
43627                         if (raw) {
43628                             fn.call(elems, value);
43629                             fn = null;
43630
43631                             // ...except when executing function values
43632                         } else {
43633                             bulk = fn;
43634                             fn = function(elem, key, value) {
43635                                 return bulk.call(jQuery(elem), value);
43636                             };
43637                         }
43638                     }
43639
43640                     if (fn) {
43641                         for (; i < len; i++) {
43642                             fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
43643                         }
43644                     }
43645                 }
43646
43647                 return chainable ?
43648                     elems :
43649
43650                     // Gets
43651                     bulk ?
43652                     fn.call(elems) :
43653                     len ? fn(elems[0], key) : emptyGet;
43654             };
43655
43656
43657             /**
43658              * Determines whether an object can have data
43659              */
43660             jQuery.acceptData = function(owner) {
43661                 // Accepts only:
43662                 // - Node
43663                 // - Node.ELEMENT_NODE
43664                 // - Node.DOCUMENT_NODE
43665                 // - Object
43666                 // - Any
43667                 /* jshint -W018 */
43668                 return owner.nodeType === 1 || owner.nodeType === 9 || !(+owner.nodeType);
43669             };
43670
43671
43672             function Data() {
43673                 // Support: Android<4,
43674                 // Old WebKit does not have Object.preventExtensions/freeze method,
43675                 // return new empty object instead with no [[set]] accessor
43676                 Object.defineProperty(this.cache = {}, 0, {
43677                     get: function() {
43678                         return {};
43679                     }
43680                 });
43681
43682                 this.expando = jQuery.expando + Data.uid++;
43683             }
43684
43685             Data.uid = 1;
43686             Data.accepts = jQuery.acceptData;
43687
43688             Data.prototype = {
43689                 key: function(owner) {
43690                     // We can accept data for non-element nodes in modern browsers,
43691                     // but we should not, see #8335.
43692                     // Always return the key for a frozen object.
43693                     if (!Data.accepts(owner)) {
43694                         return 0;
43695                     }
43696
43697                     var descriptor = {},
43698                         // Check if the owner object already has a cache key
43699                         unlock = owner[this.expando];
43700
43701                     // If not, create one
43702                     if (!unlock) {
43703                         unlock = Data.uid++;
43704
43705                         // Secure it in a non-enumerable, non-writable property
43706                         try {
43707                             descriptor[this.expando] = {
43708                                 value: unlock
43709                             };
43710                             Object.defineProperties(owner, descriptor);
43711
43712                             // Support: Android<4
43713                             // Fallback to a less secure definition
43714                         } catch (e) {
43715                             descriptor[this.expando] = unlock;
43716                             jQuery.extend(owner, descriptor);
43717                         }
43718                     }
43719
43720                     // Ensure the cache object
43721                     if (!this.cache[unlock]) {
43722                         this.cache[unlock] = {};
43723                     }
43724
43725                     return unlock;
43726                 },
43727                 set: function(owner, data, value) {
43728                     var prop,
43729                         // There may be an unlock assigned to this node,
43730                         // if there is no entry for this "owner", create one inline
43731                         // and set the unlock as though an owner entry had always existed
43732                         unlock = this.key(owner),
43733                         cache = this.cache[unlock];
43734
43735                     // Handle: [ owner, key, value ] args
43736                     if (typeof data === "string") {
43737                         cache[data] = value;
43738
43739                         // Handle: [ owner, { properties } ] args
43740                     } else {
43741                         // Fresh assignments by object are shallow copied
43742                         if (jQuery.isEmptyObject(cache)) {
43743                             jQuery.extend(this.cache[unlock], data);
43744                             // Otherwise, copy the properties one-by-one to the cache object
43745                         } else {
43746                             for (prop in data) {
43747                                 cache[prop] = data[prop];
43748                             }
43749                         }
43750                     }
43751                     return cache;
43752                 },
43753                 get: function(owner, key) {
43754                     // Either a valid cache is found, or will be created.
43755                     // New caches will be created and the unlock returned,
43756                     // allowing direct access to the newly created
43757                     // empty data object. A valid owner object must be provided.
43758                     var cache = this.cache[this.key(owner)];
43759
43760                     return key === undefined ?
43761                         cache : cache[key];
43762                 },
43763                 access: function(owner, key, value) {
43764                     var stored;
43765                     // In cases where either:
43766                     //
43767                     // 1. No key was specified
43768                     // 2. A string key was specified, but no value provided
43769                     //
43770                     // Take the "read" path and allow the get method to determine
43771                     // which value to return, respectively either:
43772                     //
43773                     // 1. The entire cache object
43774                     // 2. The data stored at the key
43775                     //
43776                     if (key === undefined ||
43777                         ((key && typeof key === "string") && value === undefined)) {
43778
43779                         stored = this.get(owner, key);
43780
43781                         return stored !== undefined ?
43782                             stored : this.get(owner, jQuery.camelCase(key));
43783                     }
43784
43785                     // [*]When the key is not a string, or both a key and value
43786                     // are specified, set or extend (existing objects) with either:
43787                     //
43788                     // 1. An object of properties
43789                     // 2. A key and value
43790                     //
43791                     this.set(owner, key, value);
43792
43793                     // Since the "set" path can have two possible entry points
43794                     // return the expected data based on which path was taken[*]
43795                     return value !== undefined ? value : key;
43796                 },
43797                 remove: function(owner, key) {
43798                     var i, name, camel,
43799                         unlock = this.key(owner),
43800                         cache = this.cache[unlock];
43801
43802                     if (key === undefined) {
43803                         this.cache[unlock] = {};
43804
43805                     } else {
43806                         // Support array or space separated string of keys
43807                         if (jQuery.isArray(key)) {
43808                             // If "name" is an array of keys...
43809                             // When data is initially created, via ("key", "val") signature,
43810                             // keys will be converted to camelCase.
43811                             // Since there is no way to tell _how_ a key was added, remove
43812                             // both plain key and camelCase key. #12786
43813                             // This will only penalize the array argument path.
43814                             name = key.concat(key.map(jQuery.camelCase));
43815                         } else {
43816                             camel = jQuery.camelCase(key);
43817                             // Try the string as a key before any manipulation
43818                             if (key in cache) {
43819                                 name = [key, camel];
43820                             } else {
43821                                 // If a key with the spaces exists, use it.
43822                                 // Otherwise, create an array by matching non-whitespace
43823                                 name = camel;
43824                                 name = name in cache ? [name] : (name.match(rnotwhite) || []);
43825                             }
43826                         }
43827
43828                         i = name.length;
43829                         while (i--) {
43830                             delete cache[name[i]];
43831                         }
43832                     }
43833                 },
43834                 hasData: function(owner) {
43835                     return !jQuery.isEmptyObject(
43836                         this.cache[owner[this.expando]] || {}
43837                     );
43838                 },
43839                 discard: function(owner) {
43840                     if (owner[this.expando]) {
43841                         delete this.cache[owner[this.expando]];
43842                     }
43843                 }
43844             };
43845             var data_priv = new Data();
43846
43847             var data_user = new Data();
43848
43849
43850
43851             // Implementation Summary
43852             //
43853             // 1. Enforce API surface and semantic compatibility with 1.9.x branch
43854             // 2. Improve the module's maintainability by reducing the storage
43855             // paths to a single mechanism.
43856             // 3. Use the same single mechanism to support "private" and "user" data.
43857             // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
43858             // 5. Avoid exposing implementation details on user objects (eg. expando
43859             // properties)
43860             // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
43861
43862             var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
43863                 rmultiDash = /([A-Z])/g;
43864
43865             function dataAttr(elem, key, data) {
43866                 var name;
43867
43868                 // If nothing was found internally, try to fetch any
43869                 // data from the HTML5 data-* attribute
43870                 if (data === undefined && elem.nodeType === 1) {
43871                     name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
43872                     data = elem.getAttribute(name);
43873
43874                     if (typeof data === "string") {
43875                         try {
43876                             data = data === "true" ? true :
43877                                 data === "false" ? false :
43878                                 data === "null" ? null :
43879                                 // Only convert to a number if it doesn't change the string
43880                                 +data + "" === data ? +data :
43881                                 rbrace.test(data) ? jQuery.parseJSON(data) :
43882                                 data;
43883                         } catch (e) {}
43884
43885                         // Make sure we set the data so it isn't changed later
43886                         data_user.set(elem, key, data);
43887                     } else {
43888                         data = undefined;
43889                     }
43890                 }
43891                 return data;
43892             }
43893
43894             jQuery.extend({
43895                 hasData: function(elem) {
43896                     return data_user.hasData(elem) || data_priv.hasData(elem);
43897                 },
43898
43899                 data: function(elem, name, data) {
43900                     return data_user.access(elem, name, data);
43901                 },
43902
43903                 removeData: function(elem, name) {
43904                     data_user.remove(elem, name);
43905                 },
43906
43907                 // TODO: Now that all calls to _data and _removeData have been replaced
43908                 // with direct calls to data_priv methods, these can be deprecated.
43909                 _data: function(elem, name, data) {
43910                     return data_priv.access(elem, name, data);
43911                 },
43912
43913                 _removeData: function(elem, name) {
43914                     data_priv.remove(elem, name);
43915                 }
43916             });
43917
43918             jQuery.fn.extend({
43919                 data: function(key, value) {
43920                     var i, name, data,
43921                         elem = this[0],
43922                         attrs = elem && elem.attributes;
43923
43924                     // Gets all values
43925                     if (key === undefined) {
43926                         if (this.length) {
43927                             data = data_user.get(elem);
43928
43929                             if (elem.nodeType === 1 && !data_priv.get(elem, "hasDataAttrs")) {
43930                                 i = attrs.length;
43931                                 while (i--) {
43932
43933                                     // Support: IE11+
43934                                     // The attrs elements can be null (#14894)
43935                                     if (attrs[i]) {
43936                                         name = attrs[i].name;
43937                                         if (name.indexOf("data-") === 0) {
43938                                             name = jQuery.camelCase(name.slice(5));
43939                                             dataAttr(elem, name, data[name]);
43940                                         }
43941                                     }
43942                                 }
43943                                 data_priv.set(elem, "hasDataAttrs", true);
43944                             }
43945                         }
43946
43947                         return data;
43948                     }
43949
43950                     // Sets multiple values
43951                     if (typeof key === "object") {
43952                         return this.each(function() {
43953                             data_user.set(this, key);
43954                         });
43955                     }
43956
43957                     return access(this, function(value) {
43958                         var data,
43959                             camelKey = jQuery.camelCase(key);
43960
43961                         // The calling jQuery object (element matches) is not empty
43962                         // (and therefore has an element appears at this[ 0 ]) and the
43963                         // `value` parameter was not undefined. An empty jQuery object
43964                         // will result in `undefined` for elem = this[ 0 ] which will
43965                         // throw an exception if an attempt to read a data cache is made.
43966                         if (elem && value === undefined) {
43967                             // Attempt to get data from the cache
43968                             // with the key as-is
43969                             data = data_user.get(elem, key);
43970                             if (data !== undefined) {
43971                                 return data;
43972                             }
43973
43974                             // Attempt to get data from the cache
43975                             // with the key camelized
43976                             data = data_user.get(elem, camelKey);
43977                             if (data !== undefined) {
43978                                 return data;
43979                             }
43980
43981                             // Attempt to "discover" the data in
43982                             // HTML5 custom data-* attrs
43983                             data = dataAttr(elem, camelKey, undefined);
43984                             if (data !== undefined) {
43985                                 return data;
43986                             }
43987
43988                             // We tried really hard, but the data doesn't exist.
43989                             return;
43990                         }
43991
43992                         // Set the data...
43993                         this.each(function() {
43994                             // First, attempt to store a copy or reference of any
43995                             // data that might've been store with a camelCased key.
43996                             var data = data_user.get(this, camelKey);
43997
43998                             // For HTML5 data-* attribute interop, we have to
43999                             // store property names with dashes in a camelCase form.
44000                             // This might not apply to all properties...*
44001                             data_user.set(this, camelKey, value);
44002
44003                             // *... In the case of properties that might _actually_
44004                             // have dashes, we need to also store a copy of that
44005                             // unchanged property.
44006                             if (key.indexOf("-") !== -1 && data !== undefined) {
44007                                 data_user.set(this, key, value);
44008                             }
44009                         });
44010                     }, null, value, arguments.length > 1, null, true);
44011                 },
44012
44013                 removeData: function(key) {
44014                     return this.each(function() {
44015                         data_user.remove(this, key);
44016                     });
44017                 }
44018             });
44019
44020
44021             jQuery.extend({
44022                 queue: function(elem, type, data) {
44023                     var queue;
44024
44025                     if (elem) {
44026                         type = (type || "fx") + "queue";
44027                         queue = data_priv.get(elem, type);
44028
44029                         // Speed up dequeue by getting out quickly if this is just a lookup
44030                         if (data) {
44031                             if (!queue || jQuery.isArray(data)) {
44032                                 queue = data_priv.access(elem, type, jQuery.makeArray(data));
44033                             } else {
44034                                 queue.push(data);
44035                             }
44036                         }
44037                         return queue || [];
44038                     }
44039                 },
44040
44041                 dequeue: function(elem, type) {
44042                     type = type || "fx";
44043
44044                     var queue = jQuery.queue(elem, type),
44045                         startLength = queue.length,
44046                         fn = queue.shift(),
44047                         hooks = jQuery._queueHooks(elem, type),
44048                         next = function() {
44049                             jQuery.dequeue(elem, type);
44050                         };
44051
44052                     // If the fx queue is dequeued, always remove the progress sentinel
44053                     if (fn === "inprogress") {
44054                         fn = queue.shift();
44055                         startLength--;
44056                     }
44057
44058                     if (fn) {
44059
44060                         // Add a progress sentinel to prevent the fx queue from being
44061                         // automatically dequeued
44062                         if (type === "fx") {
44063                             queue.unshift("inprogress");
44064                         }
44065
44066                         // Clear up the last queue stop function
44067                         delete hooks.stop;
44068                         fn.call(elem, next, hooks);
44069                     }
44070
44071                     if (!startLength && hooks) {
44072                         hooks.empty.fire();
44073                     }
44074                 },
44075
44076                 // Not public - generate a queueHooks object, or return the current one
44077                 _queueHooks: function(elem, type) {
44078                     var key = type + "queueHooks";
44079                     return data_priv.get(elem, key) || data_priv.access(elem, key, {
44080                         empty: jQuery.Callbacks("once memory").add(function() {
44081                             data_priv.remove(elem, [type + "queue", key]);
44082                         })
44083                     });
44084                 }
44085             });
44086
44087             jQuery.fn.extend({
44088                 queue: function(type, data) {
44089                     var setter = 2;
44090
44091                     if (typeof type !== "string") {
44092                         data = type;
44093                         type = "fx";
44094                         setter--;
44095                     }
44096
44097                     if (arguments.length < setter) {
44098                         return jQuery.queue(this[0], type);
44099                     }
44100
44101                     return data === undefined ?
44102                         this :
44103                         this.each(function() {
44104                             var queue = jQuery.queue(this, type, data);
44105
44106                             // Ensure a hooks for this queue
44107                             jQuery._queueHooks(this, type);
44108
44109                             if (type === "fx" && queue[0] !== "inprogress") {
44110                                 jQuery.dequeue(this, type);
44111                             }
44112                         });
44113                 },
44114                 dequeue: function(type) {
44115                     return this.each(function() {
44116                         jQuery.dequeue(this, type);
44117                     });
44118                 },
44119                 clearQueue: function(type) {
44120                     return this.queue(type || "fx", []);
44121                 },
44122                 // Get a promise resolved when queues of a certain type
44123                 // are emptied (fx is the type by default)
44124                 promise: function(type, obj) {
44125                     var tmp,
44126                         count = 1,
44127                         defer = jQuery.Deferred(),
44128                         elements = this,
44129                         i = this.length,
44130                         resolve = function() {
44131                             if (!(--count)) {
44132                                 defer.resolveWith(elements, [elements]);
44133                             }
44134                         };
44135
44136                     if (typeof type !== "string") {
44137                         obj = type;
44138                         type = undefined;
44139                     }
44140                     type = type || "fx";
44141
44142                     while (i--) {
44143                         tmp = data_priv.get(elements[i], type + "queueHooks");
44144                         if (tmp && tmp.empty) {
44145                             count++;
44146                             tmp.empty.add(resolve);
44147                         }
44148                     }
44149                     resolve();
44150                     return defer.promise(obj);
44151                 }
44152             });
44153             var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
44154
44155             var cssExpand = ["Top", "Right", "Bottom", "Left"];
44156
44157             var isHidden = function(elem, el) {
44158                 // isHidden might be called from jQuery#filter function;
44159                 // in that case, element will be second argument
44160                 elem = el || elem;
44161                 return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
44162             };
44163
44164             var rcheckableType = (/^(?:checkbox|radio)$/i);
44165
44166
44167
44168             (function() {
44169                 var fragment = document.createDocumentFragment(),
44170                     div = fragment.appendChild(document.createElement("div")),
44171                     input = document.createElement("input");
44172
44173                 // Support: Safari<=5.1
44174                 // Check state lost if the name is set (#11217)
44175                 // Support: Windows Web Apps (WWA)
44176                 // `name` and `type` must use .setAttribute for WWA (#14901)
44177                 input.setAttribute("type", "radio");
44178                 input.setAttribute("checked", "checked");
44179                 input.setAttribute("name", "t");
44180
44181                 div.appendChild(input);
44182
44183                 // Support: Safari<=5.1, Android<4.2
44184                 // Older WebKit doesn't clone checked state correctly in fragments
44185                 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
44186
44187                 // Support: IE<=11+
44188                 // Make sure textarea (and checkbox) defaultValue is properly cloned
44189                 div.innerHTML = "<textarea>x</textarea>";
44190                 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
44191             })();
44192             var strundefined = typeof undefined;
44193
44194
44195
44196             support.focusinBubbles = "onfocusin" in window;
44197
44198
44199             var
44200                 rkeyEvent = /^key/,
44201                 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
44202                 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
44203                 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
44204
44205             function returnTrue() {
44206                 return true;
44207             }
44208
44209             function returnFalse() {
44210                 return false;
44211             }
44212
44213             function safeActiveElement() {
44214                 try {
44215                     return document.activeElement;
44216                 } catch (err) {}
44217             }
44218
44219             /*
44220              * Helper functions for managing events -- not part of the public interface.
44221              * Props to Dean Edwards' addEvent library for many of the ideas.
44222              */
44223             jQuery.event = {
44224
44225                 global: {},
44226
44227                 add: function(elem, types, handler, data, selector) {
44228
44229                     var handleObjIn, eventHandle, tmp,
44230                         events, t, handleObj,
44231                         special, handlers, type, namespaces, origType,
44232                         elemData = data_priv.get(elem);
44233
44234                     // Don't attach events to noData or text/comment nodes (but allow plain
44235                     // objects)
44236                     if (!elemData) {
44237                         return;
44238                     }
44239
44240                     // Caller can pass in an object of custom data in lieu of the handler
44241                     if (handler.handler) {
44242                         handleObjIn = handler;
44243                         handler = handleObjIn.handler;
44244                         selector = handleObjIn.selector;
44245                     }
44246
44247                     // Make sure that the handler has a unique ID, used to find/remove it
44248                     // later
44249                     if (!handler.guid) {
44250                         handler.guid = jQuery.guid++;
44251                     }
44252
44253                     // Init the element's event structure and main handler, if this is the
44254                     // first
44255                     if (!(events = elemData.events)) {
44256                         events = elemData.events = {};
44257                     }
44258                     if (!(eventHandle = elemData.handle)) {
44259                         eventHandle = elemData.handle = function(e) {
44260                             // Discard the second event of a jQuery.event.trigger() and
44261                             // when an event is called after a page has unloaded
44262                             return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
44263                                 jQuery.event.dispatch.apply(elem, arguments) : undefined;
44264                         };
44265                     }
44266
44267                     // Handle multiple events separated by a space
44268                     types = (types || "").match(rnotwhite) || [""];
44269                     t = types.length;
44270                     while (t--) {
44271                         tmp = rtypenamespace.exec(types[t]) || [];
44272                         type = origType = tmp[1];
44273                         namespaces = (tmp[2] || "").split(".").sort();
44274
44275                         // There *must* be a type, no attaching namespace-only handlers
44276                         if (!type) {
44277                             continue;
44278                         }
44279
44280                         // If event changes its type, use the special event handlers for the
44281                         // changed type
44282                         special = jQuery.event.special[type] || {};
44283
44284                         // If selector defined, determine special event api type, otherwise
44285                         // given type
44286                         type = (selector ? special.delegateType : special.bindType) || type;
44287
44288                         // Update special based on newly reset type
44289                         special = jQuery.event.special[type] || {};
44290
44291                         // handleObj is passed to all event handlers
44292                         handleObj = jQuery.extend({
44293                             type: type,
44294                             origType: origType,
44295                             data: data,
44296                             handler: handler,
44297                             guid: handler.guid,
44298                             selector: selector,
44299                             needsContext: selector && jQuery.expr.match.needsContext.test(selector),
44300                             namespace: namespaces.join(".")
44301                         }, handleObjIn);
44302
44303                         // Init the event handler queue if we're the first
44304                         if (!(handlers = events[type])) {
44305                             handlers = events[type] = [];
44306                             handlers.delegateCount = 0;
44307
44308                             // Only use addEventListener if the special events handler
44309                             // returns false
44310                             if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
44311                                 if (elem.addEventListener) {
44312                                     elem.addEventListener(type, eventHandle, false);
44313                                 }
44314                             }
44315                         }
44316
44317                         if (special.add) {
44318                             special.add.call(elem, handleObj);
44319
44320                             if (!handleObj.handler.guid) {
44321                                 handleObj.handler.guid = handler.guid;
44322                             }
44323                         }
44324
44325                         // Add to the element's handler list, delegates in front
44326                         if (selector) {
44327                             handlers.splice(handlers.delegateCount++, 0, handleObj);
44328                         } else {
44329                             handlers.push(handleObj);
44330                         }
44331
44332                         // Keep track of which events have ever been used, for event
44333                         // optimization
44334                         jQuery.event.global[type] = true;
44335                     }
44336
44337                 },
44338
44339                 // Detach an event or set of events from an element
44340                 remove: function(elem, types, handler, selector, mappedTypes) {
44341
44342                     var j, origCount, tmp,
44343                         events, t, handleObj,
44344                         special, handlers, type, namespaces, origType,
44345                         elemData = data_priv.hasData(elem) && data_priv.get(elem);
44346
44347                     if (!elemData || !(events = elemData.events)) {
44348                         return;
44349                     }
44350
44351                     // Once for each type.namespace in types; type may be omitted
44352                     types = (types || "").match(rnotwhite) || [""];
44353                     t = types.length;
44354                     while (t--) {
44355                         tmp = rtypenamespace.exec(types[t]) || [];
44356                         type = origType = tmp[1];
44357                         namespaces = (tmp[2] || "").split(".").sort();
44358
44359                         // Unbind all events (on this namespace, if provided) for the
44360                         // element
44361                         if (!type) {
44362                             for (type in events) {
44363                                 jQuery.event.remove(elem, type + types[t], handler, selector, true);
44364                             }
44365                             continue;
44366                         }
44367
44368                         special = jQuery.event.special[type] || {};
44369                         type = (selector ? special.delegateType : special.bindType) || type;
44370                         handlers = events[type] || [];
44371                         tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
44372
44373                         // Remove matching events
44374                         origCount = j = handlers.length;
44375                         while (j--) {
44376                             handleObj = handlers[j];
44377
44378                             if ((mappedTypes || origType === handleObj.origType) &&
44379                                 (!handler || handler.guid === handleObj.guid) &&
44380                                 (!tmp || tmp.test(handleObj.namespace)) &&
44381                                 (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
44382                                 handlers.splice(j, 1);
44383
44384                                 if (handleObj.selector) {
44385                                     handlers.delegateCount--;
44386                                 }
44387                                 if (special.remove) {
44388                                     special.remove.call(elem, handleObj);
44389                                 }
44390                             }
44391                         }
44392
44393                         // Remove generic event handler if we removed something and no more
44394                         // handlers exist
44395                         // (avoids potential for endless recursion during removal of special
44396                         // event handlers)
44397                         if (origCount && !handlers.length) {
44398                             if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
44399                                 jQuery.removeEvent(elem, type, elemData.handle);
44400                             }
44401
44402                             delete events[type];
44403                         }
44404                     }
44405
44406                     // Remove the expando if it's no longer used
44407                     if (jQuery.isEmptyObject(events)) {
44408                         delete elemData.handle;
44409                         data_priv.remove(elem, "events");
44410                     }
44411                 },
44412
44413                 trigger: function(event, data, elem, onlyHandlers) {
44414
44415                     var i, cur, tmp, bubbleType, ontype, handle, special,
44416                         eventPath = [elem || document],
44417                         type = hasOwn.call(event, "type") ? event.type : event,
44418                         namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
44419
44420                     cur = tmp = elem = elem || document;
44421
44422                     // Don't do events on text and comment nodes
44423                     if (elem.nodeType === 3 || elem.nodeType === 8) {
44424                         return;
44425                     }
44426
44427                     // focus/blur morphs to focusin/out; ensure we're not firing them right
44428                     // now
44429                     if (rfocusMorph.test(type + jQuery.event.triggered)) {
44430                         return;
44431                     }
44432
44433                     if (type.indexOf(".") >= 0) {
44434                         // Namespaced trigger; create a regexp to match event type in
44435                         // handle()
44436                         namespaces = type.split(".");
44437                         type = namespaces.shift();
44438                         namespaces.sort();
44439                     }
44440                     ontype = type.indexOf(":") < 0 && "on" + type;
44441
44442                     // Caller can pass in a jQuery.Event object, Object, or just an event
44443                     // type string
44444                     event = event[jQuery.expando] ?
44445                         event :
44446                         new jQuery.Event(type, typeof event === "object" && event);
44447
44448                     // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always
44449                     // true)
44450                     event.isTrigger = onlyHandlers ? 2 : 3;
44451                     event.namespace = namespaces.join(".");
44452                     event.namespace_re = event.namespace ?
44453                         new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") :
44454                         null;
44455
44456                     // Clean up the event in case it is being reused
44457                     event.result = undefined;
44458                     if (!event.target) {
44459                         event.target = elem;
44460                     }
44461
44462                     // Clone any incoming data and prepend the event, creating the handler
44463                     // arg list
44464                     data = data == null ? [event] :
44465                         jQuery.makeArray(data, [event]);
44466
44467                     // Allow special events to draw outside the lines
44468                     special = jQuery.event.special[type] || {};
44469                     if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
44470                         return;
44471                     }
44472
44473                     // Determine event propagation path in advance, per W3C events spec
44474                     // (#9951)
44475                     // Bubble up to document, then to window; watch for a global
44476                     // ownerDocument var (#9724)
44477                     if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
44478
44479                         bubbleType = special.delegateType || type;
44480                         if (!rfocusMorph.test(bubbleType + type)) {
44481                             cur = cur.parentNode;
44482                         }
44483                         for (; cur; cur = cur.parentNode) {
44484                             eventPath.push(cur);
44485                             tmp = cur;
44486                         }
44487
44488                         // Only add window if we got to document (e.g., not plain obj or
44489                         // detached DOM)
44490                         if (tmp === (elem.ownerDocument || document)) {
44491                             eventPath.push(tmp.defaultView || tmp.parentWindow || window);
44492                         }
44493                     }
44494
44495                     // Fire handlers on the event path
44496                     i = 0;
44497                     while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
44498
44499                         event.type = i > 1 ?
44500                             bubbleType :
44501                             special.bindType || type;
44502
44503                         // jQuery handler
44504                         handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
44505                         if (handle) {
44506                             handle.apply(cur, data);
44507                         }
44508
44509                         // Native handler
44510                         handle = ontype && cur[ontype];
44511                         if (handle && handle.apply && jQuery.acceptData(cur)) {
44512                             event.result = handle.apply(cur, data);
44513                             if (event.result === false) {
44514                                 event.preventDefault();
44515                             }
44516                         }
44517                     }
44518                     event.type = type;
44519
44520                     // If nobody prevented the default action, do it now
44521                     if (!onlyHandlers && !event.isDefaultPrevented()) {
44522
44523                         if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&
44524                             jQuery.acceptData(elem)) {
44525
44526                             // Call a native DOM method on the target with the same name
44527                             // name as the event.
44528                             // Don't do default actions on window, that's where global
44529                             // variables be (#6170)
44530                             if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
44531
44532                                 // Don't re-trigger an onFOO event when we call its FOO()
44533                                 // method
44534                                 tmp = elem[ontype];
44535
44536                                 if (tmp) {
44537                                     elem[ontype] = null;
44538                                 }
44539
44540                                 // Prevent re-triggering of the same event, since we already
44541                                 // bubbled it above
44542                                 jQuery.event.triggered = type;
44543                                 elem[type]();
44544                                 jQuery.event.triggered = undefined;
44545
44546                                 if (tmp) {
44547                                     elem[ontype] = tmp;
44548                                 }
44549                             }
44550                         }
44551                     }
44552
44553                     return event.result;
44554                 },
44555
44556                 dispatch: function(event) {
44557
44558                     // Make a writable jQuery.Event from the native event object
44559                     event = jQuery.event.fix(event);
44560
44561                     var i, j, ret, matched, handleObj,
44562                         handlerQueue = [],
44563                         args = slice.call(arguments),
44564                         handlers = (data_priv.get(this, "events") || {})[event.type] || [],
44565                         special = jQuery.event.special[event.type] || {};
44566
44567                     // Use the fix-ed jQuery.Event rather than the (read-only) native event
44568                     args[0] = event;
44569                     event.delegateTarget = this;
44570
44571                     // Call the preDispatch hook for the mapped type, and let it bail if
44572                     // desired
44573                     if (special.preDispatch && special.preDispatch.call(this, event) === false) {
44574                         return;
44575                     }
44576
44577                     // Determine handlers
44578                     handlerQueue = jQuery.event.handlers.call(this, event, handlers);
44579
44580                     // Run delegates first; they may want to stop propagation beneath us
44581                     i = 0;
44582                     while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
44583                         event.currentTarget = matched.elem;
44584
44585                         j = 0;
44586                         while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
44587
44588                             // Triggered event must either 1) have no namespace, or 2) have
44589                             // namespace(s)
44590                             // a subset or equal to those in the bound event (both can have
44591                             // no namespace).
44592                             if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
44593
44594                                 event.handleObj = handleObj;
44595                                 event.data = handleObj.data;
44596
44597                                 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler)
44598                                     .apply(matched.elem, args);
44599
44600                                 if (ret !== undefined) {
44601                                     if ((event.result = ret) === false) {
44602                                         event.preventDefault();
44603                                         event.stopPropagation();
44604                                     }
44605                                 }
44606                             }
44607                         }
44608                     }
44609
44610                     // Call the postDispatch hook for the mapped type
44611                     if (special.postDispatch) {
44612                         special.postDispatch.call(this, event);
44613                     }
44614
44615                     return event.result;
44616                 },
44617
44618                 handlers: function(event, handlers) {
44619                     var i, matches, sel, handleObj,
44620                         handlerQueue = [],
44621                         delegateCount = handlers.delegateCount,
44622                         cur = event.target;
44623
44624                     // Find delegate handlers
44625                     // Black-hole SVG <use> instance trees (#13180)
44626                     // Avoid non-left-click bubbling in Firefox (#3861)
44627                     if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
44628
44629                         for (; cur !== this; cur = cur.parentNode || this) {
44630
44631                             // Don't process clicks on disabled elements (#6911, #8165,
44632                             // #11382, #11764)
44633                             if (cur.disabled !== true || event.type !== "click") {
44634                                 matches = [];
44635                                 for (i = 0; i < delegateCount; i++) {
44636                                     handleObj = handlers[i];
44637
44638                                     // Don't conflict with Object.prototype properties
44639                                     // (#13203)
44640                                     sel = handleObj.selector + " ";
44641
44642                                     if (matches[sel] === undefined) {
44643                                         matches[sel] = handleObj.needsContext ?
44644                                             jQuery(sel, this).index(cur) >= 0 :
44645                                             jQuery.find(sel, this, null, [cur]).length;
44646                                     }
44647                                     if (matches[sel]) {
44648                                         matches.push(handleObj);
44649                                     }
44650                                 }
44651                                 if (matches.length) {
44652                                     handlerQueue.push({
44653                                         elem: cur,
44654                                         handlers: matches
44655                                     });
44656                                 }
44657                             }
44658                         }
44659                     }
44660
44661                     // Add the remaining (directly-bound) handlers
44662                     if (delegateCount < handlers.length) {
44663                         handlerQueue.push({
44664                             elem: this,
44665                             handlers: handlers.slice(delegateCount)
44666                         });
44667                     }
44668
44669                     return handlerQueue;
44670                 },
44671
44672                 // Includes some event props shared by KeyEvent and MouseEvent
44673                 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
44674
44675                 fixHooks: {},
44676
44677                 keyHooks: {
44678                     props: "char charCode key keyCode".split(" "),
44679                     filter: function(event, original) {
44680
44681                         // Add which for key events
44682                         if (event.which == null) {
44683                             event.which = original.charCode != null ? original.charCode : original.keyCode;
44684                         }
44685
44686                         return event;
44687                     }
44688                 },
44689
44690                 mouseHooks: {
44691                     props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
44692                     filter: function(event, original) {
44693                         var eventDoc, doc, body,
44694                             button = original.button;
44695
44696                         // Calculate pageX/Y if missing and clientX/Y available
44697                         if (event.pageX == null && original.clientX != null) {
44698                             eventDoc = event.target.ownerDocument || document;
44699                             doc = eventDoc.documentElement;
44700                             body = eventDoc.body;
44701
44702                             event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
44703                             event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
44704                         }
44705
44706                         // Add which for click: 1 === left; 2 === middle; 3 === right
44707                         // Note: button is not normalized, so don't use it
44708                         if (!event.which && button !== undefined) {
44709                             event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
44710                         }
44711
44712                         return event;
44713                     }
44714                 },
44715
44716                 fix: function(event) {
44717                     if (event[jQuery.expando]) {
44718                         return event;
44719                     }
44720
44721                     // Create a writable copy of the event object and normalize some
44722                     // properties
44723                     var i, prop, copy,
44724                         type = event.type,
44725                         originalEvent = event,
44726                         fixHook = this.fixHooks[type];
44727
44728                     if (!fixHook) {
44729                         this.fixHooks[type] = fixHook =
44730                             rmouseEvent.test(type) ? this.mouseHooks :
44731                             rkeyEvent.test(type) ? this.keyHooks : {};
44732                     }
44733                     copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
44734
44735                     event = new jQuery.Event(originalEvent);
44736
44737                     i = copy.length;
44738                     while (i--) {
44739                         prop = copy[i];
44740                         event[prop] = originalEvent[prop];
44741                     }
44742
44743                     // Support: Cordova 2.5 (WebKit) (#13255)
44744                     // All events should have a target; Cordova deviceready doesn't
44745                     if (!event.target) {
44746                         event.target = document;
44747                     }
44748
44749                     // Support: Safari 6.0+, Chrome<28
44750                     // Target should not be a text node (#504, #13143)
44751                     if (event.target.nodeType === 3) {
44752                         event.target = event.target.parentNode;
44753                     }
44754
44755                     return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
44756                 },
44757
44758                 special: {
44759                     load: {
44760                         // Prevent triggered image.load events from bubbling to window.load
44761                         noBubble: true
44762                     },
44763                     focus: {
44764                         // Fire native event if possible so blur/focus sequence is correct
44765                         trigger: function() {
44766                             if (this !== safeActiveElement() && this.focus) {
44767                                 this.focus();
44768                                 return false;
44769                             }
44770                         },
44771                         delegateType: "focusin"
44772                     },
44773                     blur: {
44774                         trigger: function() {
44775                             if (this === safeActiveElement() && this.blur) {
44776                                 this.blur();
44777                                 return false;
44778                             }
44779                         },
44780                         delegateType: "focusout"
44781                     },
44782                     click: {
44783                         // For checkbox, fire native event so checked state will be right
44784                         trigger: function() {
44785                             if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) {
44786                                 this.click();
44787                                 return false;
44788                             }
44789                         },
44790
44791                         // For cross-browser consistency, don't fire native .click() on
44792                         // links
44793                         _default: function(event) {
44794                             return jQuery.nodeName(event.target, "a");
44795                         }
44796                     },
44797
44798                     beforeunload: {
44799                         postDispatch: function(event) {
44800
44801                             // Support: Firefox 20+
44802                             // Firefox doesn't alert if the returnValue field is not set.
44803                             if (event.result !== undefined && event.originalEvent) {
44804                                 event.originalEvent.returnValue = event.result;
44805                             }
44806                         }
44807                     }
44808                 },
44809
44810                 simulate: function(type, elem, event, bubble) {
44811                     // Piggyback on a donor event to simulate a different one.
44812                     // Fake originalEvent to avoid donor's stopPropagation, but if the
44813                     // simulated event prevents default then we do the same on the donor.
44814                     var e = jQuery.extend(
44815                         new jQuery.Event(),
44816                         event, {
44817                             type: type,
44818                             isSimulated: true,
44819                             originalEvent: {}
44820                         }
44821                     );
44822                     if (bubble) {
44823                         jQuery.event.trigger(e, null, elem);
44824                     } else {
44825                         jQuery.event.dispatch.call(elem, e);
44826                     }
44827                     if (e.isDefaultPrevented()) {
44828                         event.preventDefault();
44829                     }
44830                 }
44831             };
44832
44833             jQuery.removeEvent = function(elem, type, handle) {
44834                 if (elem.removeEventListener) {
44835                     elem.removeEventListener(type, handle, false);
44836                 }
44837             };
44838
44839             jQuery.Event = function(src, props) {
44840                 // Allow instantiation without the 'new' keyword
44841                 if (!(this instanceof jQuery.Event)) {
44842                     return new jQuery.Event(src, props);
44843                 }
44844
44845                 // Event object
44846                 if (src && src.type) {
44847                     this.originalEvent = src;
44848                     this.type = src.type;
44849
44850                     // Events bubbling up the document may have been marked as prevented
44851                     // by a handler lower down the tree; reflect the correct value.
44852                     this.isDefaultPrevented = src.defaultPrevented ||
44853                         src.defaultPrevented === undefined &&
44854                         // Support: Android<4.0
44855                         src.returnValue === false ?
44856                         returnTrue :
44857                         returnFalse;
44858
44859                     // Event type
44860                 } else {
44861                     this.type = src;
44862                 }
44863
44864                 // Put explicitly provided properties onto the event object
44865                 if (props) {
44866                     jQuery.extend(this, props);
44867                 }
44868
44869                 // Create a timestamp if incoming event doesn't have one
44870                 this.timeStamp = src && src.timeStamp || jQuery.now();
44871
44872                 // Mark it as fixed
44873                 this[jQuery.expando] = true;
44874             };
44875
44876             // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language
44877             // Binding
44878             // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
44879             jQuery.Event.prototype = {
44880                 isDefaultPrevented: returnFalse,
44881                 isPropagationStopped: returnFalse,
44882                 isImmediatePropagationStopped: returnFalse,
44883
44884                 preventDefault: function() {
44885                     var e = this.originalEvent;
44886
44887                     this.isDefaultPrevented = returnTrue;
44888
44889                     if (e && e.preventDefault) {
44890                         e.preventDefault();
44891                     }
44892                 },
44893                 stopPropagation: function() {
44894                     var e = this.originalEvent;
44895
44896                     this.isPropagationStopped = returnTrue;
44897
44898                     if (e && e.stopPropagation) {
44899                         e.stopPropagation();
44900                     }
44901                 },
44902                 stopImmediatePropagation: function() {
44903                     var e = this.originalEvent;
44904
44905                     this.isImmediatePropagationStopped = returnTrue;
44906
44907                     if (e && e.stopImmediatePropagation) {
44908                         e.stopImmediatePropagation();
44909                     }
44910
44911                     this.stopPropagation();
44912                 }
44913             };
44914
44915             // Create mouseenter/leave events using mouseover/out and event-time checks
44916             // Support: Chrome 15+
44917             jQuery.each({
44918                 mouseenter: "mouseover",
44919                 mouseleave: "mouseout",
44920                 pointerenter: "pointerover",
44921                 pointerleave: "pointerout"
44922             }, function(orig, fix) {
44923                 jQuery.event.special[orig] = {
44924                     delegateType: fix,
44925                     bindType: fix,
44926
44927                     handle: function(event) {
44928                         var ret,
44929                             target = this,
44930                             related = event.relatedTarget,
44931                             handleObj = event.handleObj;
44932
44933                         // For mousenter/leave call the handler if related is outside the
44934                         // target.
44935                         // NB: No relatedTarget if the mouse left/entered the browser window
44936                         if (!related || (related !== target && !jQuery.contains(target, related))) {
44937                             event.type = handleObj.origType;
44938                             ret = handleObj.handler.apply(this, arguments);
44939                             event.type = fix;
44940                         }
44941                         return ret;
44942                     }
44943                 };
44944             });
44945
44946             // Support: Firefox, Chrome, Safari
44947             // Create "bubbling" focus and blur events
44948             if (!support.focusinBubbles) {
44949                 jQuery.each({
44950                     focus: "focusin",
44951                     blur: "focusout"
44952                 }, function(orig, fix) {
44953
44954                     // Attach a single capturing handler on the document while someone wants
44955                     // focusin/focusout
44956                     var handler = function(event) {
44957                         jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
44958                     };
44959
44960                     jQuery.event.special[fix] = {
44961                         setup: function() {
44962                             var doc = this.ownerDocument || this,
44963                                 attaches = data_priv.access(doc, fix);
44964
44965                             if (!attaches) {
44966                                 doc.addEventListener(orig, handler, true);
44967                             }
44968                             data_priv.access(doc, fix, (attaches || 0) + 1);
44969                         },
44970                         teardown: function() {
44971                             var doc = this.ownerDocument || this,
44972                                 attaches = data_priv.access(doc, fix) - 1;
44973
44974                             if (!attaches) {
44975                                 doc.removeEventListener(orig, handler, true);
44976                                 data_priv.remove(doc, fix);
44977
44978                             } else {
44979                                 data_priv.access(doc, fix, attaches);
44980                             }
44981                         }
44982                     };
44983                 });
44984             }
44985
44986             jQuery.fn.extend({
44987
44988                 on: function(types, selector, data, fn, /* INTERNAL */ one) {
44989                     var origFn, type;
44990
44991                     // Types can be a map of types/handlers
44992                     if (typeof types === "object") {
44993                         // ( types-Object, selector, data )
44994                         if (typeof selector !== "string") {
44995                             // ( types-Object, data )
44996                             data = data || selector;
44997                             selector = undefined;
44998                         }
44999                         for (type in types) {
45000                             this.on(type, selector, data, types[type], one);
45001                         }
45002                         return this;
45003                     }
45004
45005                     if (data == null && fn == null) {
45006                         // ( types, fn )
45007                         fn = selector;
45008                         data = selector = undefined;
45009                     } else if (fn == null) {
45010                         if (typeof selector === "string") {
45011                             // ( types, selector, fn )
45012                             fn = data;
45013                             data = undefined;
45014                         } else {
45015                             // ( types, data, fn )
45016                             fn = data;
45017                             data = selector;
45018                             selector = undefined;
45019                         }
45020                     }
45021                     if (fn === false) {
45022                         fn = returnFalse;
45023                     } else if (!fn) {
45024                         return this;
45025                     }
45026
45027                     if (one === 1) {
45028                         origFn = fn;
45029                         fn = function(event) {
45030                             // Can use an empty set, since event contains the info
45031                             jQuery().off(event);
45032                             return origFn.apply(this, arguments);
45033                         };
45034                         // Use same guid so caller can remove using origFn
45035                         fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
45036                     }
45037                     return this.each(function() {
45038                         jQuery.event.add(this, types, fn, data, selector);
45039                     });
45040                 },
45041                 one: function(types, selector, data, fn) {
45042                     return this.on(types, selector, data, fn, 1);
45043                 },
45044                 off: function(types, selector, fn) {
45045                     var handleObj, type;
45046                     if (types && types.preventDefault && types.handleObj) {
45047                         // ( event ) dispatched jQuery.Event
45048                         handleObj = types.handleObj;
45049                         jQuery(types.delegateTarget).off(
45050                             handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
45051                             handleObj.selector,
45052                             handleObj.handler
45053                         );
45054                         return this;
45055                     }
45056                     if (typeof types === "object") {
45057                         // ( types-object [, selector] )
45058                         for (type in types) {
45059                             this.off(type, selector, types[type]);
45060                         }
45061                         return this;
45062                     }
45063                     if (selector === false || typeof selector === "function") {
45064                         // ( types [, fn] )
45065                         fn = selector;
45066                         selector = undefined;
45067                     }
45068                     if (fn === false) {
45069                         fn = returnFalse;
45070                     }
45071                     return this.each(function() {
45072                         jQuery.event.remove(this, types, fn, selector);
45073                     });
45074                 },
45075
45076                 trigger: function(type, data) {
45077                     return this.each(function() {
45078                         jQuery.event.trigger(type, data, this);
45079                     });
45080                 },
45081                 triggerHandler: function(type, data) {
45082                     var elem = this[0];
45083                     if (elem) {
45084                         return jQuery.event.trigger(type, data, elem, true);
45085                     }
45086                 }
45087             });
45088
45089
45090             var
45091                 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
45092                 rtagName = /<([\w:]+)/,
45093                 rhtml = /<|&#?\w+;/,
45094                 rnoInnerhtml = /<(?:script|style|link)/i,
45095                 // checked="checked" or checked
45096                 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
45097                 rscriptType = /^$|\/(?:java|ecma)script/i,
45098                 rscriptTypeMasked = /^true\/(.*)/,
45099                 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
45100
45101                 // We have to close these tags to support XHTML (#13200)
45102                 wrapMap = {
45103
45104                     // Support: IE9
45105                     option: [1, "<select multiple='multiple'>", "</select>"],
45106
45107                     thead: [1, "<table>", "</table>"],
45108                     col: [2, "<table><colgroup>", "</colgroup></table>"],
45109                     tr: [2, "<table><tbody>", "</tbody></table>"],
45110                     td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
45111
45112                     _default: [0, "", ""]
45113                 };
45114
45115             // Support: IE9
45116             wrapMap.optgroup = wrapMap.option;
45117
45118             wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
45119             wrapMap.th = wrapMap.td;
45120
45121             // Support: 1.x compatibility
45122             // Manipulating tables requires a tbody
45123             function manipulationTarget(elem, content) {
45124                 return jQuery.nodeName(elem, "table") &&
45125                     jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ?
45126
45127                     elem.getElementsByTagName("tbody")[0] ||
45128                     elem.appendChild(elem.ownerDocument.createElement("tbody")) :
45129                     elem;
45130             }
45131
45132             // Replace/restore the type attribute of script elements for safe DOM
45133             // manipulation
45134             function disableScript(elem) {
45135                 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
45136                 return elem;
45137             }
45138
45139             function restoreScript(elem) {
45140                 var match = rscriptTypeMasked.exec(elem.type);
45141
45142                 if (match) {
45143                     elem.type = match[1];
45144                 } else {
45145                     elem.removeAttribute("type");
45146                 }
45147
45148                 return elem;
45149             }
45150
45151             // Mark scripts as having already been evaluated
45152             function setGlobalEval(elems, refElements) {
45153                 var i = 0,
45154                     l = elems.length;
45155
45156                 for (; i < l; i++) {
45157                     data_priv.set(
45158                         elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval")
45159                     );
45160                 }
45161             }
45162
45163             function cloneCopyEvent(src, dest) {
45164                 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
45165
45166                 if (dest.nodeType !== 1) {
45167                     return;
45168                 }
45169
45170                 // 1. Copy private data: events, handlers, etc.
45171                 if (data_priv.hasData(src)) {
45172                     pdataOld = data_priv.access(src);
45173                     pdataCur = data_priv.set(dest, pdataOld);
45174                     events = pdataOld.events;
45175
45176                     if (events) {
45177                         delete pdataCur.handle;
45178                         pdataCur.events = {};
45179
45180                         for (type in events) {
45181                             for (i = 0, l = events[type].length; i < l; i++) {
45182                                 jQuery.event.add(dest, type, events[type][i]);
45183                             }
45184                         }
45185                     }
45186                 }
45187
45188                 // 2. Copy user data
45189                 if (data_user.hasData(src)) {
45190                     udataOld = data_user.access(src);
45191                     udataCur = jQuery.extend({}, udataOld);
45192
45193                     data_user.set(dest, udataCur);
45194                 }
45195             }
45196
45197             function getAll(context, tag) {
45198                 var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") :
45199                     context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
45200
45201                 return tag === undefined || tag && jQuery.nodeName(context, tag) ?
45202                     jQuery.merge([context], ret) :
45203                     ret;
45204             }
45205
45206             // Fix IE bugs, see support tests
45207             function fixInput(src, dest) {
45208                 var nodeName = dest.nodeName.toLowerCase();
45209
45210                 // Fails to persist the checked state of a cloned checkbox or radio button.
45211                 if (nodeName === "input" && rcheckableType.test(src.type)) {
45212                     dest.checked = src.checked;
45213
45214                     // Fails to return the selected option to the default selected state when
45215                     // cloning options
45216                 } else if (nodeName === "input" || nodeName === "textarea") {
45217                     dest.defaultValue = src.defaultValue;
45218                 }
45219             }
45220
45221             jQuery.extend({
45222                 clone: function(elem, dataAndEvents, deepDataAndEvents) {
45223                     var i, l, srcElements, destElements,
45224                         clone = elem.cloneNode(true),
45225                         inPage = jQuery.contains(elem.ownerDocument, elem);
45226
45227                     // Fix IE cloning issues
45228                     if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) &&
45229                         !jQuery.isXMLDoc(elem)) {
45230
45231                         // We eschew Sizzle here for performance reasons:
45232                         // http://jsperf.com/getall-vs-sizzle/2
45233                         destElements = getAll(clone);
45234                         srcElements = getAll(elem);
45235
45236                         for (i = 0, l = srcElements.length; i < l; i++) {
45237                             fixInput(srcElements[i], destElements[i]);
45238                         }
45239                     }
45240
45241                     // Copy the events from the original to the clone
45242                     if (dataAndEvents) {
45243                         if (deepDataAndEvents) {
45244                             srcElements = srcElements || getAll(elem);
45245                             destElements = destElements || getAll(clone);
45246
45247                             for (i = 0, l = srcElements.length; i < l; i++) {
45248                                 cloneCopyEvent(srcElements[i], destElements[i]);
45249                             }
45250                         } else {
45251                             cloneCopyEvent(elem, clone);
45252                         }
45253                     }
45254
45255                     // Preserve script evaluation history
45256                     destElements = getAll(clone, "script");
45257                     if (destElements.length > 0) {
45258                         setGlobalEval(destElements, !inPage && getAll(elem, "script"));
45259                     }
45260
45261                     // Return the cloned set
45262                     return clone;
45263                 },
45264
45265                 buildFragment: function(elems, context, scripts, selection) {
45266                     var elem, tmp, tag, wrap, contains, j,
45267                         fragment = context.createDocumentFragment(),
45268                         nodes = [],
45269                         i = 0,
45270                         l = elems.length;
45271
45272                     for (; i < l; i++) {
45273                         elem = elems[i];
45274
45275                         if (elem || elem === 0) {
45276
45277                             // Add nodes directly
45278                             if (jQuery.type(elem) === "object") {
45279                                 // Support: QtWebKit, PhantomJS
45280                                 // push.apply(_, arraylike) throws on ancient WebKit
45281                                 jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
45282
45283                                 // Convert non-html into a text node
45284                             } else if (!rhtml.test(elem)) {
45285                                 nodes.push(context.createTextNode(elem));
45286
45287                                 // Convert html into DOM nodes
45288                             } else {
45289                                 tmp = tmp || fragment.appendChild(context.createElement("div"));
45290
45291                                 // Deserialize a standard representation
45292                                 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
45293                                 wrap = wrapMap[tag] || wrapMap._default;
45294                                 tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
45295
45296                                 // Descend through wrappers to the right content
45297                                 j = wrap[0];
45298                                 while (j--) {
45299                                     tmp = tmp.lastChild;
45300                                 }
45301
45302                                 // Support: QtWebKit, PhantomJS
45303                                 // push.apply(_, arraylike) throws on ancient WebKit
45304                                 jQuery.merge(nodes, tmp.childNodes);
45305
45306                                 // Remember the top-level container
45307                                 tmp = fragment.firstChild;
45308
45309                                 // Ensure the created nodes are orphaned (#12392)
45310                                 tmp.textContent = "";
45311                             }
45312                         }
45313                     }
45314
45315                     // Remove wrapper from fragment
45316                     fragment.textContent = "";
45317
45318                     i = 0;
45319                     while ((elem = nodes[i++])) {
45320
45321                         // #4087 - If origin and destination elements are the same, and this
45322                         // is
45323                         // that element, do not do anything
45324                         if (selection && jQuery.inArray(elem, selection) !== -1) {
45325                             continue;
45326                         }
45327
45328                         contains = jQuery.contains(elem.ownerDocument, elem);
45329
45330                         // Append to fragment
45331                         tmp = getAll(fragment.appendChild(elem), "script");
45332
45333                         // Preserve script evaluation history
45334                         if (contains) {
45335                             setGlobalEval(tmp);
45336                         }
45337
45338                         // Capture executables
45339                         if (scripts) {
45340                             j = 0;
45341                             while ((elem = tmp[j++])) {
45342                                 if (rscriptType.test(elem.type || "")) {
45343                                     scripts.push(elem);
45344                                 }
45345                             }
45346                         }
45347                     }
45348
45349                     return fragment;
45350                 },
45351
45352                 cleanData: function(elems) {
45353                     var data, elem, type, key,
45354                         special = jQuery.event.special,
45355                         i = 0;
45356
45357                     for (;
45358                         (elem = elems[i]) !== undefined; i++) {
45359                         if (jQuery.acceptData(elem)) {
45360                             key = elem[data_priv.expando];
45361
45362                             if (key && (data = data_priv.cache[key])) {
45363                                 if (data.events) {
45364                                     for (type in data.events) {
45365                                         if (special[type]) {
45366                                             jQuery.event.remove(elem, type);
45367
45368                                             // This is a shortcut to avoid jQuery.event.remove's
45369                                             // overhead
45370                                         } else {
45371                                             jQuery.removeEvent(elem, type, data.handle);
45372                                         }
45373                                     }
45374                                 }
45375                                 if (data_priv.cache[key]) {
45376                                     // Discard any remaining `private` data
45377                                     delete data_priv.cache[key];
45378                                 }
45379                             }
45380                         }
45381                         // Discard any remaining `user` data
45382                         delete data_user.cache[elem[data_user.expando]];
45383                     }
45384                 }
45385             });
45386
45387             jQuery.fn.extend({
45388                 text: function(value) {
45389                     return access(this, function(value) {
45390                         return value === undefined ?
45391                             jQuery.text(this) :
45392                             this.empty().each(function() {
45393                                 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45394                                     this.textContent = value;
45395                                 }
45396                             });
45397                     }, null, value, arguments.length);
45398                 },
45399
45400                 append: function() {
45401                     return this.domManip(arguments, function(elem) {
45402                         if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45403                             var target = manipulationTarget(this, elem);
45404                             target.appendChild(elem);
45405                         }
45406                     });
45407                 },
45408
45409                 prepend: function() {
45410                     return this.domManip(arguments, function(elem) {
45411                         if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45412                             var target = manipulationTarget(this, elem);
45413                             target.insertBefore(elem, target.firstChild);
45414                         }
45415                     });
45416                 },
45417
45418                 before: function() {
45419                     return this.domManip(arguments, function(elem) {
45420                         if (this.parentNode) {
45421                             this.parentNode.insertBefore(elem, this);
45422                         }
45423                     });
45424                 },
45425
45426                 after: function() {
45427                     return this.domManip(arguments, function(elem) {
45428                         if (this.parentNode) {
45429                             this.parentNode.insertBefore(elem, this.nextSibling);
45430                         }
45431                     });
45432                 },
45433
45434                 remove: function(selector, keepData /* Internal Use Only */ ) {
45435                     var elem,
45436                         elems = selector ? jQuery.filter(selector, this) : this,
45437                         i = 0;
45438
45439                     for (;
45440                         (elem = elems[i]) != null; i++) {
45441                         if (!keepData && elem.nodeType === 1) {
45442                             jQuery.cleanData(getAll(elem));
45443                         }
45444
45445                         if (elem.parentNode) {
45446                             if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
45447                                 setGlobalEval(getAll(elem, "script"));
45448                             }
45449                             elem.parentNode.removeChild(elem);
45450                         }
45451                     }
45452
45453                     return this;
45454                 },
45455
45456                 empty: function() {
45457                     var elem,
45458                         i = 0;
45459
45460                     for (;
45461                         (elem = this[i]) != null; i++) {
45462                         if (elem.nodeType === 1) {
45463
45464                             // Prevent memory leaks
45465                             jQuery.cleanData(getAll(elem, false));
45466
45467                             // Remove any remaining nodes
45468                             elem.textContent = "";
45469                         }
45470                     }
45471
45472                     return this;
45473                 },
45474
45475                 clone: function(dataAndEvents, deepDataAndEvents) {
45476                     dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
45477                     deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
45478
45479                     return this.map(function() {
45480                         return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
45481                     });
45482                 },
45483
45484                 html: function(value) {
45485                     return access(this, function(value) {
45486                         var elem = this[0] || {},
45487                             i = 0,
45488                             l = this.length;
45489
45490                         if (value === undefined && elem.nodeType === 1) {
45491                             return elem.innerHTML;
45492                         }
45493
45494                         // See if we can take a shortcut and just use innerHTML
45495                         if (typeof value === "string" && !rnoInnerhtml.test(value) &&
45496                             !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
45497
45498                             value = value.replace(rxhtmlTag, "<$1></$2>");
45499
45500                             try {
45501                                 for (; i < l; i++) {
45502                                     elem = this[i] || {};
45503
45504                                     // Remove element nodes and prevent memory leaks
45505                                     if (elem.nodeType === 1) {
45506                                         jQuery.cleanData(getAll(elem, false));
45507                                         elem.innerHTML = value;
45508                                     }
45509                                 }
45510
45511                                 elem = 0;
45512
45513                                 // If using innerHTML throws an exception, use the fallback
45514                                 // method
45515                             } catch (e) {}
45516                         }
45517
45518                         if (elem) {
45519                             this.empty().append(value);
45520                         }
45521                     }, null, value, arguments.length);
45522                 },
45523
45524                 replaceWith: function() {
45525                     var arg = arguments[0];
45526
45527                     // Make the changes, replacing each context element with the new content
45528                     this.domManip(arguments, function(elem) {
45529                         arg = this.parentNode;
45530
45531                         jQuery.cleanData(getAll(this));
45532
45533                         if (arg) {
45534                             arg.replaceChild(elem, this);
45535                         }
45536                     });
45537
45538                     // Force removal if there was no new content (e.g., from empty
45539                     // arguments)
45540                     return arg && (arg.length || arg.nodeType) ? this : this.remove();
45541                 },
45542
45543                 detach: function(selector) {
45544                     return this.remove(selector, true);
45545                 },
45546
45547                 domManip: function(args, callback) {
45548
45549                     // Flatten any nested arrays
45550                     args = concat.apply([], args);
45551
45552                     var fragment, first, scripts, hasScripts, node, doc,
45553                         i = 0,
45554                         l = this.length,
45555                         set = this,
45556                         iNoClone = l - 1,
45557                         value = args[0],
45558                         isFunction = jQuery.isFunction(value);
45559
45560                     // We can't cloneNode fragments that contain checked, in WebKit
45561                     if (isFunction ||
45562                         (l > 1 && typeof value === "string" &&
45563                             !support.checkClone && rchecked.test(value))) {
45564                         return this.each(function(index) {
45565                             var self = set.eq(index);
45566                             if (isFunction) {
45567                                 args[0] = value.call(this, index, self.html());
45568                             }
45569                             self.domManip(args, callback);
45570                         });
45571                     }
45572
45573                     if (l) {
45574                         fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
45575                         first = fragment.firstChild;
45576
45577                         if (fragment.childNodes.length === 1) {
45578                             fragment = first;
45579                         }
45580
45581                         if (first) {
45582                             scripts = jQuery.map(getAll(fragment, "script"), disableScript);
45583                             hasScripts = scripts.length;
45584
45585                             // Use the original fragment for the last item instead of the
45586                             // first because it can end up
45587                             // being emptied incorrectly in certain situations (#8070).
45588                             for (; i < l; i++) {
45589                                 node = fragment;
45590
45591                                 if (i !== iNoClone) {
45592                                     node = jQuery.clone(node, true, true);
45593
45594                                     // Keep references to cloned scripts for later
45595                                     // restoration
45596                                     if (hasScripts) {
45597                                         // Support: QtWebKit
45598                                         // jQuery.merge because push.apply(_, arraylike)
45599                                         // throws
45600                                         jQuery.merge(scripts, getAll(node, "script"));
45601                                     }
45602                                 }
45603
45604                                 callback.call(this[i], node, i);
45605                             }
45606
45607                             if (hasScripts) {
45608                                 doc = scripts[scripts.length - 1].ownerDocument;
45609
45610                                 // Reenable scripts
45611                                 jQuery.map(scripts, restoreScript);
45612
45613                                 // Evaluate executable scripts on first document insertion
45614                                 for (i = 0; i < hasScripts; i++) {
45615                                     node = scripts[i];
45616                                     if (rscriptType.test(node.type || "") &&
45617                                         !data_priv.access(node, "globalEval") && jQuery.contains(doc, node)) {
45618
45619                                         if (node.src) {
45620                                             // Optional AJAX dependency, but won't run
45621                                             // scripts if not present
45622                                             if (jQuery._evalUrl) {
45623                                                 jQuery._evalUrl(node.src);
45624                                             }
45625                                         } else {
45626                                             jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
45627                                         }
45628                                     }
45629                                 }
45630                             }
45631                         }
45632                     }
45633
45634                     return this;
45635                 }
45636             });
45637
45638             jQuery.each({
45639                 appendTo: "append",
45640                 prependTo: "prepend",
45641                 insertBefore: "before",
45642                 insertAfter: "after",
45643                 replaceAll: "replaceWith"
45644             }, function(name, original) {
45645                 jQuery.fn[name] = function(selector) {
45646                     var elems,
45647                         ret = [],
45648                         insert = jQuery(selector),
45649                         last = insert.length - 1,
45650                         i = 0;
45651
45652                     for (; i <= last; i++) {
45653                         elems = i === last ? this : this.clone(true);
45654                         jQuery(insert[i])[original](elems);
45655
45656                         // Support: QtWebKit
45657                         // .get() because push.apply(_, arraylike) throws
45658                         push.apply(ret, elems.get());
45659                     }
45660
45661                     return this.pushStack(ret);
45662                 };
45663             });
45664
45665
45666             var iframe,
45667                 elemdisplay = {};
45668
45669             /**
45670              * Retrieve the actual display of a element
45671              * 
45672              * @param {String}
45673              *            name nodeName of the element
45674              * @param {Object}
45675              *            doc Document object
45676              */
45677             // Called only from within defaultDisplay
45678             function actualDisplay(name, doc) {
45679                 var style,
45680                     elem = jQuery(doc.createElement(name)).appendTo(doc.body),
45681
45682                     // getDefaultComputedStyle might be reliably used only on attached
45683                     // element
45684                     display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ?
45685
45686                     // Use of this method is a temporary fix (more like optimization)
45687                     // until something better comes along,
45688                     // since it was removed from specification and supported only in FF
45689                     style.display : jQuery.css(elem[0], "display");
45690
45691                 // We don't have any data stored on the element,
45692                 // so use "detach" method as fast way to get rid of the element
45693                 elem.detach();
45694
45695                 return display;
45696             }
45697
45698             /**
45699              * Try to determine the default display value of an element
45700              * 
45701              * @param {String}
45702              *            nodeName
45703              */
45704             function defaultDisplay(nodeName) {
45705                 var doc = document,
45706                     display = elemdisplay[nodeName];
45707
45708                 if (!display) {
45709                     display = actualDisplay(nodeName, doc);
45710
45711                     // If the simple way fails, read from inside an iframe
45712                     if (display === "none" || !display) {
45713
45714                         // Use the already-created iframe if possible
45715                         iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);
45716
45717                         // Always write a new HTML skeleton so Webkit and Firefox don't
45718                         // choke on reuse
45719                         doc = iframe[0].contentDocument;
45720
45721                         // Support: IE
45722                         doc.write();
45723                         doc.close();
45724
45725                         display = actualDisplay(nodeName, doc);
45726                         iframe.detach();
45727                     }
45728
45729                     // Store the correct default display
45730                     elemdisplay[nodeName] = display;
45731                 }
45732
45733                 return display;
45734             }
45735             var rmargin = (/^margin/);
45736
45737             var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
45738
45739             var getStyles = function(elem) {
45740                 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
45741                 // IE throws on elements created in popups
45742                 // FF meanwhile throws on frame elements through
45743                 // "defaultView.getComputedStyle"
45744                 if (elem.ownerDocument.defaultView.opener) {
45745                     return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
45746                 }
45747
45748                 return window.getComputedStyle(elem, null);
45749             };
45750
45751
45752
45753             function curCSS(elem, name, computed) {
45754                 var width, minWidth, maxWidth, ret,
45755                     style = elem.style;
45756
45757                 computed = computed || getStyles(elem);
45758
45759                 // Support: IE9
45760                 // getPropertyValue is only needed for .css('filter') (#12537)
45761                 if (computed) {
45762                     ret = computed.getPropertyValue(name) || computed[name];
45763                 }
45764
45765                 if (computed) {
45766
45767                     if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
45768                         ret = jQuery.style(elem, name);
45769                     }
45770
45771                     // Support: iOS < 6
45772                     // A tribute to the "awesome hack by Dean Edwards"
45773                     // iOS < 6 (at least) returns percentage for a larger set of values, but
45774                     // width seems to be reliably pixels
45775                     // this is against the CSSOM draft spec:
45776                     // http://dev.w3.org/csswg/cssom/#resolved-values
45777                     if (rnumnonpx.test(ret) && rmargin.test(name)) {
45778
45779                         // Remember the original values
45780                         width = style.width;
45781                         minWidth = style.minWidth;
45782                         maxWidth = style.maxWidth;
45783
45784                         // Put in the new values to get a computed value out
45785                         style.minWidth = style.maxWidth = style.width = ret;
45786                         ret = computed.width;
45787
45788                         // Revert the changed values
45789                         style.width = width;
45790                         style.minWidth = minWidth;
45791                         style.maxWidth = maxWidth;
45792                     }
45793                 }
45794
45795                 return ret !== undefined ?
45796                     // Support: IE
45797                     // IE returns zIndex value as an integer.
45798                     ret + "" :
45799                     ret;
45800             }
45801
45802
45803             function addGetHookIf(conditionFn, hookFn) {
45804                 // Define the hook, we'll check on the first run if it's really needed.
45805                 return {
45806                     get: function() {
45807                         if (conditionFn()) {
45808                             // Hook not needed (or it's not possible to use it due
45809                             // to missing dependency), remove it.
45810                             delete this.get;
45811                             return;
45812                         }
45813
45814                         // Hook needed; redefine it so that the support test is not executed
45815                         // again.
45816                         return (this.get = hookFn).apply(this, arguments);
45817                     }
45818                 };
45819             }
45820
45821
45822             (function() {
45823                 var pixelPositionVal, boxSizingReliableVal,
45824                     docElem = document.documentElement,
45825                     container = document.createElement("div"),
45826                     div = document.createElement("div");
45827
45828                 if (!div.style) {
45829                     return;
45830                 }
45831
45832                 // Support: IE9-11+
45833                 // Style of cloned element affects source element cloned (#8908)
45834                 div.style.backgroundClip = "content-box";
45835                 div.cloneNode(true).style.backgroundClip = "";
45836                 support.clearCloneStyle = div.style.backgroundClip === "content-box";
45837
45838                 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
45839                     "position:absolute";
45840                 container.appendChild(div);
45841
45842                 // Executing both pixelPosition & boxSizingReliable tests require only one
45843                 // layout
45844                 // so they're executed at the same time to save the second computation.
45845                 function computePixelPositionAndBoxSizingReliable() {
45846                     div.style.cssText =
45847                         // Support: Firefox<29, Android 2.3
45848                         // Vendor-prefix box-sizing
45849                         "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
45850                         "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
45851                         "border:1px;padding:1px;width:4px;position:absolute";
45852                     div.innerHTML = "";
45853                     docElem.appendChild(container);
45854
45855                     var divStyle = window.getComputedStyle(div, null);
45856                     pixelPositionVal = divStyle.top !== "1%";
45857                     boxSizingReliableVal = divStyle.width === "4px";
45858
45859                     docElem.removeChild(container);
45860                 }
45861
45862                 // Support: node.js jsdom
45863                 // Don't assume that getComputedStyle is a property of the global object
45864                 if (window.getComputedStyle) {
45865                     jQuery.extend(support, {
45866                         pixelPosition: function() {
45867
45868                             // This test is executed only once but we still do memoizing
45869                             // since we can use the boxSizingReliable pre-computing.
45870                             // No need to check if the test was already performed, though.
45871                             computePixelPositionAndBoxSizingReliable();
45872                             return pixelPositionVal;
45873                         },
45874                         boxSizingReliable: function() {
45875                             if (boxSizingReliableVal == null) {
45876                                 computePixelPositionAndBoxSizingReliable();
45877                             }
45878                             return boxSizingReliableVal;
45879                         },
45880                         reliableMarginRight: function() {
45881
45882                             // Support: Android 2.3
45883                             // Check if div with explicit width and no margin-right
45884                             // incorrectly
45885                             // gets computed margin-right based on width of container.
45886                             // (#3333)
45887                             // WebKit Bug 13343 - getComputedStyle returns wrong value for
45888                             // margin-right
45889                             // This support function is only executed once so no memoizing
45890                             // is needed.
45891                             var ret,
45892                                 marginDiv = div.appendChild(document.createElement("div"));
45893
45894                             // Reset CSS: box-sizing; display; margin; border; padding
45895                             marginDiv.style.cssText = div.style.cssText =
45896                                 // Support: Firefox<29, Android 2.3
45897                                 // Vendor-prefix box-sizing
45898                                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
45899                                 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
45900                             marginDiv.style.marginRight = marginDiv.style.width = "0";
45901                             div.style.width = "1px";
45902                             docElem.appendChild(container);
45903
45904                             ret = !parseFloat(window.getComputedStyle(marginDiv, null).marginRight);
45905
45906                             docElem.removeChild(container);
45907                             div.removeChild(marginDiv);
45908
45909                             return ret;
45910                         }
45911                     });
45912                 }
45913             })();
45914
45915
45916             // A method for quickly swapping in/out CSS properties to get correct
45917             // calculations.
45918             jQuery.swap = function(elem, options, callback, args) {
45919                 var ret, name,
45920                     old = {};
45921
45922                 // Remember the old values, and insert the new ones
45923                 for (name in options) {
45924                     old[name] = elem.style[name];
45925                     elem.style[name] = options[name];
45926                 }
45927
45928                 ret = callback.apply(elem, args || []);
45929
45930                 // Revert the old values
45931                 for (name in options) {
45932                     elem.style[name] = old[name];
45933                 }
45934
45935                 return ret;
45936             };
45937
45938
45939             var
45940             // Swappable if display is none or starts with table except "table",
45941             // "table-cell", or "table-caption"
45942             // See here for display values:
45943             // https://developer.mozilla.org/en-US/docs/CSS/display
45944                 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
45945                 rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"),
45946                 rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"),
45947
45948                 cssShow = {
45949                     position: "absolute",
45950                     visibility: "hidden",
45951                     display: "block"
45952                 },
45953                 cssNormalTransform = {
45954                     letterSpacing: "0",
45955                     fontWeight: "400"
45956                 },
45957
45958                 cssPrefixes = ["Webkit", "O", "Moz", "ms"];
45959
45960             // Return a css property mapped to a potentially vendor prefixed property
45961             function vendorPropName(style, name) {
45962
45963                 // Shortcut for names that are not vendor prefixed
45964                 if (name in style) {
45965                     return name;
45966                 }
45967
45968                 // Check for vendor prefixed names
45969                 var capName = name[0].toUpperCase() + name.slice(1),
45970                     origName = name,
45971                     i = cssPrefixes.length;
45972
45973                 while (i--) {
45974                     name = cssPrefixes[i] + capName;
45975                     if (name in style) {
45976                         return name;
45977                     }
45978                 }
45979
45980                 return origName;
45981             }
45982
45983             function setPositiveNumber(elem, value, subtract) {
45984                 var matches = rnumsplit.exec(value);
45985                 return matches ?
45986                     // Guard against undefined "subtract", e.g., when used as in cssHooks
45987                     Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") :
45988                     value;
45989             }
45990
45991             function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
45992                 var i = extra === (isBorderBox ? "border" : "content") ?
45993                     // If we already have the right measurement, avoid augmentation
45994                     4 :
45995                     // Otherwise initialize for horizontal or vertical properties
45996                     name === "width" ? 1 : 0,
45997
45998                     val = 0;
45999
46000                 for (; i < 4; i += 2) {
46001                     // Both box models exclude margin, so add it if we want it
46002                     if (extra === "margin") {
46003                         val += jQuery.css(elem, extra + cssExpand[i], true, styles);
46004                     }
46005
46006                     if (isBorderBox) {
46007                         // border-box includes padding, so remove it if we want content
46008                         if (extra === "content") {
46009                             val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
46010                         }
46011
46012                         // At this point, extra isn't border nor margin, so remove border
46013                         if (extra !== "margin") {
46014                             val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
46015                         }
46016                     } else {
46017                         // At this point, extra isn't content, so add padding
46018                         val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
46019
46020                         // At this point, extra isn't content nor padding, so add border
46021                         if (extra !== "padding") {
46022                             val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
46023                         }
46024                     }
46025                 }
46026
46027                 return val;
46028             }
46029
46030             function getWidthOrHeight(elem, name, extra) {
46031
46032                 // Start with offset property, which is equivalent to the border-box value
46033                 var valueIsBorderBox = true,
46034                     val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
46035                     styles = getStyles(elem),
46036                     isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
46037
46038                 // Some non-html elements return undefined for offsetWidth, so check for
46039                 // null/undefined
46040                 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
46041                 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
46042                 if (val <= 0 || val == null) {
46043                     // Fall back to computed then uncomputed css if necessary
46044                     val = curCSS(elem, name, styles);
46045                     if (val < 0 || val == null) {
46046                         val = elem.style[name];
46047                     }
46048
46049                     // Computed unit is not pixels. Stop here and return.
46050                     if (rnumnonpx.test(val)) {
46051                         return val;
46052                     }
46053
46054                     // Check for style in case a browser which returns unreliable values
46055                     // for getComputedStyle silently falls back to the reliable elem.style
46056                     valueIsBorderBox = isBorderBox &&
46057                         (support.boxSizingReliable() || val === elem.style[name]);
46058
46059                     // Normalize "", auto, and prepare for extra
46060                     val = parseFloat(val) || 0;
46061                 }
46062
46063                 // Use the active box-sizing model to add/subtract irrelevant styles
46064                 return (val +
46065                     augmentWidthOrHeight(
46066                         elem,
46067                         name,
46068                         extra || (isBorderBox ? "border" : "content"),
46069                         valueIsBorderBox,
46070                         styles
46071                     )
46072                 ) + "px";
46073             }
46074
46075             function showHide(elements, show) {
46076                 var display, elem, hidden,
46077                     values = [],
46078                     index = 0,
46079                     length = elements.length;
46080
46081                 for (; index < length; index++) {
46082                     elem = elements[index];
46083                     if (!elem.style) {
46084                         continue;
46085                     }
46086
46087                     values[index] = data_priv.get(elem, "olddisplay");
46088                     display = elem.style.display;
46089                     if (show) {
46090                         // Reset the inline display of this element to learn if it is
46091                         // being hidden by cascaded rules or not
46092                         if (!values[index] && display === "none") {
46093                             elem.style.display = "";
46094                         }
46095
46096                         // Set elements which have been overridden with display: none
46097                         // in a stylesheet to whatever the default browser style is
46098                         // for such an element
46099                         if (elem.style.display === "" && isHidden(elem)) {
46100                             values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
46101                         }
46102                     } else {
46103                         hidden = isHidden(elem);
46104
46105                         if (display !== "none" || !hidden) {
46106                             data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
46107                         }
46108                     }
46109                 }
46110
46111                 // Set the display of most of the elements in a second loop
46112                 // to avoid the constant reflow
46113                 for (index = 0; index < length; index++) {
46114                     elem = elements[index];
46115                     if (!elem.style) {
46116                         continue;
46117                     }
46118                     if (!show || elem.style.display === "none" || elem.style.display === "") {
46119                         elem.style.display = show ? values[index] || "" : "none";
46120                     }
46121                 }
46122
46123                 return elements;
46124             }
46125
46126             jQuery.extend({
46127
46128                 // Add in style property hooks for overriding the default
46129                 // behavior of getting and setting a style property
46130                 cssHooks: {
46131                     opacity: {
46132                         get: function(elem, computed) {
46133                             if (computed) {
46134
46135                                 // We should always get a number back from opacity
46136                                 var ret = curCSS(elem, "opacity");
46137                                 return ret === "" ? "1" : ret;
46138                             }
46139                         }
46140                     }
46141                 },
46142
46143                 // Don't automatically add "px" to these possibly-unitless properties
46144                 cssNumber: {
46145                     "columnCount": true,
46146                     "fillOpacity": true,
46147                     "flexGrow": true,
46148                     "flexShrink": true,
46149                     "fontWeight": true,
46150                     "lineHeight": true,
46151                     "opacity": true,
46152                     "order": true,
46153                     "orphans": true,
46154                     "widows": true,
46155                     "zIndex": true,
46156                     "zoom": true
46157                 },
46158
46159                 // Add in properties whose names you wish to fix before
46160                 // setting or getting the value
46161                 cssProps: {
46162                     "float": "cssFloat"
46163                 },
46164
46165                 // Get and set the style property on a DOM Node
46166                 style: function(elem, name, value, extra) {
46167
46168                     // Don't set styles on text and comment nodes
46169                     if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
46170                         return;
46171                     }
46172
46173                     // Make sure that we're working with the right name
46174                     var ret, type, hooks,
46175                         origName = jQuery.camelCase(name),
46176                         style = elem.style;
46177
46178                     name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
46179
46180                     // Gets hook for the prefixed version, then unprefixed version
46181                     hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46182
46183                     // Check if we're setting a value
46184                     if (value !== undefined) {
46185                         type = typeof value;
46186
46187                         // Convert "+=" or "-=" to relative numbers (#7345)
46188                         if (type === "string" && (ret = rrelNum.exec(value))) {
46189                             value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
46190                             // Fixes bug #9237
46191                             type = "number";
46192                         }
46193
46194                         // Make sure that null and NaN values aren't set (#7116)
46195                         if (value == null || value !== value) {
46196                             return;
46197                         }
46198
46199                         // If a number, add 'px' to the (except for certain CSS properties)
46200                         if (type === "number" && !jQuery.cssNumber[origName]) {
46201                             value += "px";
46202                         }
46203
46204                         // Support: IE9-11+
46205                         // background-* props affect original clone's values
46206                         if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
46207                             style[name] = "inherit";
46208                         }
46209
46210                         // If a hook was provided, use that value, otherwise just set the
46211                         // specified value
46212                         if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
46213                             style[name] = value;
46214                         }
46215
46216                     } else {
46217                         // If a hook was provided get the non-computed value from there
46218                         if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
46219                             return ret;
46220                         }
46221
46222                         // Otherwise just get the value from the style object
46223                         return style[name];
46224                     }
46225                 },
46226
46227                 css: function(elem, name, extra, styles) {
46228                     var val, num, hooks,
46229                         origName = jQuery.camelCase(name);
46230
46231                     // Make sure that we're working with the right name
46232                     name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
46233
46234                     // Try prefixed name followed by the unprefixed name
46235                     hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46236
46237                     // If a hook was provided get the computed value from there
46238                     if (hooks && "get" in hooks) {
46239                         val = hooks.get(elem, true, extra);
46240                     }
46241
46242                     // Otherwise, if a way to get the computed value exists, use that
46243                     if (val === undefined) {
46244                         val = curCSS(elem, name, styles);
46245                     }
46246
46247                     // Convert "normal" to computed value
46248                     if (val === "normal" && name in cssNormalTransform) {
46249                         val = cssNormalTransform[name];
46250                     }
46251
46252                     // Make numeric if forced or a qualifier was provided and val looks
46253                     // numeric
46254                     if (extra === "" || extra) {
46255                         num = parseFloat(val);
46256                         return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
46257                     }
46258                     return val;
46259                 }
46260             });
46261
46262             jQuery.each(["height", "width"], function(i, name) {
46263                 jQuery.cssHooks[name] = {
46264                     get: function(elem, computed, extra) {
46265                         if (computed) {
46266
46267                             // Certain elements can have dimension info if we invisibly show
46268                             // them
46269                             // but it must have a current display style that would benefit
46270                             return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ?
46271                                 jQuery.swap(elem, cssShow, function() {
46272                                     return getWidthOrHeight(elem, name, extra);
46273                                 }) :
46274                                 getWidthOrHeight(elem, name, extra);
46275                         }
46276                     },
46277
46278                     set: function(elem, value, extra) {
46279                         var styles = extra && getStyles(elem);
46280                         return setPositiveNumber(elem, value, extra ?
46281                             augmentWidthOrHeight(
46282                                 elem,
46283                                 name,
46284                                 extra,
46285                                 jQuery.css(elem, "boxSizing", false, styles) === "border-box",
46286                                 styles
46287                             ) : 0
46288                         );
46289                     }
46290                 };
46291             });
46292
46293             // Support: Android 2.3
46294             jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight,
46295                 function(elem, computed) {
46296                     if (computed) {
46297                         return jQuery.swap(elem, {
46298                                 "display": "inline-block"
46299                             },
46300                             curCSS, [elem, "marginRight"]);
46301                     }
46302                 }
46303             );
46304
46305             // These hooks are used by animate to expand properties
46306             jQuery.each({
46307                 margin: "",
46308                 padding: "",
46309                 border: "Width"
46310             }, function(prefix, suffix) {
46311                 jQuery.cssHooks[prefix + suffix] = {
46312                     expand: function(value) {
46313                         var i = 0,
46314                             expanded = {},
46315
46316                             // Assumes a single number if not a string
46317                             parts = typeof value === "string" ? value.split(" ") : [value];
46318
46319                         for (; i < 4; i++) {
46320                             expanded[prefix + cssExpand[i] + suffix] =
46321                                 parts[i] || parts[i - 2] || parts[0];
46322                         }
46323
46324                         return expanded;
46325                     }
46326                 };
46327
46328                 if (!rmargin.test(prefix)) {
46329                     jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
46330                 }
46331             });
46332
46333             jQuery.fn.extend({
46334                 css: function(name, value) {
46335                     return access(this, function(elem, name, value) {
46336                         var styles, len,
46337                             map = {},
46338                             i = 0;
46339
46340                         if (jQuery.isArray(name)) {
46341                             styles = getStyles(elem);
46342                             len = name.length;
46343
46344                             for (; i < len; i++) {
46345                                 map[name[i]] = jQuery.css(elem, name[i], false, styles);
46346                             }
46347
46348                             return map;
46349                         }
46350
46351                         return value !== undefined ?
46352                             jQuery.style(elem, name, value) :
46353                             jQuery.css(elem, name);
46354                     }, name, value, arguments.length > 1);
46355                 },
46356                 show: function() {
46357                     return showHide(this, true);
46358                 },
46359                 hide: function() {
46360                     return showHide(this);
46361                 },
46362                 toggle: function(state) {
46363                     if (typeof state === "boolean") {
46364                         return state ? this.show() : this.hide();
46365                     }
46366
46367                     return this.each(function() {
46368                         if (isHidden(this)) {
46369                             jQuery(this).show();
46370                         } else {
46371                             jQuery(this).hide();
46372                         }
46373                     });
46374                 }
46375             });
46376
46377
46378             function Tween(elem, options, prop, end, easing) {
46379                 return new Tween.prototype.init(elem, options, prop, end, easing);
46380             }
46381             jQuery.Tween = Tween;
46382
46383             Tween.prototype = {
46384                 constructor: Tween,
46385                 init: function(elem, options, prop, end, easing, unit) {
46386                     this.elem = elem;
46387                     this.prop = prop;
46388                     this.easing = easing || "swing";
46389                     this.options = options;
46390                     this.start = this.now = this.cur();
46391                     this.end = end;
46392                     this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
46393                 },
46394                 cur: function() {
46395                     var hooks = Tween.propHooks[this.prop];
46396
46397                     return hooks && hooks.get ?
46398                         hooks.get(this) :
46399                         Tween.propHooks._default.get(this);
46400                 },
46401                 run: function(percent) {
46402                     var eased,
46403                         hooks = Tween.propHooks[this.prop];
46404
46405                     if (this.options.duration) {
46406                         this.pos = eased = jQuery.easing[this.easing](
46407                             percent, this.options.duration * percent, 0, 1, this.options.duration
46408                         );
46409                     } else {
46410                         this.pos = eased = percent;
46411                     }
46412                     this.now = (this.end - this.start) * eased + this.start;
46413
46414                     if (this.options.step) {
46415                         this.options.step.call(this.elem, this.now, this);
46416                     }
46417
46418                     if (hooks && hooks.set) {
46419                         hooks.set(this);
46420                     } else {
46421                         Tween.propHooks._default.set(this);
46422                     }
46423                     return this;
46424                 }
46425             };
46426
46427             Tween.prototype.init.prototype = Tween.prototype;
46428
46429             Tween.propHooks = {
46430                 _default: {
46431                     get: function(tween) {
46432                         var result;
46433
46434                         if (tween.elem[tween.prop] != null &&
46435                             (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
46436                             return tween.elem[tween.prop];
46437                         }
46438
46439                         // Passing an empty string as a 3rd parameter to .css will
46440                         // automatically
46441                         // attempt a parseFloat and fallback to a string if the parse fails.
46442                         // Simple values such as "10px" are parsed to Float;
46443                         // complex values such as "rotate(1rad)" are returned as-is.
46444                         result = jQuery.css(tween.elem, tween.prop, "");
46445                         // Empty strings, null, undefined and "auto" are converted to 0.
46446                         return !result || result === "auto" ? 0 : result;
46447                     },
46448                     set: function(tween) {
46449                         // Use step hook for back compat.
46450                         // Use cssHook if its there.
46451                         // Use .style if available and use plain properties where available.
46452                         if (jQuery.fx.step[tween.prop]) {
46453                             jQuery.fx.step[tween.prop](tween);
46454                         } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
46455                             jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
46456                         } else {
46457                             tween.elem[tween.prop] = tween.now;
46458                         }
46459                     }
46460                 }
46461             };
46462
46463             // Support: IE9
46464             // Panic based approach to setting things on disconnected nodes
46465             Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
46466                 set: function(tween) {
46467                     if (tween.elem.nodeType && tween.elem.parentNode) {
46468                         tween.elem[tween.prop] = tween.now;
46469                     }
46470                 }
46471             };
46472
46473             jQuery.easing = {
46474                 linear: function(p) {
46475                     return p;
46476                 },
46477                 swing: function(p) {
46478                     return 0.5 - Math.cos(p * Math.PI) / 2;
46479                 }
46480             };
46481
46482             jQuery.fx = Tween.prototype.init;
46483
46484             // Back Compat <1.8 extension point
46485             jQuery.fx.step = {};
46486
46487
46488
46489
46490             var
46491                 fxNow, timerId,
46492                 rfxtypes = /^(?:toggle|show|hide)$/,
46493                 rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"),
46494                 rrun = /queueHooks$/,
46495                 animationPrefilters = [defaultPrefilter],
46496                 tweeners = {
46497                     "*": [function(prop, value) {
46498                         var tween = this.createTween(prop, value),
46499                             target = tween.cur(),
46500                             parts = rfxnum.exec(value),
46501                             unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
46502
46503                             // Starting value computation is required for potential unit
46504                             // mismatches
46505                             start = (jQuery.cssNumber[prop] || unit !== "px" && +target) &&
46506                             rfxnum.exec(jQuery.css(tween.elem, prop)),
46507                             scale = 1,
46508                             maxIterations = 20;
46509
46510                         if (start && start[3] !== unit) {
46511                             // Trust units reported by jQuery.css
46512                             unit = unit || start[3];
46513
46514                             // Make sure we update the tween properties later on
46515                             parts = parts || [];
46516
46517                             // Iteratively approximate from a nonzero starting point
46518                             start = +target || 1;
46519
46520                             do {
46521                                 // If previous iteration zeroed out, double until we get
46522                                 // *something*.
46523                                 // Use string for doubling so we don't accidentally see
46524                                 // scale as unchanged below
46525                                 scale = scale || ".5";
46526
46527                                 // Adjust and apply
46528                                 start = start / scale;
46529                                 jQuery.style(tween.elem, prop, start + unit);
46530
46531                                 // Update scale, tolerating zero or NaN from tween.cur(),
46532                                 // break the loop if scale is unchanged or perfect, or if we've
46533                                 // just had enough
46534                             } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations);
46535                         }
46536
46537                         // Update tween properties
46538                         if (parts) {
46539                             start = tween.start = +start || +target || 0;
46540                             tween.unit = unit;
46541                             // If a +=/-= token was provided, we're doing a relative
46542                             // animation
46543                             tween.end = parts[1] ?
46544                                 start + (parts[1] + 1) * parts[2] :
46545                                 +parts[2];
46546                         }
46547
46548                         return tween;
46549                     }]
46550                 };
46551
46552             // Animations created synchronously will run synchronously
46553             function createFxNow() {
46554                 setTimeout(function() {
46555                     fxNow = undefined;
46556                 });
46557                 return (fxNow = jQuery.now());
46558             }
46559
46560             // Generate parameters to create a standard animation
46561             function genFx(type, includeWidth) {
46562                 var which,
46563                     i = 0,
46564                     attrs = {
46565                         height: type
46566                     };
46567
46568                 // If we include width, step value is 1 to do all cssExpand values,
46569                 // otherwise step value is 2 to skip over Left and Right
46570                 includeWidth = includeWidth ? 1 : 0;
46571                 for (; i < 4; i += 2 - includeWidth) {
46572                     which = cssExpand[i];
46573                     attrs["margin" + which] = attrs["padding" + which] = type;
46574                 }
46575
46576                 if (includeWidth) {
46577                     attrs.opacity = attrs.width = type;
46578                 }
46579
46580                 return attrs;
46581             }
46582
46583             function createTween(value, prop, animation) {
46584                 var tween,
46585                     collection = (tweeners[prop] || []).concat(tweeners["*"]),
46586                     index = 0,
46587                     length = collection.length;
46588                 for (; index < length; index++) {
46589                     if ((tween = collection[index].call(animation, prop, value))) {
46590
46591                         // We're done with this property
46592                         return tween;
46593                     }
46594                 }
46595             }
46596
46597             function defaultPrefilter(elem, props, opts) {
46598                 /* jshint validthis: true */
46599                 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
46600                     anim = this,
46601                     orig = {},
46602                     style = elem.style,
46603                     hidden = elem.nodeType && isHidden(elem),
46604                     dataShow = data_priv.get(elem, "fxshow");
46605
46606                 // Handle queue: false promises
46607                 if (!opts.queue) {
46608                     hooks = jQuery._queueHooks(elem, "fx");
46609                     if (hooks.unqueued == null) {
46610                         hooks.unqueued = 0;
46611                         oldfire = hooks.empty.fire;
46612                         hooks.empty.fire = function() {
46613                             if (!hooks.unqueued) {
46614                                 oldfire();
46615                             }
46616                         };
46617                     }
46618                     hooks.unqueued++;
46619
46620                     anim.always(function() {
46621                         // Ensure the complete handler is called before this completes
46622                         anim.always(function() {
46623                             hooks.unqueued--;
46624                             if (!jQuery.queue(elem, "fx").length) {
46625                                 hooks.empty.fire();
46626                             }
46627                         });
46628                     });
46629                 }
46630
46631                 // Height/width overflow pass
46632                 if (elem.nodeType === 1 && ("height" in props || "width" in props)) {
46633                     // Make sure that nothing sneaks out
46634                     // Record all 3 overflow attributes because IE9-10 do not
46635                     // change the overflow attribute when overflowX and
46636                     // overflowY are set to the same value
46637                     opts.overflow = [style.overflow, style.overflowX, style.overflowY];
46638
46639                     // Set display property to inline-block for height/width
46640                     // animations on inline elements that are having width/height animated
46641                     display = jQuery.css(elem, "display");
46642
46643                     // Test default display if display is currently "none"
46644                     checkDisplay = display === "none" ?
46645                         data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display;
46646
46647                     if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") {
46648                         style.display = "inline-block";
46649                     }
46650                 }
46651
46652                 if (opts.overflow) {
46653                     style.overflow = "hidden";
46654                     anim.always(function() {
46655                         style.overflow = opts.overflow[0];
46656                         style.overflowX = opts.overflow[1];
46657                         style.overflowY = opts.overflow[2];
46658                     });
46659                 }
46660
46661                 // show/hide pass
46662                 for (prop in props) {
46663                     value = props[prop];
46664                     if (rfxtypes.exec(value)) {
46665                         delete props[prop];
46666                         toggle = toggle || value === "toggle";
46667                         if (value === (hidden ? "hide" : "show")) {
46668
46669                             // If there is dataShow left over from a stopped hide or show
46670                             // and we are going to proceed with show, we should pretend to
46671                             // be hidden
46672                             if (value === "show" && dataShow && dataShow[prop] !== undefined) {
46673                                 hidden = true;
46674                             } else {
46675                                 continue;
46676                             }
46677                         }
46678                         orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
46679
46680                         // Any non-fx value stops us from restoring the original display value
46681                     } else {
46682                         display = undefined;
46683                     }
46684                 }
46685
46686                 if (!jQuery.isEmptyObject(orig)) {
46687                     if (dataShow) {
46688                         if ("hidden" in dataShow) {
46689                             hidden = dataShow.hidden;
46690                         }
46691                     } else {
46692                         dataShow = data_priv.access(elem, "fxshow", {});
46693                     }
46694
46695                     // Store state if its toggle - enables .stop().toggle() to "reverse"
46696                     if (toggle) {
46697                         dataShow.hidden = !hidden;
46698                     }
46699                     if (hidden) {
46700                         jQuery(elem).show();
46701                     } else {
46702                         anim.done(function() {
46703                             jQuery(elem).hide();
46704                         });
46705                     }
46706                     anim.done(function() {
46707                         var prop;
46708
46709                         data_priv.remove(elem, "fxshow");
46710                         for (prop in orig) {
46711                             jQuery.style(elem, prop, orig[prop]);
46712                         }
46713                     });
46714                     for (prop in orig) {
46715                         tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
46716
46717                         if (!(prop in dataShow)) {
46718                             dataShow[prop] = tween.start;
46719                             if (hidden) {
46720                                 tween.end = tween.start;
46721                                 tween.start = prop === "width" || prop === "height" ? 1 : 0;
46722                             }
46723                         }
46724                     }
46725
46726                     // If this is a noop like .hide().hide(), restore an overwritten display
46727                     // value
46728                 } else if ((display === "none" ? defaultDisplay(elem.nodeName) : display) === "inline") {
46729                     style.display = display;
46730                 }
46731             }
46732
46733             function propFilter(props, specialEasing) {
46734                 var index, name, easing, value, hooks;
46735
46736                 // camelCase, specialEasing and expand cssHook pass
46737                 for (index in props) {
46738                     name = jQuery.camelCase(index);
46739                     easing = specialEasing[name];
46740                     value = props[index];
46741                     if (jQuery.isArray(value)) {
46742                         easing = value[1];
46743                         value = props[index] = value[0];
46744                     }
46745
46746                     if (index !== name) {
46747                         props[name] = value;
46748                         delete props[index];
46749                     }
46750
46751                     hooks = jQuery.cssHooks[name];
46752                     if (hooks && "expand" in hooks) {
46753                         value = hooks.expand(value);
46754                         delete props[name];
46755
46756                         // Not quite $.extend, this won't overwrite existing keys.
46757                         // Reusing 'index' because we have the correct "name"
46758                         for (index in value) {
46759                             if (!(index in props)) {
46760                                 props[index] = value[index];
46761                                 specialEasing[index] = easing;
46762                             }
46763                         }
46764                     } else {
46765                         specialEasing[name] = easing;
46766                     }
46767                 }
46768             }
46769
46770             function Animation(elem, properties, options) {
46771                 var result,
46772                     stopped,
46773                     index = 0,
46774                     length = animationPrefilters.length,
46775                     deferred = jQuery.Deferred().always(function() {
46776                         // Don't match elem in the :animated selector
46777                         delete tick.elem;
46778                     }),
46779                     tick = function() {
46780                         if (stopped) {
46781                             return false;
46782                         }
46783                         var currentTime = fxNow || createFxNow(),
46784                             remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
46785                             // Support: Android 2.3
46786                             // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )`
46787                             // (#12497)
46788                             temp = remaining / animation.duration || 0,
46789                             percent = 1 - temp,
46790                             index = 0,
46791                             length = animation.tweens.length;
46792
46793                         for (; index < length; index++) {
46794                             animation.tweens[index].run(percent);
46795                         }
46796
46797                         deferred.notifyWith(elem, [animation, percent, remaining]);
46798
46799                         if (percent < 1 && length) {
46800                             return remaining;
46801                         } else {
46802                             deferred.resolveWith(elem, [animation]);
46803                             return false;
46804                         }
46805                     },
46806                     animation = deferred.promise({
46807                         elem: elem,
46808                         props: jQuery.extend({}, properties),
46809                         opts: jQuery.extend(true, {
46810                             specialEasing: {}
46811                         }, options),
46812                         originalProperties: properties,
46813                         originalOptions: options,
46814                         startTime: fxNow || createFxNow(),
46815                         duration: options.duration,
46816                         tweens: [],
46817                         createTween: function(prop, end) {
46818                             var tween = jQuery.Tween(elem, animation.opts, prop, end,
46819                                 animation.opts.specialEasing[prop] || animation.opts.easing);
46820                             animation.tweens.push(tween);
46821                             return tween;
46822                         },
46823                         stop: function(gotoEnd) {
46824                             var index = 0,
46825                                 // If we are going to the end, we want to run all the tweens
46826                                 // otherwise we skip this part
46827                                 length = gotoEnd ? animation.tweens.length : 0;
46828                             if (stopped) {
46829                                 return this;
46830                             }
46831                             stopped = true;
46832                             for (; index < length; index++) {
46833                                 animation.tweens[index].run(1);
46834                             }
46835
46836                             // Resolve when we played the last frame; otherwise, reject
46837                             if (gotoEnd) {
46838                                 deferred.resolveWith(elem, [animation, gotoEnd]);
46839                             } else {
46840                                 deferred.rejectWith(elem, [animation, gotoEnd]);
46841                             }
46842                             return this;
46843                         }
46844                     }),
46845                     props = animation.props;
46846
46847                 propFilter(props, animation.opts.specialEasing);
46848
46849                 for (; index < length; index++) {
46850                     result = animationPrefilters[index].call(animation, elem, props, animation.opts);
46851                     if (result) {
46852                         return result;
46853                     }
46854                 }
46855
46856                 jQuery.map(props, createTween, animation);
46857
46858                 if (jQuery.isFunction(animation.opts.start)) {
46859                     animation.opts.start.call(elem, animation);
46860                 }
46861
46862                 jQuery.fx.timer(
46863                     jQuery.extend(tick, {
46864                         elem: elem,
46865                         anim: animation,
46866                         queue: animation.opts.queue
46867                     })
46868                 );
46869
46870                 // attach callbacks from options
46871                 return animation.progress(animation.opts.progress)
46872                     .done(animation.opts.done, animation.opts.complete)
46873                     .fail(animation.opts.fail)
46874                     .always(animation.opts.always);
46875             }
46876
46877             jQuery.Animation = jQuery.extend(Animation, {
46878
46879                 tweener: function(props, callback) {
46880                     if (jQuery.isFunction(props)) {
46881                         callback = props;
46882                         props = ["*"];
46883                     } else {
46884                         props = props.split(" ");
46885                     }
46886
46887                     var prop,
46888                         index = 0,
46889                         length = props.length;
46890
46891                     for (; index < length; index++) {
46892                         prop = props[index];
46893                         tweeners[prop] = tweeners[prop] || [];
46894                         tweeners[prop].unshift(callback);
46895                     }
46896                 },
46897
46898                 prefilter: function(callback, prepend) {
46899                     if (prepend) {
46900                         animationPrefilters.unshift(callback);
46901                     } else {
46902                         animationPrefilters.push(callback);
46903                     }
46904                 }
46905             });
46906
46907             jQuery.speed = function(speed, easing, fn) {
46908                 var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
46909                     complete: fn || !fn && easing ||
46910                         jQuery.isFunction(speed) && speed,
46911                     duration: speed,
46912                     easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
46913                 };
46914
46915                 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
46916                     opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
46917
46918                 // Normalize opt.queue - true/undefined/null -> "fx"
46919                 if (opt.queue == null || opt.queue === true) {
46920                     opt.queue = "fx";
46921                 }
46922
46923                 // Queueing
46924                 opt.old = opt.complete;
46925
46926                 opt.complete = function() {
46927                     if (jQuery.isFunction(opt.old)) {
46928                         opt.old.call(this);
46929                     }
46930
46931                     if (opt.queue) {
46932                         jQuery.dequeue(this, opt.queue);
46933                     }
46934                 };
46935
46936                 return opt;
46937             };
46938
46939             jQuery.fn.extend({
46940                 fadeTo: function(speed, to, easing, callback) {
46941
46942                     // Show any hidden elements after setting opacity to 0
46943                     return this.filter(isHidden).css("opacity", 0).show()
46944
46945                     // Animate to the value specified
46946                     .end().animate({
46947                         opacity: to
46948                     }, speed, easing, callback);
46949                 },
46950                 animate: function(prop, speed, easing, callback) {
46951                     var empty = jQuery.isEmptyObject(prop),
46952                         optall = jQuery.speed(speed, easing, callback),
46953                         doAnimation = function() {
46954                             // Operate on a copy of prop so per-property easing won't be
46955                             // lost
46956                             var anim = Animation(this, jQuery.extend({}, prop), optall);
46957
46958                             // Empty animations, or finishing resolves immediately
46959                             if (empty || data_priv.get(this, "finish")) {
46960                                 anim.stop(true);
46961                             }
46962                         };
46963                     doAnimation.finish = doAnimation;
46964
46965                     return empty || optall.queue === false ?
46966                         this.each(doAnimation) :
46967                         this.queue(optall.queue, doAnimation);
46968                 },
46969                 stop: function(type, clearQueue, gotoEnd) {
46970                     var stopQueue = function(hooks) {
46971                         var stop = hooks.stop;
46972                         delete hooks.stop;
46973                         stop(gotoEnd);
46974                     };
46975
46976                     if (typeof type !== "string") {
46977                         gotoEnd = clearQueue;
46978                         clearQueue = type;
46979                         type = undefined;
46980                     }
46981                     if (clearQueue && type !== false) {
46982                         this.queue(type || "fx", []);
46983                     }
46984
46985                     return this.each(function() {
46986                         var dequeue = true,
46987                             index = type != null && type + "queueHooks",
46988                             timers = jQuery.timers,
46989                             data = data_priv.get(this);
46990
46991                         if (index) {
46992                             if (data[index] && data[index].stop) {
46993                                 stopQueue(data[index]);
46994                             }
46995                         } else {
46996                             for (index in data) {
46997                                 if (data[index] && data[index].stop && rrun.test(index)) {
46998                                     stopQueue(data[index]);
46999                                 }
47000                             }
47001                         }
47002
47003                         for (index = timers.length; index--;) {
47004                             if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
47005                                 timers[index].anim.stop(gotoEnd);
47006                                 dequeue = false;
47007                                 timers.splice(index, 1);
47008                             }
47009                         }
47010
47011                         // Start the next in the queue if the last step wasn't forced.
47012                         // Timers currently will call their complete callbacks, which
47013                         // will dequeue but only if they were gotoEnd.
47014                         if (dequeue || !gotoEnd) {
47015                             jQuery.dequeue(this, type);
47016                         }
47017                     });
47018                 },
47019                 finish: function(type) {
47020                     if (type !== false) {
47021                         type = type || "fx";
47022                     }
47023                     return this.each(function() {
47024                         var index,
47025                             data = data_priv.get(this),
47026                             queue = data[type + "queue"],
47027                             hooks = data[type + "queueHooks"],
47028                             timers = jQuery.timers,
47029                             length = queue ? queue.length : 0;
47030
47031                         // Enable finishing flag on private data
47032                         data.finish = true;
47033
47034                         // Empty the queue first
47035                         jQuery.queue(this, type, []);
47036
47037                         if (hooks && hooks.stop) {
47038                             hooks.stop.call(this, true);
47039                         }
47040
47041                         // Look for any active animations, and finish them
47042                         for (index = timers.length; index--;) {
47043                             if (timers[index].elem === this && timers[index].queue === type) {
47044                                 timers[index].anim.stop(true);
47045                                 timers.splice(index, 1);
47046                             }
47047                         }
47048
47049                         // Look for any animations in the old queue and finish them
47050                         for (index = 0; index < length; index++) {
47051                             if (queue[index] && queue[index].finish) {
47052                                 queue[index].finish.call(this);
47053                             }
47054                         }
47055
47056                         // Turn off finishing flag
47057                         delete data.finish;
47058                     });
47059                 }
47060             });
47061
47062             jQuery.each(["toggle", "show", "hide"], function(i, name) {
47063                 var cssFn = jQuery.fn[name];
47064                 jQuery.fn[name] = function(speed, easing, callback) {
47065                     return speed == null || typeof speed === "boolean" ?
47066                         cssFn.apply(this, arguments) :
47067                         this.animate(genFx(name, true), speed, easing, callback);
47068                 };
47069             });
47070
47071             // Generate shortcuts for custom animations
47072             jQuery.each({
47073                 slideDown: genFx("show"),
47074                 slideUp: genFx("hide"),
47075                 slideToggle: genFx("toggle"),
47076                 fadeIn: {
47077                     opacity: "show"
47078                 },
47079                 fadeOut: {
47080                     opacity: "hide"
47081                 },
47082                 fadeToggle: {
47083                     opacity: "toggle"
47084                 }
47085             }, function(name, props) {
47086                 jQuery.fn[name] = function(speed, easing, callback) {
47087                     return this.animate(props, speed, easing, callback);
47088                 };
47089             });
47090
47091             jQuery.timers = [];
47092             jQuery.fx.tick = function() {
47093                 var timer,
47094                     i = 0,
47095                     timers = jQuery.timers;
47096
47097                 fxNow = jQuery.now();
47098
47099                 for (; i < timers.length; i++) {
47100                     timer = timers[i];
47101                     // Checks the timer has not already been removed
47102                     if (!timer() && timers[i] === timer) {
47103                         timers.splice(i--, 1);
47104                     }
47105                 }
47106
47107                 if (!timers.length) {
47108                     jQuery.fx.stop();
47109                 }
47110                 fxNow = undefined;
47111             };
47112
47113             jQuery.fx.timer = function(timer) {
47114                 jQuery.timers.push(timer);
47115                 if (timer()) {
47116                     jQuery.fx.start();
47117                 } else {
47118                     jQuery.timers.pop();
47119                 }
47120             };
47121
47122             jQuery.fx.interval = 13;
47123
47124             jQuery.fx.start = function() {
47125                 if (!timerId) {
47126                     timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
47127                 }
47128             };
47129
47130             jQuery.fx.stop = function() {
47131                 clearInterval(timerId);
47132                 timerId = null;
47133             };
47134
47135             jQuery.fx.speeds = {
47136                 slow: 600,
47137                 fast: 200,
47138                 // Default speed
47139                 _default: 400
47140             };
47141
47142
47143             // Based off of the plugin by Clint Helfers, with permission.
47144             // http://blindsignals.com/index.php/2009/07/jquery-delay/
47145             jQuery.fn.delay = function(time, type) {
47146                 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
47147                 type = type || "fx";
47148
47149                 return this.queue(type, function(next, hooks) {
47150                     var timeout = setTimeout(next, time);
47151                     hooks.stop = function() {
47152                         clearTimeout(timeout);
47153                     };
47154                 });
47155             };
47156
47157
47158             (function() {
47159                 var input = document.createElement("input"),
47160                     select = document.createElement("select"),
47161                     opt = select.appendChild(document.createElement("option"));
47162
47163                 input.type = "checkbox";
47164
47165                 // Support: iOS<=5.1, Android<=4.2+
47166                 // Default value for a checkbox should be "on"
47167                 support.checkOn = input.value !== "";
47168
47169                 // Support: IE<=11+
47170                 // Must access selectedIndex to make default options select
47171                 support.optSelected = opt.selected;
47172
47173                 // Support: Android<=2.3
47174                 // Options inside disabled selects are incorrectly marked as disabled
47175                 select.disabled = true;
47176                 support.optDisabled = !opt.disabled;
47177
47178                 // Support: IE<=11+
47179                 // An input loses its value after becoming a radio
47180                 input = document.createElement("input");
47181                 input.value = "t";
47182                 input.type = "radio";
47183                 support.radioValue = input.value === "t";
47184             })();
47185
47186
47187             var nodeHook, boolHook,
47188                 attrHandle = jQuery.expr.attrHandle;
47189
47190             jQuery.fn.extend({
47191                 attr: function(name, value) {
47192                     return access(this, jQuery.attr, name, value, arguments.length > 1);
47193                 },
47194
47195                 removeAttr: function(name) {
47196                     return this.each(function() {
47197                         jQuery.removeAttr(this, name);
47198                     });
47199                 }
47200             });
47201
47202             jQuery.extend({
47203                 attr: function(elem, name, value) {
47204                     var hooks, ret,
47205                         nType = elem.nodeType;
47206
47207                     // don't get/set attributes on text, comment and attribute nodes
47208                     if (!elem || nType === 3 || nType === 8 || nType === 2) {
47209                         return;
47210                     }
47211
47212                     // Fallback to prop when attributes are not supported
47213                     if (typeof elem.getAttribute === strundefined) {
47214                         return jQuery.prop(elem, name, value);
47215                     }
47216
47217                     // All attributes are lowercase
47218                     // Grab necessary hook if one is defined
47219                     if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
47220                         name = name.toLowerCase();
47221                         hooks = jQuery.attrHooks[name] ||
47222                             (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
47223                     }
47224
47225                     if (value !== undefined) {
47226
47227                         if (value === null) {
47228                             jQuery.removeAttr(elem, name);
47229
47230                         } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
47231                             return ret;
47232
47233                         } else {
47234                             elem.setAttribute(name, value + "");
47235                             return value;
47236                         }
47237
47238                     } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
47239                         return ret;
47240
47241                     } else {
47242                         ret = jQuery.find.attr(elem, name);
47243
47244                         // Non-existent attributes return null, we normalize to undefined
47245                         return ret == null ?
47246                             undefined :
47247                             ret;
47248                     }
47249                 },
47250
47251                 removeAttr: function(elem, value) {
47252                     var name, propName,
47253                         i = 0,
47254                         attrNames = value && value.match(rnotwhite);
47255
47256                     if (attrNames && elem.nodeType === 1) {
47257                         while ((name = attrNames[i++])) {
47258                             propName = jQuery.propFix[name] || name;
47259
47260                             // Boolean attributes get special treatment (#10870)
47261                             if (jQuery.expr.match.bool.test(name)) {
47262                                 // Set corresponding property to false
47263                                 elem[propName] = false;
47264                             }
47265
47266                             elem.removeAttribute(name);
47267                         }
47268                     }
47269                 },
47270
47271                 attrHooks: {
47272                     type: {
47273                         set: function(elem, value) {
47274                             if (!support.radioValue && value === "radio" &&
47275                                 jQuery.nodeName(elem, "input")) {
47276                                 var val = elem.value;
47277                                 elem.setAttribute("type", value);
47278                                 if (val) {
47279                                     elem.value = val;
47280                                 }
47281                                 return value;
47282                             }
47283                         }
47284                     }
47285                 }
47286             });
47287
47288             // Hooks for boolean attributes
47289             boolHook = {
47290                 set: function(elem, value, name) {
47291                     if (value === false) {
47292                         // Remove boolean attributes when set to false
47293                         jQuery.removeAttr(elem, name);
47294                     } else {
47295                         elem.setAttribute(name, name);
47296                     }
47297                     return name;
47298                 }
47299             };
47300             jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) {
47301                 var getter = attrHandle[name] || jQuery.find.attr;
47302
47303                 attrHandle[name] = function(elem, name, isXML) {
47304                     var ret, handle;
47305                     if (!isXML) {
47306                         // Avoid an infinite loop by temporarily removing this function from
47307                         // the getter
47308                         handle = attrHandle[name];
47309                         attrHandle[name] = ret;
47310                         ret = getter(elem, name, isXML) != null ?
47311                             name.toLowerCase() :
47312                             null;
47313                         attrHandle[name] = handle;
47314                     }
47315                     return ret;
47316                 };
47317             });
47318
47319
47320
47321
47322             var rfocusable = /^(?:input|select|textarea|button)$/i;
47323
47324             jQuery.fn.extend({
47325                 prop: function(name, value) {
47326                     return access(this, jQuery.prop, name, value, arguments.length > 1);
47327                 },
47328
47329                 removeProp: function(name) {
47330                     return this.each(function() {
47331                         delete this[jQuery.propFix[name] || name];
47332                     });
47333                 }
47334             });
47335
47336             jQuery.extend({
47337                 propFix: {
47338                     "for": "htmlFor",
47339                     "class": "className"
47340                 },
47341
47342                 prop: function(elem, name, value) {
47343                     var ret, hooks, notxml,
47344                         nType = elem.nodeType;
47345
47346                     // Don't get/set properties on text, comment and attribute nodes
47347                     if (!elem || nType === 3 || nType === 8 || nType === 2) {
47348                         return;
47349                     }
47350
47351                     notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
47352
47353                     if (notxml) {
47354                         // Fix name and attach hooks
47355                         name = jQuery.propFix[name] || name;
47356                         hooks = jQuery.propHooks[name];
47357                     }
47358
47359                     if (value !== undefined) {
47360                         return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ?
47361                             ret :
47362                             (elem[name] = value);
47363
47364                     } else {
47365                         return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ?
47366                             ret :
47367                             elem[name];
47368                     }
47369                 },
47370
47371                 propHooks: {
47372                     tabIndex: {
47373                         get: function(elem) {
47374                             return elem.hasAttribute("tabindex") || rfocusable.test(elem.nodeName) || elem.href ?
47375                                 elem.tabIndex :
47376                                 -1;
47377                         }
47378                     }
47379                 }
47380             });
47381
47382             if (!support.optSelected) {
47383                 jQuery.propHooks.selected = {
47384                     get: function(elem) {
47385                         var parent = elem.parentNode;
47386                         if (parent && parent.parentNode) {
47387                             parent.parentNode.selectedIndex;
47388                         }
47389                         return null;
47390                     }
47391                 };
47392             }
47393
47394             jQuery.each([
47395                 "tabIndex",
47396                 "readOnly",
47397                 "maxLength",
47398                 "cellSpacing",
47399                 "cellPadding",
47400                 "rowSpan",
47401                 "colSpan",
47402                 "useMap",
47403                 "frameBorder",
47404                 "contentEditable"
47405             ], function() {
47406                 jQuery.propFix[this.toLowerCase()] = this;
47407             });
47408
47409
47410
47411
47412             var rclass = /[\t\r\n\f]/g;
47413
47414             jQuery.fn.extend({
47415                 addClass: function(value) {
47416                     var classes, elem, cur, clazz, j, finalValue,
47417                         proceed = typeof value === "string" && value,
47418                         i = 0,
47419                         len = this.length;
47420
47421                     if (jQuery.isFunction(value)) {
47422                         return this.each(function(j) {
47423                             jQuery(this).addClass(value.call(this, j, this.className));
47424                         });
47425                     }
47426
47427                     if (proceed) {
47428                         // The disjunction here is for better compressibility (see
47429                         // removeClass)
47430                         classes = (value || "").match(rnotwhite) || [];
47431
47432                         for (; i < len; i++) {
47433                             elem = this[i];
47434                             cur = elem.nodeType === 1 && (elem.className ?
47435                                 (" " + elem.className + " ").replace(rclass, " ") :
47436                                 " "
47437                             );
47438
47439                             if (cur) {
47440                                 j = 0;
47441                                 while ((clazz = classes[j++])) {
47442                                     if (cur.indexOf(" " + clazz + " ") < 0) {
47443                                         cur += clazz + " ";
47444                                     }
47445                                 }
47446
47447                                 // only assign if different to avoid unneeded rendering.
47448                                 finalValue = jQuery.trim(cur);
47449                                 if (elem.className !== finalValue) {
47450                                     elem.className = finalValue;
47451                                 }
47452                             }
47453                         }
47454                     }
47455
47456                     return this;
47457                 },
47458
47459                 removeClass: function(value) {
47460                     var classes, elem, cur, clazz, j, finalValue,
47461                         proceed = arguments.length === 0 || typeof value === "string" && value,
47462                         i = 0,
47463                         len = this.length;
47464
47465                     if (jQuery.isFunction(value)) {
47466                         return this.each(function(j) {
47467                             jQuery(this).removeClass(value.call(this, j, this.className));
47468                         });
47469                     }
47470                     if (proceed) {
47471                         classes = (value || "").match(rnotwhite) || [];
47472
47473                         for (; i < len; i++) {
47474                             elem = this[i];
47475                             // This expression is here for better compressibility (see
47476                             // addClass)
47477                             cur = elem.nodeType === 1 && (elem.className ?
47478                                 (" " + elem.className + " ").replace(rclass, " ") :
47479                                 ""
47480                             );
47481
47482                             if (cur) {
47483                                 j = 0;
47484                                 while ((clazz = classes[j++])) {
47485                                     // Remove *all* instances
47486                                     while (cur.indexOf(" " + clazz + " ") >= 0) {
47487                                         cur = cur.replace(" " + clazz + " ", " ");
47488                                     }
47489                                 }
47490
47491                                 // Only assign if different to avoid unneeded rendering.
47492                                 finalValue = value ? jQuery.trim(cur) : "";
47493                                 if (elem.className !== finalValue) {
47494                                     elem.className = finalValue;
47495                                 }
47496                             }
47497                         }
47498                     }
47499
47500                     return this;
47501                 },
47502
47503                 toggleClass: function(value, stateVal) {
47504                     var type = typeof value;
47505
47506                     if (typeof stateVal === "boolean" && type === "string") {
47507                         return stateVal ? this.addClass(value) : this.removeClass(value);
47508                     }
47509
47510                     if (jQuery.isFunction(value)) {
47511                         return this.each(function(i) {
47512                             jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
47513                         });
47514                     }
47515
47516                     return this.each(function() {
47517                         if (type === "string") {
47518                             // Toggle individual class names
47519                             var className,
47520                                 i = 0,
47521                                 self = jQuery(this),
47522                                 classNames = value.match(rnotwhite) || [];
47523
47524                             while ((className = classNames[i++])) {
47525                                 // Check each className given, space separated list
47526                                 if (self.hasClass(className)) {
47527                                     self.removeClass(className);
47528                                 } else {
47529                                     self.addClass(className);
47530                                 }
47531                             }
47532
47533                             // Toggle whole class name
47534                         } else if (type === strundefined || type === "boolean") {
47535                             if (this.className) {
47536                                 // store className if set
47537                                 data_priv.set(this, "__className__", this.className);
47538                             }
47539
47540                             // If the element has a class name or if we're passed `false`,
47541                             // then remove the whole classname (if there was one, the above
47542                             // saved it).
47543                             // Otherwise bring back whatever was previously saved (if
47544                             // anything),
47545                             // falling back to the empty string if nothing was stored.
47546                             this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
47547                         }
47548                     });
47549                 },
47550
47551                 hasClass: function(selector) {
47552                     var className = " " + selector + " ",
47553                         i = 0,
47554                         l = this.length;
47555                     for (; i < l; i++) {
47556                         if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
47557                             return true;
47558                         }
47559                     }
47560
47561                     return false;
47562                 }
47563             });
47564
47565
47566
47567
47568             var rreturn = /\r/g;
47569
47570             jQuery.fn.extend({
47571                 val: function(value) {
47572                     var hooks, ret, isFunction,
47573                         elem = this[0];
47574
47575                     if (!arguments.length) {
47576                         if (elem) {
47577                             hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
47578
47579                             if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
47580                                 return ret;
47581                             }
47582
47583                             ret = elem.value;
47584
47585                             return typeof ret === "string" ?
47586                                 // Handle most common string cases
47587                                 ret.replace(rreturn, "") :
47588                                 // Handle cases where value is null/undef or number
47589                                 ret == null ? "" : ret;
47590                         }
47591
47592                         return;
47593                     }
47594
47595                     isFunction = jQuery.isFunction(value);
47596
47597                     return this.each(function(i) {
47598                         var val;
47599
47600                         if (this.nodeType !== 1) {
47601                             return;
47602                         }
47603
47604                         if (isFunction) {
47605                             val = value.call(this, i, jQuery(this).val());
47606                         } else {
47607                             val = value;
47608                         }
47609
47610                         // Treat null/undefined as ""; convert numbers to string
47611                         if (val == null) {
47612                             val = "";
47613
47614                         } else if (typeof val === "number") {
47615                             val += "";
47616
47617                         } else if (jQuery.isArray(val)) {
47618                             val = jQuery.map(val, function(value) {
47619                                 return value == null ? "" : value + "";
47620                             });
47621                         }
47622
47623                         hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
47624
47625                         // If set returns undefined, fall back to normal setting
47626                         if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
47627                             this.value = val;
47628                         }
47629                     });
47630                 }
47631             });
47632
47633             jQuery.extend({
47634                 valHooks: {
47635                     option: {
47636                         get: function(elem) {
47637                             var val = jQuery.find.attr(elem, "value");
47638                             return val != null ?
47639                                 val :
47640                                 // Support: IE10-11+
47641                                 // option.text throws exceptions (#14686, #14858)
47642                                 jQuery.trim(jQuery.text(elem));
47643                         }
47644                     },
47645                     select: {
47646                         get: function(elem) {
47647                             var value, option,
47648                                 options = elem.options,
47649                                 index = elem.selectedIndex,
47650                                 one = elem.type === "select-one" || index < 0,
47651                                 values = one ? null : [],
47652                                 max = one ? index + 1 : options.length,
47653                                 i = index < 0 ?
47654                                 max :
47655                                 one ? index : 0;
47656
47657                             // Loop through all the selected options
47658                             for (; i < max; i++) {
47659                                 option = options[i];
47660
47661                                 // IE6-9 doesn't update selected after form reset (#2551)
47662                                 if ((option.selected || i === index) &&
47663                                     // Don't return options that are disabled or in a
47664                                     // disabled optgroup
47665                                     (support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
47666                                     (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
47667
47668                                     // Get the specific value for the option
47669                                     value = jQuery(option).val();
47670
47671                                     // We don't need an array for one selects
47672                                     if (one) {
47673                                         return value;
47674                                     }
47675
47676                                     // Multi-Selects return an array
47677                                     values.push(value);
47678                                 }
47679                             }
47680
47681                             return values;
47682                         },
47683
47684                         set: function(elem, value) {
47685                             var optionSet, option,
47686                                 options = elem.options,
47687                                 values = jQuery.makeArray(value),
47688                                 i = options.length;
47689
47690                             while (i--) {
47691                                 option = options[i];
47692                                 if ((option.selected = jQuery.inArray(option.value, values) >= 0)) {
47693                                     optionSet = true;
47694                                 }
47695                             }
47696
47697                             // Force browsers to behave consistently when non-matching value
47698                             // is set
47699                             if (!optionSet) {
47700                                 elem.selectedIndex = -1;
47701                             }
47702                             return values;
47703                         }
47704                     }
47705                 }
47706             });
47707
47708             // Radios and checkboxes getter/setter
47709             jQuery.each(["radio", "checkbox"], function() {
47710                 jQuery.valHooks[this] = {
47711                     set: function(elem, value) {
47712                         if (jQuery.isArray(value)) {
47713                             return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
47714                         }
47715                     }
47716                 };
47717                 if (!support.checkOn) {
47718                     jQuery.valHooks[this].get = function(elem) {
47719                         return elem.getAttribute("value") === null ? "on" : elem.value;
47720                     };
47721                 }
47722             });
47723
47724
47725
47726
47727             // Return jQuery for attributes-only inclusion
47728
47729
47730             jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
47731                 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
47732                 "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
47733
47734                 // Handle event binding
47735                 jQuery.fn[name] = function(data, fn) {
47736                     return arguments.length > 0 ?
47737                         this.on(name, null, data, fn) :
47738                         this.trigger(name);
47739                 };
47740             });
47741
47742             jQuery.fn.extend({
47743                 hover: function(fnOver, fnOut) {
47744                     return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
47745                 },
47746
47747                 bind: function(types, data, fn) {
47748                     return this.on(types, null, data, fn);
47749                 },
47750                 unbind: function(types, fn) {
47751                     return this.off(types, null, fn);
47752                 },
47753
47754                 delegate: function(selector, types, data, fn) {
47755                     return this.on(types, selector, data, fn);
47756                 },
47757                 undelegate: function(selector, types, fn) {
47758                     // ( namespace ) or ( selector, types [, fn] )
47759                     return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
47760                 }
47761             });
47762
47763
47764             var nonce = jQuery.now();
47765
47766             var rquery = (/\?/);
47767
47768
47769
47770             // Support: Android 2.3
47771             // Workaround failure to string-cast null input
47772             jQuery.parseJSON = function(data) {
47773                 return JSON.parse(data + "");
47774             };
47775
47776
47777             // Cross-browser xml parsing
47778             jQuery.parseXML = function(data) {
47779                 var xml, tmp;
47780                 if (!data || typeof data !== "string") {
47781                     return null;
47782                 }
47783
47784                 // Support: IE9
47785                 try {
47786                     tmp = new DOMParser();
47787                     xml = tmp.parseFromString(data, "text/xml");
47788                 } catch (e) {
47789                     xml = undefined;
47790                 }
47791
47792                 if (!xml || xml.getElementsByTagName("parsererror").length) {
47793                     jQuery.error("Invalid XML: " + data);
47794                 }
47795                 return xml;
47796             };
47797
47798
47799             var
47800                 rhash = /#.*$/,
47801                 rts = /([?&])_=[^&]*/,
47802                 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
47803                 // #7653, #8125, #8152: local protocol detection
47804                 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
47805                 rnoContent = /^(?:GET|HEAD)$/,
47806                 rprotocol = /^\/\//,
47807                 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
47808
47809                 /*
47810                  * Prefilters 1) They are useful to introduce custom dataTypes (see
47811                  * ajax/jsonp.js for an example) 2) These are called: - BEFORE asking for a
47812                  * transport - AFTER param serialization (s.data is a string if
47813                  * s.processData is true) 3) key is the dataType 4) the catchall symbol "*"
47814                  * can be used 5) execution will start with transport dataType and THEN
47815                  * continue down to "*" if needed
47816                  */
47817                 prefilters = {},
47818
47819                 /*
47820                  * Transports bindings 1) key is the dataType 2) the catchall symbol "*" can
47821                  * be used 3) selection will start with transport dataType and THEN go to
47822                  * "*" if needed
47823                  */
47824                 transports = {},
47825
47826                 // Avoid comment-prolog char sequence (#10098); must appease lint and evade
47827                 // compression
47828                 allTypes = "*/".concat("*"),
47829
47830                 // Document location
47831                 ajaxLocation = window.location.href,
47832
47833                 // Segment location into parts
47834                 ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];
47835
47836             // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
47837             function addToPrefiltersOrTransports(structure) {
47838
47839                 // dataTypeExpression is optional and defaults to "*"
47840                 return function(dataTypeExpression, func) {
47841
47842                     if (typeof dataTypeExpression !== "string") {
47843                         func = dataTypeExpression;
47844                         dataTypeExpression = "*";
47845                     }
47846
47847                     var dataType,
47848                         i = 0,
47849                         dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];
47850
47851                     if (jQuery.isFunction(func)) {
47852                         // For each dataType in the dataTypeExpression
47853                         while ((dataType = dataTypes[i++])) {
47854                             // Prepend if requested
47855                             if (dataType[0] === "+") {
47856                                 dataType = dataType.slice(1) || "*";
47857                                 (structure[dataType] = structure[dataType] || []).unshift(func);
47858
47859                                 // Otherwise append
47860                             } else {
47861                                 (structure[dataType] = structure[dataType] || []).push(func);
47862                             }
47863                         }
47864                     }
47865                 };
47866             }
47867
47868             // Base inspection function for prefilters and transports
47869             function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
47870
47871                 var inspected = {},
47872                     seekingTransport = (structure === transports);
47873
47874                 function inspect(dataType) {
47875                     var selected;
47876                     inspected[dataType] = true;
47877                     jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
47878                         var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
47879                         if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
47880                             options.dataTypes.unshift(dataTypeOrTransport);
47881                             inspect(dataTypeOrTransport);
47882                             return false;
47883                         } else if (seekingTransport) {
47884                             return !(selected = dataTypeOrTransport);
47885                         }
47886                     });
47887                     return selected;
47888                 }
47889
47890                 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
47891             }
47892
47893             // A special extend for ajax options
47894             // that takes "flat" options (not to be deep extended)
47895             // Fixes #9887
47896             function ajaxExtend(target, src) {
47897                 var key, deep,
47898                     flatOptions = jQuery.ajaxSettings.flatOptions || {};
47899
47900                 for (key in src) {
47901                     if (src[key] !== undefined) {
47902                         (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];
47903                     }
47904                 }
47905                 if (deep) {
47906                     jQuery.extend(true, target, deep);
47907                 }
47908
47909                 return target;
47910             }
47911
47912             /*
47913              * Handles responses to an ajax request: - finds the right dataType (mediates
47914              * between content-type and expected dataType) - returns the corresponding
47915              * response
47916              */
47917             function ajaxHandleResponses(s, jqXHR, responses) {
47918
47919                 var ct, type, finalDataType, firstDataType,
47920                     contents = s.contents,
47921                     dataTypes = s.dataTypes;
47922
47923                 // Remove auto dataType and get content-type in the process
47924                 while (dataTypes[0] === "*") {
47925                     dataTypes.shift();
47926                     if (ct === undefined) {
47927                         ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
47928                     }
47929                 }
47930
47931                 // Check if we're dealing with a known content-type
47932                 if (ct) {
47933                     for (type in contents) {
47934                         if (contents[type] && contents[type].test(ct)) {
47935                             dataTypes.unshift(type);
47936                             break;
47937                         }
47938                     }
47939                 }
47940
47941                 // Check to see if we have a response for the expected dataType
47942                 if (dataTypes[0] in responses) {
47943                     finalDataType = dataTypes[0];
47944                 } else {
47945                     // Try convertible dataTypes
47946                     for (type in responses) {
47947                         if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
47948                             finalDataType = type;
47949                             break;
47950                         }
47951                         if (!firstDataType) {
47952                             firstDataType = type;
47953                         }
47954                     }
47955                     // Or just use first one
47956                     finalDataType = finalDataType || firstDataType;
47957                 }
47958
47959                 // If we found a dataType
47960                 // We add the dataType to the list if needed
47961                 // and return the corresponding response
47962                 if (finalDataType) {
47963                     if (finalDataType !== dataTypes[0]) {
47964                         dataTypes.unshift(finalDataType);
47965                     }
47966                     return responses[finalDataType];
47967                 }
47968             }
47969
47970             /*
47971              * Chain conversions given the request and the original response Also sets the
47972              * responseXXX fields on the jqXHR instance
47973              */
47974             function ajaxConvert(s, response, jqXHR, isSuccess) {
47975                 var conv2, current, conv, tmp, prev,
47976                     converters = {},
47977                     // Work with a copy of dataTypes in case we need to modify it for
47978                     // conversion
47979                     dataTypes = s.dataTypes.slice();
47980
47981                 // Create converters map with lowercased keys
47982                 if (dataTypes[1]) {
47983                     for (conv in s.converters) {
47984                         converters[conv.toLowerCase()] = s.converters[conv];
47985                     }
47986                 }
47987
47988                 current = dataTypes.shift();
47989
47990                 // Convert to each sequential dataType
47991                 while (current) {
47992
47993                     if (s.responseFields[current]) {
47994                         jqXHR[s.responseFields[current]] = response;
47995                     }
47996
47997                     // Apply the dataFilter if provided
47998                     if (!prev && isSuccess && s.dataFilter) {
47999                         response = s.dataFilter(response, s.dataType);
48000                     }
48001
48002                     prev = current;
48003                     current = dataTypes.shift();
48004
48005                     if (current) {
48006
48007                         // There's only work to do if current dataType is non-auto
48008                         if (current === "*") {
48009
48010                             current = prev;
48011
48012                             // Convert response if prev dataType is non-auto and differs from
48013                             // current
48014                         } else if (prev !== "*" && prev !== current) {
48015
48016                             // Seek a direct converter
48017                             conv = converters[prev + " " + current] || converters["* " + current];
48018
48019                             // If none found, seek a pair
48020                             if (!conv) {
48021                                 for (conv2 in converters) {
48022
48023                                     // If conv2 outputs current
48024                                     tmp = conv2.split(" ");
48025                                     if (tmp[1] === current) {
48026
48027                                         // If prev can be converted to accepted input
48028                                         conv = converters[prev + " " + tmp[0]] ||
48029                                             converters["* " + tmp[0]];
48030                                         if (conv) {
48031                                             // Condense equivalence converters
48032                                             if (conv === true) {
48033                                                 conv = converters[conv2];
48034
48035                                                 // Otherwise, insert the intermediate dataType
48036                                             } else if (converters[conv2] !== true) {
48037                                                 current = tmp[0];
48038                                                 dataTypes.unshift(tmp[1]);
48039                                             }
48040                                             break;
48041                                         }
48042                                     }
48043                                 }
48044                             }
48045
48046                             // Apply converter (if not an equivalence)
48047                             if (conv !== true) {
48048
48049                                 // Unless errors are allowed to bubble, catch and return
48050                                 // them
48051                                 if (conv && s["throws"]) {
48052                                     response = conv(response);
48053                                 } else {
48054                                     try {
48055                                         response = conv(response);
48056                                     } catch (e) {
48057                                         return {
48058                                             state: "parsererror",
48059                                             error: conv ? e : "No conversion from " + prev + " to " + current
48060                                         };
48061                                     }
48062                                 }
48063                             }
48064                         }
48065                     }
48066                 }
48067
48068                 return {
48069                     state: "success",
48070                     data: response
48071                 };
48072             }
48073
48074             jQuery.extend({
48075
48076                 // Counter for holding the number of active queries
48077                 active: 0,
48078
48079                 // Last-Modified header cache for next request
48080                 lastModified: {},
48081                 etag: {},
48082
48083                 ajaxSettings: {
48084                     url: ajaxLocation,
48085                     type: "GET",
48086                     isLocal: rlocalProtocol.test(ajaxLocParts[1]),
48087                     global: true,
48088                     processData: true,
48089                     async: true,
48090                     contentType: "application/x-www-form-urlencoded; charset=UTF-8",
48091                     /*
48092                      * timeout: 0, data: null, dataType: null, username: null, password:
48093                      * null, cache: null, throws: false, traditional: false, headers: {},
48094                      */
48095
48096                     accepts: {
48097                         "*": allTypes,
48098                         text: "text/plain",
48099                         html: "text/html",
48100                         xml: "application/xml, text/xml",
48101                         json: "application/json, text/javascript"
48102                     },
48103
48104                     contents: {
48105                         xml: /xml/,
48106                         html: /html/,
48107                         json: /json/
48108                     },
48109
48110                     responseFields: {
48111                         xml: "responseXML",
48112                         text: "responseText",
48113                         json: "responseJSON"
48114                     },
48115
48116                     // Data converters
48117                     // Keys separate source (or catchall "*") and destination types with a
48118                     // single space
48119                     converters: {
48120
48121                         // Convert anything to text
48122                         "* text": String,
48123
48124                         // Text to html (true = no transformation)
48125                         "text html": true,
48126
48127                         // Evaluate text as a json expression
48128                         "text json": jQuery.parseJSON,
48129
48130                         // Parse text as xml
48131                         "text xml": jQuery.parseXML
48132                     },
48133
48134                     // For options that shouldn't be deep extended:
48135                     // you can add your own custom options here if
48136                     // and when you create one that shouldn't be
48137                     // deep extended (see ajaxExtend)
48138                     flatOptions: {
48139                         url: true,
48140                         context: true
48141                     }
48142                 },
48143
48144                 // Creates a full fledged settings object into target
48145                 // with both ajaxSettings and settings fields.
48146                 // If target is omitted, writes into ajaxSettings.
48147                 ajaxSetup: function(target, settings) {
48148                     return settings ?
48149
48150                         // Building a settings object
48151                         ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
48152
48153                         // Extending ajaxSettings
48154                         ajaxExtend(jQuery.ajaxSettings, target);
48155                 },
48156
48157                 ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
48158                 ajaxTransport: addToPrefiltersOrTransports(transports),
48159
48160                 // Main method
48161                 ajax: function(url, options) {
48162
48163                     // If url is an object, simulate pre-1.5 signature
48164                     if (typeof url === "object") {
48165                         options = url;
48166                         url = undefined;
48167                     }
48168
48169                     // Force options to be an object
48170                     options = options || {};
48171
48172                     var transport,
48173                         // URL without anti-cache param
48174                         cacheURL,
48175                         // Response headers
48176                         responseHeadersString,
48177                         responseHeaders,
48178                         // timeout handle
48179                         timeoutTimer,
48180                         // Cross-domain detection vars
48181                         parts,
48182                         // To know if global events are to be dispatched
48183                         fireGlobals,
48184                         // Loop variable
48185                         i,
48186                         // Create the final options object
48187                         s = jQuery.ajaxSetup({}, options),
48188                         // Callbacks context
48189                         callbackContext = s.context || s,
48190                         // Context for global events is callbackContext if it is a DOM node
48191                         // or jQuery collection
48192                         globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ?
48193                         jQuery(callbackContext) :
48194                         jQuery.event,
48195                         // Deferreds
48196                         deferred = jQuery.Deferred(),
48197                         completeDeferred = jQuery.Callbacks("once memory"),
48198                         // Status-dependent callbacks
48199                         statusCode = s.statusCode || {},
48200                         // Headers (they are sent all at once)
48201                         requestHeaders = {},
48202                         requestHeadersNames = {},
48203                         // The jqXHR state
48204                         state = 0,
48205                         // Default abort message
48206                         strAbort = "canceled",
48207                         // Fake xhr
48208                         jqXHR = {
48209                             readyState: 0,
48210
48211                             // Builds headers hashtable if needed
48212                             getResponseHeader: function(key) {
48213                                 var match;
48214                                 if (state === 2) {
48215                                     if (!responseHeaders) {
48216                                         responseHeaders = {};
48217                                         while ((match = rheaders.exec(responseHeadersString))) {
48218                                             responseHeaders[match[1].toLowerCase()] = match[2];
48219                                         }
48220                                     }
48221                                     match = responseHeaders[key.toLowerCase()];
48222                                 }
48223                                 return match == null ? null : match;
48224                             },
48225
48226                             // Raw string
48227                             getAllResponseHeaders: function() {
48228                                 return state === 2 ? responseHeadersString : null;
48229                             },
48230
48231                             // Caches the header
48232                             setRequestHeader: function(name, value) {
48233                                 var lname = name.toLowerCase();
48234                                 if (!state) {
48235                                     name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
48236                                     requestHeaders[name] = value;
48237                                 }
48238                                 return this;
48239                             },
48240
48241                             // Overrides response content-type header
48242                             overrideMimeType: function(type) {
48243                                 if (!state) {
48244                                     s.mimeType = type;
48245                                 }
48246                                 return this;
48247                             },
48248
48249                             // Status-dependent callbacks
48250                             statusCode: function(map) {
48251                                 var code;
48252                                 if (map) {
48253                                     if (state < 2) {
48254                                         for (code in map) {
48255                                             // Lazy-add the new callback in a way that
48256                                             // preserves old ones
48257                                             statusCode[code] = [statusCode[code], map[code]];
48258                                         }
48259                                     } else {
48260                                         // Execute the appropriate callbacks
48261                                         jqXHR.always(map[jqXHR.status]);
48262                                     }
48263                                 }
48264                                 return this;
48265                             },
48266
48267                             // Cancel the request
48268                             abort: function(statusText) {
48269                                 var finalText = statusText || strAbort;
48270                                 if (transport) {
48271                                     transport.abort(finalText);
48272                                 }
48273                                 done(0, finalText);
48274                                 return this;
48275                             }
48276                         };
48277
48278                     // Attach deferreds
48279                     deferred.promise(jqXHR).complete = completeDeferred.add;
48280                     jqXHR.success = jqXHR.done;
48281                     jqXHR.error = jqXHR.fail;
48282
48283                     // Remove hash character (#7531: and string promotion)
48284                     // Add protocol if not provided (prefilters might expect it)
48285                     // Handle falsy url in the settings object (#10093: consistency with old
48286                     // signature)
48287                     // We also use the url parameter if available
48288                     s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "")
48289                         .replace(rprotocol, ajaxLocParts[1] + "//");
48290
48291                     // Alias method option to type as per ticket #12004
48292                     s.type = options.method || options.type || s.method || s.type;
48293
48294                     // Extract dataTypes list
48295                     s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""];
48296
48297                     // A cross-domain request is in order when we have a protocol:host:port
48298                     // mismatch
48299                     if (s.crossDomain == null) {
48300                         parts = rurl.exec(s.url.toLowerCase());
48301                         s.crossDomain = !!(parts &&
48302                             (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
48303                                 (parts[3] || (parts[1] === "http:" ? "80" : "443")) !==
48304                                 (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))
48305                         );
48306                     }
48307
48308                     // Convert data if not already a string
48309                     if (s.data && s.processData && typeof s.data !== "string") {
48310                         s.data = jQuery.param(s.data, s.traditional);
48311                     }
48312
48313                     // Apply prefilters
48314                     inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
48315
48316                     // If request was aborted inside a prefilter, stop there
48317                     if (state === 2) {
48318                         return jqXHR;
48319                     }
48320
48321                     // We can fire global events as of now if asked to
48322                     // Don't fire events if jQuery.event is undefined in an AMD-usage
48323                     // scenario (#15118)
48324                     fireGlobals = jQuery.event && s.global;
48325
48326                     // Watch for a new set of requests
48327                     if (fireGlobals && jQuery.active++ === 0) {
48328                         jQuery.event.trigger("ajaxStart");
48329                     }
48330
48331                     // Uppercase the type
48332                     s.type = s.type.toUpperCase();
48333
48334                     // Determine if request has content
48335                     s.hasContent = !rnoContent.test(s.type);
48336
48337                     // Save the URL in case we're toying with the If-Modified-Since
48338                     // and/or If-None-Match header later on
48339                     cacheURL = s.url;
48340
48341                     // More options handling for requests with no content
48342                     if (!s.hasContent) {
48343
48344                         // If data is available, append data to url
48345                         if (s.data) {
48346                             cacheURL = (s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data);
48347                             // #9682: remove data so that it's not used in an eventual retry
48348                             delete s.data;
48349                         }
48350
48351                         // Add anti-cache in url if needed
48352                         if (s.cache === false) {
48353                             s.url = rts.test(cacheURL) ?
48354
48355                                 // If there is already a '_' parameter, set its value
48356                                 cacheURL.replace(rts, "$1_=" + nonce++) :
48357
48358                                 // Otherwise add one to the end
48359                                 cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++;
48360                         }
48361                     }
48362
48363                     // Set the If-Modified-Since and/or If-None-Match header, if in
48364                     // ifModified mode.
48365                     if (s.ifModified) {
48366                         if (jQuery.lastModified[cacheURL]) {
48367                             jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
48368                         }
48369                         if (jQuery.etag[cacheURL]) {
48370                             jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
48371                         }
48372                     }
48373
48374                     // Set the correct header, if data is being sent
48375                     if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
48376                         jqXHR.setRequestHeader("Content-Type", s.contentType);
48377                     }
48378
48379                     // Set the Accepts header for the server, depending on the dataType
48380                     jqXHR.setRequestHeader(
48381                         "Accept",
48382                         s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
48383                         s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") :
48384                         s.accepts["*"]
48385                     );
48386
48387                     // Check for headers option
48388                     for (i in s.headers) {
48389                         jqXHR.setRequestHeader(i, s.headers[i]);
48390                     }
48391
48392                     // Allow custom headers/mimetypes and early abort
48393                     if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
48394                         // Abort if not done already and return
48395                         return jqXHR.abort();
48396                     }
48397
48398                     // Aborting is no longer a cancellation
48399                     strAbort = "abort";
48400
48401                     // Install callbacks on deferreds
48402                     for (i in {
48403                             success: 1,
48404                             error: 1,
48405                             complete: 1
48406                         }) {
48407                         jqXHR[i](s[i]);
48408                     }
48409
48410                     // Get transport
48411                     transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
48412
48413                     // If no transport, we auto-abort
48414                     if (!transport) {
48415                         done(-1, "No Transport");
48416                     } else {
48417                         jqXHR.readyState = 1;
48418
48419                         // Send global event
48420                         if (fireGlobals) {
48421                             globalEventContext.trigger("ajaxSend", [jqXHR, s]);
48422                         }
48423                         // Timeout
48424                         if (s.async && s.timeout > 0) {
48425                             timeoutTimer = setTimeout(function() {
48426                                 jqXHR.abort("timeout");
48427                             }, s.timeout);
48428                         }
48429
48430                         try {
48431                             state = 1;
48432                             transport.send(requestHeaders, done);
48433                         } catch (e) {
48434                             // Propagate exception as error if not done
48435                             if (state < 2) {
48436                                 done(-1, e);
48437                                 // Simply rethrow otherwise
48438                             } else {
48439                                 throw e;
48440                             }
48441                         }
48442                     }
48443
48444                     // Callback for when everything is done
48445                     function done(status, nativeStatusText, responses, headers) {
48446                         var isSuccess, success, error, response, modified,
48447                             statusText = nativeStatusText;
48448
48449                         // Called once
48450                         if (state === 2) {
48451                             return;
48452                         }
48453
48454                         // State is "done" now
48455                         state = 2;
48456
48457                         // Clear timeout if it exists
48458                         if (timeoutTimer) {
48459                             clearTimeout(timeoutTimer);
48460                         }
48461
48462                         // Dereference transport for early garbage collection
48463                         // (no matter how long the jqXHR object will be used)
48464                         transport = undefined;
48465
48466                         // Cache response headers
48467                         responseHeadersString = headers || "";
48468
48469                         // Set readyState
48470                         jqXHR.readyState = status > 0 ? 4 : 0;
48471
48472                         // Determine if successful
48473                         isSuccess = status >= 200 && status < 300 || status === 304;
48474
48475                         // Get response data
48476                         if (responses) {
48477                             response = ajaxHandleResponses(s, jqXHR, responses);
48478                         }
48479
48480                         // Convert no matter what (that way responseXXX fields are always
48481                         // set)
48482                         response = ajaxConvert(s, response, jqXHR, isSuccess);
48483
48484                         // If successful, handle type chaining
48485                         if (isSuccess) {
48486
48487                             // Set the If-Modified-Since and/or If-None-Match header, if in
48488                             // ifModified mode.
48489                             if (s.ifModified) {
48490                                 modified = jqXHR.getResponseHeader("Last-Modified");
48491                                 if (modified) {
48492                                     jQuery.lastModified[cacheURL] = modified;
48493                                 }
48494                                 modified = jqXHR.getResponseHeader("etag");
48495                                 if (modified) {
48496                                     jQuery.etag[cacheURL] = modified;
48497                                 }
48498                             }
48499
48500                             // if no content
48501                             if (status === 204 || s.type === "HEAD") {
48502                                 statusText = "nocontent";
48503
48504                                 // if not modified
48505                             } else if (status === 304) {
48506                                 statusText = "notmodified";
48507
48508                                 // If we have data, let's convert it
48509                             } else {
48510                                 statusText = response.state;
48511                                 success = response.data;
48512                                 error = response.error;
48513                                 isSuccess = !error;
48514                             }
48515                         } else {
48516                             // Extract error from statusText and normalize for non-aborts
48517                             error = statusText;
48518                             if (status || !statusText) {
48519                                 statusText = "error";
48520                                 if (status < 0) {
48521                                     status = 0;
48522                                 }
48523                             }
48524                         }
48525
48526                         // Set data for the fake xhr object
48527                         jqXHR.status = status;
48528                         jqXHR.statusText = (nativeStatusText || statusText) + "";
48529
48530                         // Success/Error
48531                         if (isSuccess) {
48532                             deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
48533                         } else {
48534                             deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
48535                         }
48536
48537                         // Status-dependent callbacks
48538                         jqXHR.statusCode(statusCode);
48539                         statusCode = undefined;
48540
48541                         if (fireGlobals) {
48542                             globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
48543                         }
48544
48545                         // Complete
48546                         completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
48547
48548                         if (fireGlobals) {
48549                             globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
48550                             // Handle the global AJAX counter
48551                             if (!(--jQuery.active)) {
48552                                 jQuery.event.trigger("ajaxStop");
48553                             }
48554                         }
48555                     }
48556
48557                     return jqXHR;
48558                 },
48559
48560                 getJSON: function(url, data, callback) {
48561                     return jQuery.get(url, data, callback, "json");
48562                 },
48563
48564                 getScript: function(url, callback) {
48565                     return jQuery.get(url, undefined, callback, "script");
48566                 }
48567             });
48568
48569             jQuery.each(["get", "post"], function(i, method) {
48570                 jQuery[method] = function(url, data, callback, type) {
48571                     // Shift arguments if data argument was omitted
48572                     if (jQuery.isFunction(data)) {
48573                         type = type || callback;
48574                         callback = data;
48575                         data = undefined;
48576                     }
48577
48578                     return jQuery.ajax({
48579                         url: url,
48580                         type: method,
48581                         dataType: type,
48582                         data: data,
48583                         success: callback
48584                     });
48585                 };
48586             });
48587
48588
48589             jQuery._evalUrl = function(url) {
48590                 return jQuery.ajax({
48591                     url: url,
48592                     type: "GET",
48593                     dataType: "script",
48594                     async: false,
48595                     global: false,
48596                     "throws": true
48597                 });
48598             };
48599
48600
48601             jQuery.fn.extend({
48602                 wrapAll: function(html) {
48603                     var wrap;
48604
48605                     if (jQuery.isFunction(html)) {
48606                         return this.each(function(i) {
48607                             jQuery(this).wrapAll(html.call(this, i));
48608                         });
48609                     }
48610
48611                     if (this[0]) {
48612
48613                         // The elements to wrap the target around
48614                         wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
48615
48616                         if (this[0].parentNode) {
48617                             wrap.insertBefore(this[0]);
48618                         }
48619
48620                         wrap.map(function() {
48621                             var elem = this;
48622
48623                             while (elem.firstElementChild) {
48624                                 elem = elem.firstElementChild;
48625                             }
48626
48627                             return elem;
48628                         }).append(this);
48629                     }
48630
48631                     return this;
48632                 },
48633
48634                 wrapInner: function(html) {
48635                     if (jQuery.isFunction(html)) {
48636                         return this.each(function(i) {
48637                             jQuery(this).wrapInner(html.call(this, i));
48638                         });
48639                     }
48640
48641                     return this.each(function() {
48642                         var self = jQuery(this),
48643                             contents = self.contents();
48644
48645                         if (contents.length) {
48646                             contents.wrapAll(html);
48647
48648                         } else {
48649                             self.append(html);
48650                         }
48651                     });
48652                 },
48653
48654                 wrap: function(html) {
48655                     var isFunction = jQuery.isFunction(html);
48656
48657                     return this.each(function(i) {
48658                         jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
48659                     });
48660                 },
48661
48662                 unwrap: function() {
48663                     return this.parent().each(function() {
48664                         if (!jQuery.nodeName(this, "body")) {
48665                             jQuery(this).replaceWith(this.childNodes);
48666                         }
48667                     }).end();
48668                 }
48669             });
48670
48671
48672             jQuery.expr.filters.hidden = function(elem) {
48673                 // Support: Opera <= 12.12
48674                 // Opera reports offsetWidths and offsetHeights less than zero on some
48675                 // elements
48676                 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
48677             };
48678             jQuery.expr.filters.visible = function(elem) {
48679                 return !jQuery.expr.filters.hidden(elem);
48680             };
48681
48682
48683
48684
48685             var r20 = /%20/g,
48686                 rbracket = /\[\]$/,
48687                 rCRLF = /\r?\n/g,
48688                 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
48689                 rsubmittable = /^(?:input|select|textarea|keygen)/i;
48690
48691             function buildParams(prefix, obj, traditional, add) {
48692                 var name;
48693
48694                 if (jQuery.isArray(obj)) {
48695                     // Serialize array item.
48696                     jQuery.each(obj, function(i, v) {
48697                         if (traditional || rbracket.test(prefix)) {
48698                             // Treat each array item as a scalar.
48699                             add(prefix, v);
48700
48701                         } else {
48702                             // Item is non-scalar (array or object), encode its numeric
48703                             // index.
48704                             buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
48705                         }
48706                     });
48707
48708                 } else if (!traditional && jQuery.type(obj) === "object") {
48709                     // Serialize object item.
48710                     for (name in obj) {
48711                         buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
48712                     }
48713
48714                 } else {
48715                     // Serialize scalar item.
48716                     add(prefix, obj);
48717                 }
48718             }
48719
48720             // Serialize an array of form elements or a set of
48721             // key/values into a query string
48722             jQuery.param = function(a, traditional) {
48723                 var prefix,
48724                     s = [],
48725                     add = function(key, value) {
48726                         // If value is a function, invoke it and return its value
48727                         value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
48728                         s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
48729                     };
48730
48731                 // Set traditional to true for jQuery <= 1.3.2 behavior.
48732                 if (traditional === undefined) {
48733                     traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
48734                 }
48735
48736                 // If an array was passed in, assume that it is an array of form elements.
48737                 if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
48738                     // Serialize the form elements
48739                     jQuery.each(a, function() {
48740                         add(this.name, this.value);
48741                     });
48742
48743                 } else {
48744                     // If traditional, encode the "old" way (the way 1.3.2 or older
48745                     // did it), otherwise encode params recursively.
48746                     for (prefix in a) {
48747                         buildParams(prefix, a[prefix], traditional, add);
48748                     }
48749                 }
48750
48751                 // Return the resulting serialization
48752                 return s.join("&").replace(r20, "+");
48753             };
48754
48755             jQuery.fn.extend({
48756                 serialize: function() {
48757                     return jQuery.param(this.serializeArray());
48758                 },
48759                 serializeArray: function() {
48760                     return this.map(function() {
48761                             // Can add propHook for "elements" to filter or add form elements
48762                             var elements = jQuery.prop(this, "elements");
48763                             return elements ? jQuery.makeArray(elements) : this;
48764                         })
48765                         .filter(function() {
48766                             var type = this.type;
48767
48768                             // Use .is( ":disabled" ) so that fieldset[disabled] works
48769                             return this.name && !jQuery(this).is(":disabled") &&
48770                                 rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
48771                                 (this.checked || !rcheckableType.test(type));
48772                         })
48773                         .map(function(i, elem) {
48774                             var val = jQuery(this).val();
48775
48776                             return val == null ?
48777                                 null :
48778                                 jQuery.isArray(val) ?
48779                                 jQuery.map(val, function(val) {
48780                                     return {
48781                                         name: elem.name,
48782                                         value: val.replace(rCRLF, "\r\n")
48783                                     };
48784                                 }) : {
48785                                     name: elem.name,
48786                                     value: val.replace(rCRLF, "\r\n")
48787                                 };
48788                         }).get();
48789                 }
48790             });
48791
48792
48793             jQuery.ajaxSettings.xhr = function() {
48794                 try {
48795                     return new XMLHttpRequest();
48796                 } catch (e) {}
48797             };
48798
48799             var xhrId = 0,
48800                 xhrCallbacks = {},
48801                 xhrSuccessStatus = {
48802                     // file protocol always yields status code 0, assume 200
48803                     0: 200,
48804                     // Support: IE9
48805                     // #1450: sometimes IE returns 1223 when it should be 204
48806                     1223: 204
48807                 },
48808                 xhrSupported = jQuery.ajaxSettings.xhr();
48809
48810             // Support: IE9
48811             // Open requests must be manually aborted on unload (#5280)
48812             // See https://support.microsoft.com/kb/2856746 for more info
48813             if (window.attachEvent) {
48814                 window.attachEvent("onunload", function() {
48815                     for (var key in xhrCallbacks) {
48816                         xhrCallbacks[key]();
48817                     }
48818                 });
48819             }
48820
48821             support.cors = !!xhrSupported && ("withCredentials" in xhrSupported);
48822             support.ajax = xhrSupported = !!xhrSupported;
48823
48824             jQuery.ajaxTransport(function(options) {
48825                 var callback;
48826
48827                 // Cross domain only allowed if supported through XMLHttpRequest
48828                 if (support.cors || xhrSupported && !options.crossDomain) {
48829                     return {
48830                         send: function(headers, complete) {
48831                             var i,
48832                                 xhr = options.xhr(),
48833                                 id = ++xhrId;
48834
48835                             xhr.open(options.type, options.url, options.async, options.username, options.password);
48836
48837                             // Apply custom fields if provided
48838                             if (options.xhrFields) {
48839                                 for (i in options.xhrFields) {
48840                                     xhr[i] = options.xhrFields[i];
48841                                 }
48842                             }
48843
48844                             // Override mime type if needed
48845                             if (options.mimeType && xhr.overrideMimeType) {
48846                                 xhr.overrideMimeType(options.mimeType);
48847                             }
48848
48849                             // X-Requested-With header
48850                             // For cross-domain requests, seeing as conditions for a
48851                             // preflight are
48852                             // akin to a jigsaw puzzle, we simply never set it to be sure.
48853                             // (it can always be set on a per-request basis or even using
48854                             // ajaxSetup)
48855                             // For same-domain requests, won't change header if already
48856                             // provided.
48857                             if (!options.crossDomain && !headers["X-Requested-With"]) {
48858                                 headers["X-Requested-With"] = "XMLHttpRequest";
48859                             }
48860
48861                             // Set headers
48862                             for (i in headers) {
48863                                 xhr.setRequestHeader(i, headers[i]);
48864                             }
48865
48866                             // Callback
48867                             callback = function(type) {
48868                                 return function() {
48869                                     if (callback) {
48870                                         delete xhrCallbacks[id];
48871                                         callback = xhr.onload = xhr.onerror = null;
48872
48873                                         if (type === "abort") {
48874                                             xhr.abort();
48875                                         } else if (type === "error") {
48876                                             complete(
48877                                                 // file: protocol always yields status 0;
48878                                                 // see #8605, #14207
48879                                                 xhr.status,
48880                                                 xhr.statusText
48881                                             );
48882                                         } else {
48883                                             complete(
48884                                                 xhrSuccessStatus[xhr.status] || xhr.status,
48885                                                 xhr.statusText,
48886                                                 // Support: IE9
48887                                                 // Accessing binary-data responseText throws
48888                                                 // an exception
48889                                                 // (#11426)
48890                                                 typeof xhr.responseText === "string" ? {
48891                                                     text: xhr.responseText
48892                                                 } : undefined,
48893                                                 xhr.getAllResponseHeaders()
48894                                             );
48895                                         }
48896                                     }
48897                                 };
48898                             };
48899
48900                             // Listen to events
48901                             xhr.onload = callback();
48902                             xhr.onerror = callback("error");
48903
48904                             // Create the abort callback
48905                             callback = xhrCallbacks[id] = callback("abort");
48906
48907                             try {
48908                                 // Do send the request (this may raise an exception)
48909                                 xhr.send(options.hasContent && options.data || null);
48910                             } catch (e) {
48911                                 // #14683: Only rethrow if this hasn't been notified as an
48912                                 // error yet
48913                                 if (callback) {
48914                                     throw e;
48915                                 }
48916                             }
48917                         },
48918
48919                         abort: function() {
48920                             if (callback) {
48921                                 callback();
48922                             }
48923                         }
48924                     };
48925                 }
48926             });
48927
48928
48929
48930
48931             // Install script dataType
48932             jQuery.ajaxSetup({
48933                 accepts: {
48934                     script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
48935                 },
48936                 contents: {
48937                     script: /(?:java|ecma)script/
48938                 },
48939                 converters: {
48940                     "text script": function(text) {
48941                         jQuery.globalEval(text);
48942                         return text;
48943                     }
48944                 }
48945             });
48946
48947             // Handle cache's special case and crossDomain
48948             jQuery.ajaxPrefilter("script", function(s) {
48949                 if (s.cache === undefined) {
48950                     s.cache = false;
48951                 }
48952                 if (s.crossDomain) {
48953                     s.type = "GET";
48954                 }
48955             });
48956
48957             // Bind script tag hack transport
48958             jQuery.ajaxTransport("script", function(s) {
48959                 // This transport only deals with cross domain requests
48960                 if (s.crossDomain) {
48961                     var script, callback;
48962                     return {
48963                         send: function(_, complete) {
48964                             script = jQuery("<script>").prop({
48965                                 async: true,
48966                                 charset: s.scriptCharset,
48967                                 src: s.url
48968                             }).on(
48969                                 "load error",
48970                                 callback = function(evt) {
48971                                     script.remove();
48972                                     callback = null;
48973                                     if (evt) {
48974                                         complete(evt.type === "error" ? 404 : 200, evt.type);
48975                                     }
48976                                 }
48977                             );
48978                             document.head.appendChild(script[0]);
48979                         },
48980                         abort: function() {
48981                             if (callback) {
48982                                 callback();
48983                             }
48984                         }
48985                     };
48986                 }
48987             });
48988
48989
48990
48991
48992             var oldCallbacks = [],
48993                 rjsonp = /(=)\?(?=&|$)|\?\?/;
48994
48995             // Default jsonp settings
48996             jQuery.ajaxSetup({
48997                 jsonp: "callback",
48998                 jsonpCallback: function() {
48999                     var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++));
49000                     this[callback] = true;
49001                     return callback;
49002                 }
49003             });
49004
49005             // Detect, normalize options and install callbacks for jsonp requests
49006             jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
49007
49008                 var callbackName, overwritten, responseContainer,
49009                     jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ?
49010                         "url" :
49011                         typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"
49012                     );
49013
49014                 // Handle iff the expected data type is "jsonp" or we have a parameter to
49015                 // set
49016                 if (jsonProp || s.dataTypes[0] === "jsonp") {
49017
49018                     // Get callback name, remembering preexisting value associated with it
49019                     callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?
49020                         s.jsonpCallback() :
49021                         s.jsonpCallback;
49022
49023                     // Insert callback into url or form data
49024                     if (jsonProp) {
49025                         s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
49026                     } else if (s.jsonp !== false) {
49027                         s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
49028                     }
49029
49030                     // Use data converter to retrieve json after script execution
49031                     s.converters["script json"] = function() {
49032                         if (!responseContainer) {
49033                             jQuery.error(callbackName + " was not called");
49034                         }
49035                         return responseContainer[0];
49036                     };
49037
49038                     // force json dataType
49039                     s.dataTypes[0] = "json";
49040
49041                     // Install callback
49042                     overwritten = window[callbackName];
49043                     window[callbackName] = function() {
49044                         responseContainer = arguments;
49045                     };
49046
49047                     // Clean-up function (fires after converters)
49048                     jqXHR.always(function() {
49049                         // Restore preexisting value
49050                         window[callbackName] = overwritten;
49051
49052                         // Save back as free
49053                         if (s[callbackName]) {
49054                             // make sure that re-using the options doesn't screw things
49055                             // around
49056                             s.jsonpCallback = originalSettings.jsonpCallback;
49057
49058                             // save the callback name for future use
49059                             oldCallbacks.push(callbackName);
49060                         }
49061
49062                         // Call if it was a function and we have a response
49063                         if (responseContainer && jQuery.isFunction(overwritten)) {
49064                             overwritten(responseContainer[0]);
49065                         }
49066
49067                         responseContainer = overwritten = undefined;
49068                     });
49069
49070                     // Delegate to script
49071                     return "script";
49072                 }
49073             });
49074
49075
49076
49077
49078             // data: string of html
49079             // context (optional): If specified, the fragment will be created in this
49080             // context, defaults to document
49081             // keepScripts (optional): If true, will include scripts passed in the html
49082             // string
49083             jQuery.parseHTML = function(data, context, keepScripts) {
49084                 if (!data || typeof data !== "string") {
49085                     return null;
49086                 }
49087                 if (typeof context === "boolean") {
49088                     keepScripts = context;
49089                     context = false;
49090                 }
49091                 context = context || document;
49092
49093                 var parsed = rsingleTag.exec(data),
49094                     scripts = !keepScripts && [];
49095
49096                 // Single tag
49097                 if (parsed) {
49098                     return [context.createElement(parsed[1])];
49099                 }
49100
49101                 parsed = jQuery.buildFragment([data], context, scripts);
49102
49103                 if (scripts && scripts.length) {
49104                     jQuery(scripts).remove();
49105                 }
49106
49107                 return jQuery.merge([], parsed.childNodes);
49108             };
49109
49110
49111             // Keep a copy of the old load method
49112             var _load = jQuery.fn.load;
49113
49114             /**
49115              * Load a url into a page
49116              */
49117             jQuery.fn.load = function(url, params, callback) {
49118                 if (typeof url !== "string" && _load) {
49119                     return _load.apply(this, arguments);
49120                 }
49121
49122                 var selector, type, response,
49123                     self = this,
49124                     off = url.indexOf(" ");
49125
49126                 if (off >= 0) {
49127                     selector = jQuery.trim(url.slice(off));
49128                     url = url.slice(0, off);
49129                 }
49130
49131                 // If it's a function
49132                 if (jQuery.isFunction(params)) {
49133
49134                     // We assume that it's the callback
49135                     callback = params;
49136                     params = undefined;
49137
49138                     // Otherwise, build a param string
49139                 } else if (params && typeof params === "object") {
49140                     type = "POST";
49141                 }
49142
49143                 // If we have elements to modify, make the request
49144                 if (self.length > 0) {
49145                     jQuery.ajax({
49146                         url: url,
49147
49148                         // if "type" variable is undefined, then "GET" method will be used
49149                         type: type,
49150                         dataType: "html",
49151                         data: params
49152                     }).done(function(responseText) {
49153
49154                         // Save response for use in complete callback
49155                         response = arguments;
49156
49157                         self.html(selector ?
49158
49159                             // If a selector was specified, locate the right elements in a
49160                             // dummy div
49161                             // Exclude scripts to avoid IE 'Permission Denied' errors
49162                             jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
49163
49164                             // Otherwise use the full result
49165                             responseText);
49166
49167                     }).complete(callback && function(jqXHR, status) {
49168                         self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
49169                     });
49170                 }
49171
49172                 return this;
49173             };
49174
49175
49176
49177
49178             // Attach a bunch of functions for handling common AJAX events
49179             jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
49180                 jQuery.fn[type] = function(fn) {
49181                     return this.on(type, fn);
49182                 };
49183             });
49184
49185
49186
49187
49188             jQuery.expr.filters.animated = function(elem) {
49189                 return jQuery.grep(jQuery.timers, function(fn) {
49190                     return elem === fn.elem;
49191                 }).length;
49192             };
49193
49194
49195
49196
49197             var docElem = window.document.documentElement;
49198
49199             /**
49200              * Gets a window from an element
49201              */
49202             function getWindow(elem) {
49203                 return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
49204             }
49205
49206             jQuery.offset = {
49207                 setOffset: function(elem, options, i) {
49208                     var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
49209                         position = jQuery.css(elem, "position"),
49210                         curElem = jQuery(elem),
49211                         props = {};
49212
49213                     // Set position first, in-case top/left are set even on static elem
49214                     if (position === "static") {
49215                         elem.style.position = "relative";
49216                     }
49217
49218                     curOffset = curElem.offset();
49219                     curCSSTop = jQuery.css(elem, "top");
49220                     curCSSLeft = jQuery.css(elem, "left");
49221                     calculatePosition = (position === "absolute" || position === "fixed") &&
49222                         (curCSSTop + curCSSLeft).indexOf("auto") > -1;
49223
49224                     // Need to be able to calculate position if either
49225                     // top or left is auto and position is either absolute or fixed
49226                     if (calculatePosition) {
49227                         curPosition = curElem.position();
49228                         curTop = curPosition.top;
49229                         curLeft = curPosition.left;
49230
49231                     } else {
49232                         curTop = parseFloat(curCSSTop) || 0;
49233                         curLeft = parseFloat(curCSSLeft) || 0;
49234                     }
49235
49236                     if (jQuery.isFunction(options)) {
49237                         options = options.call(elem, i, curOffset);
49238                     }
49239
49240                     if (options.top != null) {
49241                         props.top = (options.top - curOffset.top) + curTop;
49242                     }
49243                     if (options.left != null) {
49244                         props.left = (options.left - curOffset.left) + curLeft;
49245                     }
49246
49247                     if ("using" in options) {
49248                         options.using.call(elem, props);
49249
49250                     } else {
49251                         curElem.css(props);
49252                     }
49253                 }
49254             };
49255
49256             jQuery.fn.extend({
49257                 offset: function(options) {
49258                     if (arguments.length) {
49259                         return options === undefined ?
49260                             this :
49261                             this.each(function(i) {
49262                                 jQuery.offset.setOffset(this, options, i);
49263                             });
49264                     }
49265
49266                     var docElem, win,
49267                         elem = this[0],
49268                         box = {
49269                             top: 0,
49270                             left: 0
49271                         },
49272                         doc = elem && elem.ownerDocument;
49273
49274                     if (!doc) {
49275                         return;
49276                     }
49277
49278                     docElem = doc.documentElement;
49279
49280                     // Make sure it's not a disconnected DOM node
49281                     if (!jQuery.contains(docElem, elem)) {
49282                         return box;
49283                     }
49284
49285                     // Support: BlackBerry 5, iOS 3 (original iPhone)
49286                     // If we don't have gBCR, just use 0,0 rather than error
49287                     if (typeof elem.getBoundingClientRect !== strundefined) {
49288                         box = elem.getBoundingClientRect();
49289                     }
49290                     win = getWindow(doc);
49291                     return {
49292                         top: box.top + win.pageYOffset - docElem.clientTop,
49293                         left: box.left + win.pageXOffset - docElem.clientLeft
49294                     };
49295                 },
49296
49297                 position: function() {
49298                     if (!this[0]) {
49299                         return;
49300                     }
49301
49302                     var offsetParent, offset,
49303                         elem = this[0],
49304                         parentOffset = {
49305                             top: 0,
49306                             left: 0
49307                         };
49308
49309                     // Fixed elements are offset from window (parentOffset = {top:0, left:
49310                     // 0}, because it is its only offset parent
49311                     if (jQuery.css(elem, "position") === "fixed") {
49312                         // Assume getBoundingClientRect is there when computed position is
49313                         // fixed
49314                         offset = elem.getBoundingClientRect();
49315
49316                     } else {
49317                         // Get *real* offsetParent
49318                         offsetParent = this.offsetParent();
49319
49320                         // Get correct offsets
49321                         offset = this.offset();
49322                         if (!jQuery.nodeName(offsetParent[0], "html")) {
49323                             parentOffset = offsetParent.offset();
49324                         }
49325
49326                         // Add offsetParent borders
49327                         parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
49328                         parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
49329                     }
49330
49331                     // Subtract parent offsets and element margins
49332                     return {
49333                         top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
49334                         left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
49335                     };
49336                 },
49337
49338                 offsetParent: function() {
49339                     return this.map(function() {
49340                         var offsetParent = this.offsetParent || docElem;
49341
49342                         while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
49343                             offsetParent = offsetParent.offsetParent;
49344                         }
49345
49346                         return offsetParent || docElem;
49347                     });
49348                 }
49349             });
49350
49351             // Create scrollLeft and scrollTop methods
49352             jQuery.each({
49353                 scrollLeft: "pageXOffset",
49354                 scrollTop: "pageYOffset"
49355             }, function(method, prop) {
49356                 var top = "pageYOffset" === prop;
49357
49358                 jQuery.fn[method] = function(val) {
49359                     return access(this, function(elem, method, val) {
49360                         var win = getWindow(elem);
49361
49362                         if (val === undefined) {
49363                             return win ? win[prop] : elem[method];
49364                         }
49365
49366                         if (win) {
49367                             win.scrollTo(!top ? val : window.pageXOffset,
49368                                 top ? val : window.pageYOffset
49369                             );
49370
49371                         } else {
49372                             elem[method] = val;
49373                         }
49374                     }, method, val, arguments.length, null);
49375                 };
49376             });
49377
49378             // Support: Safari<7+, Chrome<37+
49379             // Add the top/left cssHooks using jQuery.fn.position
49380             // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
49381             // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
49382             // getComputedStyle returns percent when specified for top/left/bottom/right;
49383             // rather than make the css module depend on the offset module, just check for
49384             // it here
49385             jQuery.each(["top", "left"], function(i, prop) {
49386                 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition,
49387                     function(elem, computed) {
49388                         if (computed) {
49389                             computed = curCSS(elem, prop);
49390                             // If curCSS returns percentage, fallback to offset
49391                             return rnumnonpx.test(computed) ?
49392                                 jQuery(elem).position()[prop] + "px" :
49393                                 computed;
49394                         }
49395                     }
49396                 );
49397             });
49398
49399
49400             // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth
49401             // methods
49402             jQuery.each({
49403                 Height: "height",
49404                 Width: "width"
49405             }, function(name, type) {
49406                 jQuery.each({
49407                     padding: "inner" + name,
49408                     content: type,
49409                     "": "outer" + name
49410                 }, function(defaultExtra, funcName) {
49411                     // Margin is only for outerHeight, outerWidth
49412                     jQuery.fn[funcName] = function(margin, value) {
49413                         var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
49414                             extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
49415
49416                         return access(this, function(elem, type, value) {
49417                             var doc;
49418
49419                             if (jQuery.isWindow(elem)) {
49420                                 // As of 5/8/2012 this will yield incorrect results for
49421                                 // Mobile Safari, but there
49422                                 // isn't a whole lot we can do. See pull request at this URL
49423                                 // for discussion:
49424                                 // https://github.com/jquery/jquery/pull/764
49425                                 return elem.document.documentElement["client" + name];
49426                             }
49427
49428                             // Get document width or height
49429                             if (elem.nodeType === 9) {
49430                                 doc = elem.documentElement;
49431
49432                                 // Either scroll[Width/Height] or offset[Width/Height] or
49433                                 // client[Width/Height],
49434                                 // whichever is greatest
49435                                 return Math.max(
49436                                     elem.body["scroll" + name], doc["scroll" + name],
49437                                     elem.body["offset" + name], doc["offset" + name],
49438                                     doc["client" + name]
49439                                 );
49440                             }
49441
49442                             return value === undefined ?
49443                                 // Get width or height on the element, requesting but not
49444                                 // forcing parseFloat
49445                                 jQuery.css(elem, type, extra) :
49446
49447                                 // Set width or height on the element
49448                                 jQuery.style(elem, type, value, extra);
49449                         }, type, chainable ? margin : undefined, chainable, null);
49450                     };
49451                 });
49452             });
49453
49454
49455             // The number of elements contained in the matched element set
49456             jQuery.fn.size = function() {
49457                 return this.length;
49458             };
49459
49460             jQuery.fn.andSelf = jQuery.fn.addBack;
49461
49462
49463
49464
49465             // Register as a named AMD module, since jQuery can be concatenated with other
49466             // files that may use define, but not via a proper concatenation script that
49467             // understands anonymous AMD modules. A named AMD is safest and most robust
49468             // way to register. Lowercase jquery is used because AMD module names are
49469             // derived from file names, and jQuery is normally delivered in a lowercase
49470             // file name. Do this after creating the global so that if an AMD module wants
49471             // to call noConflict to hide this version of jQuery, it will work.
49472
49473             // Note that for maximum portability, libraries that are not jQuery should
49474             // declare themselves as anonymous modules, and avoid setting a global if an
49475             // AMD loader is present. jQuery is a special case. For more information, see
49476             // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
49477
49478             if (typeof define === "function" && define.amd) {
49479                 define("jquery", [], function() {
49480                     return jQuery;
49481                 });
49482             }
49483
49484
49485
49486
49487             var
49488             // Map over jQuery in case of overwrite
49489                 _jQuery = window.jQuery,
49490
49491                 // Map over the $ in case of overwrite
49492                 _$ = window.$;
49493
49494             jQuery.noConflict = function(deep) {
49495                 if (window.$ === jQuery) {
49496                     window.$ = _$;
49497                 }
49498
49499                 if (deep && window.jQuery === jQuery) {
49500                     window.jQuery = _jQuery;
49501                 }
49502
49503                 return jQuery;
49504             };
49505
49506             // Expose jQuery and $ identifiers, even in AMD
49507             // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
49508             // and CommonJS for browser emulators (#13566)
49509             if (typeof noGlobal === strundefined) {
49510                 window.jQuery = window.$ = jQuery;
49511             }
49512
49513
49514
49515
49516             return jQuery;
49517
49518         }));
49519
49520     }, {}],
49521     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js": [function(require, module, exports) {
49522         var baseFlatten = require('../internal/baseFlatten'),
49523             isIterateeCall = require('../internal/isIterateeCall');
49524
49525         /**
49526          * Flattens a nested array. If `isDeep` is `true` the array is recursively
49527          * flattened, otherwise it's only flattened a single level.
49528          * 
49529          * @static
49530          * @memberOf _
49531          * @category Array
49532          * @param {Array}
49533          *            array The array to flatten.
49534          * @param {boolean}
49535          *            [isDeep] Specify a deep flatten.
49536          * @param- {Object} [guard] Enables use as a callback for functions like
49537          *         `_.map`.
49538          * @returns {Array} Returns the new flattened array.
49539          * @example
49540          * 
49541          * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
49542          *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
49543          */
49544         function flatten(array, isDeep, guard) {
49545             var length = array ? array.length : 0;
49546             if (guard && isIterateeCall(array, isDeep, guard)) {
49547                 isDeep = false;
49548             }
49549             return length ? baseFlatten(array, isDeep) : [];
49550         }
49551
49552         module.exports = flatten;
49553
49554     }, {
49555         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
49556         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
49557     }],
49558     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js": [function(require, module, exports) {
49559         /**
49560          * Gets the last element of `array`.
49561          * 
49562          * @static
49563          * @memberOf _
49564          * @category Array
49565          * @param {Array}
49566          *            array The array to query.
49567          * @returns {*} Returns the last element of `array`.
49568          * @example
49569          * 
49570          * _.last([1, 2, 3]); // => 3
49571          */
49572         function last(array) {
49573             var length = array ? array.length : 0;
49574             return length ? array[length - 1] : undefined;
49575         }
49576
49577         module.exports = last;
49578
49579     }, {}],
49580     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js": [function(require, module, exports) {
49581         var baseCallback = require('../internal/baseCallback'),
49582             baseUniq = require('../internal/baseUniq'),
49583             isIterateeCall = require('../internal/isIterateeCall'),
49584             sortedUniq = require('../internal/sortedUniq');
49585
49586         /**
49587          * Creates a duplicate-free version of an array, using
49588          * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
49589          * for equality comparisons, in which only the first occurence of each element
49590          * is kept. Providing `true` for `isSorted` performs a faster search algorithm
49591          * for sorted arrays. If an iteratee function is provided it's invoked for each
49592          * element in the array to generate the criterion by which uniqueness is
49593          * computed. The `iteratee` is bound to `thisArg` and invoked with three
49594          * arguments: (value, index, array).
49595          * 
49596          * If a property name is provided for `iteratee` the created `_.property` style
49597          * callback returns the property value of the given element.
49598          * 
49599          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49600          * style callback returns `true` for elements that have a matching property
49601          * value, else `false`.
49602          * 
49603          * If an object is provided for `iteratee` the created `_.matches` style
49604          * callback returns `true` for elements that have the properties of the given
49605          * object, else `false`.
49606          * 
49607          * @static
49608          * @memberOf _
49609          * @alias unique
49610          * @category Array
49611          * @param {Array}
49612          *            array The array to inspect.
49613          * @param {boolean}
49614          *            [isSorted] Specify the array is sorted.
49615          * @param {Function|Object|string}
49616          *            [iteratee] The function invoked per iteration.
49617          * @param {*}
49618          *            [thisArg] The `this` binding of `iteratee`.
49619          * @returns {Array} Returns the new duplicate-value-free array.
49620          * @example
49621          * 
49622          * _.uniq([2, 1, 2]); // => [2, 1]
49623          *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
49624          *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) { return
49625          * this.floor(n); }, Math); // => [1, 2.5]
49626          *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x': 2 }, {
49627          * 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
49628          */
49629         function uniq(array, isSorted, iteratee, thisArg) {
49630             var length = array ? array.length : 0;
49631             if (!length) {
49632                 return [];
49633             }
49634             if (isSorted != null && typeof isSorted != 'boolean') {
49635                 thisArg = iteratee;
49636                 iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
49637                 isSorted = false;
49638             }
49639             iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
49640             return (isSorted) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
49641         }
49642
49643         module.exports = uniq;
49644
49645     }, {
49646         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49647         "../internal/baseUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js",
49648         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49649         "../internal/sortedUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js"
49650     }],
49651     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js": [function(require, module, exports) {
49652         module.exports = require('./uniq');
49653
49654     }, {
49655         "./uniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js"
49656     }],
49657     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js": [function(require, module, exports) {
49658         var LazyWrapper = require('../internal/LazyWrapper'),
49659             LodashWrapper = require('../internal/LodashWrapper'),
49660             baseLodash = require('../internal/baseLodash'),
49661             isArray = require('../lang/isArray'),
49662             isObjectLike = require('../internal/isObjectLike'),
49663             wrapperClone = require('../internal/wrapperClone');
49664
49665         /** Used for native method references. */
49666         var objectProto = Object.prototype;
49667
49668         /** Used to check objects for own properties. */
49669         var hasOwnProperty = objectProto.hasOwnProperty;
49670
49671         /**
49672          * Creates a `lodash` object which wraps `value` to enable implicit chaining.
49673          * Methods that operate on and return arrays, collections, and functions can be
49674          * chained together. Methods that retrieve a single value or may return a
49675          * primitive value will automatically end the chain returning the unwrapped
49676          * value. Explicit chaining may be enabled using `_.chain`. The execution of
49677          * chained methods is lazy, that is, execution is deferred until `_#value` is
49678          * implicitly or explicitly called.
49679          * 
49680          * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
49681          * fusion is an optimization strategy which merge iteratee calls; this can help
49682          * to avoid the creation of intermediate data structures and greatly reduce the
49683          * number of iteratee executions.
49684          * 
49685          * Chaining is supported in custom builds as long as the `_#value` method is
49686          * directly or indirectly included in the build.
49687          * 
49688          * In addition to lodash methods, wrappers have `Array` and `String` methods.
49689          * 
49690          * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`, `reverse`,
49691          * `shift`, `slice`, `sort`, `splice`, and `unshift`
49692          * 
49693          * The wrapper `String` methods are: `replace` and `split`
49694          * 
49695          * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
49696          * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
49697          * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
49698          * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
49699          * 
49700          * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`, `before`,
49701          * `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`, `commit`,
49702          * `compact`, `concat`, `constant`, `countBy`, `create`, `curry`, `debounce`,
49703          * `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, `drop`,
49704          * `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`,
49705          * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`,
49706          * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`,
49707          * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`,
49708          * `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`,
49709          * `method`, `methodOf`, `mixin`, `modArgs`, `negate`, `omit`, `once`, `pairs`,
49710          * `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, `property`,
49711          * `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`,
49712          * `rest`, `restParam`, `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`,
49713          * `sortByAll`, `sortByOrder`, `splice`, `spread`, `take`, `takeRight`,
49714          * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`,
49715          * `toPlainObject`, `transform`, `union`, `uniq`, `unshift`, `unzip`,
49716          * `unzipWith`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`,
49717          * `zipObject`, `zipWith`
49718          * 
49719          * The wrapper methods that are **not** chainable by default are: `add`,
49720          * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, `deburr`,
49721          * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
49722          * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
49723          * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
49724          * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
49725          * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
49726          * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
49727          * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
49728          * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
49729          * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
49730          * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
49731          * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
49732          * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
49733          * `unescape`, `uniqueId`, `value`, and `words`
49734          * 
49735          * The wrapper method `sample` will return a wrapped value when `n` is provided,
49736          * otherwise an unwrapped value is returned.
49737          * 
49738          * @name _
49739          * @constructor
49740          * @category Chain
49741          * @param {*}
49742          *            value The value to wrap in a `lodash` instance.
49743          * @returns {Object} Returns the new `lodash` wrapper instance.
49744          * @example
49745          * 
49746          * var wrapped = _([1, 2, 3]);
49747          *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
49748          * total + n; }); // => 6
49749          *  // returns a wrapped value var squares = wrapped.map(function(n) { return n *
49750          * n; });
49751          * 
49752          * _.isArray(squares); // => false
49753          * 
49754          * _.isArray(squares.value()); // => true
49755          */
49756         function lodash(value) {
49757             if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
49758                 if (value instanceof LodashWrapper) {
49759                     return value;
49760                 }
49761                 if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
49762                     return wrapperClone(value);
49763                 }
49764             }
49765             return new LodashWrapper(value);
49766         }
49767
49768         // Ensure wrappers are instances of `baseLodash`.
49769         lodash.prototype = baseLodash.prototype;
49770
49771         module.exports = lodash;
49772
49773     }, {
49774         "../internal/LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
49775         "../internal/LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
49776         "../internal/baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js",
49777         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
49778         "../internal/wrapperClone": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js",
49779         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49780     }],
49781     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js": [function(require, module, exports) {
49782         var arrayEvery = require('../internal/arrayEvery'),
49783             baseCallback = require('../internal/baseCallback'),
49784             baseEvery = require('../internal/baseEvery'),
49785             isArray = require('../lang/isArray'),
49786             isIterateeCall = require('../internal/isIterateeCall');
49787
49788         /**
49789          * Checks if `predicate` returns truthy for **all** elements of `collection`.
49790          * The predicate is bound to `thisArg` and invoked with three arguments: (value,
49791          * index|key, collection).
49792          * 
49793          * If a property name is provided for `predicate` the created `_.property` style
49794          * callback returns the property value of the given element.
49795          * 
49796          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49797          * style callback returns `true` for elements that have a matching property
49798          * value, else `false`.
49799          * 
49800          * If an object is provided for `predicate` the created `_.matches` style
49801          * callback returns `true` for elements that have the properties of the given
49802          * object, else `false`.
49803          * 
49804          * @static
49805          * @memberOf _
49806          * @alias all
49807          * @category Collection
49808          * @param {Array|Object|string}
49809          *            collection The collection to iterate over.
49810          * @param {Function|Object|string}
49811          *            [predicate=_.identity] The function invoked per iteration.
49812          * @param {*}
49813          *            [thisArg] The `this` binding of `predicate`.
49814          * @returns {boolean} Returns `true` if all elements pass the predicate check,
49815          *          else `false`.
49816          * @example
49817          * 
49818          * _.every([true, 1, null, 'yes'], Boolean); // => false
49819          * 
49820          * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
49821          * 'active': false } ];
49822          *  // using the `_.matches` callback shorthand _.every(users, { 'user':
49823          * 'barney', 'active': false }); // => false
49824          *  // using the `_.matchesProperty` callback shorthand _.every(users, 'active',
49825          * false); // => true
49826          *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
49827          * false
49828          */
49829         function every(collection, predicate, thisArg) {
49830             var func = isArray(collection) ? arrayEvery : baseEvery;
49831             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
49832                 predicate = undefined;
49833             }
49834             if (typeof predicate != 'function' || thisArg !== undefined) {
49835                 predicate = baseCallback(predicate, thisArg, 3);
49836             }
49837             return func(collection, predicate);
49838         }
49839
49840         module.exports = every;
49841
49842     }, {
49843         "../internal/arrayEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js",
49844         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49845         "../internal/baseEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js",
49846         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49847         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49848     }],
49849     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js": [function(require, module, exports) {
49850         var arrayFilter = require('../internal/arrayFilter'),
49851             baseCallback = require('../internal/baseCallback'),
49852             baseFilter = require('../internal/baseFilter'),
49853             isArray = require('../lang/isArray');
49854
49855         /**
49856          * Iterates over elements of `collection`, returning an array of all elements
49857          * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49858          * invoked with three arguments: (value, index|key, collection).
49859          * 
49860          * If a property name is provided for `predicate` the created `_.property` style
49861          * callback returns the property value of the given element.
49862          * 
49863          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49864          * style callback returns `true` for elements that have a matching property
49865          * value, else `false`.
49866          * 
49867          * If an object is provided for `predicate` the created `_.matches` style
49868          * callback returns `true` for elements that have the properties of the given
49869          * object, else `false`.
49870          * 
49871          * @static
49872          * @memberOf _
49873          * @alias select
49874          * @category Collection
49875          * @param {Array|Object|string}
49876          *            collection The collection to iterate over.
49877          * @param {Function|Object|string}
49878          *            [predicate=_.identity] The function invoked per iteration.
49879          * @param {*}
49880          *            [thisArg] The `this` binding of `predicate`.
49881          * @returns {Array} Returns the new filtered array.
49882          * @example
49883          * 
49884          * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
49885          * 
49886          * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49887          * 'fred', 'age': 40, 'active': false } ];
49888          *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, { 'age':
49889          * 36, 'active': true }), 'user'); // => ['barney']
49890          *  // using the `_.matchesProperty` callback shorthand _.pluck(_.filter(users,
49891          * 'active', false), 'user'); // => ['fred']
49892          *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
49893          * 'active'), 'user'); // => ['barney']
49894          */
49895         function filter(collection, predicate, thisArg) {
49896             var func = isArray(collection) ? arrayFilter : baseFilter;
49897             predicate = baseCallback(predicate, thisArg, 3);
49898             return func(collection, predicate);
49899         }
49900
49901         module.exports = filter;
49902
49903     }, {
49904         "../internal/arrayFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js",
49905         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49906         "../internal/baseFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js",
49907         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49908     }],
49909     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js": [function(require, module, exports) {
49910         var baseEach = require('../internal/baseEach'),
49911             createFind = require('../internal/createFind');
49912
49913         /**
49914          * Iterates over elements of `collection`, returning the first element
49915          * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49916          * invoked with three arguments: (value, index|key, collection).
49917          * 
49918          * If a property name is provided for `predicate` the created `_.property` style
49919          * callback returns the property value of the given element.
49920          * 
49921          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49922          * style callback returns `true` for elements that have a matching property
49923          * value, else `false`.
49924          * 
49925          * If an object is provided for `predicate` the created `_.matches` style
49926          * callback returns `true` for elements that have the properties of the given
49927          * object, else `false`.
49928          * 
49929          * @static
49930          * @memberOf _
49931          * @alias detect
49932          * @category Collection
49933          * @param {Array|Object|string}
49934          *            collection The collection to search.
49935          * @param {Function|Object|string}
49936          *            [predicate=_.identity] The function invoked per iteration.
49937          * @param {*}
49938          *            [thisArg] The `this` binding of `predicate`.
49939          * @returns {*} Returns the matched element, else `undefined`.
49940          * @example
49941          * 
49942          * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49943          * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
49944          * 'active': true } ];
49945          * 
49946          * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
49947          * 'barney'
49948          *  // using the `_.matches` callback shorthand _.result(_.find(users, { 'age':
49949          * 1, 'active': true }), 'user'); // => 'pebbles'
49950          *  // using the `_.matchesProperty` callback shorthand _.result(_.find(users,
49951          * 'active', false), 'user'); // => 'fred'
49952          *  // using the `_.property` callback shorthand _.result(_.find(users,
49953          * 'active'), 'user'); // => 'barney'
49954          */
49955         var find = createFind(baseEach);
49956
49957         module.exports = find;
49958
49959     }, {
49960         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
49961         "../internal/createFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js"
49962     }],
49963     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js": [function(require, module, exports) {
49964         var arrayEach = require('../internal/arrayEach'),
49965             baseEach = require('../internal/baseEach'),
49966             createForEach = require('../internal/createForEach');
49967
49968         /**
49969          * Iterates over elements of `collection` invoking `iteratee` for each element.
49970          * The `iteratee` is bound to `thisArg` and invoked with three arguments:
49971          * (value, index|key, collection). Iteratee functions may exit iteration early
49972          * by explicitly returning `false`.
49973          * 
49974          * **Note:** As with other "Collections" methods, objects with a "length"
49975          * property are iterated like arrays. To avoid this behavior `_.forIn` or
49976          * `_.forOwn` may be used for object iteration.
49977          * 
49978          * @static
49979          * @memberOf _
49980          * @alias each
49981          * @category Collection
49982          * @param {Array|Object|string}
49983          *            collection The collection to iterate over.
49984          * @param {Function}
49985          *            [iteratee=_.identity] The function invoked per iteration.
49986          * @param {*}
49987          *            [thisArg] The `this` binding of `iteratee`.
49988          * @returns {Array|Object|string} Returns `collection`.
49989          * @example
49990          * 
49991          * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs each
49992          * value from left to right and returns the array
49993          * 
49994          * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
49995          * logs each value-key pair and returns the object (iteration order is not
49996          * guaranteed)
49997          */
49998         var forEach = createForEach(arrayEach, baseEach);
49999
50000         module.exports = forEach;
50001
50002     }, {
50003         "../internal/arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
50004         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50005         "../internal/createForEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js"
50006     }],
50007     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js": [function(require, module, exports) {
50008         var createAggregator = require('../internal/createAggregator');
50009
50010         /** Used for native method references. */
50011         var objectProto = Object.prototype;
50012
50013         /** Used to check objects for own properties. */
50014         var hasOwnProperty = objectProto.hasOwnProperty;
50015
50016         /**
50017          * Creates an object composed of keys generated from the results of running each
50018          * element of `collection` through `iteratee`. The corresponding value of each
50019          * key is an array of the elements responsible for generating the key. The
50020          * `iteratee` is bound to `thisArg` and invoked with three arguments: (value,
50021          * index|key, collection).
50022          * 
50023          * If a property name is provided for `iteratee` the created `_.property` style
50024          * callback returns the property value of the given element.
50025          * 
50026          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50027          * style callback returns `true` for elements that have a matching property
50028          * value, else `false`.
50029          * 
50030          * If an object is provided for `iteratee` the created `_.matches` style
50031          * callback returns `true` for elements that have the properties of the given
50032          * object, else `false`.
50033          * 
50034          * @static
50035          * @memberOf _
50036          * @category Collection
50037          * @param {Array|Object|string}
50038          *            collection The collection to iterate over.
50039          * @param {Function|Object|string}
50040          *            [iteratee=_.identity] The function invoked per iteration.
50041          * @param {*}
50042          *            [thisArg] The `this` binding of `iteratee`.
50043          * @returns {Object} Returns the composed aggregate object.
50044          * @example
50045          * 
50046          * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
50047          * '4': [4.2], '6': [6.1, 6.4] }
50048          * 
50049          * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
50050          * '4': [4.2], '6': [6.1, 6.4] }
50051          *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
50052          * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
50053          */
50054         var groupBy = createAggregator(function(result, value, key) {
50055             if (hasOwnProperty.call(result, key)) {
50056                 result[key].push(value);
50057             } else {
50058                 result[key] = [value];
50059             }
50060         });
50061
50062         module.exports = groupBy;
50063
50064     }, {
50065         "../internal/createAggregator": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js"
50066     }],
50067     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js": [function(require, module, exports) {
50068         var baseIndexOf = require('../internal/baseIndexOf'),
50069             getLength = require('../internal/getLength'),
50070             isArray = require('../lang/isArray'),
50071             isIterateeCall = require('../internal/isIterateeCall'),
50072             isLength = require('../internal/isLength'),
50073             isString = require('../lang/isString'),
50074             values = require('../object/values');
50075
50076         /*
50077          * Native method references for those with the same name as other `lodash`
50078          * methods.
50079          */
50080         var nativeMax = Math.max;
50081
50082         /**
50083          * Checks if `target` is in `collection` using
50084          * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
50085          * for equality comparisons. If `fromIndex` is negative, it's used as the offset
50086          * from the end of `collection`.
50087          * 
50088          * @static
50089          * @memberOf _
50090          * @alias contains, include
50091          * @category Collection
50092          * @param {Array|Object|string}
50093          *            collection The collection to search.
50094          * @param {*}
50095          *            target The value to search for.
50096          * @param {number}
50097          *            [fromIndex=0] The index to search from.
50098          * @param- {Object} [guard] Enables use as a callback for functions like
50099          *         `_.reduce`.
50100          * @returns {boolean} Returns `true` if a matching element is found, else
50101          *          `false`.
50102          * @example
50103          * 
50104          * _.includes([1, 2, 3], 1); // => true
50105          * 
50106          * _.includes([1, 2, 3], 1, 2); // => false
50107          * 
50108          * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
50109          * 
50110          * _.includes('pebbles', 'eb'); // => true
50111          */
50112         function includes(collection, target, fromIndex, guard) {
50113             var length = collection ? getLength(collection) : 0;
50114             if (!isLength(length)) {
50115                 collection = values(collection);
50116                 length = collection.length;
50117             }
50118             if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
50119                 fromIndex = 0;
50120             } else {
50121                 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
50122             }
50123             return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
50124         }
50125
50126         module.exports = includes;
50127
50128     }, {
50129         "../internal/baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
50130         "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50131         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50132         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50133         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
50134         "../lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
50135         "../object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
50136     }],
50137     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js": [function(require, module, exports) {
50138         var arrayMap = require('../internal/arrayMap'),
50139             baseCallback = require('../internal/baseCallback'),
50140             baseMap = require('../internal/baseMap'),
50141             isArray = require('../lang/isArray');
50142
50143         /**
50144          * Creates an array of values by running each element in `collection` through
50145          * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
50146          * arguments: (value, index|key, collection).
50147          * 
50148          * If a property name is provided for `iteratee` the created `_.property` style
50149          * callback returns the property value of the given element.
50150          * 
50151          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50152          * style callback returns `true` for elements that have a matching property
50153          * value, else `false`.
50154          * 
50155          * If an object is provided for `iteratee` the created `_.matches` style
50156          * callback returns `true` for elements that have the properties of the given
50157          * object, else `false`.
50158          * 
50159          * Many lodash methods are guarded to work as iteratees for methods like
50160          * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
50161          * 
50162          * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
50163          * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
50164          * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`, `takeRight`,
50165          * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `random`, `range`,
50166          * `sample`, `some`, `sum`, `uniq`, and `words`
50167          * 
50168          * @static
50169          * @memberOf _
50170          * @alias collect
50171          * @category Collection
50172          * @param {Array|Object|string}
50173          *            collection The collection to iterate over.
50174          * @param {Function|Object|string}
50175          *            [iteratee=_.identity] The function invoked per iteration.
50176          * @param {*}
50177          *            [thisArg] The `this` binding of `iteratee`.
50178          * @returns {Array} Returns the new mapped array.
50179          * @example
50180          * 
50181          * function timesThree(n) { return n * 3; }
50182          * 
50183          * _.map([1, 2], timesThree); // => [3, 6]
50184          * 
50185          * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is not
50186          * guaranteed)
50187          * 
50188          * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
50189          *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
50190          * ['barney', 'fred']
50191          */
50192         function map(collection, iteratee, thisArg) {
50193             var func = isArray(collection) ? arrayMap : baseMap;
50194             iteratee = baseCallback(iteratee, thisArg, 3);
50195             return func(collection, iteratee);
50196         }
50197
50198         module.exports = map;
50199
50200     }, {
50201         "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
50202         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50203         "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50204         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50205     }],
50206     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js": [function(require, module, exports) {
50207         var arrayReduce = require('../internal/arrayReduce'),
50208             baseEach = require('../internal/baseEach'),
50209             createReduce = require('../internal/createReduce');
50210
50211         /**
50212          * Reduces `collection` to a value which is the accumulated result of running
50213          * each element in `collection` through `iteratee`, where each successive
50214          * invocation is supplied the return value of the previous. If `accumulator` is
50215          * not provided the first element of `collection` is used as the initial value.
50216          * The `iteratee` is bound to `thisArg` and invoked with four arguments:
50217          * (accumulator, value, index|key, collection).
50218          * 
50219          * Many lodash methods are guarded to work as iteratees for methods like
50220          * `_.reduce`, `_.reduceRight`, and `_.transform`.
50221          * 
50222          * The guarded methods are: `assign`, `defaults`, `defaultsDeep`, `includes`,
50223          * `merge`, `sortByAll`, and `sortByOrder`
50224          * 
50225          * @static
50226          * @memberOf _
50227          * @alias foldl, inject
50228          * @category Collection
50229          * @param {Array|Object|string}
50230          *            collection The collection to iterate over.
50231          * @param {Function}
50232          *            [iteratee=_.identity] The function invoked per iteration.
50233          * @param {*}
50234          *            [accumulator] The initial value.
50235          * @param {*}
50236          *            [thisArg] The `this` binding of `iteratee`.
50237          * @returns {*} Returns the accumulated value.
50238          * @example
50239          * 
50240          * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
50241          * 
50242          * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n * 3;
50243          * return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is not
50244          * guaranteed)
50245          */
50246         var reduce = createReduce(arrayReduce, baseEach);
50247
50248         module.exports = reduce;
50249
50250     }, {
50251         "../internal/arrayReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js",
50252         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50253         "../internal/createReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js"
50254     }],
50255     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js": [function(require, module, exports) {
50256         var getLength = require('../internal/getLength'),
50257             isLength = require('../internal/isLength'),
50258             keys = require('../object/keys');
50259
50260         /**
50261          * Gets the size of `collection` by returning its length for array-like values
50262          * or the number of own enumerable properties for objects.
50263          * 
50264          * @static
50265          * @memberOf _
50266          * @category Collection
50267          * @param {Array|Object|string}
50268          *            collection The collection to inspect.
50269          * @returns {number} Returns the size of `collection`.
50270          * @example
50271          * 
50272          * _.size([1, 2, 3]); // => 3
50273          * 
50274          * _.size({ 'a': 1, 'b': 2 }); // => 2
50275          * 
50276          * _.size('pebbles'); // => 7
50277          */
50278         function size(collection) {
50279             var length = collection ? getLength(collection) : 0;
50280             return isLength(length) ? length : keys(collection).length;
50281         }
50282
50283         module.exports = size;
50284
50285     }, {
50286         "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50287         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50288         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
50289     }],
50290     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js": [function(require, module, exports) {
50291         var arraySome = require('../internal/arraySome'),
50292             baseCallback = require('../internal/baseCallback'),
50293             baseSome = require('../internal/baseSome'),
50294             isArray = require('../lang/isArray'),
50295             isIterateeCall = require('../internal/isIterateeCall');
50296
50297         /**
50298          * Checks if `predicate` returns truthy for **any** element of `collection`. The
50299          * function returns as soon as it finds a passing value and does not iterate
50300          * over the entire collection. The predicate is bound to `thisArg` and invoked
50301          * with three arguments: (value, index|key, collection).
50302          * 
50303          * If a property name is provided for `predicate` the created `_.property` style
50304          * callback returns the property value of the given element.
50305          * 
50306          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50307          * style callback returns `true` for elements that have a matching property
50308          * value, else `false`.
50309          * 
50310          * If an object is provided for `predicate` the created `_.matches` style
50311          * callback returns `true` for elements that have the properties of the given
50312          * object, else `false`.
50313          * 
50314          * @static
50315          * @memberOf _
50316          * @alias any
50317          * @category Collection
50318          * @param {Array|Object|string}
50319          *            collection The collection to iterate over.
50320          * @param {Function|Object|string}
50321          *            [predicate=_.identity] The function invoked per iteration.
50322          * @param {*}
50323          *            [thisArg] The `this` binding of `predicate`.
50324          * @returns {boolean} Returns `true` if any element passes the predicate check,
50325          *          else `false`.
50326          * @example
50327          * 
50328          * _.some([null, 0, 'yes', false], Boolean); // => true
50329          * 
50330          * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
50331          * 'active': false } ];
50332          *  // using the `_.matches` callback shorthand _.some(users, { 'user':
50333          * 'barney', 'active': false }); // => false
50334          *  // using the `_.matchesProperty` callback shorthand _.some(users, 'active',
50335          * false); // => true
50336          *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
50337          * true
50338          */
50339         function some(collection, predicate, thisArg) {
50340             var func = isArray(collection) ? arraySome : baseSome;
50341             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
50342                 predicate = undefined;
50343             }
50344             if (typeof predicate != 'function' || thisArg !== undefined) {
50345                 predicate = baseCallback(predicate, thisArg, 3);
50346             }
50347             return func(collection, predicate);
50348         }
50349
50350         module.exports = some;
50351
50352     }, {
50353         "../internal/arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js",
50354         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50355         "../internal/baseSome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js",
50356         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50357         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50358     }],
50359     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js": [function(require, module, exports) {
50360         var baseCallback = require('../internal/baseCallback'),
50361             baseMap = require('../internal/baseMap'),
50362             baseSortBy = require('../internal/baseSortBy'),
50363             compareAscending = require('../internal/compareAscending'),
50364             isIterateeCall = require('../internal/isIterateeCall');
50365
50366         /**
50367          * Creates an array of elements, sorted in ascending order by the results of
50368          * running each element in a collection through `iteratee`. This method performs
50369          * a stable sort, that is, it preserves the original sort order of equal
50370          * elements. The `iteratee` is bound to `thisArg` and invoked with three
50371          * arguments: (value, index|key, collection).
50372          * 
50373          * If a property name is provided for `iteratee` the created `_.property` style
50374          * callback returns the property value of the given element.
50375          * 
50376          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50377          * style callback returns `true` for elements that have a matching property
50378          * value, else `false`.
50379          * 
50380          * If an object is provided for `iteratee` the created `_.matches` style
50381          * callback returns `true` for elements that have the properties of the given
50382          * object, else `false`.
50383          * 
50384          * @static
50385          * @memberOf _
50386          * @category Collection
50387          * @param {Array|Object|string}
50388          *            collection The collection to iterate over.
50389          * @param {Function|Object|string}
50390          *            [iteratee=_.identity] The function invoked per iteration.
50391          * @param {*}
50392          *            [thisArg] The `this` binding of `iteratee`.
50393          * @returns {Array} Returns the new sorted array.
50394          * @example
50395          * 
50396          * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
50397          * 
50398          * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3, 1,
50399          * 2]
50400          * 
50401          * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user': 'barney' } ];
50402          *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
50403          * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
50404          */
50405         function sortBy(collection, iteratee, thisArg) {
50406             if (collection == null) {
50407                 return [];
50408             }
50409             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
50410                 iteratee = undefined;
50411             }
50412             var index = -1;
50413             iteratee = baseCallback(iteratee, thisArg, 3);
50414
50415             var result = baseMap(collection, function(value, key, collection) {
50416                 return {
50417                     'criteria': iteratee(value, key, collection),
50418                     'index': ++index,
50419                     'value': value
50420                 };
50421             });
50422             return baseSortBy(result, compareAscending);
50423         }
50424
50425         module.exports = sortBy;
50426
50427     }, {
50428         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50429         "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50430         "../internal/baseSortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js",
50431         "../internal/compareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js",
50432         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
50433     }],
50434     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js": [function(require, module, exports) {
50435         var getNative = require('../internal/getNative');
50436
50437         /*
50438          * Native method references for those with the same name as other `lodash`
50439          * methods.
50440          */
50441         var nativeNow = getNative(Date, 'now');
50442
50443         /**
50444          * Gets the number of milliseconds that have elapsed since the Unix epoch (1
50445          * January 1970 00:00:00 UTC).
50446          * 
50447          * @static
50448          * @memberOf _
50449          * @category Date
50450          * @example
50451          * 
50452          * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
50453          * logs the number of milliseconds it took for the deferred function to be
50454          * invoked
50455          */
50456         var now = nativeNow || function() {
50457             return new Date().getTime();
50458         };
50459
50460         module.exports = now;
50461
50462     }, {
50463         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
50464     }],
50465     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js": [function(require, module, exports) {
50466         var createWrapper = require('../internal/createWrapper'),
50467             replaceHolders = require('../internal/replaceHolders'),
50468             restParam = require('./restParam');
50469
50470         /** Used to compose bitmasks for wrapper metadata. */
50471         var BIND_FLAG = 1,
50472             PARTIAL_FLAG = 32;
50473
50474         /**
50475          * Creates a function that invokes `func` with the `this` binding of `thisArg`
50476          * and prepends any additional `_.bind` arguments to those provided to the bound
50477          * function.
50478          * 
50479          * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
50480          * may be used as a placeholder for partially applied arguments.
50481          * 
50482          * **Note:** Unlike native `Function#bind` this method does not set the "length"
50483          * property of bound functions.
50484          * 
50485          * @static
50486          * @memberOf _
50487          * @category Function
50488          * @param {Function}
50489          *            func The function to bind.
50490          * @param {*}
50491          *            thisArg The `this` binding of `func`.
50492          * @param {...*}
50493          *            [partials] The arguments to be partially applied.
50494          * @returns {Function} Returns the new bound function.
50495          * @example
50496          * 
50497          * var greet = function(greeting, punctuation) { return greeting + ' ' +
50498          * this.user + punctuation; };
50499          * 
50500          * var object = { 'user': 'fred' };
50501          * 
50502          * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
50503          *  // using placeholders var bound = _.bind(greet, object, _, '!');
50504          * bound('hi'); // => 'hi fred!'
50505          */
50506         var bind = restParam(function(func, thisArg, partials) {
50507             var bitmask = BIND_FLAG;
50508             if (partials.length) {
50509                 var holders = replaceHolders(partials, bind.placeholder);
50510                 bitmask |= PARTIAL_FLAG;
50511             }
50512             return createWrapper(func, bitmask, thisArg, partials, holders);
50513         });
50514
50515         // Assign default placeholders.
50516         bind.placeholder = {};
50517
50518         module.exports = bind;
50519
50520     }, {
50521         "../internal/createWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js",
50522         "../internal/replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
50523         "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50524     }],
50525     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js": [function(require, module, exports) {
50526         var isObject = require('../lang/isObject'),
50527             now = require('../date/now');
50528
50529         /** Used as the `TypeError` message for "Functions" methods. */
50530         var FUNC_ERROR_TEXT = 'Expected a function';
50531
50532         /*
50533          * Native method references for those with the same name as other `lodash`
50534          * methods.
50535          */
50536         var nativeMax = Math.max;
50537
50538         /**
50539          * Creates a debounced function that delays invoking `func` until after `wait`
50540          * milliseconds have elapsed since the last time the debounced function was
50541          * invoked. The debounced function comes with a `cancel` method to cancel
50542          * delayed invocations. Provide an options object to indicate that `func` should
50543          * be invoked on the leading and/or trailing edge of the `wait` timeout.
50544          * Subsequent calls to the debounced function return the result of the last
50545          * `func` invocation.
50546          * 
50547          * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
50548          * on the trailing edge of the timeout only if the the debounced function is
50549          * invoked more than once during the `wait` timeout.
50550          * 
50551          * See [David Corbacho's
50552          * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
50553          * for details over the differences between `_.debounce` and `_.throttle`.
50554          * 
50555          * @static
50556          * @memberOf _
50557          * @category Function
50558          * @param {Function}
50559          *            func The function to debounce.
50560          * @param {number}
50561          *            [wait=0] The number of milliseconds to delay.
50562          * @param {Object}
50563          *            [options] The options object.
50564          * @param {boolean}
50565          *            [options.leading=false] Specify invoking on the leading edge of
50566          *            the timeout.
50567          * @param {number}
50568          *            [options.maxWait] The maximum time `func` is allowed to be delayed
50569          *            before it's invoked.
50570          * @param {boolean}
50571          *            [options.trailing=true] Specify invoking on the trailing edge of
50572          *            the timeout.
50573          * @returns {Function} Returns the new debounced function.
50574          * @example
50575          *  // avoid costly calculations while the window size is in flux
50576          * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
50577          *  // invoke `sendMail` when the click event is fired, debouncing subsequent
50578          * calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, { 'leading':
50579          * true, 'trailing': false }));
50580          *  // ensure `batchLog` is invoked once after 1 second of debounced calls var
50581          * source = new EventSource('/stream'); jQuery(source).on('message',
50582          * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
50583          *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
50584          * Object.observe(models.todo, todoChanges);
50585          * 
50586          * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
50587          * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
50588          *  // ...at some point `models.todo` is changed models.todo.completed = true;
50589          *  // ...before 1 second has passed `models.todo` is deleted // which cancels
50590          * the debounced `todoChanges` call delete models.todo;
50591          */
50592         function debounce(func, wait, options) {
50593             var args,
50594                 maxTimeoutId,
50595                 result,
50596                 stamp,
50597                 thisArg,
50598                 timeoutId,
50599                 trailingCall,
50600                 lastCalled = 0,
50601                 maxWait = false,
50602                 trailing = true;
50603
50604             if (typeof func != 'function') {
50605                 throw new TypeError(FUNC_ERROR_TEXT);
50606             }
50607             wait = wait < 0 ? 0 : (+wait || 0);
50608             if (options === true) {
50609                 var leading = true;
50610                 trailing = false;
50611             } else if (isObject(options)) {
50612                 leading = !!options.leading;
50613                 maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
50614                 trailing = 'trailing' in options ? !!options.trailing : trailing;
50615             }
50616
50617             function cancel() {
50618                 if (timeoutId) {
50619                     clearTimeout(timeoutId);
50620                 }
50621                 if (maxTimeoutId) {
50622                     clearTimeout(maxTimeoutId);
50623                 }
50624                 lastCalled = 0;
50625                 maxTimeoutId = timeoutId = trailingCall = undefined;
50626             }
50627
50628             function complete(isCalled, id) {
50629                 if (id) {
50630                     clearTimeout(id);
50631                 }
50632                 maxTimeoutId = timeoutId = trailingCall = undefined;
50633                 if (isCalled) {
50634                     lastCalled = now();
50635                     result = func.apply(thisArg, args);
50636                     if (!timeoutId && !maxTimeoutId) {
50637                         args = thisArg = undefined;
50638                     }
50639                 }
50640             }
50641
50642             function delayed() {
50643                 var remaining = wait - (now() - stamp);
50644                 if (remaining <= 0 || remaining > wait) {
50645                     complete(trailingCall, maxTimeoutId);
50646                 } else {
50647                     timeoutId = setTimeout(delayed, remaining);
50648                 }
50649             }
50650
50651             function maxDelayed() {
50652                 complete(trailing, timeoutId);
50653             }
50654
50655             function debounced() {
50656                 args = arguments;
50657                 stamp = now();
50658                 thisArg = this;
50659                 trailingCall = trailing && (timeoutId || !leading);
50660
50661                 if (maxWait === false) {
50662                     var leadingCall = leading && !timeoutId;
50663                 } else {
50664                     if (!maxTimeoutId && !leading) {
50665                         lastCalled = stamp;
50666                     }
50667                     var remaining = maxWait - (stamp - lastCalled),
50668                         isCalled = remaining <= 0 || remaining > maxWait;
50669
50670                     if (isCalled) {
50671                         if (maxTimeoutId) {
50672                             maxTimeoutId = clearTimeout(maxTimeoutId);
50673                         }
50674                         lastCalled = stamp;
50675                         result = func.apply(thisArg, args);
50676                     } else if (!maxTimeoutId) {
50677                         maxTimeoutId = setTimeout(maxDelayed, remaining);
50678                     }
50679                 }
50680                 if (isCalled && timeoutId) {
50681                     timeoutId = clearTimeout(timeoutId);
50682                 } else if (!timeoutId && wait !== maxWait) {
50683                     timeoutId = setTimeout(delayed, wait);
50684                 }
50685                 if (leadingCall) {
50686                     isCalled = true;
50687                     result = func.apply(thisArg, args);
50688                 }
50689                 if (isCalled && !timeoutId && !maxTimeoutId) {
50690                     args = thisArg = undefined;
50691                 }
50692                 return result;
50693             }
50694             debounced.cancel = cancel;
50695             return debounced;
50696         }
50697
50698         module.exports = debounce;
50699
50700     }, {
50701         "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
50702         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
50703     }],
50704     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js": [function(require, module, exports) {
50705         var baseDelay = require('../internal/baseDelay'),
50706             restParam = require('./restParam');
50707
50708         /**
50709          * Defers invoking the `func` until the current call stack has cleared. Any
50710          * additional arguments are provided to `func` when it's invoked.
50711          * 
50712          * @static
50713          * @memberOf _
50714          * @category Function
50715          * @param {Function}
50716          *            func The function to defer.
50717          * @param {...*}
50718          *            [args] The arguments to invoke the function with.
50719          * @returns {number} Returns the timer id.
50720          * @example
50721          * 
50722          * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
50723          * 'deferred' after one or more milliseconds
50724          */
50725         var defer = restParam(function(func, args) {
50726             return baseDelay(func, 1, args);
50727         });
50728
50729         module.exports = defer;
50730
50731     }, {
50732         "../internal/baseDelay": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js",
50733         "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50734     }],
50735     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js": [function(require, module, exports) {
50736         /** Used as the `TypeError` message for "Functions" methods. */
50737         var FUNC_ERROR_TEXT = 'Expected a function';
50738
50739         /*
50740          * Native method references for those with the same name as other `lodash`
50741          * methods.
50742          */
50743         var nativeMax = Math.max;
50744
50745         /**
50746          * Creates a function that invokes `func` with the `this` binding of the created
50747          * function and arguments from `start` and beyond provided as an array.
50748          * 
50749          * **Note:** This method is based on the [rest
50750          * parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
50751          * 
50752          * @static
50753          * @memberOf _
50754          * @category Function
50755          * @param {Function}
50756          *            func The function to apply a rest parameter to.
50757          * @param {number}
50758          *            [start=func.length-1] The start position of the rest parameter.
50759          * @returns {Function} Returns the new function.
50760          * @example
50761          * 
50762          * var say = _.restParam(function(what, names) { return what + ' ' +
50763          * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
50764          * _.last(names); });
50765          * 
50766          * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
50767          * pebbles'
50768          */
50769         function restParam(func, start) {
50770             if (typeof func != 'function') {
50771                 throw new TypeError(FUNC_ERROR_TEXT);
50772             }
50773             start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
50774             return function() {
50775                 var args = arguments,
50776                     index = -1,
50777                     length = nativeMax(args.length - start, 0),
50778                     rest = Array(length);
50779
50780                 while (++index < length) {
50781                     rest[index] = args[start + index];
50782                 }
50783                 switch (start) {
50784                     case 0:
50785                         return func.call(this, rest);
50786                     case 1:
50787                         return func.call(this, args[0], rest);
50788                     case 2:
50789                         return func.call(this, args[0], args[1], rest);
50790                 }
50791                 var otherArgs = Array(start + 1);
50792                 index = -1;
50793                 while (++index < start) {
50794                     otherArgs[index] = args[index];
50795                 }
50796                 otherArgs[start] = rest;
50797                 return func.apply(this, otherArgs);
50798             };
50799         }
50800
50801         module.exports = restParam;
50802
50803     }, {}],
50804     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js": [function(require, module, exports) {
50805         (function(global) {
50806             /**
50807              * @license lodash 3.10.1 (Custom Build) <https://lodash.com/> Build: `lodash
50808              *          modern -d -o ./index.js` Copyright 2012-2015 The Dojo Foundation
50809              *          <http://dojofoundation.org/> Based on Underscore.js 1.8.3
50810              *          <http://underscorejs.org/LICENSE> Copyright 2009-2015 Jeremy
50811              *          Ashkenas, DocumentCloud and Investigative Reporters & Editors
50812              *          Available under MIT license <https://lodash.com/license>
50813              */
50814             ;
50815             (function() {
50816
50817                 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
50818                 var undefined;
50819
50820                 /** Used as the semantic version number. */
50821                 var VERSION = '3.10.1';
50822
50823                 /** Used to compose bitmasks for wrapper metadata. */
50824                 var BIND_FLAG = 1,
50825                     BIND_KEY_FLAG = 2,
50826                     CURRY_BOUND_FLAG = 4,
50827                     CURRY_FLAG = 8,
50828                     CURRY_RIGHT_FLAG = 16,
50829                     PARTIAL_FLAG = 32,
50830                     PARTIAL_RIGHT_FLAG = 64,
50831                     ARY_FLAG = 128,
50832                     REARG_FLAG = 256;
50833
50834                 /** Used as default options for `_.trunc`. */
50835                 var DEFAULT_TRUNC_LENGTH = 30,
50836                     DEFAULT_TRUNC_OMISSION = '...';
50837
50838                 /** Used to detect when a function becomes hot. */
50839                 var HOT_COUNT = 150,
50840                     HOT_SPAN = 16;
50841
50842                 /** Used as the size to enable large array optimizations. */
50843                 var LARGE_ARRAY_SIZE = 200;
50844
50845                 /** Used to indicate the type of lazy iteratees. */
50846                 var LAZY_FILTER_FLAG = 1,
50847                     LAZY_MAP_FLAG = 2;
50848
50849                 /** Used as the `TypeError` message for "Functions" methods. */
50850                 var FUNC_ERROR_TEXT = 'Expected a function';
50851
50852                 /** Used as the internal argument placeholder. */
50853                 var PLACEHOLDER = '__lodash_placeholder__';
50854
50855                 /** `Object#toString` result references. */
50856                 var argsTag = '[object Arguments]',
50857                     arrayTag = '[object Array]',
50858                     boolTag = '[object Boolean]',
50859                     dateTag = '[object Date]',
50860                     errorTag = '[object Error]',
50861                     funcTag = '[object Function]',
50862                     mapTag = '[object Map]',
50863                     numberTag = '[object Number]',
50864                     objectTag = '[object Object]',
50865                     regexpTag = '[object RegExp]',
50866                     setTag = '[object Set]',
50867                     stringTag = '[object String]',
50868                     weakMapTag = '[object WeakMap]';
50869
50870                 var arrayBufferTag = '[object ArrayBuffer]',
50871                     float32Tag = '[object Float32Array]',
50872                     float64Tag = '[object Float64Array]',
50873                     int8Tag = '[object Int8Array]',
50874                     int16Tag = '[object Int16Array]',
50875                     int32Tag = '[object Int32Array]',
50876                     uint8Tag = '[object Uint8Array]',
50877                     uint8ClampedTag = '[object Uint8ClampedArray]',
50878                     uint16Tag = '[object Uint16Array]',
50879                     uint32Tag = '[object Uint32Array]';
50880
50881                 /** Used to match empty string literals in compiled template source. */
50882                 var reEmptyStringLeading = /\b__p \+= '';/g,
50883                     reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
50884                     reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
50885
50886                 /** Used to match HTML entities and HTML characters. */
50887                 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
50888                     reUnescapedHtml = /[&<>"'`]/g,
50889                     reHasEscapedHtml = RegExp(reEscapedHtml.source),
50890                     reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
50891
50892                 /** Used to match template delimiters. */
50893                 var reEscape = /<%-([\s\S]+?)%>/g,
50894                     reEvaluate = /<%([\s\S]+?)%>/g,
50895                     reInterpolate = /<%=([\s\S]+?)%>/g;
50896
50897                 /** Used to match property names within property paths. */
50898                 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
50899                     reIsPlainProp = /^\w*$/,
50900                     rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
50901
50902                 /**
50903                  * Used to match `RegExp` [syntax
50904                  * characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) and
50905                  * those outlined by
50906                  * [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
50907                  */
50908                 var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
50909                     reHasRegExpChars = RegExp(reRegExpChars.source);
50910
50911                 /**
50912                  * Used to match [combining diacritical
50913                  * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
50914                  */
50915                 var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
50916
50917                 /** Used to match backslashes in property paths. */
50918                 var reEscapeChar = /\\(\\)?/g;
50919
50920                 /**
50921                  * Used to match [ES template
50922                  * delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
50923                  */
50924                 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
50925
50926                 /** Used to match `RegExp` flags from their coerced string values. */
50927                 var reFlags = /\w*$/;
50928
50929                 /** Used to detect hexadecimal string values. */
50930                 var reHasHexPrefix = /^0[xX]/;
50931
50932                 /** Used to detect host constructors (Safari > 5). */
50933                 var reIsHostCtor = /^\[object .+?Constructor\]$/;
50934
50935                 /** Used to detect unsigned integer values. */
50936                 var reIsUint = /^\d+$/;
50937
50938                 /**
50939                  * Used to match latin-1 supplementary letters (excluding mathematical
50940                  * operators).
50941                  */
50942                 var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
50943
50944                 /** Used to ensure capturing order of template delimiters. */
50945                 var reNoMatch = /($^)/;
50946
50947                 /** Used to match unescaped characters in compiled string literals. */
50948                 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
50949
50950                 /** Used to match words to create compound words. */
50951                 var reWords = (function() {
50952                     var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
50953                         lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
50954
50955                     return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
50956                 }());
50957
50958                 /** Used to assign default `context` object properties. */
50959                 var contextProps = [
50960                     'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
50961                     'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
50962                     'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
50963                     'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
50964                     'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
50965                 ];
50966
50967                 /** Used to make template sourceURLs easier to identify. */
50968                 var templateCounter = -1;
50969
50970                 /** Used to identify `toStringTag` values of typed arrays. */
50971                 var typedArrayTags = {};
50972                 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
50973                     typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
50974                     typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
50975                     typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
50976                     typedArrayTags[uint32Tag] = true;
50977                 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
50978                     typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
50979                     typedArrayTags[dateTag] = typedArrayTags[errorTag] =
50980                     typedArrayTags[funcTag] = typedArrayTags[mapTag] =
50981                     typedArrayTags[numberTag] = typedArrayTags[objectTag] =
50982                     typedArrayTags[regexpTag] = typedArrayTags[setTag] =
50983                     typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
50984
50985                 /** Used to identify `toStringTag` values supported by `_.clone`. */
50986                 var cloneableTags = {};
50987                 cloneableTags[argsTag] = cloneableTags[arrayTag] =
50988                     cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
50989                     cloneableTags[dateTag] = cloneableTags[float32Tag] =
50990                     cloneableTags[float64Tag] = cloneableTags[int8Tag] =
50991                     cloneableTags[int16Tag] = cloneableTags[int32Tag] =
50992                     cloneableTags[numberTag] = cloneableTags[objectTag] =
50993                     cloneableTags[regexpTag] = cloneableTags[stringTag] =
50994                     cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
50995                     cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
50996                 cloneableTags[errorTag] = cloneableTags[funcTag] =
50997                     cloneableTags[mapTag] = cloneableTags[setTag] =
50998                     cloneableTags[weakMapTag] = false;
50999
51000                 /** Used to map latin-1 supplementary letters to basic latin letters. */
51001                 var deburredLetters = {
51002                     '\xc0': 'A',
51003                     '\xc1': 'A',
51004                     '\xc2': 'A',
51005                     '\xc3': 'A',
51006                     '\xc4': 'A',
51007                     '\xc5': 'A',
51008                     '\xe0': 'a',
51009                     '\xe1': 'a',
51010                     '\xe2': 'a',
51011                     '\xe3': 'a',
51012                     '\xe4': 'a',
51013                     '\xe5': 'a',
51014                     '\xc7': 'C',
51015                     '\xe7': 'c',
51016                     '\xd0': 'D',
51017                     '\xf0': 'd',
51018                     '\xc8': 'E',
51019                     '\xc9': 'E',
51020                     '\xca': 'E',
51021                     '\xcb': 'E',
51022                     '\xe8': 'e',
51023                     '\xe9': 'e',
51024                     '\xea': 'e',
51025                     '\xeb': 'e',
51026                     '\xcC': 'I',
51027                     '\xcd': 'I',
51028                     '\xce': 'I',
51029                     '\xcf': 'I',
51030                     '\xeC': 'i',
51031                     '\xed': 'i',
51032                     '\xee': 'i',
51033                     '\xef': 'i',
51034                     '\xd1': 'N',
51035                     '\xf1': 'n',
51036                     '\xd2': 'O',
51037                     '\xd3': 'O',
51038                     '\xd4': 'O',
51039                     '\xd5': 'O',
51040                     '\xd6': 'O',
51041                     '\xd8': 'O',
51042                     '\xf2': 'o',
51043                     '\xf3': 'o',
51044                     '\xf4': 'o',
51045                     '\xf5': 'o',
51046                     '\xf6': 'o',
51047                     '\xf8': 'o',
51048                     '\xd9': 'U',
51049                     '\xda': 'U',
51050                     '\xdb': 'U',
51051                     '\xdc': 'U',
51052                     '\xf9': 'u',
51053                     '\xfa': 'u',
51054                     '\xfb': 'u',
51055                     '\xfc': 'u',
51056                     '\xdd': 'Y',
51057                     '\xfd': 'y',
51058                     '\xff': 'y',
51059                     '\xc6': 'Ae',
51060                     '\xe6': 'ae',
51061                     '\xde': 'Th',
51062                     '\xfe': 'th',
51063                     '\xdf': 'ss'
51064                 };
51065
51066                 /** Used to map characters to HTML entities. */
51067                 var htmlEscapes = {
51068                     '&': '&amp;',
51069                     '<': '&lt;',
51070                     '>': '&gt;',
51071                     '"': '&quot;',
51072                     "'": '&#39;',
51073                     '`': '&#96;'
51074                 };
51075
51076                 /** Used to map HTML entities to characters. */
51077                 var htmlUnescapes = {
51078                     '&amp;': '&',
51079                     '&lt;': '<',
51080                     '&gt;': '>',
51081                     '&quot;': '"',
51082                     '&#39;': "'",
51083                     '&#96;': '`'
51084                 };
51085
51086                 /** Used to determine if values are of the language type `Object`. */
51087                 var objectTypes = {
51088                     'function': true,
51089                     'object': true
51090                 };
51091
51092                 /** Used to escape characters for inclusion in compiled regexes. */
51093                 var regexpEscapes = {
51094                     '0': 'x30',
51095                     '1': 'x31',
51096                     '2': 'x32',
51097                     '3': 'x33',
51098                     '4': 'x34',
51099                     '5': 'x35',
51100                     '6': 'x36',
51101                     '7': 'x37',
51102                     '8': 'x38',
51103                     '9': 'x39',
51104                     'A': 'x41',
51105                     'B': 'x42',
51106                     'C': 'x43',
51107                     'D': 'x44',
51108                     'E': 'x45',
51109                     'F': 'x46',
51110                     'a': 'x61',
51111                     'b': 'x62',
51112                     'c': 'x63',
51113                     'd': 'x64',
51114                     'e': 'x65',
51115                     'f': 'x66',
51116                     'n': 'x6e',
51117                     'r': 'x72',
51118                     't': 'x74',
51119                     'u': 'x75',
51120                     'v': 'x76',
51121                     'x': 'x78'
51122                 };
51123
51124                 /** Used to escape characters for inclusion in compiled string literals. */
51125                 var stringEscapes = {
51126                     '\\': '\\',
51127                     "'": "'",
51128                     '\n': 'n',
51129                     '\r': 'r',
51130                     '\u2028': 'u2028',
51131                     '\u2029': 'u2029'
51132                 };
51133
51134                 /** Detect free variable `exports`. */
51135                 var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
51136
51137                 /** Detect free variable `module`. */
51138                 var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
51139
51140                 /** Detect free variable `global` from Node.js. */
51141                 var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
51142
51143                 /** Detect free variable `self`. */
51144                 var freeSelf = objectTypes[typeof self] && self && self.Object && self;
51145
51146                 /** Detect free variable `window`. */
51147                 var freeWindow = objectTypes[typeof window] && window && window.Object && window;
51148
51149                 /** Detect the popular CommonJS extension `module.exports`. */
51150                 var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
51151
51152                 /**
51153                  * Used as a reference to the global object.
51154                  * 
51155                  * The `this` value is used if it's the global object to avoid
51156                  * Greasemonkey's restricted `window` object, otherwise the `window` object
51157                  * is used.
51158                  */
51159                 var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
51160
51161                 /*--------------------------------------------------------------------------*/
51162
51163                 /**
51164                  * The base implementation of `compareAscending` which compares values and
51165                  * sorts them in ascending order without guaranteeing a stable sort.
51166                  * 
51167                  * @private
51168                  * @param {*}
51169                  *            value The value to compare.
51170                  * @param {*}
51171                  *            other The other value to compare.
51172                  * @returns {number} Returns the sort order indicator for `value`.
51173                  */
51174                 function baseCompareAscending(value, other) {
51175                     if (value !== other) {
51176                         var valIsNull = value === null,
51177                             valIsUndef = value === undefined,
51178                             valIsReflexive = value === value;
51179
51180                         var othIsNull = other === null,
51181                             othIsUndef = other === undefined,
51182                             othIsReflexive = other === other;
51183
51184                         if ((value > other && !othIsNull) || !valIsReflexive ||
51185                             (valIsNull && !othIsUndef && othIsReflexive) ||
51186                             (valIsUndef && othIsReflexive)) {
51187                             return 1;
51188                         }
51189                         if ((value < other && !valIsNull) || !othIsReflexive ||
51190                             (othIsNull && !valIsUndef && valIsReflexive) ||
51191                             (othIsUndef && valIsReflexive)) {
51192                             return -1;
51193                         }
51194                     }
51195                     return 0;
51196                 }
51197
51198                 /**
51199                  * The base implementation of `_.findIndex` and `_.findLastIndex` without
51200                  * support for callback shorthands and `this` binding.
51201                  * 
51202                  * @private
51203                  * @param {Array}
51204                  *            array The array to search.
51205                  * @param {Function}
51206                  *            predicate The function invoked per iteration.
51207                  * @param {boolean}
51208                  *            [fromRight] Specify iterating from right to left.
51209                  * @returns {number} Returns the index of the matched value, else `-1`.
51210                  */
51211                 function baseFindIndex(array, predicate, fromRight) {
51212                     var length = array.length,
51213                         index = fromRight ? length : -1;
51214
51215                     while ((fromRight ? index-- : ++index < length)) {
51216                         if (predicate(array[index], index, array)) {
51217                             return index;
51218                         }
51219                     }
51220                     return -1;
51221                 }
51222
51223                 /**
51224                  * The base implementation of `_.indexOf` without support for binary
51225                  * searches.
51226                  * 
51227                  * @private
51228                  * @param {Array}
51229                  *            array The array to search.
51230                  * @param {*}
51231                  *            value The value to search for.
51232                  * @param {number}
51233                  *            fromIndex The index to search from.
51234                  * @returns {number} Returns the index of the matched value, else `-1`.
51235                  */
51236                 function baseIndexOf(array, value, fromIndex) {
51237                     if (value !== value) {
51238                         return indexOfNaN(array, fromIndex);
51239                     }
51240                     var index = fromIndex - 1,
51241                         length = array.length;
51242
51243                     while (++index < length) {
51244                         if (array[index] === value) {
51245                             return index;
51246                         }
51247                     }
51248                     return -1;
51249                 }
51250
51251                 /**
51252                  * The base implementation of `_.isFunction` without support for
51253                  * environments with incorrect `typeof` results.
51254                  * 
51255                  * @private
51256                  * @param {*}
51257                  *            value The value to check.
51258                  * @returns {boolean} Returns `true` if `value` is correctly classified,
51259                  *          else `false`.
51260                  */
51261                 function baseIsFunction(value) {
51262                     // Avoid a Chakra JIT bug in compatibility modes of IE 11.
51263                     // See https://github.com/jashkenas/underscore/issues/1621 for more details.
51264                     return typeof value == 'function' || false;
51265                 }
51266
51267                 /**
51268                  * Converts `value` to a string if it's not one. An empty string is returned
51269                  * for `null` or `undefined` values.
51270                  * 
51271                  * @private
51272                  * @param {*}
51273                  *            value The value to process.
51274                  * @returns {string} Returns the string.
51275                  */
51276                 function baseToString(value) {
51277                     return value == null ? '' : (value + '');
51278                 }
51279
51280                 /**
51281                  * Used by `_.trim` and `_.trimLeft` to get the index of the first character
51282                  * of `string` that is not found in `chars`.
51283                  * 
51284                  * @private
51285                  * @param {string}
51286                  *            string The string to inspect.
51287                  * @param {string}
51288                  *            chars The characters to find.
51289                  * @returns {number} Returns the index of the first character not found in
51290                  *          `chars`.
51291                  */
51292                 function charsLeftIndex(string, chars) {
51293                     var index = -1,
51294                         length = string.length;
51295
51296                     while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
51297                     return index;
51298                 }
51299
51300                 /**
51301                  * Used by `_.trim` and `_.trimRight` to get the index of the last character
51302                  * of `string` that is not found in `chars`.
51303                  * 
51304                  * @private
51305                  * @param {string}
51306                  *            string The string to inspect.
51307                  * @param {string}
51308                  *            chars The characters to find.
51309                  * @returns {number} Returns the index of the last character not found in
51310                  *          `chars`.
51311                  */
51312                 function charsRightIndex(string, chars) {
51313                     var index = string.length;
51314
51315                     while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
51316                     return index;
51317                 }
51318
51319                 /**
51320                  * Used by `_.sortBy` to compare transformed elements of a collection and
51321                  * stable sort them in ascending order.
51322                  * 
51323                  * @private
51324                  * @param {Object}
51325                  *            object The object to compare.
51326                  * @param {Object}
51327                  *            other The other object to compare.
51328                  * @returns {number} Returns the sort order indicator for `object`.
51329                  */
51330                 function compareAscending(object, other) {
51331                     return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
51332                 }
51333
51334                 /**
51335                  * Used by `_.sortByOrder` to compare multiple properties of a value to
51336                  * another and stable sort them.
51337                  * 
51338                  * If `orders` is unspecified, all valuess are sorted in ascending order.
51339                  * Otherwise, a value is sorted in ascending order if its corresponding
51340                  * order is "asc", and descending if "desc".
51341                  * 
51342                  * @private
51343                  * @param {Object}
51344                  *            object The object to compare.
51345                  * @param {Object}
51346                  *            other The other object to compare.
51347                  * @param {boolean[]}
51348                  *            orders The order to sort by for each property.
51349                  * @returns {number} Returns the sort order indicator for `object`.
51350                  */
51351                 function compareMultiple(object, other, orders) {
51352                     var index = -1,
51353                         objCriteria = object.criteria,
51354                         othCriteria = other.criteria,
51355                         length = objCriteria.length,
51356                         ordersLength = orders.length;
51357
51358                     while (++index < length) {
51359                         var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
51360                         if (result) {
51361                             if (index >= ordersLength) {
51362                                 return result;
51363                             }
51364                             var order = orders[index];
51365                             return result * ((order === 'asc' || order === true) ? 1 : -1);
51366                         }
51367                     }
51368                     // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
51369                     // that causes it, under certain circumstances, to provide the same value
51370                     // for
51371                     // `object` and `other`. See
51372                     // https://github.com/jashkenas/underscore/pull/1247
51373                     // for more details.
51374                     //
51375                     // This also ensures a stable sort in V8 and other engines.
51376                     // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
51377                     return object.index - other.index;
51378                 }
51379
51380                 /**
51381                  * Used by `_.deburr` to convert latin-1 supplementary letters to basic
51382                  * latin letters.
51383                  * 
51384                  * @private
51385                  * @param {string}
51386                  *            letter The matched letter to deburr.
51387                  * @returns {string} Returns the deburred letter.
51388                  */
51389                 function deburrLetter(letter) {
51390                     return deburredLetters[letter];
51391                 }
51392
51393                 /**
51394                  * Used by `_.escape` to convert characters to HTML entities.
51395                  * 
51396                  * @private
51397                  * @param {string}
51398                  *            chr The matched character to escape.
51399                  * @returns {string} Returns the escaped character.
51400                  */
51401                 function escapeHtmlChar(chr) {
51402                     return htmlEscapes[chr];
51403                 }
51404
51405                 /**
51406                  * Used by `_.escapeRegExp` to escape characters for inclusion in compiled
51407                  * regexes.
51408                  * 
51409                  * @private
51410                  * @param {string}
51411                  *            chr The matched character to escape.
51412                  * @param {string}
51413                  *            leadingChar The capture group for a leading character.
51414                  * @param {string}
51415                  *            whitespaceChar The capture group for a whitespace character.
51416                  * @returns {string} Returns the escaped character.
51417                  */
51418                 function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
51419                     if (leadingChar) {
51420                         chr = regexpEscapes[chr];
51421                     } else if (whitespaceChar) {
51422                         chr = stringEscapes[chr];
51423                     }
51424                     return '\\' + chr;
51425                 }
51426
51427                 /**
51428                  * Used by `_.template` to escape characters for inclusion in compiled
51429                  * string literals.
51430                  * 
51431                  * @private
51432                  * @param {string}
51433                  *            chr The matched character to escape.
51434                  * @returns {string} Returns the escaped character.
51435                  */
51436                 function escapeStringChar(chr) {
51437                     return '\\' + stringEscapes[chr];
51438                 }
51439
51440                 /**
51441                  * Gets the index at which the first occurrence of `NaN` is found in
51442                  * `array`.
51443                  * 
51444                  * @private
51445                  * @param {Array}
51446                  *            array The array to search.
51447                  * @param {number}
51448                  *            fromIndex The index to search from.
51449                  * @param {boolean}
51450                  *            [fromRight] Specify iterating from right to left.
51451                  * @returns {number} Returns the index of the matched `NaN`, else `-1`.
51452                  */
51453                 function indexOfNaN(array, fromIndex, fromRight) {
51454                     var length = array.length,
51455                         index = fromIndex + (fromRight ? 0 : -1);
51456
51457                     while ((fromRight ? index-- : ++index < length)) {
51458                         var other = array[index];
51459                         if (other !== other) {
51460                             return index;
51461                         }
51462                     }
51463                     return -1;
51464                 }
51465
51466                 /**
51467                  * Checks if `value` is object-like.
51468                  * 
51469                  * @private
51470                  * @param {*}
51471                  *            value The value to check.
51472                  * @returns {boolean} Returns `true` if `value` is object-like, else
51473                  *          `false`.
51474                  */
51475                 function isObjectLike(value) {
51476                     return !!value && typeof value == 'object';
51477                 }
51478
51479                 /**
51480                  * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
51481                  * character code is whitespace.
51482                  * 
51483                  * @private
51484                  * @param {number}
51485                  *            charCode The character code to inspect.
51486                  * @returns {boolean} Returns `true` if `charCode` is whitespace, else
51487                  *          `false`.
51488                  */
51489                 function isSpace(charCode) {
51490                     return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
51491                         (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
51492                 }
51493
51494                 /**
51495                  * Replaces all `placeholder` elements in `array` with an internal
51496                  * placeholder and returns an array of their indexes.
51497                  * 
51498                  * @private
51499                  * @param {Array}
51500                  *            array The array to modify.
51501                  * @param {*}
51502                  *            placeholder The placeholder to replace.
51503                  * @returns {Array} Returns the new array of placeholder indexes.
51504                  */
51505                 function replaceHolders(array, placeholder) {
51506                     var index = -1,
51507                         length = array.length,
51508                         resIndex = -1,
51509                         result = [];
51510
51511                     while (++index < length) {
51512                         if (array[index] === placeholder) {
51513                             array[index] = PLACEHOLDER;
51514                             result[++resIndex] = index;
51515                         }
51516                     }
51517                     return result;
51518                 }
51519
51520                 /**
51521                  * An implementation of `_.uniq` optimized for sorted arrays without support
51522                  * for callback shorthands and `this` binding.
51523                  * 
51524                  * @private
51525                  * @param {Array}
51526                  *            array The array to inspect.
51527                  * @param {Function}
51528                  *            [iteratee] The function invoked per iteration.
51529                  * @returns {Array} Returns the new duplicate-value-free array.
51530                  */
51531                 function sortedUniq(array, iteratee) {
51532                     var seen,
51533                         index = -1,
51534                         length = array.length,
51535                         resIndex = -1,
51536                         result = [];
51537
51538                     while (++index < length) {
51539                         var value = array[index],
51540                             computed = iteratee ? iteratee(value, index, array) : value;
51541
51542                         if (!index || seen !== computed) {
51543                             seen = computed;
51544                             result[++resIndex] = value;
51545                         }
51546                     }
51547                     return result;
51548                 }
51549
51550                 /**
51551                  * Used by `_.trim` and `_.trimLeft` to get the index of the first
51552                  * non-whitespace character of `string`.
51553                  * 
51554                  * @private
51555                  * @param {string}
51556                  *            string The string to inspect.
51557                  * @returns {number} Returns the index of the first non-whitespace
51558                  *          character.
51559                  */
51560                 function trimmedLeftIndex(string) {
51561                     var index = -1,
51562                         length = string.length;
51563
51564                     while (++index < length && isSpace(string.charCodeAt(index))) {}
51565                     return index;
51566                 }
51567
51568                 /**
51569                  * Used by `_.trim` and `_.trimRight` to get the index of the last
51570                  * non-whitespace character of `string`.
51571                  * 
51572                  * @private
51573                  * @param {string}
51574                  *            string The string to inspect.
51575                  * @returns {number} Returns the index of the last non-whitespace character.
51576                  */
51577                 function trimmedRightIndex(string) {
51578                     var index = string.length;
51579
51580                     while (index-- && isSpace(string.charCodeAt(index))) {}
51581                     return index;
51582                 }
51583
51584                 /**
51585                  * Used by `_.unescape` to convert HTML entities to characters.
51586                  * 
51587                  * @private
51588                  * @param {string}
51589                  *            chr The matched character to unescape.
51590                  * @returns {string} Returns the unescaped character.
51591                  */
51592                 function unescapeHtmlChar(chr) {
51593                     return htmlUnescapes[chr];
51594                 }
51595
51596                 /*--------------------------------------------------------------------------*/
51597
51598                 /**
51599                  * Create a new pristine `lodash` function using the given `context` object.
51600                  * 
51601                  * @static
51602                  * @memberOf _
51603                  * @category Utility
51604                  * @param {Object}
51605                  *            [context=root] The context object.
51606                  * @returns {Function} Returns a new `lodash` function.
51607                  * @example
51608                  * 
51609                  * _.mixin({ 'foo': _.constant('foo') });
51610                  * 
51611                  * var lodash = _.runInContext(); lodash.mixin({ 'bar':
51612                  * lodash.constant('bar') });
51613                  * 
51614                  * _.isFunction(_.foo); // => true _.isFunction(_.bar); // => false
51615                  * 
51616                  * lodash.isFunction(lodash.foo); // => false lodash.isFunction(lodash.bar); // =>
51617                  * true
51618                  *  // using `context` to mock `Date#getTime` use in `_.now` var mock =
51619                  * _.runInContext({ 'Date': function() { return { 'getTime': getTimeMock }; }
51620                  * });
51621                  *  // or creating a suped-up `defer` in Node.js var defer =
51622                  * _.runInContext({ 'setTimeout': setImmediate }).defer;
51623                  */
51624                 function runInContext(context) {
51625                     // Avoid issues with some ES3 environments that attempt to use values, named
51626                     // after built-in constructors like `Object`, for the creation of literals.
51627                     // ES5 clears this up by stating that literals must use built-in
51628                     // constructors.
51629                     // See https://es5.github.io/#x11.1.5 for more details.
51630                     context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
51631
51632                     /** Native constructor references. */
51633                     var Array = context.Array,
51634                         Date = context.Date,
51635                         Error = context.Error,
51636                         Function = context.Function,
51637                         Math = context.Math,
51638                         Number = context.Number,
51639                         Object = context.Object,
51640                         RegExp = context.RegExp,
51641                         String = context.String,
51642                         TypeError = context.TypeError;
51643
51644                     /** Used for native method references. */
51645                     var arrayProto = Array.prototype,
51646                         objectProto = Object.prototype,
51647                         stringProto = String.prototype;
51648
51649                     /** Used to resolve the decompiled source of functions. */
51650                     var fnToString = Function.prototype.toString;
51651
51652                     /** Used to check objects for own properties. */
51653                     var hasOwnProperty = objectProto.hasOwnProperty;
51654
51655                     /** Used to generate unique IDs. */
51656                     var idCounter = 0;
51657
51658                     /**
51659                      * Used to resolve the
51660                      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
51661                      * of values.
51662                      */
51663                     var objToString = objectProto.toString;
51664
51665                     /** Used to restore the original `_` reference in `_.noConflict`. */
51666                     var oldDash = root._;
51667
51668                     /** Used to detect if a method is native. */
51669                     var reIsNative = RegExp('^' +
51670                         fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
51671                         .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
51672                     );
51673
51674                     /** Native method references. */
51675                     var ArrayBuffer = context.ArrayBuffer,
51676                         clearTimeout = context.clearTimeout,
51677                         parseFloat = context.parseFloat,
51678                         pow = Math.pow,
51679                         propertyIsEnumerable = objectProto.propertyIsEnumerable,
51680                         Set = getNative(context, 'Set'),
51681                         setTimeout = context.setTimeout,
51682                         splice = arrayProto.splice,
51683                         Uint8Array = context.Uint8Array,
51684                         WeakMap = getNative(context, 'WeakMap');
51685
51686                     /*
51687                      * Native method references for those with the same name as other `lodash`
51688                      * methods.
51689                      */
51690                     var nativeCeil = Math.ceil,
51691                         nativeCreate = getNative(Object, 'create'),
51692                         nativeFloor = Math.floor,
51693                         nativeIsArray = getNative(Array, 'isArray'),
51694                         nativeIsFinite = context.isFinite,
51695                         nativeKeys = getNative(Object, 'keys'),
51696                         nativeMax = Math.max,
51697                         nativeMin = Math.min,
51698                         nativeNow = getNative(Date, 'now'),
51699                         nativeParseInt = context.parseInt,
51700                         nativeRandom = Math.random;
51701
51702                     /** Used as references for `-Infinity` and `Infinity`. */
51703                     var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
51704                         POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
51705
51706                     /** Used as references for the maximum length and index of an array. */
51707                     var MAX_ARRAY_LENGTH = 4294967295,
51708                         MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
51709                         HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
51710
51711                     /**
51712                      * Used as the [maximum
51713                      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
51714                      * of an array-like value.
51715                      */
51716                     var MAX_SAFE_INTEGER = 9007199254740991;
51717
51718                     /** Used to store function metadata. */
51719                     var metaMap = WeakMap && new WeakMap;
51720
51721                     /** Used to lookup unminified function names. */
51722                     var realNames = {};
51723
51724                     /*------------------------------------------------------------------------*/
51725
51726                     /**
51727                      * Creates a `lodash` object which wraps `value` to enable implicit
51728                      * chaining. Methods that operate on and return arrays, collections, and
51729                      * functions can be chained together. Methods that retrieve a single value
51730                      * or may return a primitive value will automatically end the chain
51731                      * returning the unwrapped value. Explicit chaining may be enabled using
51732                      * `_.chain`. The execution of chained methods is lazy, that is, execution
51733                      * is deferred until `_#value` is implicitly or explicitly called.
51734                      * 
51735                      * Lazy evaluation allows several methods to support shortcut fusion.
51736                      * Shortcut fusion is an optimization strategy which merge iteratee calls;
51737                      * this can help to avoid the creation of intermediate data structures and
51738                      * greatly reduce the number of iteratee executions.
51739                      * 
51740                      * Chaining is supported in custom builds as long as the `_#value` method is
51741                      * directly or indirectly included in the build.
51742                      * 
51743                      * In addition to lodash methods, wrappers have `Array` and `String`
51744                      * methods.
51745                      * 
51746                      * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`,
51747                      * `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift`
51748                      * 
51749                      * The wrapper `String` methods are: `replace` and `split`
51750                      * 
51751                      * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
51752                      * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
51753                      * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
51754                      * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
51755                      * 
51756                      * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`,
51757                      * `before`, `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`,
51758                      * `commit`, `compact`, `concat`, `constant`, `countBy`, `create`, `curry`,
51759                      * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
51760                      * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`,
51761                      * `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`,
51762                      * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`,
51763                      * `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
51764                      * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
51765                      * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `modArgs`, `negate`,
51766                      * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`,
51767                      * `plant`, `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`,
51768                      * `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, `reverse`,
51769                      * `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`,
51770                      * `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`,
51771                      * `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
51772                      * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
51773                      * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`,
51774                      * `zipWith`
51775                      * 
51776                      * The wrapper methods that are **not** chainable by default are: `add`,
51777                      * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
51778                      * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`,
51779                      * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`,
51780                      * `findWhere`, `first`, `floor`, `get`, `gt`, `gte`, `has`, `identity`,
51781                      * `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`, `isBoolean`,
51782                      * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
51783                      * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
51784                      * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
51785                      * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
51786                      * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
51787                      * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
51788                      * `round`, `runInContext`, `shift`, `size`, `snakeCase`, `some`,
51789                      * `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`, `sum`,
51790                      * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
51791                      * `uniqueId`, `value`, and `words`
51792                      * 
51793                      * The wrapper method `sample` will return a wrapped value when `n` is
51794                      * provided, otherwise an unwrapped value is returned.
51795                      * 
51796                      * @name _
51797                      * @constructor
51798                      * @category Chain
51799                      * @param {*}
51800                      *            value The value to wrap in a `lodash` instance.
51801                      * @returns {Object} Returns the new `lodash` wrapper instance.
51802                      * @example
51803                      * 
51804                      * var wrapped = _([1, 2, 3]);
51805                      *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
51806                      * total + n; }); // => 6
51807                      *  // returns a wrapped value var squares = wrapped.map(function(n) {
51808                      * return n * n; });
51809                      * 
51810                      * _.isArray(squares); // => false
51811                      * 
51812                      * _.isArray(squares.value()); // => true
51813                      */
51814                     function lodash(value) {
51815                         if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
51816                             if (value instanceof LodashWrapper) {
51817                                 return value;
51818                             }
51819                             if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
51820                                 return wrapperClone(value);
51821                             }
51822                         }
51823                         return new LodashWrapper(value);
51824                     }
51825
51826                     /**
51827                      * The function whose prototype all chaining wrappers inherit from.
51828                      * 
51829                      * @private
51830                      */
51831                     function baseLodash() {
51832                         // No operation performed.
51833                     }
51834
51835                     /**
51836                      * The base constructor for creating `lodash` wrapper objects.
51837                      * 
51838                      * @private
51839                      * @param {*}
51840                      *            value The value to wrap.
51841                      * @param {boolean}
51842                      *            [chainAll] Enable chaining for all wrapper methods.
51843                      * @param {Array}
51844                      *            [actions=[]] Actions to peform to resolve the unwrapped value.
51845                      */
51846                     function LodashWrapper(value, chainAll, actions) {
51847                         this.__wrapped__ = value;
51848                         this.__actions__ = actions || [];
51849                         this.__chain__ = !!chainAll;
51850                     }
51851
51852                     /**
51853                      * An object environment feature flags.
51854                      * 
51855                      * @static
51856                      * @memberOf _
51857                      * @type Object
51858                      */
51859                     var support = lodash.support = {};
51860
51861                     /**
51862                      * By default, the template delimiters used by lodash are like those in
51863                      * embedded Ruby (ERB). Change the following template settings to use
51864                      * alternative delimiters.
51865                      * 
51866                      * @static
51867                      * @memberOf _
51868                      * @type Object
51869                      */
51870                     lodash.templateSettings = {
51871
51872                         /**
51873                          * Used to detect `data` property values to be HTML-escaped.
51874                          * 
51875                          * @memberOf _.templateSettings
51876                          * @type RegExp
51877                          */
51878                         'escape': reEscape,
51879
51880                         /**
51881                          * Used to detect code to be evaluated.
51882                          * 
51883                          * @memberOf _.templateSettings
51884                          * @type RegExp
51885                          */
51886                         'evaluate': reEvaluate,
51887
51888                         /**
51889                          * Used to detect `data` property values to inject.
51890                          * 
51891                          * @memberOf _.templateSettings
51892                          * @type RegExp
51893                          */
51894                         'interpolate': reInterpolate,
51895
51896                         /**
51897                          * Used to reference the data object in the template text.
51898                          * 
51899                          * @memberOf _.templateSettings
51900                          * @type string
51901                          */
51902                         'variable': '',
51903
51904                         /**
51905                          * Used to import variables into the compiled template.
51906                          * 
51907                          * @memberOf _.templateSettings
51908                          * @type Object
51909                          */
51910                         'imports': {
51911
51912                             /**
51913                              * A reference to the `lodash` function.
51914                              * 
51915                              * @memberOf _.templateSettings.imports
51916                              * @type Function
51917                              */
51918                             '_': lodash
51919                         }
51920                     };
51921
51922                     /*------------------------------------------------------------------------*/
51923
51924                     /**
51925                      * Creates a lazy wrapper object which wraps `value` to enable lazy
51926                      * evaluation.
51927                      * 
51928                      * @private
51929                      * @param {*}
51930                      *            value The value to wrap.
51931                      */
51932                     function LazyWrapper(value) {
51933                         this.__wrapped__ = value;
51934                         this.__actions__ = [];
51935                         this.__dir__ = 1;
51936                         this.__filtered__ = false;
51937                         this.__iteratees__ = [];
51938                         this.__takeCount__ = POSITIVE_INFINITY;
51939                         this.__views__ = [];
51940                     }
51941
51942                     /**
51943                      * Creates a clone of the lazy wrapper object.
51944                      * 
51945                      * @private
51946                      * @name clone
51947                      * @memberOf LazyWrapper
51948                      * @returns {Object} Returns the cloned `LazyWrapper` object.
51949                      */
51950                     function lazyClone() {
51951                         var result = new LazyWrapper(this.__wrapped__);
51952                         result.__actions__ = arrayCopy(this.__actions__);
51953                         result.__dir__ = this.__dir__;
51954                         result.__filtered__ = this.__filtered__;
51955                         result.__iteratees__ = arrayCopy(this.__iteratees__);
51956                         result.__takeCount__ = this.__takeCount__;
51957                         result.__views__ = arrayCopy(this.__views__);
51958                         return result;
51959                     }
51960
51961                     /**
51962                      * Reverses the direction of lazy iteration.
51963                      * 
51964                      * @private
51965                      * @name reverse
51966                      * @memberOf LazyWrapper
51967                      * @returns {Object} Returns the new reversed `LazyWrapper` object.
51968                      */
51969                     function lazyReverse() {
51970                         if (this.__filtered__) {
51971                             var result = new LazyWrapper(this);
51972                             result.__dir__ = -1;
51973                             result.__filtered__ = true;
51974                         } else {
51975                             result = this.clone();
51976                             result.__dir__ *= -1;
51977                         }
51978                         return result;
51979                     }
51980
51981                     /**
51982                      * Extracts the unwrapped value from its lazy wrapper.
51983                      * 
51984                      * @private
51985                      * @name value
51986                      * @memberOf LazyWrapper
51987                      * @returns {*} Returns the unwrapped value.
51988                      */
51989                     function lazyValue() {
51990                         var array = this.__wrapped__.value(),
51991                             dir = this.__dir__,
51992                             isArr = isArray(array),
51993                             isRight = dir < 0,
51994                             arrLength = isArr ? array.length : 0,
51995                             view = getView(0, arrLength, this.__views__),
51996                             start = view.start,
51997                             end = view.end,
51998                             length = end - start,
51999                             index = isRight ? end : (start - 1),
52000                             iteratees = this.__iteratees__,
52001                             iterLength = iteratees.length,
52002                             resIndex = 0,
52003                             takeCount = nativeMin(length, this.__takeCount__);
52004
52005                         if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
52006                             return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
52007                         }
52008                         var result = [];
52009
52010                         outer:
52011                             while (length-- && resIndex < takeCount) {
52012                                 index += dir;
52013
52014                                 var iterIndex = -1,
52015                                     value = array[index];
52016
52017                                 while (++iterIndex < iterLength) {
52018                                     var data = iteratees[iterIndex],
52019                                         iteratee = data.iteratee,
52020                                         type = data.type,
52021                                         computed = iteratee(value);
52022
52023                                     if (type == LAZY_MAP_FLAG) {
52024                                         value = computed;
52025                                     } else if (!computed) {
52026                                         if (type == LAZY_FILTER_FLAG) {
52027                                             continue outer;
52028                                         } else {
52029                                             break outer;
52030                                         }
52031                                     }
52032                                 }
52033                                 result[resIndex++] = value;
52034                             }
52035                         return result;
52036                     }
52037
52038                     /*------------------------------------------------------------------------*/
52039
52040                     /**
52041                      * Creates a cache object to store key/value pairs.
52042                      * 
52043                      * @private
52044                      * @static
52045                      * @name Cache
52046                      * @memberOf _.memoize
52047                      */
52048                     function MapCache() {
52049                         this.__data__ = {};
52050                     }
52051
52052                     /**
52053                      * Removes `key` and its value from the cache.
52054                      * 
52055                      * @private
52056                      * @name delete
52057                      * @memberOf _.memoize.Cache
52058                      * @param {string}
52059                      *            key The key of the value to remove.
52060                      * @returns {boolean} Returns `true` if the entry was removed successfully,
52061                      *          else `false`.
52062                      */
52063                     function mapDelete(key) {
52064                         return this.has(key) && delete this.__data__[key];
52065                     }
52066
52067                     /**
52068                      * Gets the cached value for `key`.
52069                      * 
52070                      * @private
52071                      * @name get
52072                      * @memberOf _.memoize.Cache
52073                      * @param {string}
52074                      *            key The key of the value to get.
52075                      * @returns {*} Returns the cached value.
52076                      */
52077                     function mapGet(key) {
52078                         return key == '__proto__' ? undefined : this.__data__[key];
52079                     }
52080
52081                     /**
52082                      * Checks if a cached value for `key` exists.
52083                      * 
52084                      * @private
52085                      * @name has
52086                      * @memberOf _.memoize.Cache
52087                      * @param {string}
52088                      *            key The key of the entry to check.
52089                      * @returns {boolean} Returns `true` if an entry for `key` exists, else
52090                      *          `false`.
52091                      */
52092                     function mapHas(key) {
52093                         return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
52094                     }
52095
52096                     /**
52097                      * Sets `value` to `key` of the cache.
52098                      * 
52099                      * @private
52100                      * @name set
52101                      * @memberOf _.memoize.Cache
52102                      * @param {string}
52103                      *            key The key of the value to cache.
52104                      * @param {*}
52105                      *            value The value to cache.
52106                      * @returns {Object} Returns the cache object.
52107                      */
52108                     function mapSet(key, value) {
52109                         if (key != '__proto__') {
52110                             this.__data__[key] = value;
52111                         }
52112                         return this;
52113                     }
52114
52115                     /*------------------------------------------------------------------------*/
52116
52117                     /**
52118                      * 
52119                      * Creates a cache object to store unique values.
52120                      * 
52121                      * @private
52122                      * @param {Array}
52123                      *            [values] The values to cache.
52124                      */
52125                     function SetCache(values) {
52126                         var length = values ? values.length : 0;
52127
52128                         this.data = {
52129                             'hash': nativeCreate(null),
52130                             'set': new Set
52131                         };
52132                         while (length--) {
52133                             this.push(values[length]);
52134                         }
52135                     }
52136
52137                     /**
52138                      * Checks if `value` is in `cache` mimicking the return signature of
52139                      * `_.indexOf` by returning `0` if the value is found, else `-1`.
52140                      * 
52141                      * @private
52142                      * @param {Object}
52143                      *            cache The cache to search.
52144                      * @param {*}
52145                      *            value The value to search for.
52146                      * @returns {number} Returns `0` if `value` is found, else `-1`.
52147                      */
52148                     function cacheIndexOf(cache, value) {
52149                         var data = cache.data,
52150                             result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
52151
52152                         return result ? 0 : -1;
52153                     }
52154
52155                     /**
52156                      * Adds `value` to the cache.
52157                      * 
52158                      * @private
52159                      * @name push
52160                      * @memberOf SetCache
52161                      * @param {*}
52162                      *            value The value to cache.
52163                      */
52164                     function cachePush(value) {
52165                         var data = this.data;
52166                         if (typeof value == 'string' || isObject(value)) {
52167                             data.set.add(value);
52168                         } else {
52169                             data.hash[value] = true;
52170                         }
52171                     }
52172
52173                     /*------------------------------------------------------------------------*/
52174
52175                     /**
52176                      * Creates a new array joining `array` with `other`.
52177                      * 
52178                      * @private
52179                      * @param {Array}
52180                      *            array The array to join.
52181                      * @param {Array}
52182                      *            other The other array to join.
52183                      * @returns {Array} Returns the new concatenated array.
52184                      */
52185                     function arrayConcat(array, other) {
52186                         var index = -1,
52187                             length = array.length,
52188                             othIndex = -1,
52189                             othLength = other.length,
52190                             result = Array(length + othLength);
52191
52192                         while (++index < length) {
52193                             result[index] = array[index];
52194                         }
52195                         while (++othIndex < othLength) {
52196                             result[index++] = other[othIndex];
52197                         }
52198                         return result;
52199                     }
52200
52201                     /**
52202                      * Copies the values of `source` to `array`.
52203                      * 
52204                      * @private
52205                      * @param {Array}
52206                      *            source The array to copy values from.
52207                      * @param {Array}
52208                      *            [array=[]] The array to copy values to.
52209                      * @returns {Array} Returns `array`.
52210                      */
52211                     function arrayCopy(source, array) {
52212                         var index = -1,
52213                             length = source.length;
52214
52215                         array || (array = Array(length));
52216                         while (++index < length) {
52217                             array[index] = source[index];
52218                         }
52219                         return array;
52220                     }
52221
52222                     /**
52223                      * A specialized version of `_.forEach` for arrays without support for
52224                      * callback shorthands and `this` binding.
52225                      * 
52226                      * @private
52227                      * @param {Array}
52228                      *            array The array to iterate over.
52229                      * @param {Function}
52230                      *            iteratee The function invoked per iteration.
52231                      * @returns {Array} Returns `array`.
52232                      */
52233                     function arrayEach(array, iteratee) {
52234                         var index = -1,
52235                             length = array.length;
52236
52237                         while (++index < length) {
52238                             if (iteratee(array[index], index, array) === false) {
52239                                 break;
52240                             }
52241                         }
52242                         return array;
52243                     }
52244
52245                     /**
52246                      * A specialized version of `_.forEachRight` for arrays without support for
52247                      * callback shorthands and `this` binding.
52248                      * 
52249                      * @private
52250                      * @param {Array}
52251                      *            array The array to iterate over.
52252                      * @param {Function}
52253                      *            iteratee The function invoked per iteration.
52254                      * @returns {Array} Returns `array`.
52255                      */
52256                     function arrayEachRight(array, iteratee) {
52257                         var length = array.length;
52258
52259                         while (length--) {
52260                             if (iteratee(array[length], length, array) === false) {
52261                                 break;
52262                             }
52263                         }
52264                         return array;
52265                     }
52266
52267                     /**
52268                      * A specialized version of `_.every` for arrays without support for
52269                      * callback shorthands and `this` binding.
52270                      * 
52271                      * @private
52272                      * @param {Array}
52273                      *            array The array to iterate over.
52274                      * @param {Function}
52275                      *            predicate The function invoked per iteration.
52276                      * @returns {boolean} Returns `true` if all elements pass the predicate
52277                      *          check, else `false`.
52278                      */
52279                     function arrayEvery(array, predicate) {
52280                         var index = -1,
52281                             length = array.length;
52282
52283                         while (++index < length) {
52284                             if (!predicate(array[index], index, array)) {
52285                                 return false;
52286                             }
52287                         }
52288                         return true;
52289                     }
52290
52291                     /**
52292                      * A specialized version of `baseExtremum` for arrays which invokes
52293                      * `iteratee` with one argument: (value).
52294                      * 
52295                      * @private
52296                      * @param {Array}
52297                      *            array The array to iterate over.
52298                      * @param {Function}
52299                      *            iteratee The function invoked per iteration.
52300                      * @param {Function}
52301                      *            comparator The function used to compare values.
52302                      * @param {*}
52303                      *            exValue The initial extremum value.
52304                      * @returns {*} Returns the extremum value.
52305                      */
52306                     function arrayExtremum(array, iteratee, comparator, exValue) {
52307                         var index = -1,
52308                             length = array.length,
52309                             computed = exValue,
52310                             result = computed;
52311
52312                         while (++index < length) {
52313                             var value = array[index],
52314                                 current = +iteratee(value);
52315
52316                             if (comparator(current, computed)) {
52317                                 computed = current;
52318                                 result = value;
52319                             }
52320                         }
52321                         return result;
52322                     }
52323
52324                     /**
52325                      * A specialized version of `_.filter` for arrays without support for
52326                      * callback shorthands and `this` binding.
52327                      * 
52328                      * @private
52329                      * @param {Array}
52330                      *            array The array to iterate over.
52331                      * @param {Function}
52332                      *            predicate The function invoked per iteration.
52333                      * @returns {Array} Returns the new filtered array.
52334                      */
52335                     function arrayFilter(array, predicate) {
52336                         var index = -1,
52337                             length = array.length,
52338                             resIndex = -1,
52339                             result = [];
52340
52341                         while (++index < length) {
52342                             var value = array[index];
52343                             if (predicate(value, index, array)) {
52344                                 result[++resIndex] = value;
52345                             }
52346                         }
52347                         return result;
52348                     }
52349
52350                     /**
52351                      * A specialized version of `_.map` for arrays without support for callback
52352                      * shorthands and `this` binding.
52353                      * 
52354                      * @private
52355                      * @param {Array}
52356                      *            array The array to iterate over.
52357                      * @param {Function}
52358                      *            iteratee The function invoked per iteration.
52359                      * @returns {Array} Returns the new mapped array.
52360                      */
52361                     function arrayMap(array, iteratee) {
52362                         var index = -1,
52363                             length = array.length,
52364                             result = Array(length);
52365
52366                         while (++index < length) {
52367                             result[index] = iteratee(array[index], index, array);
52368                         }
52369                         return result;
52370                     }
52371
52372                     /**
52373                      * Appends the elements of `values` to `array`.
52374                      * 
52375                      * @private
52376                      * @param {Array}
52377                      *            array The array to modify.
52378                      * @param {Array}
52379                      *            values The values to append.
52380                      * @returns {Array} Returns `array`.
52381                      */
52382                     function arrayPush(array, values) {
52383                         var index = -1,
52384                             length = values.length,
52385                             offset = array.length;
52386
52387                         while (++index < length) {
52388                             array[offset + index] = values[index];
52389                         }
52390                         return array;
52391                     }
52392
52393                     /**
52394                      * A specialized version of `_.reduce` for arrays without support for
52395                      * callback shorthands and `this` binding.
52396                      * 
52397                      * @private
52398                      * @param {Array}
52399                      *            array The array to iterate over.
52400                      * @param {Function}
52401                      *            iteratee The function invoked per iteration.
52402                      * @param {*}
52403                      *            [accumulator] The initial value.
52404                      * @param {boolean}
52405                      *            [initFromArray] Specify using the first element of `array` as
52406                      *            the initial value.
52407                      * @returns {*} Returns the accumulated value.
52408                      */
52409                     function arrayReduce(array, iteratee, accumulator, initFromArray) {
52410                         var index = -1,
52411                             length = array.length;
52412
52413                         if (initFromArray && length) {
52414                             accumulator = array[++index];
52415                         }
52416                         while (++index < length) {
52417                             accumulator = iteratee(accumulator, array[index], index, array);
52418                         }
52419                         return accumulator;
52420                     }
52421
52422                     /**
52423                      * A specialized version of `_.reduceRight` for arrays without support for
52424                      * callback shorthands and `this` binding.
52425                      * 
52426                      * @private
52427                      * @param {Array}
52428                      *            array The array to iterate over.
52429                      * @param {Function}
52430                      *            iteratee The function invoked per iteration.
52431                      * @param {*}
52432                      *            [accumulator] The initial value.
52433                      * @param {boolean}
52434                      *            [initFromArray] Specify using the last element of `array` as
52435                      *            the initial value.
52436                      * @returns {*} Returns the accumulated value.
52437                      */
52438                     function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
52439                         var length = array.length;
52440                         if (initFromArray && length) {
52441                             accumulator = array[--length];
52442                         }
52443                         while (length--) {
52444                             accumulator = iteratee(accumulator, array[length], length, array);
52445                         }
52446                         return accumulator;
52447                     }
52448
52449                     /**
52450                      * A specialized version of `_.some` for arrays without support for callback
52451                      * shorthands and `this` binding.
52452                      * 
52453                      * @private
52454                      * @param {Array}
52455                      *            array The array to iterate over.
52456                      * @param {Function}
52457                      *            predicate The function invoked per iteration.
52458                      * @returns {boolean} Returns `true` if any element passes the predicate
52459                      *          check, else `false`.
52460                      */
52461                     function arraySome(array, predicate) {
52462                         var index = -1,
52463                             length = array.length;
52464
52465                         while (++index < length) {
52466                             if (predicate(array[index], index, array)) {
52467                                 return true;
52468                             }
52469                         }
52470                         return false;
52471                     }
52472
52473                     /**
52474                      * A specialized version of `_.sum` for arrays without support for callback
52475                      * shorthands and `this` binding..
52476                      * 
52477                      * @private
52478                      * @param {Array}
52479                      *            array The array to iterate over.
52480                      * @param {Function}
52481                      *            iteratee The function invoked per iteration.
52482                      * @returns {number} Returns the sum.
52483                      */
52484                     function arraySum(array, iteratee) {
52485                         var length = array.length,
52486                             result = 0;
52487
52488                         while (length--) {
52489                             result += +iteratee(array[length]) || 0;
52490                         }
52491                         return result;
52492                     }
52493
52494                     /**
52495                      * Used by `_.defaults` to customize its `_.assign` use.
52496                      * 
52497                      * @private
52498                      * @param {*}
52499                      *            objectValue The destination object property value.
52500                      * @param {*}
52501                      *            sourceValue The source object property value.
52502                      * @returns {*} Returns the value to assign to the destination object.
52503                      */
52504                     function assignDefaults(objectValue, sourceValue) {
52505                         return objectValue === undefined ? sourceValue : objectValue;
52506                     }
52507
52508                     /**
52509                      * Used by `_.template` to customize its `_.assign` use.
52510                      * 
52511                      * **Note:** This function is like `assignDefaults` except that it ignores
52512                      * inherited property values when checking if a property is `undefined`.
52513                      * 
52514                      * @private
52515                      * @param {*}
52516                      *            objectValue The destination object property value.
52517                      * @param {*}
52518                      *            sourceValue The source object property value.
52519                      * @param {string}
52520                      *            key The key associated with the object and source values.
52521                      * @param {Object}
52522                      *            object The destination object.
52523                      * @returns {*} Returns the value to assign to the destination object.
52524                      */
52525                     function assignOwnDefaults(objectValue, sourceValue, key, object) {
52526                         return (objectValue === undefined || !hasOwnProperty.call(object, key)) ? sourceValue : objectValue;
52527                     }
52528
52529                     /**
52530                      * A specialized version of `_.assign` for customizing assigned values
52531                      * without support for argument juggling, multiple sources, and `this`
52532                      * binding `customizer` functions.
52533                      * 
52534                      * @private
52535                      * @param {Object}
52536                      *            object The destination object.
52537                      * @param {Object}
52538                      *            source The source object.
52539                      * @param {Function}
52540                      *            customizer The function to customize assigned values.
52541                      * @returns {Object} Returns `object`.
52542                      */
52543                     function assignWith(object, source, customizer) {
52544                         var index = -1,
52545                             props = keys(source),
52546                             length = props.length;
52547
52548                         while (++index < length) {
52549                             var key = props[index],
52550                                 value = object[key],
52551                                 result = customizer(value, source[key], key, object, source);
52552
52553                             if ((result === result ? (result !== value) : (value === value)) ||
52554                                 (value === undefined && !(key in object))) {
52555                                 object[key] = result;
52556                             }
52557                         }
52558                         return object;
52559                     }
52560
52561                     /**
52562                      * The base implementation of `_.assign` without support for argument
52563                      * juggling, multiple sources, and `customizer` functions.
52564                      * 
52565                      * @private
52566                      * @param {Object}
52567                      *            object The destination object.
52568                      * @param {Object}
52569                      *            source The source object.
52570                      * @returns {Object} Returns `object`.
52571                      */
52572                     function baseAssign(object, source) {
52573                         return source == null ? object : baseCopy(source, keys(source), object);
52574                     }
52575
52576                     /**
52577                      * The base implementation of `_.at` without support for string collections
52578                      * and individual key arguments.
52579                      * 
52580                      * @private
52581                      * @param {Array|Object}
52582                      *            collection The collection to iterate over.
52583                      * @param {number[]|string[]}
52584                      *            props The property names or indexes of elements to pick.
52585                      * @returns {Array} Returns the new array of picked elements.
52586                      */
52587                     function baseAt(collection, props) {
52588                         var index = -1,
52589                             isNil = collection == null,
52590                             isArr = !isNil && isArrayLike(collection),
52591                             length = isArr ? collection.length : 0,
52592                             propsLength = props.length,
52593                             result = Array(propsLength);
52594
52595                         while (++index < propsLength) {
52596                             var key = props[index];
52597                             if (isArr) {
52598                                 result[index] = isIndex(key, length) ? collection[key] : undefined;
52599                             } else {
52600                                 result[index] = isNil ? undefined : collection[key];
52601                             }
52602                         }
52603                         return result;
52604                     }
52605
52606                     /**
52607                      * Copies properties of `source` to `object`.
52608                      * 
52609                      * @private
52610                      * @param {Object}
52611                      *            source The object to copy properties from.
52612                      * @param {Array}
52613                      *            props The property names to copy.
52614                      * @param {Object}
52615                      *            [object={}] The object to copy properties to.
52616                      * @returns {Object} Returns `object`.
52617                      */
52618                     function baseCopy(source, props, object) {
52619                         object || (object = {});
52620
52621                         var index = -1,
52622                             length = props.length;
52623
52624                         while (++index < length) {
52625                             var key = props[index];
52626                             object[key] = source[key];
52627                         }
52628                         return object;
52629                     }
52630
52631                     /**
52632                      * The base implementation of `_.callback` which supports specifying the
52633                      * number of arguments to provide to `func`.
52634                      * 
52635                      * @private
52636                      * @param {*}
52637                      *            [func=_.identity] The value to convert to a callback.
52638                      * @param {*}
52639                      *            [thisArg] The `this` binding of `func`.
52640                      * @param {number}
52641                      *            [argCount] The number of arguments to provide to `func`.
52642                      * @returns {Function} Returns the callback.
52643                      */
52644                     function baseCallback(func, thisArg, argCount) {
52645                         var type = typeof func;
52646                         if (type == 'function') {
52647                             return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
52648                         }
52649                         if (func == null) {
52650                             return identity;
52651                         }
52652                         if (type == 'object') {
52653                             return baseMatches(func);
52654                         }
52655                         return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
52656                     }
52657
52658                     /**
52659                      * The base implementation of `_.clone` without support for argument
52660                      * juggling and `this` binding `customizer` functions.
52661                      * 
52662                      * @private
52663                      * @param {*}
52664                      *            value The value to clone.
52665                      * @param {boolean}
52666                      *            [isDeep] Specify a deep clone.
52667                      * @param {Function}
52668                      *            [customizer] The function to customize cloning values.
52669                      * @param {string}
52670                      *            [key] The key of `value`.
52671                      * @param {Object}
52672                      *            [object] The object `value` belongs to.
52673                      * @param {Array}
52674                      *            [stackA=[]] Tracks traversed source objects.
52675                      * @param {Array}
52676                      *            [stackB=[]] Associates clones with source counterparts.
52677                      * @returns {*} Returns the cloned value.
52678                      */
52679                     function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
52680                         var result;
52681                         if (customizer) {
52682                             result = object ? customizer(value, key, object) : customizer(value);
52683                         }
52684                         if (result !== undefined) {
52685                             return result;
52686                         }
52687                         if (!isObject(value)) {
52688                             return value;
52689                         }
52690                         var isArr = isArray(value);
52691                         if (isArr) {
52692                             result = initCloneArray(value);
52693                             if (!isDeep) {
52694                                 return arrayCopy(value, result);
52695                             }
52696                         } else {
52697                             var tag = objToString.call(value),
52698                                 isFunc = tag == funcTag;
52699
52700                             if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
52701                                 result = initCloneObject(isFunc ? {} : value);
52702                                 if (!isDeep) {
52703                                     return baseAssign(result, value);
52704                                 }
52705                             } else {
52706                                 return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : (object ? value : {});
52707                             }
52708                         }
52709                         // Check for circular references and return its corresponding clone.
52710                         stackA || (stackA = []);
52711                         stackB || (stackB = []);
52712
52713                         var length = stackA.length;
52714                         while (length--) {
52715                             if (stackA[length] == value) {
52716                                 return stackB[length];
52717                             }
52718                         }
52719                         // Add the source value to the stack of traversed objects and associate
52720                         // it with its clone.
52721                         stackA.push(value);
52722                         stackB.push(result);
52723
52724                         // Recursively populate clone (susceptible to call stack limits).
52725                         (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
52726                             result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
52727                         });
52728                         return result;
52729                     }
52730
52731                     /**
52732                      * The base implementation of `_.create` without support for assigning
52733                      * properties to the created object.
52734                      * 
52735                      * @private
52736                      * @param {Object}
52737                      *            prototype The object to inherit from.
52738                      * @returns {Object} Returns the new object.
52739                      */
52740                     var baseCreate = (function() {
52741                         function object() {}
52742                         return function(prototype) {
52743                             if (isObject(prototype)) {
52744                                 object.prototype = prototype;
52745                                 var result = new object;
52746                                 object.prototype = undefined;
52747                             }
52748                             return result || {};
52749                         };
52750                     }());
52751
52752                     /**
52753                      * The base implementation of `_.delay` and `_.defer` which accepts an index
52754                      * of where to slice the arguments to provide to `func`.
52755                      * 
52756                      * @private
52757                      * @param {Function}
52758                      *            func The function to delay.
52759                      * @param {number}
52760                      *            wait The number of milliseconds to delay invocation.
52761                      * @param {Object}
52762                      *            args The arguments provide to `func`.
52763                      * @returns {number} Returns the timer id.
52764                      */
52765                     function baseDelay(func, wait, args) {
52766                         if (typeof func != 'function') {
52767                             throw new TypeError(FUNC_ERROR_TEXT);
52768                         }
52769                         return setTimeout(function() {
52770                             func.apply(undefined, args);
52771                         }, wait);
52772                     }
52773
52774                     /**
52775                      * The base implementation of `_.difference` which accepts a single array of
52776                      * values to exclude.
52777                      * 
52778                      * @private
52779                      * @param {Array}
52780                      *            array The array to inspect.
52781                      * @param {Array}
52782                      *            values The values to exclude.
52783                      * @returns {Array} Returns the new array of filtered values.
52784                      */
52785                     function baseDifference(array, values) {
52786                         var length = array ? array.length : 0,
52787                             result = [];
52788
52789                         if (!length) {
52790                             return result;
52791                         }
52792                         var index = -1,
52793                             indexOf = getIndexOf(),
52794                             isCommon = indexOf == baseIndexOf,
52795                             cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
52796                             valuesLength = values.length;
52797
52798                         if (cache) {
52799                             indexOf = cacheIndexOf;
52800                             isCommon = false;
52801                             values = cache;
52802                         }
52803                         outer:
52804                             while (++index < length) {
52805                                 var value = array[index];
52806
52807                                 if (isCommon && value === value) {
52808                                     var valuesIndex = valuesLength;
52809                                     while (valuesIndex--) {
52810                                         if (values[valuesIndex] === value) {
52811                                             continue outer;
52812                                         }
52813                                     }
52814                                     result.push(value);
52815                                 } else if (indexOf(values, value, 0) < 0) {
52816                                     result.push(value);
52817                                 }
52818                             }
52819                         return result;
52820                     }
52821
52822                     /**
52823                      * The base implementation of `_.forEach` without support for callback
52824                      * shorthands and `this` binding.
52825                      * 
52826                      * @private
52827                      * @param {Array|Object|string}
52828                      *            collection The collection to iterate over.
52829                      * @param {Function}
52830                      *            iteratee The function invoked per iteration.
52831                      * @returns {Array|Object|string} Returns `collection`.
52832                      */
52833                     var baseEach = createBaseEach(baseForOwn);
52834
52835                     /**
52836                      * The base implementation of `_.forEachRight` without support for callback
52837                      * shorthands and `this` binding.
52838                      * 
52839                      * @private
52840                      * @param {Array|Object|string}
52841                      *            collection The collection to iterate over.
52842                      * @param {Function}
52843                      *            iteratee The function invoked per iteration.
52844                      * @returns {Array|Object|string} Returns `collection`.
52845                      */
52846                     var baseEachRight = createBaseEach(baseForOwnRight, true);
52847
52848                     /**
52849                      * The base implementation of `_.every` without support for callback
52850                      * shorthands and `this` binding.
52851                      * 
52852                      * @private
52853                      * @param {Array|Object|string}
52854                      *            collection The collection to iterate over.
52855                      * @param {Function}
52856                      *            predicate The function invoked per iteration.
52857                      * @returns {boolean} Returns `true` if all elements pass the predicate
52858                      *          check, else `false`
52859                      */
52860                     function baseEvery(collection, predicate) {
52861                         var result = true;
52862                         baseEach(collection, function(value, index, collection) {
52863                             result = !!predicate(value, index, collection);
52864                             return result;
52865                         });
52866                         return result;
52867                     }
52868
52869                     /**
52870                      * Gets the extremum value of `collection` invoking `iteratee` for each
52871                      * value in `collection` to generate the criterion by which the value is
52872                      * ranked. The `iteratee` is invoked with three arguments: (value,
52873                      * index|key, collection).
52874                      * 
52875                      * @private
52876                      * @param {Array|Object|string}
52877                      *            collection The collection to iterate over.
52878                      * @param {Function}
52879                      *            iteratee The function invoked per iteration.
52880                      * @param {Function}
52881                      *            comparator The function used to compare values.
52882                      * @param {*}
52883                      *            exValue The initial extremum value.
52884                      * @returns {*} Returns the extremum value.
52885                      */
52886                     function baseExtremum(collection, iteratee, comparator, exValue) {
52887                         var computed = exValue,
52888                             result = computed;
52889
52890                         baseEach(collection, function(value, index, collection) {
52891                             var current = +iteratee(value, index, collection);
52892                             if (comparator(current, computed) || (current === exValue && current === result)) {
52893                                 computed = current;
52894                                 result = value;
52895                             }
52896                         });
52897                         return result;
52898                     }
52899
52900                     /**
52901                      * The base implementation of `_.fill` without an iteratee call guard.
52902                      * 
52903                      * @private
52904                      * @param {Array}
52905                      *            array The array to fill.
52906                      * @param {*}
52907                      *            value The value to fill `array` with.
52908                      * @param {number}
52909                      *            [start=0] The start position.
52910                      * @param {number}
52911                      *            [end=array.length] The end position.
52912                      * @returns {Array} Returns `array`.
52913                      */
52914                     function baseFill(array, value, start, end) {
52915                         var length = array.length;
52916
52917                         start = start == null ? 0 : (+start || 0);
52918                         if (start < 0) {
52919                             start = -start > length ? 0 : (length + start);
52920                         }
52921                         end = (end === undefined || end > length) ? length : (+end || 0);
52922                         if (end < 0) {
52923                             end += length;
52924                         }
52925                         length = start > end ? 0 : (end >>> 0);
52926                         start >>>= 0;
52927
52928                         while (start < length) {
52929                             array[start++] = value;
52930                         }
52931                         return array;
52932                     }
52933
52934                     /**
52935                      * The base implementation of `_.filter` without support for callback
52936                      * shorthands and `this` binding.
52937                      * 
52938                      * @private
52939                      * @param {Array|Object|string}
52940                      *            collection The collection to iterate over.
52941                      * @param {Function}
52942                      *            predicate The function invoked per iteration.
52943                      * @returns {Array} Returns the new filtered array.
52944                      */
52945                     function baseFilter(collection, predicate) {
52946                         var result = [];
52947                         baseEach(collection, function(value, index, collection) {
52948                             if (predicate(value, index, collection)) {
52949                                 result.push(value);
52950                             }
52951                         });
52952                         return result;
52953                     }
52954
52955                     /**
52956                      * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
52957                      * `_.findLastKey`, without support for callback shorthands and `this`
52958                      * binding, which iterates over `collection` using the provided `eachFunc`.
52959                      * 
52960                      * @private
52961                      * @param {Array|Object|string}
52962                      *            collection The collection to search.
52963                      * @param {Function}
52964                      *            predicate The function invoked per iteration.
52965                      * @param {Function}
52966                      *            eachFunc The function to iterate over `collection`.
52967                      * @param {boolean}
52968                      *            [retKey] Specify returning the key of the found element
52969                      *            instead of the element itself.
52970                      * @returns {*} Returns the found element or its key, else `undefined`.
52971                      */
52972                     function baseFind(collection, predicate, eachFunc, retKey) {
52973                         var result;
52974                         eachFunc(collection, function(value, key, collection) {
52975                             if (predicate(value, key, collection)) {
52976                                 result = retKey ? key : value;
52977                                 return false;
52978                             }
52979                         });
52980                         return result;
52981                     }
52982
52983                     /**
52984                      * The base implementation of `_.flatten` with added support for restricting
52985                      * flattening and specifying the start index.
52986                      * 
52987                      * @private
52988                      * @param {Array}
52989                      *            array The array to flatten.
52990                      * @param {boolean}
52991                      *            [isDeep] Specify a deep flatten.
52992                      * @param {boolean}
52993                      *            [isStrict] Restrict flattening to arrays-like objects.
52994                      * @param {Array}
52995                      *            [result=[]] The initial result value.
52996                      * @returns {Array} Returns the new flattened array.
52997                      */
52998                     function baseFlatten(array, isDeep, isStrict, result) {
52999                         result || (result = []);
53000
53001                         var index = -1,
53002                             length = array.length;
53003
53004                         while (++index < length) {
53005                             var value = array[index];
53006                             if (isObjectLike(value) && isArrayLike(value) &&
53007                                 (isStrict || isArray(value) || isArguments(value))) {
53008                                 if (isDeep) {
53009                                     // Recursively flatten arrays (susceptible to call stack limits).
53010                                     baseFlatten(value, isDeep, isStrict, result);
53011                                 } else {
53012                                     arrayPush(result, value);
53013                                 }
53014                             } else if (!isStrict) {
53015                                 result[result.length] = value;
53016                             }
53017                         }
53018                         return result;
53019                     }
53020
53021                     /**
53022                      * The base implementation of `baseForIn` and `baseForOwn` which iterates
53023                      * over `object` properties returned by `keysFunc` invoking `iteratee` for
53024                      * each property. Iteratee functions may exit iteration early by explicitly
53025                      * returning `false`.
53026                      * 
53027                      * @private
53028                      * @param {Object}
53029                      *            object The object to iterate over.
53030                      * @param {Function}
53031                      *            iteratee The function invoked per iteration.
53032                      * @param {Function}
53033                      *            keysFunc The function to get the keys of `object`.
53034                      * @returns {Object} Returns `object`.
53035                      */
53036                     var baseFor = createBaseFor();
53037
53038                     /**
53039                      * This function is like `baseFor` except that it iterates over properties
53040                      * in the opposite order.
53041                      * 
53042                      * @private
53043                      * @param {Object}
53044                      *            object The object to iterate over.
53045                      * @param {Function}
53046                      *            iteratee The function invoked per iteration.
53047                      * @param {Function}
53048                      *            keysFunc The function to get the keys of `object`.
53049                      * @returns {Object} Returns `object`.
53050                      */
53051                     var baseForRight = createBaseFor(true);
53052
53053                     /**
53054                      * The base implementation of `_.forIn` without support for callback
53055                      * shorthands and `this` binding.
53056                      * 
53057                      * @private
53058                      * @param {Object}
53059                      *            object The object to iterate over.
53060                      * @param {Function}
53061                      *            iteratee The function invoked per iteration.
53062                      * @returns {Object} Returns `object`.
53063                      */
53064                     function baseForIn(object, iteratee) {
53065                         return baseFor(object, iteratee, keysIn);
53066                     }
53067
53068                     /**
53069                      * The base implementation of `_.forOwn` without support for callback
53070                      * shorthands and `this` binding.
53071                      * 
53072                      * @private
53073                      * @param {Object}
53074                      *            object The object to iterate over.
53075                      * @param {Function}
53076                      *            iteratee The function invoked per iteration.
53077                      * @returns {Object} Returns `object`.
53078                      */
53079                     function baseForOwn(object, iteratee) {
53080                         return baseFor(object, iteratee, keys);
53081                     }
53082
53083                     /**
53084                      * The base implementation of `_.forOwnRight` without support for callback
53085                      * shorthands and `this` binding.
53086                      * 
53087                      * @private
53088                      * @param {Object}
53089                      *            object The object to iterate over.
53090                      * @param {Function}
53091                      *            iteratee The function invoked per iteration.
53092                      * @returns {Object} Returns `object`.
53093                      */
53094                     function baseForOwnRight(object, iteratee) {
53095                         return baseForRight(object, iteratee, keys);
53096                     }
53097
53098                     /**
53099                      * The base implementation of `_.functions` which creates an array of
53100                      * `object` function property names filtered from those provided.
53101                      * 
53102                      * @private
53103                      * @param {Object}
53104                      *            object The object to inspect.
53105                      * @param {Array}
53106                      *            props The property names to filter.
53107                      * @returns {Array} Returns the new array of filtered property names.
53108                      */
53109                     function baseFunctions(object, props) {
53110                         var index = -1,
53111                             length = props.length,
53112                             resIndex = -1,
53113                             result = [];
53114
53115                         while (++index < length) {
53116                             var key = props[index];
53117                             if (isFunction(object[key])) {
53118                                 result[++resIndex] = key;
53119                             }
53120                         }
53121                         return result;
53122                     }
53123
53124                     /**
53125                      * The base implementation of `get` without support for string paths and
53126                      * default values.
53127                      * 
53128                      * @private
53129                      * @param {Object}
53130                      *            object The object to query.
53131                      * @param {Array}
53132                      *            path The path of the property to get.
53133                      * @param {string}
53134                      *            [pathKey] The key representation of path.
53135                      * @returns {*} Returns the resolved value.
53136                      */
53137                     function baseGet(object, path, pathKey) {
53138                         if (object == null) {
53139                             return;
53140                         }
53141                         if (pathKey !== undefined && pathKey in toObject(object)) {
53142                             path = [pathKey];
53143                         }
53144                         var index = 0,
53145                             length = path.length;
53146
53147                         while (object != null && index < length) {
53148                             object = object[path[index++]];
53149                         }
53150                         return (index && index == length) ? object : undefined;
53151                     }
53152
53153                     /**
53154                      * The base implementation of `_.isEqual` without support for `this` binding
53155                      * `customizer` functions.
53156                      * 
53157                      * @private
53158                      * @param {*}
53159                      *            value The value to compare.
53160                      * @param {*}
53161                      *            other The other value to compare.
53162                      * @param {Function}
53163                      *            [customizer] The function to customize comparing values.
53164                      * @param {boolean}
53165                      *            [isLoose] Specify performing partial comparisons.
53166                      * @param {Array}
53167                      *            [stackA] Tracks traversed `value` objects.
53168                      * @param {Array}
53169                      *            [stackB] Tracks traversed `other` objects.
53170                      * @returns {boolean} Returns `true` if the values are equivalent, else
53171                      *          `false`.
53172                      */
53173                     function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
53174                         if (value === other) {
53175                             return true;
53176                         }
53177                         if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
53178                             return value !== value && other !== other;
53179                         }
53180                         return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
53181                     }
53182
53183                     /**
53184                      * A specialized version of `baseIsEqual` for arrays and objects which
53185                      * performs deep comparisons and tracks traversed objects enabling objects
53186                      * with circular references to be compared.
53187                      * 
53188                      * @private
53189                      * @param {Object}
53190                      *            object The object to compare.
53191                      * @param {Object}
53192                      *            other The other object to compare.
53193                      * @param {Function}
53194                      *            equalFunc The function to determine equivalents of values.
53195                      * @param {Function}
53196                      *            [customizer] The function to customize comparing objects.
53197                      * @param {boolean}
53198                      *            [isLoose] Specify performing partial comparisons.
53199                      * @param {Array}
53200                      *            [stackA=[]] Tracks traversed `value` objects.
53201                      * @param {Array}
53202                      *            [stackB=[]] Tracks traversed `other` objects.
53203                      * @returns {boolean} Returns `true` if the objects are equivalent, else
53204                      *          `false`.
53205                      */
53206                     function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
53207                         var objIsArr = isArray(object),
53208                             othIsArr = isArray(other),
53209                             objTag = arrayTag,
53210                             othTag = arrayTag;
53211
53212                         if (!objIsArr) {
53213                             objTag = objToString.call(object);
53214                             if (objTag == argsTag) {
53215                                 objTag = objectTag;
53216                             } else if (objTag != objectTag) {
53217                                 objIsArr = isTypedArray(object);
53218                             }
53219                         }
53220                         if (!othIsArr) {
53221                             othTag = objToString.call(other);
53222                             if (othTag == argsTag) {
53223                                 othTag = objectTag;
53224                             } else if (othTag != objectTag) {
53225                                 othIsArr = isTypedArray(other);
53226                             }
53227                         }
53228                         var objIsObj = objTag == objectTag,
53229                             othIsObj = othTag == objectTag,
53230                             isSameTag = objTag == othTag;
53231
53232                         if (isSameTag && !(objIsArr || objIsObj)) {
53233                             return equalByTag(object, other, objTag);
53234                         }
53235                         if (!isLoose) {
53236                             var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
53237                                 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
53238
53239                             if (objIsWrapped || othIsWrapped) {
53240                                 return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
53241                             }
53242                         }
53243                         if (!isSameTag) {
53244                             return false;
53245                         }
53246                         // Assume cyclic values are equal.
53247                         // For more information on detecting circular references see
53248                         // https://es5.github.io/#JO.
53249                         stackA || (stackA = []);
53250                         stackB || (stackB = []);
53251
53252                         var length = stackA.length;
53253                         while (length--) {
53254                             if (stackA[length] == object) {
53255                                 return stackB[length] == other;
53256                             }
53257                         }
53258                         // Add `object` and `other` to the stack of traversed objects.
53259                         stackA.push(object);
53260                         stackB.push(other);
53261
53262                         var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
53263
53264                         stackA.pop();
53265                         stackB.pop();
53266
53267                         return result;
53268                     }
53269
53270                     /**
53271                      * The base implementation of `_.isMatch` without support for callback
53272                      * shorthands and `this` binding.
53273                      * 
53274                      * @private
53275                      * @param {Object}
53276                      *            object The object to inspect.
53277                      * @param {Array}
53278                      *            matchData The propery names, values, and compare flags to
53279                      *            match.
53280                      * @param {Function}
53281                      *            [customizer] The function to customize comparing objects.
53282                      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
53283                      */
53284                     function baseIsMatch(object, matchData, customizer) {
53285                         var index = matchData.length,
53286                             length = index,
53287                             noCustomizer = !customizer;
53288
53289                         if (object == null) {
53290                             return !length;
53291                         }
53292                         object = toObject(object);
53293                         while (index--) {
53294                             var data = matchData[index];
53295                             if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
53296                                 return false;
53297                             }
53298                         }
53299                         while (++index < length) {
53300                             data = matchData[index];
53301                             var key = data[0],
53302                                 objValue = object[key],
53303                                 srcValue = data[1];
53304
53305                             if (noCustomizer && data[2]) {
53306                                 if (objValue === undefined && !(key in object)) {
53307                                     return false;
53308                                 }
53309                             } else {
53310                                 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
53311                                 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
53312                                     return false;
53313                                 }
53314                             }
53315                         }
53316                         return true;
53317                     }
53318
53319                     /**
53320                      * The base implementation of `_.map` without support for callback
53321                      * shorthands and `this` binding.
53322                      * 
53323                      * @private
53324                      * @param {Array|Object|string}
53325                      *            collection The collection to iterate over.
53326                      * @param {Function}
53327                      *            iteratee The function invoked per iteration.
53328                      * @returns {Array} Returns the new mapped array.
53329                      */
53330                     function baseMap(collection, iteratee) {
53331                         var index = -1,
53332                             result = isArrayLike(collection) ? Array(collection.length) : [];
53333
53334                         baseEach(collection, function(value, key, collection) {
53335                             result[++index] = iteratee(value, key, collection);
53336                         });
53337                         return result;
53338                     }
53339
53340                     /**
53341                      * The base implementation of `_.matches` which does not clone `source`.
53342                      * 
53343                      * @private
53344                      * @param {Object}
53345                      *            source The object of property values to match.
53346                      * @returns {Function} Returns the new function.
53347                      */
53348                     function baseMatches(source) {
53349                         var matchData = getMatchData(source);
53350                         if (matchData.length == 1 && matchData[0][2]) {
53351                             var key = matchData[0][0],
53352                                 value = matchData[0][1];
53353
53354                             return function(object) {
53355                                 if (object == null) {
53356                                     return false;
53357                                 }
53358                                 return object[key] === value && (value !== undefined || (key in toObject(object)));
53359                             };
53360                         }
53361                         return function(object) {
53362                             return baseIsMatch(object, matchData);
53363                         };
53364                     }
53365
53366                     /**
53367                      * The base implementation of `_.matchesProperty` which does not clone
53368                      * `srcValue`.
53369                      * 
53370                      * @private
53371                      * @param {string}
53372                      *            path The path of the property to get.
53373                      * @param {*}
53374                      *            srcValue The value to compare.
53375                      * @returns {Function} Returns the new function.
53376                      */
53377                     function baseMatchesProperty(path, srcValue) {
53378                         var isArr = isArray(path),
53379                             isCommon = isKey(path) && isStrictComparable(srcValue),
53380                             pathKey = (path + '');
53381
53382                         path = toPath(path);
53383                         return function(object) {
53384                             if (object == null) {
53385                                 return false;
53386                             }
53387                             var key = pathKey;
53388                             object = toObject(object);
53389                             if ((isArr || !isCommon) && !(key in object)) {
53390                                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
53391                                 if (object == null) {
53392                                     return false;
53393                                 }
53394                                 key = last(path);
53395                                 object = toObject(object);
53396                             }
53397                             return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
53398                         };
53399                     }
53400
53401                     /**
53402                      * The base implementation of `_.merge` without support for argument
53403                      * juggling, multiple sources, and `this` binding `customizer` functions.
53404                      * 
53405                      * @private
53406                      * @param {Object}
53407                      *            object The destination object.
53408                      * @param {Object}
53409                      *            source The source object.
53410                      * @param {Function}
53411                      *            [customizer] The function to customize merged values.
53412                      * @param {Array}
53413                      *            [stackA=[]] Tracks traversed source objects.
53414                      * @param {Array}
53415                      *            [stackB=[]] Associates values with source counterparts.
53416                      * @returns {Object} Returns `object`.
53417                      */
53418                     function baseMerge(object, source, customizer, stackA, stackB) {
53419                         if (!isObject(object)) {
53420                             return object;
53421                         }
53422                         var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
53423                             props = isSrcArr ? undefined : keys(source);
53424
53425                         arrayEach(props || source, function(srcValue, key) {
53426                             if (props) {
53427                                 key = srcValue;
53428                                 srcValue = source[key];
53429                             }
53430                             if (isObjectLike(srcValue)) {
53431                                 stackA || (stackA = []);
53432                                 stackB || (stackB = []);
53433                                 baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
53434                             } else {
53435                                 var value = object[key],
53436                                     result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53437                                     isCommon = result === undefined;
53438
53439                                 if (isCommon) {
53440                                     result = srcValue;
53441                                 }
53442                                 if ((result !== undefined || (isSrcArr && !(key in object))) &&
53443                                     (isCommon || (result === result ? (result !== value) : (value === value)))) {
53444                                     object[key] = result;
53445                                 }
53446                             }
53447                         });
53448                         return object;
53449                     }
53450
53451                     /**
53452                      * A specialized version of `baseMerge` for arrays and objects which
53453                      * performs deep merges and tracks traversed objects enabling objects with
53454                      * circular references to be merged.
53455                      * 
53456                      * @private
53457                      * @param {Object}
53458                      *            object The destination object.
53459                      * @param {Object}
53460                      *            source The source object.
53461                      * @param {string}
53462                      *            key The key of the value to merge.
53463                      * @param {Function}
53464                      *            mergeFunc The function to merge values.
53465                      * @param {Function}
53466                      *            [customizer] The function to customize merged values.
53467                      * @param {Array}
53468                      *            [stackA=[]] Tracks traversed source objects.
53469                      * @param {Array}
53470                      *            [stackB=[]] Associates values with source counterparts.
53471                      * @returns {boolean} Returns `true` if the objects are equivalent, else
53472                      *          `false`.
53473                      */
53474                     function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
53475                         var length = stackA.length,
53476                             srcValue = source[key];
53477
53478                         while (length--) {
53479                             if (stackA[length] == srcValue) {
53480                                 object[key] = stackB[length];
53481                                 return;
53482                             }
53483                         }
53484                         var value = object[key],
53485                             result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53486                             isCommon = result === undefined;
53487
53488                         if (isCommon) {
53489                             result = srcValue;
53490                             if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
53491                                 result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
53492                             } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
53493                                 result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
53494                             } else {
53495                                 isCommon = false;
53496                             }
53497                         }
53498                         // Add the source value to the stack of traversed objects and associate
53499                         // it with its merged value.
53500                         stackA.push(srcValue);
53501                         stackB.push(result);
53502
53503                         if (isCommon) {
53504                             // Recursively merge objects and arrays (susceptible to call stack
53505                             // limits).
53506                             object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
53507                         } else if (result === result ? (result !== value) : (value === value)) {
53508                             object[key] = result;
53509                         }
53510                     }
53511
53512                     /**
53513                      * The base implementation of `_.property` without support for deep paths.
53514                      * 
53515                      * @private
53516                      * @param {string}
53517                      *            key The key of the property to get.
53518                      * @returns {Function} Returns the new function.
53519                      */
53520                     function baseProperty(key) {
53521                         return function(object) {
53522                             return object == null ? undefined : object[key];
53523                         };
53524                     }
53525
53526                     /**
53527                      * A specialized version of `baseProperty` which supports deep paths.
53528                      * 
53529                      * @private
53530                      * @param {Array|string}
53531                      *            path The path of the property to get.
53532                      * @returns {Function} Returns the new function.
53533                      */
53534                     function basePropertyDeep(path) {
53535                         var pathKey = (path + '');
53536                         path = toPath(path);
53537                         return function(object) {
53538                             return baseGet(object, path, pathKey);
53539                         };
53540                     }
53541
53542                     /**
53543                      * The base implementation of `_.pullAt` without support for individual
53544                      * index arguments and capturing the removed elements.
53545                      * 
53546                      * @private
53547                      * @param {Array}
53548                      *            array The array to modify.
53549                      * @param {number[]}
53550                      *            indexes The indexes of elements to remove.
53551                      * @returns {Array} Returns `array`.
53552                      */
53553                     function basePullAt(array, indexes) {
53554                         var length = array ? indexes.length : 0;
53555                         while (length--) {
53556                             var index = indexes[length];
53557                             if (index != previous && isIndex(index)) {
53558                                 var previous = index;
53559                                 splice.call(array, index, 1);
53560                             }
53561                         }
53562                         return array;
53563                     }
53564
53565                     /**
53566                      * The base implementation of `_.random` without support for argument
53567                      * juggling and returning floating-point numbers.
53568                      * 
53569                      * @private
53570                      * @param {number}
53571                      *            min The minimum possible value.
53572                      * @param {number}
53573                      *            max The maximum possible value.
53574                      * @returns {number} Returns the random number.
53575                      */
53576                     function baseRandom(min, max) {
53577                         return min + nativeFloor(nativeRandom() * (max - min + 1));
53578                     }
53579
53580                     /**
53581                      * The base implementation of `_.reduce` and `_.reduceRight` without support
53582                      * for callback shorthands and `this` binding, which iterates over
53583                      * `collection` using the provided `eachFunc`.
53584                      * 
53585                      * @private
53586                      * @param {Array|Object|string}
53587                      *            collection The collection to iterate over.
53588                      * @param {Function}
53589                      *            iteratee The function invoked per iteration.
53590                      * @param {*}
53591                      *            accumulator The initial value.
53592                      * @param {boolean}
53593                      *            initFromCollection Specify using the first or last element of
53594                      *            `collection` as the initial value.
53595                      * @param {Function}
53596                      *            eachFunc The function to iterate over `collection`.
53597                      * @returns {*} Returns the accumulated value.
53598                      */
53599                     function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
53600                         eachFunc(collection, function(value, index, collection) {
53601                             accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
53602                         });
53603                         return accumulator;
53604                     }
53605
53606                     /**
53607                      * The base implementation of `setData` without support for hot loop
53608                      * detection.
53609                      * 
53610                      * @private
53611                      * @param {Function}
53612                      *            func The function to associate metadata with.
53613                      * @param {*}
53614                      *            data The metadata.
53615                      * @returns {Function} Returns `func`.
53616                      */
53617                     var baseSetData = !metaMap ? identity : function(func, data) {
53618                         metaMap.set(func, data);
53619                         return func;
53620                     };
53621
53622                     /**
53623                      * The base implementation of `_.slice` without an iteratee call guard.
53624                      * 
53625                      * @private
53626                      * @param {Array}
53627                      *            array The array to slice.
53628                      * @param {number}
53629                      *            [start=0] The start position.
53630                      * @param {number}
53631                      *            [end=array.length] The end position.
53632                      * @returns {Array} Returns the slice of `array`.
53633                      */
53634                     function baseSlice(array, start, end) {
53635                         var index = -1,
53636                             length = array.length;
53637
53638                         start = start == null ? 0 : (+start || 0);
53639                         if (start < 0) {
53640                             start = -start > length ? 0 : (length + start);
53641                         }
53642                         end = (end === undefined || end > length) ? length : (+end || 0);
53643                         if (end < 0) {
53644                             end += length;
53645                         }
53646                         length = start > end ? 0 : ((end - start) >>> 0);
53647                         start >>>= 0;
53648
53649                         var result = Array(length);
53650                         while (++index < length) {
53651                             result[index] = array[index + start];
53652                         }
53653                         return result;
53654                     }
53655
53656                     /**
53657                      * The base implementation of `_.some` without support for callback
53658                      * shorthands and `this` binding.
53659                      * 
53660                      * @private
53661                      * @param {Array|Object|string}
53662                      *            collection The collection to iterate over.
53663                      * @param {Function}
53664                      *            predicate The function invoked per iteration.
53665                      * @returns {boolean} Returns `true` if any element passes the predicate
53666                      *          check, else `false`.
53667                      */
53668                     function baseSome(collection, predicate) {
53669                         var result;
53670
53671                         baseEach(collection, function(value, index, collection) {
53672                             result = predicate(value, index, collection);
53673                             return !result;
53674                         });
53675                         return !!result;
53676                     }
53677
53678                     /**
53679                      * The base implementation of `_.sortBy` which uses `comparer` to define the
53680                      * sort order of `array` and replaces criteria objects with their
53681                      * corresponding values.
53682                      * 
53683                      * @private
53684                      * @param {Array}
53685                      *            array The array to sort.
53686                      * @param {Function}
53687                      *            comparer The function to define sort order.
53688                      * @returns {Array} Returns `array`.
53689                      */
53690                     function baseSortBy(array, comparer) {
53691                         var length = array.length;
53692
53693                         array.sort(comparer);
53694                         while (length--) {
53695                             array[length] = array[length].value;
53696                         }
53697                         return array;
53698                     }
53699
53700                     /**
53701                      * The base implementation of `_.sortByOrder` without param guards.
53702                      * 
53703                      * @private
53704                      * @param {Array|Object|string}
53705                      *            collection The collection to iterate over.
53706                      * @param {Function[]|Object[]|string[]}
53707                      *            iteratees The iteratees to sort by.
53708                      * @param {boolean[]}
53709                      *            orders The sort orders of `iteratees`.
53710                      * @returns {Array} Returns the new sorted array.
53711                      */
53712                     function baseSortByOrder(collection, iteratees, orders) {
53713                         var callback = getCallback(),
53714                             index = -1;
53715
53716                         iteratees = arrayMap(iteratees, function(iteratee) {
53717                             return callback(iteratee);
53718                         });
53719
53720                         var result = baseMap(collection, function(value) {
53721                             var criteria = arrayMap(iteratees, function(iteratee) {
53722                                 return iteratee(value);
53723                             });
53724                             return {
53725                                 'criteria': criteria,
53726                                 'index': ++index,
53727                                 'value': value
53728                             };
53729                         });
53730
53731                         return baseSortBy(result, function(object, other) {
53732                             return compareMultiple(object, other, orders);
53733                         });
53734                     }
53735
53736                     /**
53737                      * The base implementation of `_.sum` without support for callback
53738                      * shorthands and `this` binding.
53739                      * 
53740                      * @private
53741                      * @param {Array|Object|string}
53742                      *            collection The collection to iterate over.
53743                      * @param {Function}
53744                      *            iteratee The function invoked per iteration.
53745                      * @returns {number} Returns the sum.
53746                      */
53747                     function baseSum(collection, iteratee) {
53748                         var result = 0;
53749                         baseEach(collection, function(value, index, collection) {
53750                             result += +iteratee(value, index, collection) || 0;
53751                         });
53752                         return result;
53753                     }
53754
53755                     /**
53756                      * The base implementation of `_.uniq` without support for callback
53757                      * shorthands and `this` binding.
53758                      * 
53759                      * @private
53760                      * @param {Array}
53761                      *            array The array to inspect.
53762                      * @param {Function}
53763                      *            [iteratee] The function invoked per iteration.
53764                      * @returns {Array} Returns the new duplicate-value-free array.
53765                      */
53766                     function baseUniq(array, iteratee) {
53767                         var index = -1,
53768                             indexOf = getIndexOf(),
53769                             length = array.length,
53770                             isCommon = indexOf == baseIndexOf,
53771                             isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
53772                             seen = isLarge ? createCache() : null,
53773                             result = [];
53774
53775                         if (seen) {
53776                             indexOf = cacheIndexOf;
53777                             isCommon = false;
53778                         } else {
53779                             isLarge = false;
53780                             seen = iteratee ? [] : result;
53781                         }
53782                         outer:
53783                             while (++index < length) {
53784                                 var value = array[index],
53785                                     computed = iteratee ? iteratee(value, index, array) : value;
53786
53787                                 if (isCommon && value === value) {
53788                                     var seenIndex = seen.length;
53789                                     while (seenIndex--) {
53790                                         if (seen[seenIndex] === computed) {
53791                                             continue outer;
53792                                         }
53793                                     }
53794                                     if (iteratee) {
53795                                         seen.push(computed);
53796                                     }
53797                                     result.push(value);
53798                                 } else if (indexOf(seen, computed, 0) < 0) {
53799                                     if (iteratee || isLarge) {
53800                                         seen.push(computed);
53801                                     }
53802                                     result.push(value);
53803                                 }
53804                             }
53805                         return result;
53806                     }
53807
53808                     /**
53809                      * The base implementation of `_.values` and `_.valuesIn` which creates an
53810                      * array of `object` property values corresponding to the property names of
53811                      * `props`.
53812                      * 
53813                      * @private
53814                      * @param {Object}
53815                      *            object The object to query.
53816                      * @param {Array}
53817                      *            props The property names to get values for.
53818                      * @returns {Object} Returns the array of property values.
53819                      */
53820                     function baseValues(object, props) {
53821                         var index = -1,
53822                             length = props.length,
53823                             result = Array(length);
53824
53825                         while (++index < length) {
53826                             result[index] = object[props[index]];
53827                         }
53828                         return result;
53829                     }
53830
53831                     /**
53832                      * The base implementation of `_.dropRightWhile`, `_.dropWhile`,
53833                      * `_.takeRightWhile`, and `_.takeWhile` without support for callback
53834                      * shorthands and `this` binding.
53835                      * 
53836                      * @private
53837                      * @param {Array}
53838                      *            array The array to query.
53839                      * @param {Function}
53840                      *            predicate The function invoked per iteration.
53841                      * @param {boolean}
53842                      *            [isDrop] Specify dropping elements instead of taking them.
53843                      * @param {boolean}
53844                      *            [fromRight] Specify iterating from right to left.
53845                      * @returns {Array} Returns the slice of `array`.
53846                      */
53847                     function baseWhile(array, predicate, isDrop, fromRight) {
53848                         var length = array.length,
53849                             index = fromRight ? length : -1;
53850
53851                         while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
53852                         return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
53853                     }
53854
53855                     /**
53856                      * The base implementation of `wrapperValue` which returns the result of
53857                      * performing a sequence of actions on the unwrapped `value`, where each
53858                      * successive action is supplied the return value of the previous.
53859                      * 
53860                      * @private
53861                      * @param {*}
53862                      *            value The unwrapped value.
53863                      * @param {Array}
53864                      *            actions Actions to peform to resolve the unwrapped value.
53865                      * @returns {*} Returns the resolved value.
53866                      */
53867                     function baseWrapperValue(value, actions) {
53868                         var result = value;
53869                         if (result instanceof LazyWrapper) {
53870                             result = result.value();
53871                         }
53872                         var index = -1,
53873                             length = actions.length;
53874
53875                         while (++index < length) {
53876                             var action = actions[index];
53877                             result = action.func.apply(action.thisArg, arrayPush([result], action.args));
53878                         }
53879                         return result;
53880                     }
53881
53882                     /**
53883                      * Performs a binary search of `array` to determine the index at which
53884                      * `value` should be inserted into `array` in order to maintain its sort
53885                      * order.
53886                      * 
53887                      * @private
53888                      * @param {Array}
53889                      *            array The sorted array to inspect.
53890                      * @param {*}
53891                      *            value The value to evaluate.
53892                      * @param {boolean}
53893                      *            [retHighest] Specify returning the highest qualified index.
53894                      * @returns {number} Returns the index at which `value` should be inserted
53895                      *          into `array`.
53896                      */
53897                     function binaryIndex(array, value, retHighest) {
53898                         var low = 0,
53899                             high = array ? array.length : low;
53900
53901                         if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
53902                             while (low < high) {
53903                                 var mid = (low + high) >>> 1,
53904                                     computed = array[mid];
53905
53906                                 if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
53907                                     low = mid + 1;
53908                                 } else {
53909                                     high = mid;
53910                                 }
53911                             }
53912                             return high;
53913                         }
53914                         return binaryIndexBy(array, value, identity, retHighest);
53915                     }
53916
53917                     /**
53918                      * This function is like `binaryIndex` except that it invokes `iteratee` for
53919                      * `value` and each element of `array` to compute their sort ranking. The
53920                      * iteratee is invoked with one argument; (value).
53921                      * 
53922                      * @private
53923                      * @param {Array}
53924                      *            array The sorted array to inspect.
53925                      * @param {*}
53926                      *            value The value to evaluate.
53927                      * @param {Function}
53928                      *            iteratee The function invoked per iteration.
53929                      * @param {boolean}
53930                      *            [retHighest] Specify returning the highest qualified index.
53931                      * @returns {number} Returns the index at which `value` should be inserted
53932                      *          into `array`.
53933                      */
53934                     function binaryIndexBy(array, value, iteratee, retHighest) {
53935                         value = iteratee(value);
53936
53937                         var low = 0,
53938                             high = array ? array.length : 0,
53939                             valIsNaN = value !== value,
53940                             valIsNull = value === null,
53941                             valIsUndef = value === undefined;
53942
53943                         while (low < high) {
53944                             var mid = nativeFloor((low + high) / 2),
53945                                 computed = iteratee(array[mid]),
53946                                 isDef = computed !== undefined,
53947                                 isReflexive = computed === computed;
53948
53949                             if (valIsNaN) {
53950                                 var setLow = isReflexive || retHighest;
53951                             } else if (valIsNull) {
53952                                 setLow = isReflexive && isDef && (retHighest || computed != null);
53953                             } else if (valIsUndef) {
53954                                 setLow = isReflexive && (retHighest || isDef);
53955                             } else if (computed == null) {
53956                                 setLow = false;
53957                             } else {
53958                                 setLow = retHighest ? (computed <= value) : (computed < value);
53959                             }
53960                             if (setLow) {
53961                                 low = mid + 1;
53962                             } else {
53963                                 high = mid;
53964                             }
53965                         }
53966                         return nativeMin(high, MAX_ARRAY_INDEX);
53967                     }
53968
53969                     /**
53970                      * A specialized version of `baseCallback` which only supports `this`
53971                      * binding and specifying the number of arguments to provide to `func`.
53972                      * 
53973                      * @private
53974                      * @param {Function}
53975                      *            func The function to bind.
53976                      * @param {*}
53977                      *            thisArg The `this` binding of `func`.
53978                      * @param {number}
53979                      *            [argCount] The number of arguments to provide to `func`.
53980                      * @returns {Function} Returns the callback.
53981                      */
53982                     function bindCallback(func, thisArg, argCount) {
53983                         if (typeof func != 'function') {
53984                             return identity;
53985                         }
53986                         if (thisArg === undefined) {
53987                             return func;
53988                         }
53989                         switch (argCount) {
53990                             case 1:
53991                                 return function(value) {
53992                                     return func.call(thisArg, value);
53993                                 };
53994                             case 3:
53995                                 return function(value, index, collection) {
53996                                     return func.call(thisArg, value, index, collection);
53997                                 };
53998                             case 4:
53999                                 return function(accumulator, value, index, collection) {
54000                                     return func.call(thisArg, accumulator, value, index, collection);
54001                                 };
54002                             case 5:
54003                                 return function(value, other, key, object, source) {
54004                                     return func.call(thisArg, value, other, key, object, source);
54005                                 };
54006                         }
54007                         return function() {
54008                             return func.apply(thisArg, arguments);
54009                         };
54010                     }
54011
54012                     /**
54013                      * Creates a clone of the given array buffer.
54014                      * 
54015                      * @private
54016                      * @param {ArrayBuffer}
54017                      *            buffer The array buffer to clone.
54018                      * @returns {ArrayBuffer} Returns the cloned array buffer.
54019                      */
54020                     function bufferClone(buffer) {
54021                         var result = new ArrayBuffer(buffer.byteLength),
54022                             view = new Uint8Array(result);
54023
54024                         view.set(new Uint8Array(buffer));
54025                         return result;
54026                     }
54027
54028                     /**
54029                      * Creates an array that is the composition of partially applied arguments,
54030                      * placeholders, and provided arguments into a single array of arguments.
54031                      * 
54032                      * @private
54033                      * @param {Array|Object}
54034                      *            args The provided arguments.
54035                      * @param {Array}
54036                      *            partials The arguments to prepend to those provided.
54037                      * @param {Array}
54038                      *            holders The `partials` placeholder indexes.
54039                      * @returns {Array} Returns the new array of composed arguments.
54040                      */
54041                     function composeArgs(args, partials, holders) {
54042                         var holdersLength = holders.length,
54043                             argsIndex = -1,
54044                             argsLength = nativeMax(args.length - holdersLength, 0),
54045                             leftIndex = -1,
54046                             leftLength = partials.length,
54047                             result = Array(leftLength + argsLength);
54048
54049                         while (++leftIndex < leftLength) {
54050                             result[leftIndex] = partials[leftIndex];
54051                         }
54052                         while (++argsIndex < holdersLength) {
54053                             result[holders[argsIndex]] = args[argsIndex];
54054                         }
54055                         while (argsLength--) {
54056                             result[leftIndex++] = args[argsIndex++];
54057                         }
54058                         return result;
54059                     }
54060
54061                     /**
54062                      * This function is like `composeArgs` except that the arguments composition
54063                      * is tailored for `_.partialRight`.
54064                      * 
54065                      * @private
54066                      * @param {Array|Object}
54067                      *            args The provided arguments.
54068                      * @param {Array}
54069                      *            partials The arguments to append to those provided.
54070                      * @param {Array}
54071                      *            holders The `partials` placeholder indexes.
54072                      * @returns {Array} Returns the new array of composed arguments.
54073                      */
54074                     function composeArgsRight(args, partials, holders) {
54075                         var holdersIndex = -1,
54076                             holdersLength = holders.length,
54077                             argsIndex = -1,
54078                             argsLength = nativeMax(args.length - holdersLength, 0),
54079                             rightIndex = -1,
54080                             rightLength = partials.length,
54081                             result = Array(argsLength + rightLength);
54082
54083                         while (++argsIndex < argsLength) {
54084                             result[argsIndex] = args[argsIndex];
54085                         }
54086                         var offset = argsIndex;
54087                         while (++rightIndex < rightLength) {
54088                             result[offset + rightIndex] = partials[rightIndex];
54089                         }
54090                         while (++holdersIndex < holdersLength) {
54091                             result[offset + holders[holdersIndex]] = args[argsIndex++];
54092                         }
54093                         return result;
54094                     }
54095
54096                     /**
54097                      * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition`
54098                      * function.
54099                      * 
54100                      * @private
54101                      * @param {Function}
54102                      *            setter The function to set keys and values of the accumulator
54103                      *            object.
54104                      * @param {Function}
54105                      *            [initializer] The function to initialize the accumulator
54106                      *            object.
54107                      * @returns {Function} Returns the new aggregator function.
54108                      */
54109                     function createAggregator(setter, initializer) {
54110                         return function(collection, iteratee, thisArg) {
54111                             var result = initializer ? initializer() : {};
54112                             iteratee = getCallback(iteratee, thisArg, 3);
54113
54114                             if (isArray(collection)) {
54115                                 var index = -1,
54116                                     length = collection.length;
54117
54118                                 while (++index < length) {
54119                                     var value = collection[index];
54120                                     setter(result, value, iteratee(value, index, collection), collection);
54121                                 }
54122                             } else {
54123                                 baseEach(collection, function(value, key, collection) {
54124                                     setter(result, value, iteratee(value, key, collection), collection);
54125                                 });
54126                             }
54127                             return result;
54128                         };
54129                     }
54130
54131                     /**
54132                      * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
54133                      * 
54134                      * @private
54135                      * @param {Function}
54136                      *            assigner The function to assign values.
54137                      * @returns {Function} Returns the new assigner function.
54138                      */
54139                     function createAssigner(assigner) {
54140                         return restParam(function(object, sources) {
54141                             var index = -1,
54142                                 length = object == null ? 0 : sources.length,
54143                                 customizer = length > 2 ? sources[length - 2] : undefined,
54144                                 guard = length > 2 ? sources[2] : undefined,
54145                                 thisArg = length > 1 ? sources[length - 1] : undefined;
54146
54147                             if (typeof customizer == 'function') {
54148                                 customizer = bindCallback(customizer, thisArg, 5);
54149                                 length -= 2;
54150                             } else {
54151                                 customizer = typeof thisArg == 'function' ? thisArg : undefined;
54152                                 length -= (customizer ? 1 : 0);
54153                             }
54154                             if (guard && isIterateeCall(sources[0], sources[1], guard)) {
54155                                 customizer = length < 3 ? undefined : customizer;
54156                                 length = 1;
54157                             }
54158                             while (++index < length) {
54159                                 var source = sources[index];
54160                                 if (source) {
54161                                     assigner(object, source, customizer);
54162                                 }
54163                             }
54164                             return object;
54165                         });
54166                     }
54167
54168                     /**
54169                      * Creates a `baseEach` or `baseEachRight` function.
54170                      * 
54171                      * @private
54172                      * @param {Function}
54173                      *            eachFunc The function to iterate over a collection.
54174                      * @param {boolean}
54175                      *            [fromRight] Specify iterating from right to left.
54176                      * @returns {Function} Returns the new base function.
54177                      */
54178                     function createBaseEach(eachFunc, fromRight) {
54179                         return function(collection, iteratee) {
54180                             var length = collection ? getLength(collection) : 0;
54181                             if (!isLength(length)) {
54182                                 return eachFunc(collection, iteratee);
54183                             }
54184                             var index = fromRight ? length : -1,
54185                                 iterable = toObject(collection);
54186
54187                             while ((fromRight ? index-- : ++index < length)) {
54188                                 if (iteratee(iterable[index], index, iterable) === false) {
54189                                     break;
54190                                 }
54191                             }
54192                             return collection;
54193                         };
54194                     }
54195
54196                     /**
54197                      * Creates a base function for `_.forIn` or `_.forInRight`.
54198                      * 
54199                      * @private
54200                      * @param {boolean}
54201                      *            [fromRight] Specify iterating from right to left.
54202                      * @returns {Function} Returns the new base function.
54203                      */
54204                     function createBaseFor(fromRight) {
54205                         return function(object, iteratee, keysFunc) {
54206                             var iterable = toObject(object),
54207                                 props = keysFunc(object),
54208                                 length = props.length,
54209                                 index = fromRight ? length : -1;
54210
54211                             while ((fromRight ? index-- : ++index < length)) {
54212                                 var key = props[index];
54213                                 if (iteratee(iterable[key], key, iterable) === false) {
54214                                     break;
54215                                 }
54216                             }
54217                             return object;
54218                         };
54219                     }
54220
54221                     /**
54222                      * Creates a function that wraps `func` and invokes it with the `this`
54223                      * binding of `thisArg`.
54224                      * 
54225                      * @private
54226                      * @param {Function}
54227                      *            func The function to bind.
54228                      * @param {*}
54229                      *            [thisArg] The `this` binding of `func`.
54230                      * @returns {Function} Returns the new bound function.
54231                      */
54232                     function createBindWrapper(func, thisArg) {
54233                         var Ctor = createCtorWrapper(func);
54234
54235                         function wrapper() {
54236                             var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54237                             return fn.apply(thisArg, arguments);
54238                         }
54239                         return wrapper;
54240                     }
54241
54242                     /**
54243                      * Creates a `Set` cache object to optimize linear searches of large arrays.
54244                      * 
54245                      * @private
54246                      * @param {Array}
54247                      *            [values] The values to cache.
54248                      * @returns {null|Object} Returns the new cache object if `Set` is
54249                      *          supported, else `null`.
54250                      */
54251                     function createCache(values) {
54252                         return (nativeCreate && Set) ? new SetCache(values) : null;
54253                     }
54254
54255                     /**
54256                      * Creates a function that produces compound words out of the words in a
54257                      * given string.
54258                      * 
54259                      * @private
54260                      * @param {Function}
54261                      *            callback The function to combine each word.
54262                      * @returns {Function} Returns the new compounder function.
54263                      */
54264                     function createCompounder(callback) {
54265                         return function(string) {
54266                             var index = -1,
54267                                 array = words(deburr(string)),
54268                                 length = array.length,
54269                                 result = '';
54270
54271                             while (++index < length) {
54272                                 result = callback(result, array[index], index);
54273                             }
54274                             return result;
54275                         };
54276                     }
54277
54278                     /**
54279                      * Creates a function that produces an instance of `Ctor` regardless of
54280                      * whether it was invoked as part of a `new` expression or by `call` or
54281                      * `apply`.
54282                      * 
54283                      * @private
54284                      * @param {Function}
54285                      *            Ctor The constructor to wrap.
54286                      * @returns {Function} Returns the new wrapped function.
54287                      */
54288                     function createCtorWrapper(Ctor) {
54289                         return function() {
54290                             // Use a `switch` statement to work with class constructors.
54291                             // See
54292                             // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
54293                             // for more details.
54294                             var args = arguments;
54295                             switch (args.length) {
54296                                 case 0:
54297                                     return new Ctor;
54298                                 case 1:
54299                                     return new Ctor(args[0]);
54300                                 case 2:
54301                                     return new Ctor(args[0], args[1]);
54302                                 case 3:
54303                                     return new Ctor(args[0], args[1], args[2]);
54304                                 case 4:
54305                                     return new Ctor(args[0], args[1], args[2], args[3]);
54306                                 case 5:
54307                                     return new Ctor(args[0], args[1], args[2], args[3], args[4]);
54308                                 case 6:
54309                                     return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
54310                                 case 7:
54311                                     return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
54312                             }
54313                             var thisBinding = baseCreate(Ctor.prototype),
54314                                 result = Ctor.apply(thisBinding, args);
54315
54316                             // Mimic the constructor's `return` behavior.
54317                             // See https://es5.github.io/#x13.2.2 for more details.
54318                             return isObject(result) ? result : thisBinding;
54319                         };
54320                     }
54321
54322                     /**
54323                      * Creates a `_.curry` or `_.curryRight` function.
54324                      * 
54325                      * @private
54326                      * @param {boolean}
54327                      *            flag The curry bit flag.
54328                      * @returns {Function} Returns the new curry function.
54329                      */
54330                     function createCurry(flag) {
54331                         function curryFunc(func, arity, guard) {
54332                             if (guard && isIterateeCall(func, arity, guard)) {
54333                                 arity = undefined;
54334                             }
54335                             var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
54336                             result.placeholder = curryFunc.placeholder;
54337                             return result;
54338                         }
54339                         return curryFunc;
54340                     }
54341
54342                     /**
54343                      * Creates a `_.defaults` or `_.defaultsDeep` function.
54344                      * 
54345                      * @private
54346                      * @param {Function}
54347                      *            assigner The function to assign values.
54348                      * @param {Function}
54349                      *            customizer The function to customize assigned values.
54350                      * @returns {Function} Returns the new defaults function.
54351                      */
54352                     function createDefaults(assigner, customizer) {
54353                         return restParam(function(args) {
54354                             var object = args[0];
54355                             if (object == null) {
54356                                 return object;
54357                             }
54358                             args.push(customizer);
54359                             return assigner.apply(undefined, args);
54360                         });
54361                     }
54362
54363                     /**
54364                      * Creates a `_.max` or `_.min` function.
54365                      * 
54366                      * @private
54367                      * @param {Function}
54368                      *            comparator The function used to compare values.
54369                      * @param {*}
54370                      *            exValue The initial extremum value.
54371                      * @returns {Function} Returns the new extremum function.
54372                      */
54373                     function createExtremum(comparator, exValue) {
54374                         return function(collection, iteratee, thisArg) {
54375                             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
54376                                 iteratee = undefined;
54377                             }
54378                             iteratee = getCallback(iteratee, thisArg, 3);
54379                             if (iteratee.length == 1) {
54380                                 collection = isArray(collection) ? collection : toIterable(collection);
54381                                 var result = arrayExtremum(collection, iteratee, comparator, exValue);
54382                                 if (!(collection.length && result === exValue)) {
54383                                     return result;
54384                                 }
54385                             }
54386                             return baseExtremum(collection, iteratee, comparator, exValue);
54387                         };
54388                     }
54389
54390                     /**
54391                      * Creates a `_.find` or `_.findLast` function.
54392                      * 
54393                      * @private
54394                      * @param {Function}
54395                      *            eachFunc The function to iterate over a collection.
54396                      * @param {boolean}
54397                      *            [fromRight] Specify iterating from right to left.
54398                      * @returns {Function} Returns the new find function.
54399                      */
54400                     function createFind(eachFunc, fromRight) {
54401                         return function(collection, predicate, thisArg) {
54402                             predicate = getCallback(predicate, thisArg, 3);
54403                             if (isArray(collection)) {
54404                                 var index = baseFindIndex(collection, predicate, fromRight);
54405                                 return index > -1 ? collection[index] : undefined;
54406                             }
54407                             return baseFind(collection, predicate, eachFunc);
54408                         };
54409                     }
54410
54411                     /**
54412                      * Creates a `_.findIndex` or `_.findLastIndex` function.
54413                      * 
54414                      * @private
54415                      * @param {boolean}
54416                      *            [fromRight] Specify iterating from right to left.
54417                      * @returns {Function} Returns the new find function.
54418                      */
54419                     function createFindIndex(fromRight) {
54420                         return function(array, predicate, thisArg) {
54421                             if (!(array && array.length)) {
54422                                 return -1;
54423                             }
54424                             predicate = getCallback(predicate, thisArg, 3);
54425                             return baseFindIndex(array, predicate, fromRight);
54426                         };
54427                     }
54428
54429                     /**
54430                      * Creates a `_.findKey` or `_.findLastKey` function.
54431                      * 
54432                      * @private
54433                      * @param {Function}
54434                      *            objectFunc The function to iterate over an object.
54435                      * @returns {Function} Returns the new find function.
54436                      */
54437                     function createFindKey(objectFunc) {
54438                         return function(object, predicate, thisArg) {
54439                             predicate = getCallback(predicate, thisArg, 3);
54440                             return baseFind(object, predicate, objectFunc, true);
54441                         };
54442                     }
54443
54444                     /**
54445                      * Creates a `_.flow` or `_.flowRight` function.
54446                      * 
54447                      * @private
54448                      * @param {boolean}
54449                      *            [fromRight] Specify iterating from right to left.
54450                      * @returns {Function} Returns the new flow function.
54451                      */
54452                     function createFlow(fromRight) {
54453                         return function() {
54454                             var wrapper,
54455                                 length = arguments.length,
54456                                 index = fromRight ? length : -1,
54457                                 leftIndex = 0,
54458                                 funcs = Array(length);
54459
54460                             while ((fromRight ? index-- : ++index < length)) {
54461                                 var func = funcs[leftIndex++] = arguments[index];
54462                                 if (typeof func != 'function') {
54463                                     throw new TypeError(FUNC_ERROR_TEXT);
54464                                 }
54465                                 if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
54466                                     wrapper = new LodashWrapper([], true);
54467                                 }
54468                             }
54469                             index = wrapper ? -1 : length;
54470                             while (++index < length) {
54471                                 func = funcs[index];
54472
54473                                 var funcName = getFuncName(func),
54474                                     data = funcName == 'wrapper' ? getData(func) : undefined;
54475
54476                                 if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
54477                                     wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
54478                                 } else {
54479                                     wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
54480                                 }
54481                             }
54482                             return function() {
54483                                 var args = arguments,
54484                                     value = args[0];
54485
54486                                 if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
54487                                     return wrapper.plant(value).value();
54488                                 }
54489                                 var index = 0,
54490                                     result = length ? funcs[index].apply(this, args) : value;
54491
54492                                 while (++index < length) {
54493                                     result = funcs[index].call(this, result);
54494                                 }
54495                                 return result;
54496                             };
54497                         };
54498                     }
54499
54500                     /**
54501                      * Creates a function for `_.forEach` or `_.forEachRight`.
54502                      * 
54503                      * @private
54504                      * @param {Function}
54505                      *            arrayFunc The function to iterate over an array.
54506                      * @param {Function}
54507                      *            eachFunc The function to iterate over a collection.
54508                      * @returns {Function} Returns the new each function.
54509                      */
54510                     function createForEach(arrayFunc, eachFunc) {
54511                         return function(collection, iteratee, thisArg) {
54512                             return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
54513                         };
54514                     }
54515
54516                     /**
54517                      * Creates a function for `_.forIn` or `_.forInRight`.
54518                      * 
54519                      * @private
54520                      * @param {Function}
54521                      *            objectFunc The function to iterate over an object.
54522                      * @returns {Function} Returns the new each function.
54523                      */
54524                     function createForIn(objectFunc) {
54525                         return function(object, iteratee, thisArg) {
54526                             if (typeof iteratee != 'function' || thisArg !== undefined) {
54527                                 iteratee = bindCallback(iteratee, thisArg, 3);
54528                             }
54529                             return objectFunc(object, iteratee, keysIn);
54530                         };
54531                     }
54532
54533                     /**
54534                      * Creates a function for `_.forOwn` or `_.forOwnRight`.
54535                      * 
54536                      * @private
54537                      * @param {Function}
54538                      *            objectFunc The function to iterate over an object.
54539                      * @returns {Function} Returns the new each function.
54540                      */
54541                     function createForOwn(objectFunc) {
54542                         return function(object, iteratee, thisArg) {
54543                             if (typeof iteratee != 'function' || thisArg !== undefined) {
54544                                 iteratee = bindCallback(iteratee, thisArg, 3);
54545                             }
54546                             return objectFunc(object, iteratee);
54547                         };
54548                     }
54549
54550                     /**
54551                      * Creates a function for `_.mapKeys` or `_.mapValues`.
54552                      * 
54553                      * @private
54554                      * @param {boolean}
54555                      *            [isMapKeys] Specify mapping keys instead of values.
54556                      * @returns {Function} Returns the new map function.
54557                      */
54558                     function createObjectMapper(isMapKeys) {
54559                         return function(object, iteratee, thisArg) {
54560                             var result = {};
54561                             iteratee = getCallback(iteratee, thisArg, 3);
54562
54563                             baseForOwn(object, function(value, key, object) {
54564                                 var mapped = iteratee(value, key, object);
54565                                 key = isMapKeys ? mapped : key;
54566                                 value = isMapKeys ? value : mapped;
54567                                 result[key] = value;
54568                             });
54569                             return result;
54570                         };
54571                     }
54572
54573                     /**
54574                      * Creates a function for `_.padLeft` or `_.padRight`.
54575                      * 
54576                      * @private
54577                      * @param {boolean}
54578                      *            [fromRight] Specify padding from the right.
54579                      * @returns {Function} Returns the new pad function.
54580                      */
54581                     function createPadDir(fromRight) {
54582                         return function(string, length, chars) {
54583                             string = baseToString(string);
54584                             return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
54585                         };
54586                     }
54587
54588                     /**
54589                      * Creates a `_.partial` or `_.partialRight` function.
54590                      * 
54591                      * @private
54592                      * @param {boolean}
54593                      *            flag The partial bit flag.
54594                      * @returns {Function} Returns the new partial function.
54595                      */
54596                     function createPartial(flag) {
54597                         var partialFunc = restParam(function(func, partials) {
54598                             var holders = replaceHolders(partials, partialFunc.placeholder);
54599                             return createWrapper(func, flag, undefined, partials, holders);
54600                         });
54601                         return partialFunc;
54602                     }
54603
54604                     /**
54605                      * Creates a function for `_.reduce` or `_.reduceRight`.
54606                      * 
54607                      * @private
54608                      * @param {Function}
54609                      *            arrayFunc The function to iterate over an array.
54610                      * @param {Function}
54611                      *            eachFunc The function to iterate over a collection.
54612                      * @returns {Function} Returns the new each function.
54613                      */
54614                     function createReduce(arrayFunc, eachFunc) {
54615                         return function(collection, iteratee, accumulator, thisArg) {
54616                             var initFromArray = arguments.length < 3;
54617                             return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
54618                         };
54619                     }
54620
54621                     /**
54622                      * Creates a function that wraps `func` and invokes it with optional `this`
54623                      * binding of, partial application, and currying.
54624                      * 
54625                      * @private
54626                      * @param {Function|string}
54627                      *            func The function or method name to reference.
54628                      * @param {number}
54629                      *            bitmask The bitmask of flags. See `createWrapper` for more
54630                      *            details.
54631                      * @param {*}
54632                      *            [thisArg] The `this` binding of `func`.
54633                      * @param {Array}
54634                      *            [partials] The arguments to prepend to those provided to the
54635                      *            new function.
54636                      * @param {Array}
54637                      *            [holders] The `partials` placeholder indexes.
54638                      * @param {Array}
54639                      *            [partialsRight] The arguments to append to those provided to
54640                      *            the new function.
54641                      * @param {Array}
54642                      *            [holdersRight] The `partialsRight` placeholder indexes.
54643                      * @param {Array}
54644                      *            [argPos] The argument positions of the new function.
54645                      * @param {number}
54646                      *            [ary] The arity cap of `func`.
54647                      * @param {number}
54648                      *            [arity] The arity of `func`.
54649                      * @returns {Function} Returns the new wrapped function.
54650                      */
54651                     function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
54652                         var isAry = bitmask & ARY_FLAG,
54653                             isBind = bitmask & BIND_FLAG,
54654                             isBindKey = bitmask & BIND_KEY_FLAG,
54655                             isCurry = bitmask & CURRY_FLAG,
54656                             isCurryBound = bitmask & CURRY_BOUND_FLAG,
54657                             isCurryRight = bitmask & CURRY_RIGHT_FLAG,
54658                             Ctor = isBindKey ? undefined : createCtorWrapper(func);
54659
54660                         function wrapper() {
54661                             // Avoid `arguments` object use disqualifying optimizations by
54662                             // converting it to an array before providing it to other functions.
54663                             var length = arguments.length,
54664                                 index = length,
54665                                 args = Array(length);
54666
54667                             while (index--) {
54668                                 args[index] = arguments[index];
54669                             }
54670                             if (partials) {
54671                                 args = composeArgs(args, partials, holders);
54672                             }
54673                             if (partialsRight) {
54674                                 args = composeArgsRight(args, partialsRight, holdersRight);
54675                             }
54676                             if (isCurry || isCurryRight) {
54677                                 var placeholder = wrapper.placeholder,
54678                                     argsHolders = replaceHolders(args, placeholder);
54679
54680                                 length -= argsHolders.length;
54681                                 if (length < arity) {
54682                                     var newArgPos = argPos ? arrayCopy(argPos) : undefined,
54683                                         newArity = nativeMax(arity - length, 0),
54684                                         newsHolders = isCurry ? argsHolders : undefined,
54685                                         newHoldersRight = isCurry ? undefined : argsHolders,
54686                                         newPartials = isCurry ? args : undefined,
54687                                         newPartialsRight = isCurry ? undefined : args;
54688
54689                                     bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
54690                                     bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
54691
54692                                     if (!isCurryBound) {
54693                                         bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
54694                                     }
54695                                     var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
54696                                         result = createHybridWrapper.apply(undefined, newData);
54697
54698                                     if (isLaziable(func)) {
54699                                         setData(result, newData);
54700                                     }
54701                                     result.placeholder = placeholder;
54702                                     return result;
54703                                 }
54704                             }
54705                             var thisBinding = isBind ? thisArg : this,
54706                                 fn = isBindKey ? thisBinding[func] : func;
54707
54708                             if (argPos) {
54709                                 args = reorder(args, argPos);
54710                             }
54711                             if (isAry && ary < args.length) {
54712                                 args.length = ary;
54713                             }
54714                             if (this && this !== root && this instanceof wrapper) {
54715                                 fn = Ctor || createCtorWrapper(func);
54716                             }
54717                             return fn.apply(thisBinding, args);
54718                         }
54719                         return wrapper;
54720                     }
54721
54722                     /**
54723                      * Creates the padding required for `string` based on the given `length`.
54724                      * The `chars` string is truncated if the number of characters exceeds
54725                      * `length`.
54726                      * 
54727                      * @private
54728                      * @param {string}
54729                      *            string The string to create padding for.
54730                      * @param {number}
54731                      *            [length=0] The padding length.
54732                      * @param {string}
54733                      *            [chars=' '] The string used as padding.
54734                      * @returns {string} Returns the pad for `string`.
54735                      */
54736                     function createPadding(string, length, chars) {
54737                         var strLength = string.length;
54738                         length = +length;
54739
54740                         if (strLength >= length || !nativeIsFinite(length)) {
54741                             return '';
54742                         }
54743                         var padLength = length - strLength;
54744                         chars = chars == null ? ' ' : (chars + '');
54745                         return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
54746                     }
54747
54748                     /**
54749                      * Creates a function that wraps `func` and invokes it with the optional
54750                      * `this` binding of `thisArg` and the `partials` prepended to those
54751                      * provided to the wrapper.
54752                      * 
54753                      * @private
54754                      * @param {Function}
54755                      *            func The function to partially apply arguments to.
54756                      * @param {number}
54757                      *            bitmask The bitmask of flags. See `createWrapper` for more
54758                      *            details.
54759                      * @param {*}
54760                      *            thisArg The `this` binding of `func`.
54761                      * @param {Array}
54762                      *            partials The arguments to prepend to those provided to the new
54763                      *            function.
54764                      * @returns {Function} Returns the new bound function.
54765                      */
54766                     function createPartialWrapper(func, bitmask, thisArg, partials) {
54767                         var isBind = bitmask & BIND_FLAG,
54768                             Ctor = createCtorWrapper(func);
54769
54770                         function wrapper() {
54771                             // Avoid `arguments` object use disqualifying optimizations by
54772                             // converting it to an array before providing it `func`.
54773                             var argsIndex = -1,
54774                                 argsLength = arguments.length,
54775                                 leftIndex = -1,
54776                                 leftLength = partials.length,
54777                                 args = Array(leftLength + argsLength);
54778
54779                             while (++leftIndex < leftLength) {
54780                                 args[leftIndex] = partials[leftIndex];
54781                             }
54782                             while (argsLength--) {
54783                                 args[leftIndex++] = arguments[++argsIndex];
54784                             }
54785                             var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54786                             return fn.apply(isBind ? thisArg : this, args);
54787                         }
54788                         return wrapper;
54789                     }
54790
54791                     /**
54792                      * Creates a `_.ceil`, `_.floor`, or `_.round` function.
54793                      * 
54794                      * @private
54795                      * @param {string}
54796                      *            methodName The name of the `Math` method to use when rounding.
54797                      * @returns {Function} Returns the new round function.
54798                      */
54799                     function createRound(methodName) {
54800                         var func = Math[methodName];
54801                         return function(number, precision) {
54802                             precision = precision === undefined ? 0 : (+precision || 0);
54803                             if (precision) {
54804                                 precision = pow(10, precision);
54805                                 return func(number * precision) / precision;
54806                             }
54807                             return func(number);
54808                         };
54809                     }
54810
54811                     /**
54812                      * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
54813                      * 
54814                      * @private
54815                      * @param {boolean}
54816                      *            [retHighest] Specify returning the highest qualified index.
54817                      * @returns {Function} Returns the new index function.
54818                      */
54819                     function createSortedIndex(retHighest) {
54820                         return function(array, value, iteratee, thisArg) {
54821                             var callback = getCallback(iteratee);
54822                             return (iteratee == null && callback === baseCallback) ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
54823                         };
54824                     }
54825
54826                     /**
54827                      * Creates a function that either curries or invokes `func` with optional
54828                      * `this` binding and partially applied arguments.
54829                      * 
54830                      * @private
54831                      * @param {Function|string}
54832                      *            func The function or method name to reference.
54833                      * @param {number}
54834                      *            bitmask The bitmask of flags. The bitmask may be composed of
54835                      *            the following flags: 1 - `_.bind` 2 - `_.bindKey` 4 -
54836                      *            `_.curry` or `_.curryRight` of a bound function 8 - `_.curry`
54837                      *            16 - `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
54838                      *            `_.rearg` 256 - `_.ary`
54839                      * @param {*}
54840                      *            [thisArg] The `this` binding of `func`.
54841                      * @param {Array}
54842                      *            [partials] The arguments to be partially applied.
54843                      * @param {Array}
54844                      *            [holders] The `partials` placeholder indexes.
54845                      * @param {Array}
54846                      *            [argPos] The argument positions of the new function.
54847                      * @param {number}
54848                      *            [ary] The arity cap of `func`.
54849                      * @param {number}
54850                      *            [arity] The arity of `func`.
54851                      * @returns {Function} Returns the new wrapped function.
54852                      */
54853                     function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
54854                         var isBindKey = bitmask & BIND_KEY_FLAG;
54855                         if (!isBindKey && typeof func != 'function') {
54856                             throw new TypeError(FUNC_ERROR_TEXT);
54857                         }
54858                         var length = partials ? partials.length : 0;
54859                         if (!length) {
54860                             bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
54861                             partials = holders = undefined;
54862                         }
54863                         length -= (holders ? holders.length : 0);
54864                         if (bitmask & PARTIAL_RIGHT_FLAG) {
54865                             var partialsRight = partials,
54866                                 holdersRight = holders;
54867
54868                             partials = holders = undefined;
54869                         }
54870                         var data = isBindKey ? undefined : getData(func),
54871                             newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
54872
54873                         if (data) {
54874                             mergeData(newData, data);
54875                             bitmask = newData[1];
54876                             arity = newData[9];
54877                         }
54878                         newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
54879
54880                         if (bitmask == BIND_FLAG) {
54881                             var result = createBindWrapper(newData[0], newData[2]);
54882                         } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
54883                             result = createPartialWrapper.apply(undefined, newData);
54884                         } else {
54885                             result = createHybridWrapper.apply(undefined, newData);
54886                         }
54887                         var setter = data ? baseSetData : setData;
54888                         return setter(result, newData);
54889                     }
54890
54891                     /**
54892                      * A specialized version of `baseIsEqualDeep` for arrays with support for
54893                      * partial deep comparisons.
54894                      * 
54895                      * @private
54896                      * @param {Array}
54897                      *            array The array to compare.
54898                      * @param {Array}
54899                      *            other The other array to compare.
54900                      * @param {Function}
54901                      *            equalFunc The function to determine equivalents of values.
54902                      * @param {Function}
54903                      *            [customizer] The function to customize comparing arrays.
54904                      * @param {boolean}
54905                      *            [isLoose] Specify performing partial comparisons.
54906                      * @param {Array}
54907                      *            [stackA] Tracks traversed `value` objects.
54908                      * @param {Array}
54909                      *            [stackB] Tracks traversed `other` objects.
54910                      * @returns {boolean} Returns `true` if the arrays are equivalent, else
54911                      *          `false`.
54912                      */
54913                     function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
54914                         var index = -1,
54915                             arrLength = array.length,
54916                             othLength = other.length;
54917
54918                         if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
54919                             return false;
54920                         }
54921                         // Ignore non-index properties.
54922                         while (++index < arrLength) {
54923                             var arrValue = array[index],
54924                                 othValue = other[index],
54925                                 result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
54926
54927                             if (result !== undefined) {
54928                                 if (result) {
54929                                     continue;
54930                                 }
54931                                 return false;
54932                             }
54933                             // Recursively compare arrays (susceptible to call stack limits).
54934                             if (isLoose) {
54935                                 if (!arraySome(other, function(othValue) {
54936                                         return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
54937                                     })) {
54938                                     return false;
54939                                 }
54940                             } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
54941                                 return false;
54942                             }
54943                         }
54944                         return true;
54945                     }
54946
54947                     /**
54948                      * A specialized version of `baseIsEqualDeep` for comparing objects of the
54949                      * same `toStringTag`.
54950                      * 
54951                      * **Note:** This function only supports comparing values with tags of
54952                      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
54953                      * 
54954                      * @private
54955                      * @param {Object}
54956                      *            object The object to compare.
54957                      * @param {Object}
54958                      *            other The other object to compare.
54959                      * @param {string}
54960                      *            tag The `toStringTag` of the objects to compare.
54961                      * @returns {boolean} Returns `true` if the objects are equivalent, else
54962                      *          `false`.
54963                      */
54964                     function equalByTag(object, other, tag) {
54965                         switch (tag) {
54966                             case boolTag:
54967                             case dateTag:
54968                                 // Coerce dates and booleans to numbers, dates to milliseconds and
54969                                 // booleans
54970                                 // to `1` or `0` treating invalid dates coerced to `NaN` as not
54971                                 // equal.
54972                                 return +object == +other;
54973
54974                             case errorTag:
54975                                 return object.name == other.name && object.message == other.message;
54976
54977                             case numberTag:
54978                                 // Treat `NaN` vs. `NaN` as equal.
54979                                 return (object != +object) ? other != +other : object == +other;
54980
54981                             case regexpTag:
54982                             case stringTag:
54983                                 // Coerce regexes to strings and treat strings primitives and string
54984                                 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
54985                                 // details.
54986                                 return object == (other + '');
54987                         }
54988                         return false;
54989                     }
54990
54991                     /**
54992                      * A specialized version of `baseIsEqualDeep` for objects with support for
54993                      * partial deep comparisons.
54994                      * 
54995                      * @private
54996                      * @param {Object}
54997                      *            object The object to compare.
54998                      * @param {Object}
54999                      *            other The other object to compare.
55000                      * @param {Function}
55001                      *            equalFunc The function to determine equivalents of values.
55002                      * @param {Function}
55003                      *            [customizer] The function to customize comparing values.
55004                      * @param {boolean}
55005                      *            [isLoose] Specify performing partial comparisons.
55006                      * @param {Array}
55007                      *            [stackA] Tracks traversed `value` objects.
55008                      * @param {Array}
55009                      *            [stackB] Tracks traversed `other` objects.
55010                      * @returns {boolean} Returns `true` if the objects are equivalent, else
55011                      *          `false`.
55012                      */
55013                     function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
55014                         var objProps = keys(object),
55015                             objLength = objProps.length,
55016                             othProps = keys(other),
55017                             othLength = othProps.length;
55018
55019                         if (objLength != othLength && !isLoose) {
55020                             return false;
55021                         }
55022                         var index = objLength;
55023                         while (index--) {
55024                             var key = objProps[index];
55025                             if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
55026                                 return false;
55027                             }
55028                         }
55029                         var skipCtor = isLoose;
55030                         while (++index < objLength) {
55031                             key = objProps[index];
55032                             var objValue = object[key],
55033                                 othValue = other[key],
55034                                 result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
55035
55036                             // Recursively compare objects (susceptible to call stack limits).
55037                             if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
55038                                 return false;
55039                             }
55040                             skipCtor || (skipCtor = key == 'constructor');
55041                         }
55042                         if (!skipCtor) {
55043                             var objCtor = object.constructor,
55044                                 othCtor = other.constructor;
55045
55046                             // Non `Object` object instances with different constructors are not
55047                             // equal.
55048                             if (objCtor != othCtor &&
55049                                 ('constructor' in object && 'constructor' in other) &&
55050                                 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
55051                                     typeof othCtor == 'function' && othCtor instanceof othCtor)) {
55052                                 return false;
55053                             }
55054                         }
55055                         return true;
55056                     }
55057
55058                     /**
55059                      * Gets the appropriate "callback" function. If the `_.callback` method is
55060                      * customized this function returns the custom method, otherwise it returns
55061                      * the `baseCallback` function. If arguments are provided the chosen
55062                      * function is invoked with them and its result is returned.
55063                      * 
55064                      * @private
55065                      * @returns {Function} Returns the chosen function or its result.
55066                      */
55067                     function getCallback(func, thisArg, argCount) {
55068                         var result = lodash.callback || callback;
55069                         result = result === callback ? baseCallback : result;
55070                         return argCount ? result(func, thisArg, argCount) : result;
55071                     }
55072
55073                     /**
55074                      * Gets metadata for `func`.
55075                      * 
55076                      * @private
55077                      * @param {Function}
55078                      *            func The function to query.
55079                      * @returns {*} Returns the metadata for `func`.
55080                      */
55081                     var getData = !metaMap ? noop : function(func) {
55082                         return metaMap.get(func);
55083                     };
55084
55085                     /**
55086                      * Gets the name of `func`.
55087                      * 
55088                      * @private
55089                      * @param {Function}
55090                      *            func The function to query.
55091                      * @returns {string} Returns the function name.
55092                      */
55093                     function getFuncName(func) {
55094                         var result = func.name,
55095                             array = realNames[result],
55096                             length = array ? array.length : 0;
55097
55098                         while (length--) {
55099                             var data = array[length],
55100                                 otherFunc = data.func;
55101                             if (otherFunc == null || otherFunc == func) {
55102                                 return data.name;
55103                             }
55104                         }
55105                         return result;
55106                     }
55107
55108                     /**
55109                      * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
55110                      * customized this function returns the custom method, otherwise it returns
55111                      * the `baseIndexOf` function. If arguments are provided the chosen function
55112                      * is invoked with them and its result is returned.
55113                      * 
55114                      * @private
55115                      * @returns {Function|number} Returns the chosen function or its result.
55116                      */
55117                     function getIndexOf(collection, target, fromIndex) {
55118                         var result = lodash.indexOf || indexOf;
55119                         result = result === indexOf ? baseIndexOf : result;
55120                         return collection ? result(collection, target, fromIndex) : result;
55121                     }
55122
55123                     /**
55124                      * Gets the "length" property value of `object`.
55125                      * 
55126                      * **Note:** This function is used to avoid a [JIT
55127                      * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari
55128                      * on at least iOS 8.1-8.3 ARM64.
55129                      * 
55130                      * @private
55131                      * @param {Object}
55132                      *            object The object to query.
55133                      * @returns {*} Returns the "length" value.
55134                      */
55135                     var getLength = baseProperty('length');
55136
55137                     /**
55138                      * Gets the propery names, values, and compare flags of `object`.
55139                      * 
55140                      * @private
55141                      * @param {Object}
55142                      *            object The object to query.
55143                      * @returns {Array} Returns the match data of `object`.
55144                      */
55145                     function getMatchData(object) {
55146                         var result = pairs(object),
55147                             length = result.length;
55148
55149                         while (length--) {
55150                             result[length][2] = isStrictComparable(result[length][1]);
55151                         }
55152                         return result;
55153                     }
55154
55155                     /**
55156                      * Gets the native function at `key` of `object`.
55157                      * 
55158                      * @private
55159                      * @param {Object}
55160                      *            object The object to query.
55161                      * @param {string}
55162                      *            key The key of the method to get.
55163                      * @returns {*} Returns the function if it's native, else `undefined`.
55164                      */
55165                     function getNative(object, key) {
55166                         var value = object == null ? undefined : object[key];
55167                         return isNative(value) ? value : undefined;
55168                     }
55169
55170                     /**
55171                      * Gets the view, applying any `transforms` to the `start` and `end`
55172                      * positions.
55173                      * 
55174                      * @private
55175                      * @param {number}
55176                      *            start The start of the view.
55177                      * @param {number}
55178                      *            end The end of the view.
55179                      * @param {Array}
55180                      *            transforms The transformations to apply to the view.
55181                      * @returns {Object} Returns an object containing the `start` and `end`
55182                      *          positions of the view.
55183                      */
55184                     function getView(start, end, transforms) {
55185                         var index = -1,
55186                             length = transforms.length;
55187
55188                         while (++index < length) {
55189                             var data = transforms[index],
55190                                 size = data.size;
55191
55192                             switch (data.type) {
55193                                 case 'drop':
55194                                     start += size;
55195                                     break;
55196                                 case 'dropRight':
55197                                     end -= size;
55198                                     break;
55199                                 case 'take':
55200                                     end = nativeMin(end, start + size);
55201                                     break;
55202                                 case 'takeRight':
55203                                     start = nativeMax(start, end - size);
55204                                     break;
55205                             }
55206                         }
55207                         return {
55208                             'start': start,
55209                             'end': end
55210                         };
55211                     }
55212
55213                     /**
55214                      * Initializes an array clone.
55215                      * 
55216                      * @private
55217                      * @param {Array}
55218                      *            array The array to clone.
55219                      * @returns {Array} Returns the initialized clone.
55220                      */
55221                     function initCloneArray(array) {
55222                         var length = array.length,
55223                             result = new array.constructor(length);
55224
55225                         // Add array properties assigned by `RegExp#exec`.
55226                         if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
55227                             result.index = array.index;
55228                             result.input = array.input;
55229                         }
55230                         return result;
55231                     }
55232
55233                     /**
55234                      * Initializes an object clone.
55235                      * 
55236                      * @private
55237                      * @param {Object}
55238                      *            object The object to clone.
55239                      * @returns {Object} Returns the initialized clone.
55240                      */
55241                     function initCloneObject(object) {
55242                         var Ctor = object.constructor;
55243                         if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
55244                             Ctor = Object;
55245                         }
55246                         return new Ctor;
55247                     }
55248
55249                     /**
55250                      * Initializes an object clone based on its `toStringTag`.
55251                      * 
55252                      * **Note:** This function only supports cloning values with tags of
55253                      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55254                      * 
55255                      * @private
55256                      * @param {Object}
55257                      *            object The object to clone.
55258                      * @param {string}
55259                      *            tag The `toStringTag` of the object to clone.
55260                      * @param {boolean}
55261                      *            [isDeep] Specify a deep clone.
55262                      * @returns {Object} Returns the initialized clone.
55263                      */
55264                     function initCloneByTag(object, tag, isDeep) {
55265                         var Ctor = object.constructor;
55266                         switch (tag) {
55267                             case arrayBufferTag:
55268                                 return bufferClone(object);
55269
55270                             case boolTag:
55271                             case dateTag:
55272                                 return new Ctor(+object);
55273
55274                             case float32Tag:
55275                             case float64Tag:
55276                             case int8Tag:
55277                             case int16Tag:
55278                             case int32Tag:
55279                             case uint8Tag:
55280                             case uint8ClampedTag:
55281                             case uint16Tag:
55282                             case uint32Tag:
55283                                 var buffer = object.buffer;
55284                                 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
55285
55286                             case numberTag:
55287                             case stringTag:
55288                                 return new Ctor(object);
55289
55290                             case regexpTag:
55291                                 var result = new Ctor(object.source, reFlags.exec(object));
55292                                 result.lastIndex = object.lastIndex;
55293                         }
55294                         return result;
55295                     }
55296
55297                     /**
55298                      * Invokes the method at `path` on `object`.
55299                      * 
55300                      * @private
55301                      * @param {Object}
55302                      *            object The object to query.
55303                      * @param {Array|string}
55304                      *            path The path of the method to invoke.
55305                      * @param {Array}
55306                      *            args The arguments to invoke the method with.
55307                      * @returns {*} Returns the result of the invoked method.
55308                      */
55309                     function invokePath(object, path, args) {
55310                         if (object != null && !isKey(path, object)) {
55311                             path = toPath(path);
55312                             object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
55313                             path = last(path);
55314                         }
55315                         var func = object == null ? object : object[path];
55316                         return func == null ? undefined : func.apply(object, args);
55317                     }
55318
55319                     /**
55320                      * Checks if `value` is array-like.
55321                      * 
55322                      * @private
55323                      * @param {*}
55324                      *            value The value to check.
55325                      * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
55326                      */
55327                     function isArrayLike(value) {
55328                         return value != null && isLength(getLength(value));
55329                     }
55330
55331                     /**
55332                      * Checks if `value` is a valid array-like index.
55333                      * 
55334                      * @private
55335                      * @param {*}
55336                      *            value The value to check.
55337                      * @param {number}
55338                      *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
55339                      * @returns {boolean} Returns `true` if `value` is a valid index, else
55340                      *          `false`.
55341                      */
55342                     function isIndex(value, length) {
55343                         value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
55344                         length = length == null ? MAX_SAFE_INTEGER : length;
55345                         return value > -1 && value % 1 == 0 && value < length;
55346                     }
55347
55348                     /**
55349                      * Checks if the provided arguments are from an iteratee call.
55350                      * 
55351                      * @private
55352                      * @param {*}
55353                      *            value The potential iteratee value argument.
55354                      * @param {*}
55355                      *            index The potential iteratee index or key argument.
55356                      * @param {*}
55357                      *            object The potential iteratee object argument.
55358                      * @returns {boolean} Returns `true` if the arguments are from an iteratee
55359                      *          call, else `false`.
55360                      */
55361                     function isIterateeCall(value, index, object) {
55362                         if (!isObject(object)) {
55363                             return false;
55364                         }
55365                         var type = typeof index;
55366                         if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
55367                             var other = object[index];
55368                             return value === value ? (value === other) : (other !== other);
55369                         }
55370                         return false;
55371                     }
55372
55373                     /**
55374                      * Checks if `value` is a property name and not a property path.
55375                      * 
55376                      * @private
55377                      * @param {*}
55378                      *            value The value to check.
55379                      * @param {Object}
55380                      *            [object] The object to query keys on.
55381                      * @returns {boolean} Returns `true` if `value` is a property name, else
55382                      *          `false`.
55383                      */
55384                     function isKey(value, object) {
55385                         var type = typeof value;
55386                         if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
55387                             return true;
55388                         }
55389                         if (isArray(value)) {
55390                             return false;
55391                         }
55392                         var result = !reIsDeepProp.test(value);
55393                         return result || (object != null && value in toObject(object));
55394                     }
55395
55396                     /**
55397                      * Checks if `func` has a lazy counterpart.
55398                      * 
55399                      * @private
55400                      * @param {Function}
55401                      *            func The function to check.
55402                      * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
55403                      *          `false`.
55404                      */
55405                     function isLaziable(func) {
55406                         var funcName = getFuncName(func);
55407                         if (!(funcName in LazyWrapper.prototype)) {
55408                             return false;
55409                         }
55410                         var other = lodash[funcName];
55411                         if (func === other) {
55412                             return true;
55413                         }
55414                         var data = getData(other);
55415                         return !!data && func === data[0];
55416                     }
55417
55418                     /**
55419                      * Checks if `value` is a valid array-like length.
55420                      * 
55421                      * **Note:** This function is based on
55422                      * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
55423                      * 
55424                      * @private
55425                      * @param {*}
55426                      *            value The value to check.
55427                      * @returns {boolean} Returns `true` if `value` is a valid length, else
55428                      *          `false`.
55429                      */
55430                     function isLength(value) {
55431                         return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
55432                     }
55433
55434                     /**
55435                      * Checks if `value` is suitable for strict equality comparisons, i.e.
55436                      * `===`.
55437                      * 
55438                      * @private
55439                      * @param {*}
55440                      *            value The value to check.
55441                      * @returns {boolean} Returns `true` if `value` if suitable for strict
55442                      *          equality comparisons, else `false`.
55443                      */
55444                     function isStrictComparable(value) {
55445                         return value === value && !isObject(value);
55446                     }
55447
55448                     /**
55449                      * Merges the function metadata of `source` into `data`.
55450                      * 
55451                      * Merging metadata reduces the number of wrappers required to invoke a
55452                      * function. This is possible because methods like `_.bind`, `_.curry`, and
55453                      * `_.partial` may be applied regardless of execution order. Methods like
55454                      * `_.ary` and `_.rearg` augment function arguments, making the order in
55455                      * which they are executed important, preventing the merging of metadata.
55456                      * However, we make an exception for a safe common case where curried
55457                      * functions have `_.ary` and or `_.rearg` applied.
55458                      * 
55459                      * @private
55460                      * @param {Array}
55461                      *            data The destination metadata.
55462                      * @param {Array}
55463                      *            source The source metadata.
55464                      * @returns {Array} Returns `data`.
55465                      */
55466                     function mergeData(data, source) {
55467                         var bitmask = data[1],
55468                             srcBitmask = source[1],
55469                             newBitmask = bitmask | srcBitmask,
55470                             isCommon = newBitmask < ARY_FLAG;
55471
55472                         var isCombo =
55473                             (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
55474                             (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
55475                             (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
55476
55477                         // Exit early if metadata can't be merged.
55478                         if (!(isCommon || isCombo)) {
55479                             return data;
55480                         }
55481                         // Use source `thisArg` if available.
55482                         if (srcBitmask & BIND_FLAG) {
55483                             data[2] = source[2];
55484                             // Set when currying a bound function.
55485                             newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
55486                         }
55487                         // Compose partial arguments.
55488                         var value = source[3];
55489                         if (value) {
55490                             var partials = data[3];
55491                             data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
55492                             data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
55493                         }
55494                         // Compose partial right arguments.
55495                         value = source[5];
55496                         if (value) {
55497                             partials = data[5];
55498                             data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
55499                             data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
55500                         }
55501                         // Use source `argPos` if available.
55502                         value = source[7];
55503                         if (value) {
55504                             data[7] = arrayCopy(value);
55505                         }
55506                         // Use source `ary` if it's smaller.
55507                         if (srcBitmask & ARY_FLAG) {
55508                             data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
55509                         }
55510                         // Use source `arity` if one is not provided.
55511                         if (data[9] == null) {
55512                             data[9] = source[9];
55513                         }
55514                         // Use source `func` and merge bitmasks.
55515                         data[0] = source[0];
55516                         data[1] = newBitmask;
55517
55518                         return data;
55519                     }
55520
55521                     /**
55522                      * Used by `_.defaultsDeep` to customize its `_.merge` use.
55523                      * 
55524                      * @private
55525                      * @param {*}
55526                      *            objectValue The destination object property value.
55527                      * @param {*}
55528                      *            sourceValue The source object property value.
55529                      * @returns {*} Returns the value to assign to the destination object.
55530                      */
55531                     function mergeDefaults(objectValue, sourceValue) {
55532                         return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
55533                     }
55534
55535                     /**
55536                      * A specialized version of `_.pick` which picks `object` properties
55537                      * specified by `props`.
55538                      * 
55539                      * @private
55540                      * @param {Object}
55541                      *            object The source object.
55542                      * @param {string[]}
55543                      *            props The property names to pick.
55544                      * @returns {Object} Returns the new object.
55545                      */
55546                     function pickByArray(object, props) {
55547                         object = toObject(object);
55548
55549                         var index = -1,
55550                             length = props.length,
55551                             result = {};
55552
55553                         while (++index < length) {
55554                             var key = props[index];
55555                             if (key in object) {
55556                                 result[key] = object[key];
55557                             }
55558                         }
55559                         return result;
55560                     }
55561
55562                     /**
55563                      * A specialized version of `_.pick` which picks `object` properties
55564                      * `predicate` returns truthy for.
55565                      * 
55566                      * @private
55567                      * @param {Object}
55568                      *            object The source object.
55569                      * @param {Function}
55570                      *            predicate The function invoked per iteration.
55571                      * @returns {Object} Returns the new object.
55572                      */
55573                     function pickByCallback(object, predicate) {
55574                         var result = {};
55575                         baseForIn(object, function(value, key, object) {
55576                             if (predicate(value, key, object)) {
55577                                 result[key] = value;
55578                             }
55579                         });
55580                         return result;
55581                     }
55582
55583                     /**
55584                      * Reorder `array` according to the specified indexes where the element at
55585                      * the first index is assigned as the first element, the element at the
55586                      * second index is assigned as the second element, and so on.
55587                      * 
55588                      * @private
55589                      * @param {Array}
55590                      *            array The array to reorder.
55591                      * @param {Array}
55592                      *            indexes The arranged array indexes.
55593                      * @returns {Array} Returns `array`.
55594                      */
55595                     function reorder(array, indexes) {
55596                         var arrLength = array.length,
55597                             length = nativeMin(indexes.length, arrLength),
55598                             oldArray = arrayCopy(array);
55599
55600                         while (length--) {
55601                             var index = indexes[length];
55602                             array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
55603                         }
55604                         return array;
55605                     }
55606
55607                     /**
55608                      * Sets metadata for `func`.
55609                      * 
55610                      * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
55611                      * period of time, it will trip its breaker and transition to an identity
55612                      * function to avoid garbage collection pauses in V8. See [V8 issue
55613                      * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more
55614                      * details.
55615                      * 
55616                      * @private
55617                      * @param {Function}
55618                      *            func The function to associate metadata with.
55619                      * @param {*}
55620                      *            data The metadata.
55621                      * @returns {Function} Returns `func`.
55622                      */
55623                     var setData = (function() {
55624                         var count = 0,
55625                             lastCalled = 0;
55626
55627                         return function(key, value) {
55628                             var stamp = now(),
55629                                 remaining = HOT_SPAN - (stamp - lastCalled);
55630
55631                             lastCalled = stamp;
55632                             if (remaining > 0) {
55633                                 if (++count >= HOT_COUNT) {
55634                                     return key;
55635                                 }
55636                             } else {
55637                                 count = 0;
55638                             }
55639                             return baseSetData(key, value);
55640                         };
55641                     }());
55642
55643                     /**
55644                      * A fallback implementation of `Object.keys` which creates an array of the
55645                      * own enumerable property names of `object`.
55646                      * 
55647                      * @private
55648                      * @param {Object}
55649                      *            object The object to query.
55650                      * @returns {Array} Returns the array of property names.
55651                      */
55652                     function shimKeys(object) {
55653                         var props = keysIn(object),
55654                             propsLength = props.length,
55655                             length = propsLength && object.length;
55656
55657                         var allowIndexes = !!length && isLength(length) &&
55658                             (isArray(object) || isArguments(object));
55659
55660                         var index = -1,
55661                             result = [];
55662
55663                         while (++index < propsLength) {
55664                             var key = props[index];
55665                             if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
55666                                 result.push(key);
55667                             }
55668                         }
55669                         return result;
55670                     }
55671
55672                     /**
55673                      * Converts `value` to an array-like object if it's not one.
55674                      * 
55675                      * @private
55676                      * @param {*}
55677                      *            value The value to process.
55678                      * @returns {Array|Object} Returns the array-like object.
55679                      */
55680                     function toIterable(value) {
55681                         if (value == null) {
55682                             return [];
55683                         }
55684                         if (!isArrayLike(value)) {
55685                             return values(value);
55686                         }
55687                         return isObject(value) ? value : Object(value);
55688                     }
55689
55690                     /**
55691                      * Converts `value` to an object if it's not one.
55692                      * 
55693                      * @private
55694                      * @param {*}
55695                      *            value The value to process.
55696                      * @returns {Object} Returns the object.
55697                      */
55698                     function toObject(value) {
55699                         return isObject(value) ? value : Object(value);
55700                     }
55701
55702                     /**
55703                      * Converts `value` to property path array if it's not one.
55704                      * 
55705                      * @private
55706                      * @param {*}
55707                      *            value The value to process.
55708                      * @returns {Array} Returns the property path array.
55709                      */
55710                     function toPath(value) {
55711                         if (isArray(value)) {
55712                             return value;
55713                         }
55714                         var result = [];
55715                         baseToString(value).replace(rePropName, function(match, number, quote, string) {
55716                             result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
55717                         });
55718                         return result;
55719                     }
55720
55721                     /**
55722                      * Creates a clone of `wrapper`.
55723                      * 
55724                      * @private
55725                      * @param {Object}
55726                      *            wrapper The wrapper to clone.
55727                      * @returns {Object} Returns the cloned wrapper.
55728                      */
55729                     function wrapperClone(wrapper) {
55730                         return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
55731                     }
55732
55733                     /*------------------------------------------------------------------------*/
55734
55735                     /**
55736                      * Creates an array of elements split into groups the length of `size`. If
55737                      * `collection` can't be split evenly, the final chunk will be the remaining
55738                      * elements.
55739                      * 
55740                      * @static
55741                      * @memberOf _
55742                      * @category Array
55743                      * @param {Array}
55744                      *            array The array to process.
55745                      * @param {number}
55746                      *            [size=1] The length of each chunk.
55747                      * @param- {Object} [guard] Enables use as a callback for functions like
55748                      *         `_.map`.
55749                      * @returns {Array} Returns the new array containing chunks.
55750                      * @example
55751                      * 
55752                      * _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']]
55753                      * 
55754                      * _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']]
55755                      */
55756                     function chunk(array, size, guard) {
55757                         if (guard ? isIterateeCall(array, size, guard) : size == null) {
55758                             size = 1;
55759                         } else {
55760                             size = nativeMax(nativeFloor(size) || 1, 1);
55761                         }
55762                         var index = 0,
55763                             length = array ? array.length : 0,
55764                             resIndex = -1,
55765                             result = Array(nativeCeil(length / size));
55766
55767                         while (index < length) {
55768                             result[++resIndex] = baseSlice(array, index, (index += size));
55769                         }
55770                         return result;
55771                     }
55772
55773                     /**
55774                      * Creates an array with all falsey values removed. The values `false`,
55775                      * `null`, `0`, `""`, `undefined`, and `NaN` are falsey.
55776                      * 
55777                      * @static
55778                      * @memberOf _
55779                      * @category Array
55780                      * @param {Array}
55781                      *            array The array to compact.
55782                      * @returns {Array} Returns the new array of filtered values.
55783                      * @example
55784                      * 
55785                      * _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]
55786                      */
55787                     function compact(array) {
55788                         var index = -1,
55789                             length = array ? array.length : 0,
55790                             resIndex = -1,
55791                             result = [];
55792
55793                         while (++index < length) {
55794                             var value = array[index];
55795                             if (value) {
55796                                 result[++resIndex] = value;
55797                             }
55798                         }
55799                         return result;
55800                     }
55801
55802                     /**
55803                      * Creates an array of unique `array` values not included in the other
55804                      * provided arrays using
55805                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
55806                      * for equality comparisons.
55807                      * 
55808                      * @static
55809                      * @memberOf _
55810                      * @category Array
55811                      * @param {Array}
55812                      *            array The array to inspect.
55813                      * @param {...Array}
55814                      *            [values] The arrays of values to exclude.
55815                      * @returns {Array} Returns the new array of filtered values.
55816                      * @example
55817                      * 
55818                      * _.difference([1, 2, 3], [4, 2]); // => [1, 3]
55819                      */
55820                     var difference = restParam(function(array, values) {
55821                         return (isObjectLike(array) && isArrayLike(array)) ? baseDifference(array, baseFlatten(values, false, true)) : [];
55822                     });
55823
55824                     /**
55825                      * Creates a slice of `array` with `n` elements dropped from the beginning.
55826                      * 
55827                      * @static
55828                      * @memberOf _
55829                      * @category Array
55830                      * @param {Array}
55831                      *            array The array to query.
55832                      * @param {number}
55833                      *            [n=1] The number of elements to drop.
55834                      * @param- {Object} [guard] Enables use as a callback for functions like
55835                      *         `_.map`.
55836                      * @returns {Array} Returns the slice of `array`.
55837                      * @example
55838                      * 
55839                      * _.drop([1, 2, 3]); // => [2, 3]
55840                      * 
55841                      * _.drop([1, 2, 3], 2); // => [3]
55842                      * 
55843                      * _.drop([1, 2, 3], 5); // => []
55844                      * 
55845                      * _.drop([1, 2, 3], 0); // => [1, 2, 3]
55846                      */
55847                     function drop(array, n, guard) {
55848                         var length = array ? array.length : 0;
55849                         if (!length) {
55850                             return [];
55851                         }
55852                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
55853                             n = 1;
55854                         }
55855                         return baseSlice(array, n < 0 ? 0 : n);
55856                     }
55857
55858                     /**
55859                      * Creates a slice of `array` with `n` elements dropped from the end.
55860                      * 
55861                      * @static
55862                      * @memberOf _
55863                      * @category Array
55864                      * @param {Array}
55865                      *            array The array to query.
55866                      * @param {number}
55867                      *            [n=1] The number of elements to drop.
55868                      * @param- {Object} [guard] Enables use as a callback for functions like
55869                      *         `_.map`.
55870                      * @returns {Array} Returns the slice of `array`.
55871                      * @example
55872                      * 
55873                      * _.dropRight([1, 2, 3]); // => [1, 2]
55874                      * 
55875                      * _.dropRight([1, 2, 3], 2); // => [1]
55876                      * 
55877                      * _.dropRight([1, 2, 3], 5); // => []
55878                      * 
55879                      * _.dropRight([1, 2, 3], 0); // => [1, 2, 3]
55880                      */
55881                     function dropRight(array, n, guard) {
55882                         var length = array ? array.length : 0;
55883                         if (!length) {
55884                             return [];
55885                         }
55886                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
55887                             n = 1;
55888                         }
55889                         n = length - (+n || 0);
55890                         return baseSlice(array, 0, n < 0 ? 0 : n);
55891                     }
55892
55893                     /**
55894                      * Creates a slice of `array` excluding elements dropped from the end.
55895                      * Elements are dropped until `predicate` returns falsey. The predicate is
55896                      * bound to `thisArg` and invoked with three arguments: (value, index,
55897                      * array).
55898                      * 
55899                      * If a property name is provided for `predicate` the created `_.property`
55900                      * style callback returns the property value of the given element.
55901                      * 
55902                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55903                      * style callback returns `true` for elements that have a matching property
55904                      * value, else `false`.
55905                      * 
55906                      * If an object is provided for `predicate` the created `_.matches` style
55907                      * callback returns `true` for elements that match the properties of the
55908                      * given object, else `false`.
55909                      * 
55910                      * @static
55911                      * @memberOf _
55912                      * @category Array
55913                      * @param {Array}
55914                      *            array The array to query.
55915                      * @param {Function|Object|string}
55916                      *            [predicate=_.identity] The function invoked per iteration.
55917                      * @param {*}
55918                      *            [thisArg] The `this` binding of `predicate`.
55919                      * @returns {Array} Returns the slice of `array`.
55920                      * @example
55921                      * 
55922                      * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [1]
55923                      * 
55924                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
55925                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
55926                      *  // using the `_.matches` callback shorthand
55927                      * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }),
55928                      * 'user'); // => ['barney', 'fred']
55929                      *  // using the `_.matchesProperty` callback shorthand
55930                      * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); // =>
55931                      * ['barney']
55932                      *  // using the `_.property` callback shorthand
55933                      * _.pluck(_.dropRightWhile(users, 'active'), 'user'); // => ['barney',
55934                      * 'fred', 'pebbles']
55935                      */
55936                     function dropRightWhile(array, predicate, thisArg) {
55937                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : [];
55938                     }
55939
55940                     /**
55941                      * Creates a slice of `array` excluding elements dropped from the beginning.
55942                      * Elements are dropped until `predicate` returns falsey. The predicate is
55943                      * bound to `thisArg` and invoked with three arguments: (value, index,
55944                      * array).
55945                      * 
55946                      * If a property name is provided for `predicate` the created `_.property`
55947                      * style callback returns the property value of the given element.
55948                      * 
55949                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55950                      * style callback returns `true` for elements that have a matching property
55951                      * value, else `false`.
55952                      * 
55953                      * If an object is provided for `predicate` the created `_.matches` style
55954                      * callback returns `true` for elements that have the properties of the
55955                      * given object, else `false`.
55956                      * 
55957                      * @static
55958                      * @memberOf _
55959                      * @category Array
55960                      * @param {Array}
55961                      *            array The array to query.
55962                      * @param {Function|Object|string}
55963                      *            [predicate=_.identity] The function invoked per iteration.
55964                      * @param {*}
55965                      *            [thisArg] The `this` binding of `predicate`.
55966                      * @returns {Array} Returns the slice of `array`.
55967                      * @example
55968                      * 
55969                      * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); // => [3]
55970                      * 
55971                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
55972                      * 'active': false }, { 'user': 'pebbles', 'active': true } ];
55973                      *  // using the `_.matches` callback shorthand _.pluck(_.dropWhile(users, {
55974                      * 'user': 'barney', 'active': false }), 'user'); // => ['fred', 'pebbles']
55975                      *  // using the `_.matchesProperty` callback shorthand
55976                      * _.pluck(_.dropWhile(users, 'active', false), 'user'); // => ['pebbles']
55977                      *  // using the `_.property` callback shorthand _.pluck(_.dropWhile(users,
55978                      * 'active'), 'user'); // => ['barney', 'fred', 'pebbles']
55979                      */
55980                     function dropWhile(array, predicate, thisArg) {
55981                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : [];
55982                     }
55983
55984                     /**
55985                      * Fills elements of `array` with `value` from `start` up to, but not
55986                      * including, `end`.
55987                      * 
55988                      * **Note:** This method mutates `array`.
55989                      * 
55990                      * @static
55991                      * @memberOf _
55992                      * @category Array
55993                      * @param {Array}
55994                      *            array The array to fill.
55995                      * @param {*}
55996                      *            value The value to fill `array` with.
55997                      * @param {number}
55998                      *            [start=0] The start position.
55999                      * @param {number}
56000                      *            [end=array.length] The end position.
56001                      * @returns {Array} Returns `array`.
56002                      * @example
56003                      * 
56004                      * var array = [1, 2, 3];
56005                      * 
56006                      * _.fill(array, 'a'); console.log(array); // => ['a', 'a', 'a']
56007                      * 
56008                      * _.fill(Array(3), 2); // => [2, 2, 2]
56009                      * 
56010                      * _.fill([4, 6, 8], '*', 1, 2); // => [4, '*', 8]
56011                      */
56012                     function fill(array, value, start, end) {
56013                         var length = array ? array.length : 0;
56014                         if (!length) {
56015                             return [];
56016                         }
56017                         if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
56018                             start = 0;
56019                             end = length;
56020                         }
56021                         return baseFill(array, value, start, end);
56022                     }
56023
56024                     /**
56025                      * This method is like `_.find` except that it returns the index of the
56026                      * first element `predicate` returns truthy for instead of the element
56027                      * itself.
56028                      * 
56029                      * If a property name is provided for `predicate` the created `_.property`
56030                      * style callback returns the property value of the given element.
56031                      * 
56032                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56033                      * style callback returns `true` for elements that have a matching property
56034                      * value, else `false`.
56035                      * 
56036                      * If an object is provided for `predicate` the created `_.matches` style
56037                      * callback returns `true` for elements that have the properties of the
56038                      * given object, else `false`.
56039                      * 
56040                      * @static
56041                      * @memberOf _
56042                      * @category Array
56043                      * @param {Array}
56044                      *            array The array to search.
56045                      * @param {Function|Object|string}
56046                      *            [predicate=_.identity] The function invoked per iteration.
56047                      * @param {*}
56048                      *            [thisArg] The `this` binding of `predicate`.
56049                      * @returns {number} Returns the index of the found element, else `-1`.
56050                      * @example
56051                      * 
56052                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56053                      * 'active': false }, { 'user': 'pebbles', 'active': true } ];
56054                      * 
56055                      * _.findIndex(users, function(chr) { return chr.user == 'barney'; }); // =>
56056                      * 0
56057                      *  // using the `_.matches` callback shorthand _.findIndex(users, { 'user':
56058                      * 'fred', 'active': false }); // => 1
56059                      *  // using the `_.matchesProperty` callback shorthand _.findIndex(users,
56060                      * 'active', false); // => 0
56061                      *  // using the `_.property` callback shorthand _.findIndex(users,
56062                      * 'active'); // => 2
56063                      */
56064                     var findIndex = createFindIndex();
56065
56066                     /**
56067                      * This method is like `_.findIndex` except that it iterates over elements
56068                      * of `collection` from right to left.
56069                      * 
56070                      * If a property name is provided for `predicate` the created `_.property`
56071                      * style callback returns the property value of the given element.
56072                      * 
56073                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56074                      * style callback returns `true` for elements that have a matching property
56075                      * value, else `false`.
56076                      * 
56077                      * If an object is provided for `predicate` the created `_.matches` style
56078                      * callback returns `true` for elements that have the properties of the
56079                      * given object, else `false`.
56080                      * 
56081                      * @static
56082                      * @memberOf _
56083                      * @category Array
56084                      * @param {Array}
56085                      *            array The array to search.
56086                      * @param {Function|Object|string}
56087                      *            [predicate=_.identity] The function invoked per iteration.
56088                      * @param {*}
56089                      *            [thisArg] The `this` binding of `predicate`.
56090                      * @returns {number} Returns the index of the found element, else `-1`.
56091                      * @example
56092                      * 
56093                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56094                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56095                      * 
56096                      * _.findLastIndex(users, function(chr) { return chr.user == 'pebbles'; }); // =>
56097                      * 2
56098                      *  // using the `_.matches` callback shorthand _.findLastIndex(users, {
56099                      * 'user': 'barney', 'active': true }); // => 0
56100                      *  // using the `_.matchesProperty` callback shorthand
56101                      * _.findLastIndex(users, 'active', false); // => 2
56102                      *  // using the `_.property` callback shorthand _.findLastIndex(users,
56103                      * 'active'); // => 0
56104                      */
56105                     var findLastIndex = createFindIndex(true);
56106
56107                     /**
56108                      * Gets the first element of `array`.
56109                      * 
56110                      * @static
56111                      * @memberOf _
56112                      * @alias head
56113                      * @category Array
56114                      * @param {Array}
56115                      *            array The array to query.
56116                      * @returns {*} Returns the first element of `array`.
56117                      * @example
56118                      * 
56119                      * _.first([1, 2, 3]); // => 1
56120                      * 
56121                      * _.first([]); // => undefined
56122                      */
56123                     function first(array) {
56124                         return array ? array[0] : undefined;
56125                     }
56126
56127                     /**
56128                      * Flattens a nested array. If `isDeep` is `true` the array is recursively
56129                      * flattened, otherwise it is only flattened a single level.
56130                      * 
56131                      * @static
56132                      * @memberOf _
56133                      * @category Array
56134                      * @param {Array}
56135                      *            array The array to flatten.
56136                      * @param {boolean}
56137                      *            [isDeep] Specify a deep flatten.
56138                      * @param- {Object} [guard] Enables use as a callback for functions like
56139                      *         `_.map`.
56140                      * @returns {Array} Returns the new flattened array.
56141                      * @example
56142                      * 
56143                      * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
56144                      *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
56145                      */
56146                     function flatten(array, isDeep, guard) {
56147                         var length = array ? array.length : 0;
56148                         if (guard && isIterateeCall(array, isDeep, guard)) {
56149                             isDeep = false;
56150                         }
56151                         return length ? baseFlatten(array, isDeep) : [];
56152                     }
56153
56154                     /**
56155                      * Recursively flattens a nested array.
56156                      * 
56157                      * @static
56158                      * @memberOf _
56159                      * @category Array
56160                      * @param {Array}
56161                      *            array The array to recursively flatten.
56162                      * @returns {Array} Returns the new flattened array.
56163                      * @example
56164                      * 
56165                      * _.flattenDeep([1, [2, 3, [4]]]); // => [1, 2, 3, 4]
56166                      */
56167                     function flattenDeep(array) {
56168                         var length = array ? array.length : 0;
56169                         return length ? baseFlatten(array, true) : [];
56170                     }
56171
56172                     /**
56173                      * Gets the index at which the first occurrence of `value` is found in
56174                      * `array` using
56175                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56176                      * for equality comparisons. If `fromIndex` is negative, it is used as the
56177                      * offset from the end of `array`. If `array` is sorted providing `true` for
56178                      * `fromIndex` performs a faster binary search.
56179                      * 
56180                      * @static
56181                      * @memberOf _
56182                      * @category Array
56183                      * @param {Array}
56184                      *            array The array to search.
56185                      * @param {*}
56186                      *            value The value to search for.
56187                      * @param {boolean|number}
56188                      *            [fromIndex=0] The index to search from or `true` to perform a
56189                      *            binary search on a sorted array.
56190                      * @returns {number} Returns the index of the matched value, else `-1`.
56191                      * @example
56192                      * 
56193                      * _.indexOf([1, 2, 1, 2], 2); // => 1
56194                      *  // using `fromIndex` _.indexOf([1, 2, 1, 2], 2, 2); // => 3
56195                      *  // performing a binary search _.indexOf([1, 1, 2, 2], 2, true); // => 2
56196                      */
56197                     function indexOf(array, value, fromIndex) {
56198                         var length = array ? array.length : 0;
56199                         if (!length) {
56200                             return -1;
56201                         }
56202                         if (typeof fromIndex == 'number') {
56203                             fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
56204                         } else if (fromIndex) {
56205                             var index = binaryIndex(array, value);
56206                             if (index < length &&
56207                                 (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
56208                                 return index;
56209                             }
56210                             return -1;
56211                         }
56212                         return baseIndexOf(array, value, fromIndex || 0);
56213                     }
56214
56215                     /**
56216                      * Gets all but the last element of `array`.
56217                      * 
56218                      * @static
56219                      * @memberOf _
56220                      * @category Array
56221                      * @param {Array}
56222                      *            array The array to query.
56223                      * @returns {Array} Returns the slice of `array`.
56224                      * @example
56225                      * 
56226                      * _.initial([1, 2, 3]); // => [1, 2]
56227                      */
56228                     function initial(array) {
56229                         return dropRight(array, 1);
56230                     }
56231
56232                     /**
56233                      * Creates an array of unique values that are included in all of the
56234                      * provided arrays using
56235                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56236                      * for equality comparisons.
56237                      * 
56238                      * @static
56239                      * @memberOf _
56240                      * @category Array
56241                      * @param {...Array}
56242                      *            [arrays] The arrays to inspect.
56243                      * @returns {Array} Returns the new array of shared values.
56244                      * @example _.intersection([1, 2], [4, 2], [2, 1]); // => [2]
56245                      */
56246                     var intersection = restParam(function(arrays) {
56247                         var othLength = arrays.length,
56248                             othIndex = othLength,
56249                             caches = Array(length),
56250                             indexOf = getIndexOf(),
56251                             isCommon = indexOf == baseIndexOf,
56252                             result = [];
56253
56254                         while (othIndex--) {
56255                             var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
56256                             caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
56257                         }
56258                         var array = arrays[0],
56259                             index = -1,
56260                             length = array ? array.length : 0,
56261                             seen = caches[0];
56262
56263                         outer:
56264                             while (++index < length) {
56265                                 value = array[index];
56266                                 if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
56267                                     var othIndex = othLength;
56268                                     while (--othIndex) {
56269                                         var cache = caches[othIndex];
56270                                         if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
56271                                             continue outer;
56272                                         }
56273                                     }
56274                                     if (seen) {
56275                                         seen.push(value);
56276                                     }
56277                                     result.push(value);
56278                                 }
56279                             }
56280                         return result;
56281                     });
56282
56283                     /**
56284                      * Gets the last element of `array`.
56285                      * 
56286                      * @static
56287                      * @memberOf _
56288                      * @category Array
56289                      * @param {Array}
56290                      *            array The array to query.
56291                      * @returns {*} Returns the last element of `array`.
56292                      * @example
56293                      * 
56294                      * _.last([1, 2, 3]); // => 3
56295                      */
56296                     function last(array) {
56297                         var length = array ? array.length : 0;
56298                         return length ? array[length - 1] : undefined;
56299                     }
56300
56301                     /**
56302                      * This method is like `_.indexOf` except that it iterates over elements of
56303                      * `array` from right to left.
56304                      * 
56305                      * @static
56306                      * @memberOf _
56307                      * @category Array
56308                      * @param {Array}
56309                      *            array The array to search.
56310                      * @param {*}
56311                      *            value The value to search for.
56312                      * @param {boolean|number}
56313                      *            [fromIndex=array.length-1] The index to search from or `true`
56314                      *            to perform a binary search on a sorted array.
56315                      * @returns {number} Returns the index of the matched value, else `-1`.
56316                      * @example
56317                      * 
56318                      * _.lastIndexOf([1, 2, 1, 2], 2); // => 3
56319                      *  // using `fromIndex` _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1
56320                      *  // performing a binary search _.lastIndexOf([1, 1, 2, 2], 2, true); // =>
56321                      * 3
56322                      */
56323                     function lastIndexOf(array, value, fromIndex) {
56324                         var length = array ? array.length : 0;
56325                         if (!length) {
56326                             return -1;
56327                         }
56328                         var index = length;
56329                         if (typeof fromIndex == 'number') {
56330                             index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
56331                         } else if (fromIndex) {
56332                             index = binaryIndex(array, value, true) - 1;
56333                             var other = array[index];
56334                             if (value === value ? (value === other) : (other !== other)) {
56335                                 return index;
56336                             }
56337                             return -1;
56338                         }
56339                         if (value !== value) {
56340                             return indexOfNaN(array, index, true);
56341                         }
56342                         while (index--) {
56343                             if (array[index] === value) {
56344                                 return index;
56345                             }
56346                         }
56347                         return -1;
56348                     }
56349
56350                     /**
56351                      * Removes all provided values from `array` using
56352                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56353                      * for equality comparisons.
56354                      * 
56355                      * **Note:** Unlike `_.without`, this method mutates `array`.
56356                      * 
56357                      * @static
56358                      * @memberOf _
56359                      * @category Array
56360                      * @param {Array}
56361                      *            array The array to modify.
56362                      * @param {...*}
56363                      *            [values] The values to remove.
56364                      * @returns {Array} Returns `array`.
56365                      * @example
56366                      * 
56367                      * var array = [1, 2, 3, 1, 2, 3];
56368                      * 
56369                      * _.pull(array, 2, 3); console.log(array); // => [1, 1]
56370                      */
56371                     function pull() {
56372                         var args = arguments,
56373                             array = args[0];
56374
56375                         if (!(array && array.length)) {
56376                             return array;
56377                         }
56378                         var index = 0,
56379                             indexOf = getIndexOf(),
56380                             length = args.length;
56381
56382                         while (++index < length) {
56383                             var fromIndex = 0,
56384                                 value = args[index];
56385
56386                             while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
56387                                 splice.call(array, fromIndex, 1);
56388                             }
56389                         }
56390                         return array;
56391                     }
56392
56393                     /**
56394                      * Removes elements from `array` corresponding to the given indexes and
56395                      * returns an array of the removed elements. Indexes may be specified as an
56396                      * array of indexes or as individual arguments.
56397                      * 
56398                      * **Note:** Unlike `_.at`, this method mutates `array`.
56399                      * 
56400                      * @static
56401                      * @memberOf _
56402                      * @category Array
56403                      * @param {Array}
56404                      *            array The array to modify.
56405                      * @param {...(number|number[])}
56406                      *            [indexes] The indexes of elements to remove, specified as
56407                      *            individual indexes or arrays of indexes.
56408                      * @returns {Array} Returns the new array of removed elements.
56409                      * @example
56410                      * 
56411                      * var array = [5, 10, 15, 20]; var evens = _.pullAt(array, 1, 3);
56412                      * 
56413                      * console.log(array); // => [5, 15]
56414                      * 
56415                      * console.log(evens); // => [10, 20]
56416                      */
56417                     var pullAt = restParam(function(array, indexes) {
56418                         indexes = baseFlatten(indexes);
56419
56420                         var result = baseAt(array, indexes);
56421                         basePullAt(array, indexes.sort(baseCompareAscending));
56422                         return result;
56423                     });
56424
56425                     /**
56426                      * Removes all elements from `array` that `predicate` returns truthy for and
56427                      * returns an array of the removed elements. The predicate is bound to
56428                      * `thisArg` and invoked with three arguments: (value, index, array).
56429                      * 
56430                      * If a property name is provided for `predicate` the created `_.property`
56431                      * style callback returns the property value of the given element.
56432                      * 
56433                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56434                      * style callback returns `true` for elements that have a matching property
56435                      * value, else `false`.
56436                      * 
56437                      * If an object is provided for `predicate` the created `_.matches` style
56438                      * callback returns `true` for elements that have the properties of the
56439                      * given object, else `false`.
56440                      * 
56441                      * **Note:** Unlike `_.filter`, this method mutates `array`.
56442                      * 
56443                      * @static
56444                      * @memberOf _
56445                      * @category Array
56446                      * @param {Array}
56447                      *            array The array to modify.
56448                      * @param {Function|Object|string}
56449                      *            [predicate=_.identity] The function invoked per iteration.
56450                      * @param {*}
56451                      *            [thisArg] The `this` binding of `predicate`.
56452                      * @returns {Array} Returns the new array of removed elements.
56453                      * @example
56454                      * 
56455                      * var array = [1, 2, 3, 4]; var evens = _.remove(array, function(n) {
56456                      * return n % 2 == 0; });
56457                      * 
56458                      * console.log(array); // => [1, 3]
56459                      * 
56460                      * console.log(evens); // => [2, 4]
56461                      */
56462                     function remove(array, predicate, thisArg) {
56463                         var result = [];
56464                         if (!(array && array.length)) {
56465                             return result;
56466                         }
56467                         var index = -1,
56468                             indexes = [],
56469                             length = array.length;
56470
56471                         predicate = getCallback(predicate, thisArg, 3);
56472                         while (++index < length) {
56473                             var value = array[index];
56474                             if (predicate(value, index, array)) {
56475                                 result.push(value);
56476                                 indexes.push(index);
56477                             }
56478                         }
56479                         basePullAt(array, indexes);
56480                         return result;
56481                     }
56482
56483                     /**
56484                      * Gets all but the first element of `array`.
56485                      * 
56486                      * @static
56487                      * @memberOf _
56488                      * @alias tail
56489                      * @category Array
56490                      * @param {Array}
56491                      *            array The array to query.
56492                      * @returns {Array} Returns the slice of `array`.
56493                      * @example
56494                      * 
56495                      * _.rest([1, 2, 3]); // => [2, 3]
56496                      */
56497                     function rest(array) {
56498                         return drop(array, 1);
56499                     }
56500
56501                     /**
56502                      * Creates a slice of `array` from `start` up to, but not including, `end`.
56503                      * 
56504                      * **Note:** This method is used instead of `Array#slice` to support node
56505                      * lists in IE < 9 and to ensure dense arrays are returned.
56506                      * 
56507                      * @static
56508                      * @memberOf _
56509                      * @category Array
56510                      * @param {Array}
56511                      *            array The array to slice.
56512                      * @param {number}
56513                      *            [start=0] The start position.
56514                      * @param {number}
56515                      *            [end=array.length] The end position.
56516                      * @returns {Array} Returns the slice of `array`.
56517                      */
56518                     function slice(array, start, end) {
56519                         var length = array ? array.length : 0;
56520                         if (!length) {
56521                             return [];
56522                         }
56523                         if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
56524                             start = 0;
56525                             end = length;
56526                         }
56527                         return baseSlice(array, start, end);
56528                     }
56529
56530                     /**
56531                      * Uses a binary search to determine the lowest index at which `value`
56532                      * should be inserted into `array` in order to maintain its sort order. If
56533                      * an iteratee function is provided it is invoked for `value` and each
56534                      * element of `array` to compute their sort ranking. The iteratee is bound
56535                      * to `thisArg` and invoked with one argument; (value).
56536                      * 
56537                      * If a property name is provided for `iteratee` the created `_.property`
56538                      * style callback returns the property value of the given element.
56539                      * 
56540                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56541                      * style callback returns `true` for elements that have a matching property
56542                      * value, else `false`.
56543                      * 
56544                      * If an object is provided for `iteratee` the created `_.matches` style
56545                      * callback returns `true` for elements that have the properties of the
56546                      * given object, else `false`.
56547                      * 
56548                      * @static
56549                      * @memberOf _
56550                      * @category Array
56551                      * @param {Array}
56552                      *            array The sorted array to inspect.
56553                      * @param {*}
56554                      *            value The value to evaluate.
56555                      * @param {Function|Object|string}
56556                      *            [iteratee=_.identity] The function invoked per iteration.
56557                      * @param {*}
56558                      *            [thisArg] The `this` binding of `iteratee`.
56559                      * @returns {number} Returns the index at which `value` should be inserted
56560                      *          into `array`.
56561                      * @example
56562                      * 
56563                      * _.sortedIndex([30, 50], 40); // => 1
56564                      * 
56565                      * _.sortedIndex([4, 4, 5, 5], 5); // => 2
56566                      * 
56567                      * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
56568                      *  // using an iteratee function _.sortedIndex(['thirty', 'fifty'],
56569                      * 'forty', function(word) { return this.data[word]; }, dict); // => 1
56570                      *  // using the `_.property` callback shorthand _.sortedIndex([{ 'x': 30 }, {
56571                      * 'x': 50 }], { 'x': 40 }, 'x'); // => 1
56572                      */
56573                     var sortedIndex = createSortedIndex();
56574
56575                     /**
56576                      * This method is like `_.sortedIndex` except that it returns the highest
56577                      * index at which `value` should be inserted into `array` in order to
56578                      * maintain its sort order.
56579                      * 
56580                      * @static
56581                      * @memberOf _
56582                      * @category Array
56583                      * @param {Array}
56584                      *            array The sorted array to inspect.
56585                      * @param {*}
56586                      *            value The value to evaluate.
56587                      * @param {Function|Object|string}
56588                      *            [iteratee=_.identity] The function invoked per iteration.
56589                      * @param {*}
56590                      *            [thisArg] The `this` binding of `iteratee`.
56591                      * @returns {number} Returns the index at which `value` should be inserted
56592                      *          into `array`.
56593                      * @example
56594                      * 
56595                      * _.sortedLastIndex([4, 4, 5, 5], 5); // => 4
56596                      */
56597                     var sortedLastIndex = createSortedIndex(true);
56598
56599                     /**
56600                      * Creates a slice of `array` with `n` elements taken from the beginning.
56601                      * 
56602                      * @static
56603                      * @memberOf _
56604                      * @category Array
56605                      * @param {Array}
56606                      *            array The array to query.
56607                      * @param {number}
56608                      *            [n=1] The number of elements to take.
56609                      * @param- {Object} [guard] Enables use as a callback for functions like
56610                      *         `_.map`.
56611                      * @returns {Array} Returns the slice of `array`.
56612                      * @example
56613                      * 
56614                      * _.take([1, 2, 3]); // => [1]
56615                      * 
56616                      * _.take([1, 2, 3], 2); // => [1, 2]
56617                      * 
56618                      * _.take([1, 2, 3], 5); // => [1, 2, 3]
56619                      * 
56620                      * _.take([1, 2, 3], 0); // => []
56621                      */
56622                     function take(array, n, guard) {
56623                         var length = array ? array.length : 0;
56624                         if (!length) {
56625                             return [];
56626                         }
56627                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
56628                             n = 1;
56629                         }
56630                         return baseSlice(array, 0, n < 0 ? 0 : n);
56631                     }
56632
56633                     /**
56634                      * Creates a slice of `array` with `n` elements taken from the end.
56635                      * 
56636                      * @static
56637                      * @memberOf _
56638                      * @category Array
56639                      * @param {Array}
56640                      *            array The array to query.
56641                      * @param {number}
56642                      *            [n=1] The number of elements to take.
56643                      * @param- {Object} [guard] Enables use as a callback for functions like
56644                      *         `_.map`.
56645                      * @returns {Array} Returns the slice of `array`.
56646                      * @example
56647                      * 
56648                      * _.takeRight([1, 2, 3]); // => [3]
56649                      * 
56650                      * _.takeRight([1, 2, 3], 2); // => [2, 3]
56651                      * 
56652                      * _.takeRight([1, 2, 3], 5); // => [1, 2, 3]
56653                      * 
56654                      * _.takeRight([1, 2, 3], 0); // => []
56655                      */
56656                     function takeRight(array, n, guard) {
56657                         var length = array ? array.length : 0;
56658                         if (!length) {
56659                             return [];
56660                         }
56661                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
56662                             n = 1;
56663                         }
56664                         n = length - (+n || 0);
56665                         return baseSlice(array, n < 0 ? 0 : n);
56666                     }
56667
56668                     /**
56669                      * Creates a slice of `array` with elements taken from the end. Elements are
56670                      * taken until `predicate` returns falsey. The predicate is bound to
56671                      * `thisArg` and invoked with three arguments: (value, index, array).
56672                      * 
56673                      * If a property name is provided for `predicate` the created `_.property`
56674                      * style callback returns the property value of the given element.
56675                      * 
56676                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56677                      * style callback returns `true` for elements that have a matching property
56678                      * value, else `false`.
56679                      * 
56680                      * If an object is provided for `predicate` the created `_.matches` style
56681                      * callback returns `true` for elements that have the properties of the
56682                      * given object, else `false`.
56683                      * 
56684                      * @static
56685                      * @memberOf _
56686                      * @category Array
56687                      * @param {Array}
56688                      *            array The array to query.
56689                      * @param {Function|Object|string}
56690                      *            [predicate=_.identity] The function invoked per iteration.
56691                      * @param {*}
56692                      *            [thisArg] The `this` binding of `predicate`.
56693                      * @returns {Array} Returns the slice of `array`.
56694                      * @example
56695                      * 
56696                      * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [2, 3]
56697                      * 
56698                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56699                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56700                      *  // using the `_.matches` callback shorthand
56701                      * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }),
56702                      * 'user'); // => ['pebbles']
56703                      *  // using the `_.matchesProperty` callback shorthand
56704                      * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); // => ['fred',
56705                      * 'pebbles']
56706                      *  // using the `_.property` callback shorthand
56707                      * _.pluck(_.takeRightWhile(users, 'active'), 'user'); // => []
56708                      */
56709                     function takeRightWhile(array, predicate, thisArg) {
56710                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : [];
56711                     }
56712
56713                     /**
56714                      * Creates a slice of `array` with elements taken from the beginning.
56715                      * Elements are taken until `predicate` returns falsey. The predicate is
56716                      * bound to `thisArg` and invoked with three arguments: (value, index,
56717                      * array).
56718                      * 
56719                      * If a property name is provided for `predicate` the created `_.property`
56720                      * style callback returns the property value of the given element.
56721                      * 
56722                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56723                      * style callback returns `true` for elements that have a matching property
56724                      * value, else `false`.
56725                      * 
56726                      * If an object is provided for `predicate` the created `_.matches` style
56727                      * callback returns `true` for elements that have the properties of the
56728                      * given object, else `false`.
56729                      * 
56730                      * @static
56731                      * @memberOf _
56732                      * @category Array
56733                      * @param {Array}
56734                      *            array The array to query.
56735                      * @param {Function|Object|string}
56736                      *            [predicate=_.identity] The function invoked per iteration.
56737                      * @param {*}
56738                      *            [thisArg] The `this` binding of `predicate`.
56739                      * @returns {Array} Returns the slice of `array`.
56740                      * @example
56741                      * 
56742                      * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); // => [1, 2]
56743                      * 
56744                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56745                      * 'active': false}, { 'user': 'pebbles', 'active': true } ];
56746                      *  // using the `_.matches` callback shorthand _.pluck(_.takeWhile(users, {
56747                      * 'user': 'barney', 'active': false }), 'user'); // => ['barney']
56748                      *  // using the `_.matchesProperty` callback shorthand
56749                      * _.pluck(_.takeWhile(users, 'active', false), 'user'); // => ['barney',
56750                      * 'fred']
56751                      *  // using the `_.property` callback shorthand _.pluck(_.takeWhile(users,
56752                      * 'active'), 'user'); // => []
56753                      */
56754                     function takeWhile(array, predicate, thisArg) {
56755                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3)) : [];
56756                     }
56757
56758                     /**
56759                      * Creates an array of unique values, in order, from all of the provided
56760                      * arrays using
56761                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56762                      * for equality comparisons.
56763                      * 
56764                      * @static
56765                      * @memberOf _
56766                      * @category Array
56767                      * @param {...Array}
56768                      *            [arrays] The arrays to inspect.
56769                      * @returns {Array} Returns the new array of combined values.
56770                      * @example
56771                      * 
56772                      * _.union([1, 2], [4, 2], [2, 1]); // => [1, 2, 4]
56773                      */
56774                     var union = restParam(function(arrays) {
56775                         return baseUniq(baseFlatten(arrays, false, true));
56776                     });
56777
56778                     /**
56779                      * Creates a duplicate-free version of an array, using
56780                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56781                      * for equality comparisons, in which only the first occurence of each
56782                      * element is kept. Providing `true` for `isSorted` performs a faster search
56783                      * algorithm for sorted arrays. If an iteratee function is provided it is
56784                      * invoked for each element in the array to generate the criterion by which
56785                      * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
56786                      * with three arguments: (value, index, array).
56787                      * 
56788                      * If a property name is provided for `iteratee` the created `_.property`
56789                      * style callback returns the property value of the given element.
56790                      * 
56791                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56792                      * style callback returns `true` for elements that have a matching property
56793                      * value, else `false`.
56794                      * 
56795                      * If an object is provided for `iteratee` the created `_.matches` style
56796                      * callback returns `true` for elements that have the properties of the
56797                      * given object, else `false`.
56798                      * 
56799                      * @static
56800                      * @memberOf _
56801                      * @alias unique
56802                      * @category Array
56803                      * @param {Array}
56804                      *            array The array to inspect.
56805                      * @param {boolean}
56806                      *            [isSorted] Specify the array is sorted.
56807                      * @param {Function|Object|string}
56808                      *            [iteratee] The function invoked per iteration.
56809                      * @param {*}
56810                      *            [thisArg] The `this` binding of `iteratee`.
56811                      * @returns {Array} Returns the new duplicate-value-free array.
56812                      * @example
56813                      * 
56814                      * _.uniq([2, 1, 2]); // => [2, 1]
56815                      *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
56816                      *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) {
56817                      * return this.floor(n); }, Math); // => [1, 2.5]
56818                      *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x':
56819                      * 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
56820                      */
56821                     function uniq(array, isSorted, iteratee, thisArg) {
56822                         var length = array ? array.length : 0;
56823                         if (!length) {
56824                             return [];
56825                         }
56826                         if (isSorted != null && typeof isSorted != 'boolean') {
56827                             thisArg = iteratee;
56828                             iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
56829                             isSorted = false;
56830                         }
56831                         var callback = getCallback();
56832                         if (!(iteratee == null && callback === baseCallback)) {
56833                             iteratee = callback(iteratee, thisArg, 3);
56834                         }
56835                         return (isSorted && getIndexOf() == baseIndexOf) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
56836                     }
56837
56838                     /**
56839                      * This method is like `_.zip` except that it accepts an array of grouped
56840                      * elements and creates an array regrouping the elements to their pre-zip
56841                      * configuration.
56842                      * 
56843                      * @static
56844                      * @memberOf _
56845                      * @category Array
56846                      * @param {Array}
56847                      *            array The array of grouped elements to process.
56848                      * @returns {Array} Returns the new array of regrouped elements.
56849                      * @example
56850                      * 
56851                      * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); // =>
56852                      * [['fred', 30, true], ['barney', 40, false]]
56853                      * 
56854                      * _.unzip(zipped); // => [['fred', 'barney'], [30, 40], [true, false]]
56855                      */
56856                     function unzip(array) {
56857                         if (!(array && array.length)) {
56858                             return [];
56859                         }
56860                         var index = -1,
56861                             length = 0;
56862
56863                         array = arrayFilter(array, function(group) {
56864                             if (isArrayLike(group)) {
56865                                 length = nativeMax(group.length, length);
56866                                 return true;
56867                             }
56868                         });
56869                         var result = Array(length);
56870                         while (++index < length) {
56871                             result[index] = arrayMap(array, baseProperty(index));
56872                         }
56873                         return result;
56874                     }
56875
56876                     /**
56877                      * This method is like `_.unzip` except that it accepts an iteratee to
56878                      * specify how regrouped values should be combined. The `iteratee` is bound
56879                      * to `thisArg` and invoked with four arguments: (accumulator, value, index,
56880                      * group).
56881                      * 
56882                      * @static
56883                      * @memberOf _
56884                      * @category Array
56885                      * @param {Array}
56886                      *            array The array of grouped elements to process.
56887                      * @param {Function}
56888                      *            [iteratee] The function to combine regrouped values.
56889                      * @param {*}
56890                      *            [thisArg] The `this` binding of `iteratee`.
56891                      * @returns {Array} Returns the new array of regrouped elements.
56892                      * @example
56893                      * 
56894                      * var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100],
56895                      * [2, 20, 200]]
56896                      * 
56897                      * _.unzipWith(zipped, _.add); // => [3, 30, 300]
56898                      */
56899                     function unzipWith(array, iteratee, thisArg) {
56900                         var length = array ? array.length : 0;
56901                         if (!length) {
56902                             return [];
56903                         }
56904                         var result = unzip(array);
56905                         if (iteratee == null) {
56906                             return result;
56907                         }
56908                         iteratee = bindCallback(iteratee, thisArg, 4);
56909                         return arrayMap(result, function(group) {
56910                             return arrayReduce(group, iteratee, undefined, true);
56911                         });
56912                     }
56913
56914                     /**
56915                      * Creates an array excluding all provided values using
56916                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56917                      * for equality comparisons.
56918                      * 
56919                      * @static
56920                      * @memberOf _
56921                      * @category Array
56922                      * @param {Array}
56923                      *            array The array to filter.
56924                      * @param {...*}
56925                      *            [values] The values to exclude.
56926                      * @returns {Array} Returns the new array of filtered values.
56927                      * @example
56928                      * 
56929                      * _.without([1, 2, 1, 3], 1, 2); // => [3]
56930                      */
56931                     var without = restParam(function(array, values) {
56932                         return isArrayLike(array) ? baseDifference(array, values) : [];
56933                     });
56934
56935                     /**
56936                      * Creates an array of unique values that is the [symmetric
56937                      * difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the
56938                      * provided arrays.
56939                      * 
56940                      * @static
56941                      * @memberOf _
56942                      * @category Array
56943                      * @param {...Array}
56944                      *            [arrays] The arrays to inspect.
56945                      * @returns {Array} Returns the new array of values.
56946                      * @example
56947                      * 
56948                      * _.xor([1, 2], [4, 2]); // => [1, 4]
56949                      */
56950                     function xor() {
56951                         var index = -1,
56952                             length = arguments.length;
56953
56954                         while (++index < length) {
56955                             var array = arguments[index];
56956                             if (isArrayLike(array)) {
56957                                 var result = result ? arrayPush(baseDifference(result, array), baseDifference(array, result)) : array;
56958                             }
56959                         }
56960                         return result ? baseUniq(result) : [];
56961                     }
56962
56963                     /**
56964                      * Creates an array of grouped elements, the first of which contains the
56965                      * first elements of the given arrays, the second of which contains the
56966                      * second elements of the given arrays, and so on.
56967                      * 
56968                      * @static
56969                      * @memberOf _
56970                      * @category Array
56971                      * @param {...Array}
56972                      *            [arrays] The arrays to process.
56973                      * @returns {Array} Returns the new array of grouped elements.
56974                      * @example
56975                      * 
56976                      * _.zip(['fred', 'barney'], [30, 40], [true, false]); // => [['fred', 30,
56977                      * true], ['barney', 40, false]]
56978                      */
56979                     var zip = restParam(unzip);
56980
56981                     /**
56982                      * The inverse of `_.pairs`; this method returns an object composed from
56983                      * arrays of property names and values. Provide either a single two
56984                      * dimensional array, e.g. `[[key1, value1], [key2, value2]]` or two arrays,
56985                      * one of property names and one of corresponding values.
56986                      * 
56987                      * @static
56988                      * @memberOf _
56989                      * @alias object
56990                      * @category Array
56991                      * @param {Array}
56992                      *            props The property names.
56993                      * @param {Array}
56994                      *            [values=[]] The property values.
56995                      * @returns {Object} Returns the new object.
56996                      * @example
56997                      * 
56998                      * _.zipObject([['fred', 30], ['barney', 40]]); // => { 'fred': 30,
56999                      * 'barney': 40 }
57000                      * 
57001                      * _.zipObject(['fred', 'barney'], [30, 40]); // => { 'fred': 30, 'barney':
57002                      * 40 }
57003                      */
57004                     function zipObject(props, values) {
57005                         var index = -1,
57006                             length = props ? props.length : 0,
57007                             result = {};
57008
57009                         if (length && !values && !isArray(props[0])) {
57010                             values = [];
57011                         }
57012                         while (++index < length) {
57013                             var key = props[index];
57014                             if (values) {
57015                                 result[key] = values[index];
57016                             } else if (key) {
57017                                 result[key[0]] = key[1];
57018                             }
57019                         }
57020                         return result;
57021                     }
57022
57023                     /**
57024                      * This method is like `_.zip` except that it accepts an iteratee to specify
57025                      * how grouped values should be combined. The `iteratee` is bound to
57026                      * `thisArg` and invoked with four arguments: (accumulator, value, index,
57027                      * group).
57028                      * 
57029                      * @static
57030                      * @memberOf _
57031                      * @category Array
57032                      * @param {...Array}
57033                      *            [arrays] The arrays to process.
57034                      * @param {Function}
57035                      *            [iteratee] The function to combine grouped values.
57036                      * @param {*}
57037                      *            [thisArg] The `this` binding of `iteratee`.
57038                      * @returns {Array} Returns the new array of grouped elements.
57039                      * @example
57040                      * 
57041                      * _.zipWith([1, 2], [10, 20], [100, 200], _.add); // => [111, 222]
57042                      */
57043                     var zipWith = restParam(function(arrays) {
57044                         var length = arrays.length,
57045                             iteratee = length > 2 ? arrays[length - 2] : undefined,
57046                             thisArg = length > 1 ? arrays[length - 1] : undefined;
57047
57048                         if (length > 2 && typeof iteratee == 'function') {
57049                             length -= 2;
57050                         } else {
57051                             iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
57052                             thisArg = undefined;
57053                         }
57054                         arrays.length = length;
57055                         return unzipWith(arrays, iteratee, thisArg);
57056                     });
57057
57058                     /*------------------------------------------------------------------------*/
57059
57060                     /**
57061                      * Creates a `lodash` object that wraps `value` with explicit method
57062                      * chaining enabled.
57063                      * 
57064                      * @static
57065                      * @memberOf _
57066                      * @category Chain
57067                      * @param {*}
57068                      *            value The value to wrap.
57069                      * @returns {Object} Returns the new `lodash` wrapper instance.
57070                      * @example
57071                      * 
57072                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57073                      * 40 }, { 'user': 'pebbles', 'age': 1 } ];
57074                      * 
57075                      * var youngest = _.chain(users) .sortBy('age') .map(function(chr) { return
57076                      * chr.user + ' is ' + chr.age; }) .first() .value(); // => 'pebbles is 1'
57077                      */
57078                     function chain(value) {
57079                         var result = lodash(value);
57080                         result.__chain__ = true;
57081                         return result;
57082                     }
57083
57084                     /**
57085                      * This method invokes `interceptor` and returns `value`. The interceptor is
57086                      * bound to `thisArg` and invoked with one argument; (value). The purpose of
57087                      * this method is to "tap into" a method chain in order to perform
57088                      * operations on intermediate results within the chain.
57089                      * 
57090                      * @static
57091                      * @memberOf _
57092                      * @category Chain
57093                      * @param {*}
57094                      *            value The value to provide to `interceptor`.
57095                      * @param {Function}
57096                      *            interceptor The function to invoke.
57097                      * @param {*}
57098                      *            [thisArg] The `this` binding of `interceptor`.
57099                      * @returns {*} Returns `value`.
57100                      * @example
57101                      * 
57102                      * _([1, 2, 3]) .tap(function(array) { array.pop(); }) .reverse() .value(); // =>
57103                      * [2, 1]
57104                      */
57105                     function tap(value, interceptor, thisArg) {
57106                         interceptor.call(thisArg, value);
57107                         return value;
57108                     }
57109
57110                     /**
57111                      * This method is like `_.tap` except that it returns the result of
57112                      * `interceptor`.
57113                      * 
57114                      * @static
57115                      * @memberOf _
57116                      * @category Chain
57117                      * @param {*}
57118                      *            value The value to provide to `interceptor`.
57119                      * @param {Function}
57120                      *            interceptor The function to invoke.
57121                      * @param {*}
57122                      *            [thisArg] The `this` binding of `interceptor`.
57123                      * @returns {*} Returns the result of `interceptor`.
57124                      * @example
57125                      * 
57126                      * _(' abc ') .chain() .trim() .thru(function(value) { return [value]; })
57127                      * .value(); // => ['abc']
57128                      */
57129                     function thru(value, interceptor, thisArg) {
57130                         return interceptor.call(thisArg, value);
57131                     }
57132
57133                     /**
57134                      * Enables explicit method chaining on the wrapper object.
57135                      * 
57136                      * @name chain
57137                      * @memberOf _
57138                      * @category Chain
57139                      * @returns {Object} Returns the new `lodash` wrapper instance.
57140                      * @example
57141                      * 
57142                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57143                      * 40 } ];
57144                      *  // without explicit chaining _(users).first(); // => { 'user': 'barney',
57145                      * 'age': 36 }
57146                      *  // with explicit chaining _(users).chain() .first() .pick('user')
57147                      * .value(); // => { 'user': 'barney' }
57148                      */
57149                     function wrapperChain() {
57150                         return chain(this);
57151                     }
57152
57153                     /**
57154                      * Executes the chained sequence and returns the wrapped result.
57155                      * 
57156                      * @name commit
57157                      * @memberOf _
57158                      * @category Chain
57159                      * @returns {Object} Returns the new `lodash` wrapper instance.
57160                      * @example
57161                      * 
57162                      * var array = [1, 2]; var wrapped = _(array).push(3);
57163                      * 
57164                      * console.log(array); // => [1, 2]
57165                      * 
57166                      * wrapped = wrapped.commit(); console.log(array); // => [1, 2, 3]
57167                      * 
57168                      * wrapped.last(); // => 3
57169                      * 
57170                      * console.log(array); // => [1, 2, 3]
57171                      */
57172                     function wrapperCommit() {
57173                         return new LodashWrapper(this.value(), this.__chain__);
57174                     }
57175
57176                     /**
57177                      * Creates a new array joining a wrapped array with any additional arrays
57178                      * and/or values.
57179                      * 
57180                      * @name concat
57181                      * @memberOf _
57182                      * @category Chain
57183                      * @param {...*}
57184                      *            [values] The values to concatenate.
57185                      * @returns {Array} Returns the new concatenated array.
57186                      * @example
57187                      * 
57188                      * var array = [1]; var wrapped = _(array).concat(2, [3], [[4]]);
57189                      * 
57190                      * console.log(wrapped.value()); // => [1, 2, 3, [4]]
57191                      * 
57192                      * console.log(array); // => [1]
57193                      */
57194                     var wrapperConcat = restParam(function(values) {
57195                         values = baseFlatten(values);
57196                         return this.thru(function(array) {
57197                             return arrayConcat(isArray(array) ? array : [toObject(array)], values);
57198                         });
57199                     });
57200
57201                     /**
57202                      * Creates a clone of the chained sequence planting `value` as the wrapped
57203                      * value.
57204                      * 
57205                      * @name plant
57206                      * @memberOf _
57207                      * @category Chain
57208                      * @returns {Object} Returns the new `lodash` wrapper instance.
57209                      * @example
57210                      * 
57211                      * var array = [1, 2]; var wrapped = _(array).map(function(value) { return
57212                      * Math.pow(value, 2); });
57213                      * 
57214                      * var other = [3, 4]; var otherWrapped = wrapped.plant(other);
57215                      * 
57216                      * otherWrapped.value(); // => [9, 16]
57217                      * 
57218                      * wrapped.value(); // => [1, 4]
57219                      */
57220                     function wrapperPlant(value) {
57221                         var result,
57222                             parent = this;
57223
57224                         while (parent instanceof baseLodash) {
57225                             var clone = wrapperClone(parent);
57226                             if (result) {
57227                                 previous.__wrapped__ = clone;
57228                             } else {
57229                                 result = clone;
57230                             }
57231                             var previous = clone;
57232                             parent = parent.__wrapped__;
57233                         }
57234                         previous.__wrapped__ = value;
57235                         return result;
57236                     }
57237
57238                     /**
57239                      * Reverses the wrapped array so the first element becomes the last, the
57240                      * second element becomes the second to last, and so on.
57241                      * 
57242                      * **Note:** This method mutates the wrapped array.
57243                      * 
57244                      * @name reverse
57245                      * @memberOf _
57246                      * @category Chain
57247                      * @returns {Object} Returns the new reversed `lodash` wrapper instance.
57248                      * @example
57249                      * 
57250                      * var array = [1, 2, 3];
57251                      * 
57252                      * _(array).reverse().value() // => [3, 2, 1]
57253                      * 
57254                      * console.log(array); // => [3, 2, 1]
57255                      */
57256                     function wrapperReverse() {
57257                         var value = this.__wrapped__;
57258
57259                         var interceptor = function(value) {
57260                             return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
57261                         };
57262                         if (value instanceof LazyWrapper) {
57263                             var wrapped = value;
57264                             if (this.__actions__.length) {
57265                                 wrapped = new LazyWrapper(this);
57266                             }
57267                             wrapped = wrapped.reverse();
57268                             wrapped.__actions__.push({
57269                                 'func': thru,
57270                                 'args': [interceptor],
57271                                 'thisArg': undefined
57272                             });
57273                             return new LodashWrapper(wrapped, this.__chain__);
57274                         }
57275                         return this.thru(interceptor);
57276                     }
57277
57278                     /**
57279                      * Produces the result of coercing the unwrapped value to a string.
57280                      * 
57281                      * @name toString
57282                      * @memberOf _
57283                      * @category Chain
57284                      * @returns {string} Returns the coerced string value.
57285                      * @example
57286                      * 
57287                      * _([1, 2, 3]).toString(); // => '1,2,3'
57288                      */
57289                     function wrapperToString() {
57290                         return (this.value() + '');
57291                     }
57292
57293                     /**
57294                      * Executes the chained sequence to extract the unwrapped value.
57295                      * 
57296                      * @name value
57297                      * @memberOf _
57298                      * @alias run, toJSON, valueOf
57299                      * @category Chain
57300                      * @returns {*} Returns the resolved unwrapped value.
57301                      * @example
57302                      * 
57303                      * _([1, 2, 3]).value(); // => [1, 2, 3]
57304                      */
57305                     function wrapperValue() {
57306                         return baseWrapperValue(this.__wrapped__, this.__actions__);
57307                     }
57308
57309                     /*------------------------------------------------------------------------*/
57310
57311                     /**
57312                      * Creates an array of elements corresponding to the given keys, or indexes,
57313                      * of `collection`. Keys may be specified as individual arguments or as
57314                      * arrays of keys.
57315                      * 
57316                      * @static
57317                      * @memberOf _
57318                      * @category Collection
57319                      * @param {Array|Object|string}
57320                      *            collection The collection to iterate over.
57321                      * @param {...(number|number[]|string|string[])}
57322                      *            [props] The property names or indexes of elements to pick,
57323                      *            specified individually or in arrays.
57324                      * @returns {Array} Returns the new array of picked elements.
57325                      * @example
57326                      * 
57327                      * _.at(['a', 'b', 'c'], [0, 2]); // => ['a', 'c']
57328                      * 
57329                      * _.at(['barney', 'fred', 'pebbles'], 0, 2); // => ['barney', 'pebbles']
57330                      */
57331                     var at = restParam(function(collection, props) {
57332                         return baseAt(collection, baseFlatten(props));
57333                     });
57334
57335                     /**
57336                      * Creates an object composed of keys generated from the results of running
57337                      * each element of `collection` through `iteratee`. The corresponding value
57338                      * of each key is the number of times the key was returned by `iteratee`.
57339                      * The `iteratee` is bound to `thisArg` and invoked with three arguments:
57340                      * (value, index|key, collection).
57341                      * 
57342                      * If a property name is provided for `iteratee` the created `_.property`
57343                      * style callback returns the property value of the given element.
57344                      * 
57345                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57346                      * style callback returns `true` for elements that have a matching property
57347                      * value, else `false`.
57348                      * 
57349                      * If an object is provided for `iteratee` the created `_.matches` style
57350                      * callback returns `true` for elements that have the properties of the
57351                      * given object, else `false`.
57352                      * 
57353                      * @static
57354                      * @memberOf _
57355                      * @category Collection
57356                      * @param {Array|Object|string}
57357                      *            collection The collection to iterate over.
57358                      * @param {Function|Object|string}
57359                      *            [iteratee=_.identity] The function invoked per iteration.
57360                      * @param {*}
57361                      *            [thisArg] The `this` binding of `iteratee`.
57362                      * @returns {Object} Returns the composed aggregate object.
57363                      * @example
57364                      * 
57365                      * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57366                      * '4': 1, '6': 2 }
57367                      * 
57368                      * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57369                      * '4': 1, '6': 2 }
57370                      * 
57371                      * _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 }
57372                      */
57373                     var countBy = createAggregator(function(result, value, key) {
57374                         hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
57375                     });
57376
57377                     /**
57378                      * Checks if `predicate` returns truthy for **all** elements of
57379                      * `collection`. The predicate is bound to `thisArg` and invoked with three
57380                      * arguments: (value, index|key, collection).
57381                      * 
57382                      * If a property name is provided for `predicate` the created `_.property`
57383                      * style callback returns the property value of the given element.
57384                      * 
57385                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57386                      * style callback returns `true` for elements that have a matching property
57387                      * value, else `false`.
57388                      * 
57389                      * If an object is provided for `predicate` the created `_.matches` style
57390                      * callback returns `true` for elements that have the properties of the
57391                      * given object, else `false`.
57392                      * 
57393                      * @static
57394                      * @memberOf _
57395                      * @alias all
57396                      * @category Collection
57397                      * @param {Array|Object|string}
57398                      *            collection The collection to iterate over.
57399                      * @param {Function|Object|string}
57400                      *            [predicate=_.identity] The function invoked per iteration.
57401                      * @param {*}
57402                      *            [thisArg] The `this` binding of `predicate`.
57403                      * @returns {boolean} Returns `true` if all elements pass the predicate
57404                      *          check, else `false`.
57405                      * @example
57406                      * 
57407                      * _.every([true, 1, null, 'yes'], Boolean); // => false
57408                      * 
57409                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
57410                      * 'active': false } ];
57411                      *  // using the `_.matches` callback shorthand _.every(users, { 'user':
57412                      * 'barney', 'active': false }); // => false
57413                      *  // using the `_.matchesProperty` callback shorthand _.every(users,
57414                      * 'active', false); // => true
57415                      *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
57416                      * false
57417                      */
57418                     function every(collection, predicate, thisArg) {
57419                         var func = isArray(collection) ? arrayEvery : baseEvery;
57420                         if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
57421                             predicate = undefined;
57422                         }
57423                         if (typeof predicate != 'function' || thisArg !== undefined) {
57424                             predicate = getCallback(predicate, thisArg, 3);
57425                         }
57426                         return func(collection, predicate);
57427                     }
57428
57429                     /**
57430                      * Iterates over elements of `collection`, returning an array of all
57431                      * elements `predicate` returns truthy for. The predicate is bound to
57432                      * `thisArg` and invoked with three arguments: (value, index|key,
57433                      * collection).
57434                      * 
57435                      * If a property name is provided for `predicate` the created `_.property`
57436                      * style callback returns the property value of the given element.
57437                      * 
57438                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57439                      * style callback returns `true` for elements that have a matching property
57440                      * value, else `false`.
57441                      * 
57442                      * If an object is provided for `predicate` the created `_.matches` style
57443                      * callback returns `true` for elements that have the properties of the
57444                      * given object, else `false`.
57445                      * 
57446                      * @static
57447                      * @memberOf _
57448                      * @alias select
57449                      * @category Collection
57450                      * @param {Array|Object|string}
57451                      *            collection The collection to iterate over.
57452                      * @param {Function|Object|string}
57453                      *            [predicate=_.identity] The function invoked per iteration.
57454                      * @param {*}
57455                      *            [thisArg] The `this` binding of `predicate`.
57456                      * @returns {Array} Returns the new filtered array.
57457                      * @example
57458                      * 
57459                      * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
57460                      * 
57461                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57462                      * 'fred', 'age': 40, 'active': false } ];
57463                      *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, {
57464                      * 'age': 36, 'active': true }), 'user'); // => ['barney']
57465                      *  // using the `_.matchesProperty` callback shorthand
57466                      * _.pluck(_.filter(users, 'active', false), 'user'); // => ['fred']
57467                      *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
57468                      * 'active'), 'user'); // => ['barney']
57469                      */
57470                     function filter(collection, predicate, thisArg) {
57471                         var func = isArray(collection) ? arrayFilter : baseFilter;
57472                         predicate = getCallback(predicate, thisArg, 3);
57473                         return func(collection, predicate);
57474                     }
57475
57476                     /**
57477                      * Iterates over elements of `collection`, returning the first element
57478                      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
57479                      * invoked with three arguments: (value, index|key, collection).
57480                      * 
57481                      * If a property name is provided for `predicate` the created `_.property`
57482                      * style callback returns the property value of the given element.
57483                      * 
57484                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57485                      * style callback returns `true` for elements that have a matching property
57486                      * value, else `false`.
57487                      * 
57488                      * If an object is provided for `predicate` the created `_.matches` style
57489                      * callback returns `true` for elements that have the properties of the
57490                      * given object, else `false`.
57491                      * 
57492                      * @static
57493                      * @memberOf _
57494                      * @alias detect
57495                      * @category Collection
57496                      * @param {Array|Object|string}
57497                      *            collection The collection to search.
57498                      * @param {Function|Object|string}
57499                      *            [predicate=_.identity] The function invoked per iteration.
57500                      * @param {*}
57501                      *            [thisArg] The `this` binding of `predicate`.
57502                      * @returns {*} Returns the matched element, else `undefined`.
57503                      * @example
57504                      * 
57505                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57506                      * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
57507                      * 'active': true } ];
57508                      * 
57509                      * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
57510                      * 'barney'
57511                      *  // using the `_.matches` callback shorthand _.result(_.find(users, {
57512                      * 'age': 1, 'active': true }), 'user'); // => 'pebbles'
57513                      *  // using the `_.matchesProperty` callback shorthand
57514                      * _.result(_.find(users, 'active', false), 'user'); // => 'fred'
57515                      *  // using the `_.property` callback shorthand _.result(_.find(users,
57516                      * 'active'), 'user'); // => 'barney'
57517                      */
57518                     var find = createFind(baseEach);
57519
57520                     /**
57521                      * This method is like `_.find` except that it iterates over elements of
57522                      * `collection` from right to left.
57523                      * 
57524                      * @static
57525                      * @memberOf _
57526                      * @category Collection
57527                      * @param {Array|Object|string}
57528                      *            collection The collection to search.
57529                      * @param {Function|Object|string}
57530                      *            [predicate=_.identity] The function invoked per iteration.
57531                      * @param {*}
57532                      *            [thisArg] The `this` binding of `predicate`.
57533                      * @returns {*} Returns the matched element, else `undefined`.
57534                      * @example
57535                      * 
57536                      * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3
57537                      */
57538                     var findLast = createFind(baseEachRight, true);
57539
57540                     /**
57541                      * Performs a deep comparison between each element in `collection` and the
57542                      * source object, returning the first element that has equivalent property
57543                      * values.
57544                      * 
57545                      * **Note:** This method supports comparing arrays, booleans, `Date`
57546                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
57547                      * compared by their own, not inherited, enumerable properties. For
57548                      * comparing a single own or inherited property value see
57549                      * `_.matchesProperty`.
57550                      * 
57551                      * @static
57552                      * @memberOf _
57553                      * @category Collection
57554                      * @param {Array|Object|string}
57555                      *            collection The collection to search.
57556                      * @param {Object}
57557                      *            source The object of property values to match.
57558                      * @returns {*} Returns the matched element, else `undefined`.
57559                      * @example
57560                      * 
57561                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57562                      * 'fred', 'age': 40, 'active': false } ];
57563                      * 
57564                      * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); // =>
57565                      * 'barney'
57566                      * 
57567                      * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); // =>
57568                      * 'fred'
57569                      */
57570                     function findWhere(collection, source) {
57571                         return find(collection, baseMatches(source));
57572                     }
57573
57574                     /**
57575                      * Iterates over elements of `collection` invoking `iteratee` for each
57576                      * element. The `iteratee` is bound to `thisArg` and invoked with three
57577                      * arguments: (value, index|key, collection). Iteratee functions may exit
57578                      * iteration early by explicitly returning `false`.
57579                      * 
57580                      * **Note:** As with other "Collections" methods, objects with a "length"
57581                      * property are iterated like arrays. To avoid this behavior `_.forIn` or
57582                      * `_.forOwn` may be used for object iteration.
57583                      * 
57584                      * @static
57585                      * @memberOf _
57586                      * @alias each
57587                      * @category Collection
57588                      * @param {Array|Object|string}
57589                      *            collection The collection to iterate over.
57590                      * @param {Function}
57591                      *            [iteratee=_.identity] The function invoked per iteration.
57592                      * @param {*}
57593                      *            [thisArg] The `this` binding of `iteratee`.
57594                      * @returns {Array|Object|string} Returns `collection`.
57595                      * @example
57596                      * 
57597                      * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs
57598                      * each value from left to right and returns the array
57599                      * 
57600                      * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
57601                      * logs each value-key pair and returns the object (iteration order is not
57602                      * guaranteed)
57603                      */
57604                     var forEach = createForEach(arrayEach, baseEach);
57605
57606                     /**
57607                      * This method is like `_.forEach` except that it iterates over elements of
57608                      * `collection` from right to left.
57609                      * 
57610                      * @static
57611                      * @memberOf _
57612                      * @alias eachRight
57613                      * @category Collection
57614                      * @param {Array|Object|string}
57615                      *            collection The collection to iterate over.
57616                      * @param {Function}
57617                      *            [iteratee=_.identity] The function invoked per iteration.
57618                      * @param {*}
57619                      *            [thisArg] The `this` binding of `iteratee`.
57620                      * @returns {Array|Object|string} Returns `collection`.
57621                      * @example
57622                      * 
57623                      * _([1, 2]).forEachRight(function(n) { console.log(n); }).value(); // =>
57624                      * logs each value from right to left and returns the array
57625                      */
57626                     var forEachRight = createForEach(arrayEachRight, baseEachRight);
57627
57628                     /**
57629                      * Creates an object composed of keys generated from the results of running
57630                      * each element of `collection` through `iteratee`. The corresponding value
57631                      * of each key is an array of the elements responsible for generating the
57632                      * key. The `iteratee` is bound to `thisArg` and invoked with three
57633                      * arguments: (value, index|key, collection).
57634                      * 
57635                      * If a property name is provided for `iteratee` the created `_.property`
57636                      * style callback returns the property value of the given element.
57637                      * 
57638                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57639                      * style callback returns `true` for elements that have a matching property
57640                      * value, else `false`.
57641                      * 
57642                      * If an object is provided for `iteratee` the created `_.matches` style
57643                      * callback returns `true` for elements that have the properties of the
57644                      * given object, else `false`.
57645                      * 
57646                      * @static
57647                      * @memberOf _
57648                      * @category Collection
57649                      * @param {Array|Object|string}
57650                      *            collection The collection to iterate over.
57651                      * @param {Function|Object|string}
57652                      *            [iteratee=_.identity] The function invoked per iteration.
57653                      * @param {*}
57654                      *            [thisArg] The `this` binding of `iteratee`.
57655                      * @returns {Object} Returns the composed aggregate object.
57656                      * @example
57657                      * 
57658                      * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57659                      * '4': [4.2], '6': [6.1, 6.4] }
57660                      * 
57661                      * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57662                      * '4': [4.2], '6': [6.1, 6.4] }
57663                      *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
57664                      * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
57665                      */
57666                     var groupBy = createAggregator(function(result, value, key) {
57667                         if (hasOwnProperty.call(result, key)) {
57668                             result[key].push(value);
57669                         } else {
57670                             result[key] = [value];
57671                         }
57672                     });
57673
57674                     /**
57675                      * Checks if `value` is in `collection` using
57676                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
57677                      * for equality comparisons. If `fromIndex` is negative, it is used as the
57678                      * offset from the end of `collection`.
57679                      * 
57680                      * @static
57681                      * @memberOf _
57682                      * @alias contains, include
57683                      * @category Collection
57684                      * @param {Array|Object|string}
57685                      *            collection The collection to search.
57686                      * @param {*}
57687                      *            target The value to search for.
57688                      * @param {number}
57689                      *            [fromIndex=0] The index to search from.
57690                      * @param- {Object} [guard] Enables use as a callback for functions like
57691                      *         `_.reduce`.
57692                      * @returns {boolean} Returns `true` if a matching element is found, else
57693                      *          `false`.
57694                      * @example
57695                      * 
57696                      * _.includes([1, 2, 3], 1); // => true
57697                      * 
57698                      * _.includes([1, 2, 3], 1, 2); // => false
57699                      * 
57700                      * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
57701                      * 
57702                      * _.includes('pebbles', 'eb'); // => true
57703                      */
57704                     function includes(collection, target, fromIndex, guard) {
57705                         var length = collection ? getLength(collection) : 0;
57706                         if (!isLength(length)) {
57707                             collection = values(collection);
57708                             length = collection.length;
57709                         }
57710                         if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
57711                             fromIndex = 0;
57712                         } else {
57713                             fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
57714                         }
57715                         return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && getIndexOf(collection, target, fromIndex) > -1);
57716                     }
57717
57718                     /**
57719                      * Creates an object composed of keys generated from the results of running
57720                      * each element of `collection` through `iteratee`. The corresponding value
57721                      * of each key is the last element responsible for generating the key. The
57722                      * iteratee function is bound to `thisArg` and invoked with three arguments:
57723                      * (value, index|key, collection).
57724                      * 
57725                      * If a property name is provided for `iteratee` the created `_.property`
57726                      * style callback returns the property value of the given element.
57727                      * 
57728                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57729                      * style callback returns `true` for elements that have a matching property
57730                      * value, else `false`.
57731                      * 
57732                      * If an object is provided for `iteratee` the created `_.matches` style
57733                      * callback returns `true` for elements that have the properties of the
57734                      * given object, else `false`.
57735                      * 
57736                      * @static
57737                      * @memberOf _
57738                      * @category Collection
57739                      * @param {Array|Object|string}
57740                      *            collection The collection to iterate over.
57741                      * @param {Function|Object|string}
57742                      *            [iteratee=_.identity] The function invoked per iteration.
57743                      * @param {*}
57744                      *            [thisArg] The `this` binding of `iteratee`.
57745                      * @returns {Object} Returns the composed aggregate object.
57746                      * @example
57747                      * 
57748                      * var keyData = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code':
57749                      * 100 } ];
57750                      * 
57751                      * _.indexBy(keyData, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 },
57752                      * 'right': { 'dir': 'right', 'code': 100 } }
57753                      * 
57754                      * _.indexBy(keyData, function(object) { return
57755                      * String.fromCharCode(object.code); }); // => { 'a': { 'dir': 'left',
57756                      * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57757                      * 
57758                      * _.indexBy(keyData, function(object) { return
57759                      * this.fromCharCode(object.code); }, String); // => { 'a': { 'dir': 'left',
57760                      * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57761                      */
57762                     var indexBy = createAggregator(function(result, value, key) {
57763                         result[key] = value;
57764                     });
57765
57766                     /**
57767                      * Invokes the method at `path` of each element in `collection`, returning
57768                      * an array of the results of each invoked method. Any additional arguments
57769                      * are provided to each invoked method. If `methodName` is a function it is
57770                      * invoked for, and `this` bound to, each element in `collection`.
57771                      * 
57772                      * @static
57773                      * @memberOf _
57774                      * @category Collection
57775                      * @param {Array|Object|string}
57776                      *            collection The collection to iterate over.
57777                      * @param {Array|Function|string}
57778                      *            path The path of the method to invoke or the function invoked
57779                      *            per iteration.
57780                      * @param {...*}
57781                      *            [args] The arguments to invoke the method with.
57782                      * @returns {Array} Returns the array of results.
57783                      * @example
57784                      * 
57785                      * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); // => [[1, 5, 7], [1, 2, 3]]
57786                      * 
57787                      * _.invoke([123, 456], String.prototype.split, ''); // => [['1', '2', '3'],
57788                      * ['4', '5', '6']]
57789                      */
57790                     var invoke = restParam(function(collection, path, args) {
57791                         var index = -1,
57792                             isFunc = typeof path == 'function',
57793                             isProp = isKey(path),
57794                             result = isArrayLike(collection) ? Array(collection.length) : [];
57795
57796                         baseEach(collection, function(value) {
57797                             var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
57798                             result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
57799                         });
57800                         return result;
57801                     });
57802
57803                     /**
57804                      * Creates an array of values by running each element in `collection`
57805                      * through `iteratee`. The `iteratee` is bound to `thisArg` and invoked with
57806                      * three arguments: (value, index|key, collection).
57807                      * 
57808                      * If a property name is provided for `iteratee` the created `_.property`
57809                      * style callback returns the property value of the given element.
57810                      * 
57811                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57812                      * style callback returns `true` for elements that have a matching property
57813                      * value, else `false`.
57814                      * 
57815                      * If an object is provided for `iteratee` the created `_.matches` style
57816                      * callback returns `true` for elements that have the properties of the
57817                      * given object, else `false`.
57818                      * 
57819                      * Many lodash methods are guarded to work as iteratees for methods like
57820                      * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
57821                      * 
57822                      * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
57823                      * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
57824                      * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`,
57825                      * `takeRight`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
57826                      * `random`, `range`, `sample`, `some`, `sum`, `uniq`, and `words`
57827                      * 
57828                      * @static
57829                      * @memberOf _
57830                      * @alias collect
57831                      * @category Collection
57832                      * @param {Array|Object|string}
57833                      *            collection The collection to iterate over.
57834                      * @param {Function|Object|string}
57835                      *            [iteratee=_.identity] The function invoked per iteration.
57836                      * @param {*}
57837                      *            [thisArg] The `this` binding of `iteratee`.
57838                      * @returns {Array} Returns the new mapped array.
57839                      * @example
57840                      * 
57841                      * function timesThree(n) { return n * 3; }
57842                      * 
57843                      * _.map([1, 2], timesThree); // => [3, 6]
57844                      * 
57845                      * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is
57846                      * not guaranteed)
57847                      * 
57848                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
57849                      *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
57850                      * ['barney', 'fred']
57851                      */
57852                     function map(collection, iteratee, thisArg) {
57853                         var func = isArray(collection) ? arrayMap : baseMap;
57854                         iteratee = getCallback(iteratee, thisArg, 3);
57855                         return func(collection, iteratee);
57856                     }
57857
57858                     /**
57859                      * Creates an array of elements split into two groups, the first of which
57860                      * contains elements `predicate` returns truthy for, while the second of
57861                      * which contains elements `predicate` returns falsey for. The predicate is
57862                      * bound to `thisArg` and invoked with three arguments: (value, index|key,
57863                      * collection).
57864                      * 
57865                      * If a property name is provided for `predicate` the created `_.property`
57866                      * style callback returns the property value of the given element.
57867                      * 
57868                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57869                      * style callback returns `true` for elements that have a matching property
57870                      * value, else `false`.
57871                      * 
57872                      * If an object is provided for `predicate` the created `_.matches` style
57873                      * callback returns `true` for elements that have the properties of the
57874                      * given object, else `false`.
57875                      * 
57876                      * @static
57877                      * @memberOf _
57878                      * @category Collection
57879                      * @param {Array|Object|string}
57880                      *            collection The collection to iterate over.
57881                      * @param {Function|Object|string}
57882                      *            [predicate=_.identity] The function invoked per iteration.
57883                      * @param {*}
57884                      *            [thisArg] The `this` binding of `predicate`.
57885                      * @returns {Array} Returns the array of grouped elements.
57886                      * @example
57887                      * 
57888                      * _.partition([1, 2, 3], function(n) { return n % 2; }); // => [[1, 3],
57889                      * [2]]
57890                      * 
57891                      * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; },
57892                      * Math); // => [[1.2, 3.4], [2.3]]
57893                      * 
57894                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57895                      * 'fred', 'age': 40, 'active': true }, { 'user': 'pebbles', 'age': 1,
57896                      * 'active': false } ];
57897                      * 
57898                      * var mapper = function(array) { return _.pluck(array, 'user'); };
57899                      *  // using the `_.matches` callback shorthand _.map(_.partition(users, {
57900                      * 'age': 1, 'active': false }), mapper); // => [['pebbles'], ['barney',
57901                      * 'fred']]
57902                      *  // using the `_.matchesProperty` callback shorthand
57903                      * _.map(_.partition(users, 'active', false), mapper); // => [['barney',
57904                      * 'pebbles'], ['fred']]
57905                      *  // using the `_.property` callback shorthand _.map(_.partition(users,
57906                      * 'active'), mapper); // => [['fred'], ['barney', 'pebbles']]
57907                      */
57908                     var partition = createAggregator(function(result, value, key) {
57909                         result[key ? 0 : 1].push(value);
57910                     }, function() {
57911                         return [
57912                             [],
57913                             []
57914                         ];
57915                     });
57916
57917                     /**
57918                      * Gets the property value of `path` from all elements in `collection`.
57919                      * 
57920                      * @static
57921                      * @memberOf _
57922                      * @category Collection
57923                      * @param {Array|Object|string}
57924                      *            collection The collection to iterate over.
57925                      * @param {Array|string}
57926                      *            path The path of the property to pluck.
57927                      * @returns {Array} Returns the property values.
57928                      * @example
57929                      * 
57930                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57931                      * 40 } ];
57932                      * 
57933                      * _.pluck(users, 'user'); // => ['barney', 'fred']
57934                      * 
57935                      * var userIndex = _.indexBy(users, 'user'); _.pluck(userIndex, 'age'); // =>
57936                      * [36, 40] (iteration order is not guaranteed)
57937                      */
57938                     function pluck(collection, path) {
57939                         return map(collection, property(path));
57940                     }
57941
57942                     /**
57943                      * Reduces `collection` to a value which is the accumulated result of
57944                      * running each element in `collection` through `iteratee`, where each
57945                      * successive invocation is supplied the return value of the previous. If
57946                      * `accumulator` is not provided the first element of `collection` is used
57947                      * as the initial value. The `iteratee` is bound to `thisArg` and invoked
57948                      * with four arguments: (accumulator, value, index|key, collection).
57949                      * 
57950                      * Many lodash methods are guarded to work as iteratees for methods like
57951                      * `_.reduce`, `_.reduceRight`, and `_.transform`.
57952                      * 
57953                      * The guarded methods are: `assign`, `defaults`, `defaultsDeep`,
57954                      * `includes`, `merge`, `sortByAll`, and `sortByOrder`
57955                      * 
57956                      * @static
57957                      * @memberOf _
57958                      * @alias foldl, inject
57959                      * @category Collection
57960                      * @param {Array|Object|string}
57961                      *            collection The collection to iterate over.
57962                      * @param {Function}
57963                      *            [iteratee=_.identity] The function invoked per iteration.
57964                      * @param {*}
57965                      *            [accumulator] The initial value.
57966                      * @param {*}
57967                      *            [thisArg] The `this` binding of `iteratee`.
57968                      * @returns {*} Returns the accumulated value.
57969                      * @example
57970                      * 
57971                      * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
57972                      * 
57973                      * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n *
57974                      * 3; return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is
57975                      * not guaranteed)
57976                      */
57977                     var reduce = createReduce(arrayReduce, baseEach);
57978
57979                     /**
57980                      * This method is like `_.reduce` except that it iterates over elements of
57981                      * `collection` from right to left.
57982                      * 
57983                      * @static
57984                      * @memberOf _
57985                      * @alias foldr
57986                      * @category Collection
57987                      * @param {Array|Object|string}
57988                      *            collection The collection to iterate over.
57989                      * @param {Function}
57990                      *            [iteratee=_.identity] The function invoked per iteration.
57991                      * @param {*}
57992                      *            [accumulator] The initial value.
57993                      * @param {*}
57994                      *            [thisArg] The `this` binding of `iteratee`.
57995                      * @returns {*} Returns the accumulated value.
57996                      * @example
57997                      * 
57998                      * var array = [[0, 1], [2, 3], [4, 5]];
57999                      * 
58000                      * _.reduceRight(array, function(flattened, other) { return
58001                      * flattened.concat(other); }, []); // => [4, 5, 2, 3, 0, 1]
58002                      */
58003                     var reduceRight = createReduce(arrayReduceRight, baseEachRight);
58004
58005                     /**
58006                      * The opposite of `_.filter`; this method returns the elements of
58007                      * `collection` that `predicate` does **not** return truthy for.
58008                      * 
58009                      * @static
58010                      * @memberOf _
58011                      * @category Collection
58012                      * @param {Array|Object|string}
58013                      *            collection The collection to iterate over.
58014                      * @param {Function|Object|string}
58015                      *            [predicate=_.identity] The function invoked per iteration.
58016                      * @param {*}
58017                      *            [thisArg] The `this` binding of `predicate`.
58018                      * @returns {Array} Returns the new filtered array.
58019                      * @example
58020                      * 
58021                      * _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); // => [1, 3]
58022                      * 
58023                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
58024                      * 'fred', 'age': 40, 'active': true } ];
58025                      *  // using the `_.matches` callback shorthand _.pluck(_.reject(users, {
58026                      * 'age': 40, 'active': true }), 'user'); // => ['barney']
58027                      *  // using the `_.matchesProperty` callback shorthand
58028                      * _.pluck(_.reject(users, 'active', false), 'user'); // => ['fred']
58029                      *  // using the `_.property` callback shorthand _.pluck(_.reject(users,
58030                      * 'active'), 'user'); // => ['barney']
58031                      */
58032                     function reject(collection, predicate, thisArg) {
58033                         var func = isArray(collection) ? arrayFilter : baseFilter;
58034                         predicate = getCallback(predicate, thisArg, 3);
58035                         return func(collection, function(value, index, collection) {
58036                             return !predicate(value, index, collection);
58037                         });
58038                     }
58039
58040                     /**
58041                      * Gets a random element or `n` random elements from a collection.
58042                      * 
58043                      * @static
58044                      * @memberOf _
58045                      * @category Collection
58046                      * @param {Array|Object|string}
58047                      *            collection The collection to sample.
58048                      * @param {number}
58049                      *            [n] The number of elements to sample.
58050                      * @param- {Object} [guard] Enables use as a callback for functions like
58051                      *         `_.map`.
58052                      * @returns {*} Returns the random sample(s).
58053                      * @example
58054                      * 
58055                      * _.sample([1, 2, 3, 4]); // => 2
58056                      * 
58057                      * _.sample([1, 2, 3, 4], 2); // => [3, 1]
58058                      */
58059                     function sample(collection, n, guard) {
58060                         if (guard ? isIterateeCall(collection, n, guard) : n == null) {
58061                             collection = toIterable(collection);
58062                             var length = collection.length;
58063                             return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
58064                         }
58065                         var index = -1,
58066                             result = toArray(collection),
58067                             length = result.length,
58068                             lastIndex = length - 1;
58069
58070                         n = nativeMin(n < 0 ? 0 : (+n || 0), length);
58071                         while (++index < n) {
58072                             var rand = baseRandom(index, lastIndex),
58073                                 value = result[rand];
58074
58075                             result[rand] = result[index];
58076                             result[index] = value;
58077                         }
58078                         result.length = n;
58079                         return result;
58080                     }
58081
58082                     /**
58083                      * Creates an array of shuffled values, using a version of the [Fisher-Yates
58084                      * shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
58085                      * 
58086                      * @static
58087                      * @memberOf _
58088                      * @category Collection
58089                      * @param {Array|Object|string}
58090                      *            collection The collection to shuffle.
58091                      * @returns {Array} Returns the new shuffled array.
58092                      * @example
58093                      * 
58094                      * _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2]
58095                      */
58096                     function shuffle(collection) {
58097                         return sample(collection, POSITIVE_INFINITY);
58098                     }
58099
58100                     /**
58101                      * Gets the size of `collection` by returning its length for array-like
58102                      * values or the number of own enumerable properties for objects.
58103                      * 
58104                      * @static
58105                      * @memberOf _
58106                      * @category Collection
58107                      * @param {Array|Object|string}
58108                      *            collection The collection to inspect.
58109                      * @returns {number} Returns the size of `collection`.
58110                      * @example
58111                      * 
58112                      * _.size([1, 2, 3]); // => 3
58113                      * 
58114                      * _.size({ 'a': 1, 'b': 2 }); // => 2
58115                      * 
58116                      * _.size('pebbles'); // => 7
58117                      */
58118                     function size(collection) {
58119                         var length = collection ? getLength(collection) : 0;
58120                         return isLength(length) ? length : keys(collection).length;
58121                     }
58122
58123                     /**
58124                      * Checks if `predicate` returns truthy for **any** element of `collection`.
58125                      * The function returns as soon as it finds a passing value and does not
58126                      * iterate over the entire collection. The predicate is bound to `thisArg`
58127                      * and invoked with three arguments: (value, index|key, collection).
58128                      * 
58129                      * If a property name is provided for `predicate` the created `_.property`
58130                      * style callback returns the property value of the given element.
58131                      * 
58132                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
58133                      * style callback returns `true` for elements that have a matching property
58134                      * value, else `false`.
58135                      * 
58136                      * If an object is provided for `predicate` the created `_.matches` style
58137                      * callback returns `true` for elements that have the properties of the
58138                      * given object, else `false`.
58139                      * 
58140                      * @static
58141                      * @memberOf _
58142                      * @alias any
58143                      * @category Collection
58144                      * @param {Array|Object|string}
58145                      *            collection The collection to iterate over.
58146                      * @param {Function|Object|string}
58147                      *            [predicate=_.identity] The function invoked per iteration.
58148                      * @param {*}
58149                      *            [thisArg] The `this` binding of `predicate`.
58150                      * @returns {boolean} Returns `true` if any element passes the predicate
58151                      *          check, else `false`.
58152                      * @example
58153                      * 
58154                      * _.some([null, 0, 'yes', false], Boolean); // => true
58155                      * 
58156                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
58157                      * 'active': false } ];
58158                      *  // using the `_.matches` callback shorthand _.some(users, { 'user':
58159                      * 'barney', 'active': false }); // => false
58160                      *  // using the `_.matchesProperty` callback shorthand _.some(users,
58161                      * 'active', false); // => true
58162                      *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
58163                      * true
58164                      */
58165                     function some(collection, predicate, thisArg) {
58166                         var func = isArray(collection) ? arraySome : baseSome;
58167                         if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
58168                             predicate = undefined;
58169                         }
58170                         if (typeof predicate != 'function' || thisArg !== undefined) {
58171                             predicate = getCallback(predicate, thisArg, 3);
58172                         }
58173                         return func(collection, predicate);
58174                     }
58175
58176                     /**
58177                      * Creates an array of elements, sorted in ascending order by the results of
58178                      * running each element in a collection through `iteratee`. This method
58179                      * performs a stable sort, that is, it preserves the original sort order of
58180                      * equal elements. The `iteratee` is bound to `thisArg` and invoked with
58181                      * three arguments: (value, index|key, collection).
58182                      * 
58183                      * If a property name is provided for `iteratee` the created `_.property`
58184                      * style callback returns the property value of the given element.
58185                      * 
58186                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
58187                      * style callback returns `true` for elements that have a matching property
58188                      * value, else `false`.
58189                      * 
58190                      * If an object is provided for `iteratee` the created `_.matches` style
58191                      * callback returns `true` for elements that have the properties of the
58192                      * given object, else `false`.
58193                      * 
58194                      * @static
58195                      * @memberOf _
58196                      * @category Collection
58197                      * @param {Array|Object|string}
58198                      *            collection The collection to iterate over.
58199                      * @param {Function|Object|string}
58200                      *            [iteratee=_.identity] The function invoked per iteration.
58201                      * @param {*}
58202                      *            [thisArg] The `this` binding of `iteratee`.
58203                      * @returns {Array} Returns the new sorted array.
58204                      * @example
58205                      * 
58206                      * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
58207                      * 
58208                      * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3,
58209                      * 1, 2]
58210                      * 
58211                      * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user':
58212                      * 'barney' } ];
58213                      *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
58214                      * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
58215                      */
58216                     function sortBy(collection, iteratee, thisArg) {
58217                         if (collection == null) {
58218                             return [];
58219                         }
58220                         if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
58221                             iteratee = undefined;
58222                         }
58223                         var index = -1;
58224                         iteratee = getCallback(iteratee, thisArg, 3);
58225
58226                         var result = baseMap(collection, function(value, key, collection) {
58227                             return {
58228                                 'criteria': iteratee(value, key, collection),
58229                                 'index': ++index,
58230                                 'value': value
58231                             };
58232                         });
58233                         return baseSortBy(result, compareAscending);
58234                     }
58235
58236                     /**
58237                      * This method is like `_.sortBy` except that it can sort by multiple
58238                      * iteratees or property names.
58239                      * 
58240                      * If a property name is provided for an iteratee the created `_.property`
58241                      * style callback returns the property value of the given element.
58242                      * 
58243                      * If an object is provided for an iteratee the created `_.matches` style
58244                      * callback returns `true` for elements that have the properties of the
58245                      * given object, else `false`.
58246                      * 
58247                      * @static
58248                      * @memberOf _
58249                      * @category Collection
58250                      * @param {Array|Object|string}
58251                      *            collection The collection to iterate over.
58252                      * @param {...(Function|Function[]|Object|Object[]|string|string[])}
58253                      *            iteratees The iteratees to sort by, specified as individual
58254                      *            values or arrays of values.
58255                      * @returns {Array} Returns the new sorted array.
58256                      * @example
58257                      * 
58258                      * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58259                      * 36 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 34 } ];
58260                      * 
58261                      * _.map(_.sortByAll(users, ['user', 'age']), _.values); // => [['barney',
58262                      * 34], ['barney', 36], ['fred', 42], ['fred', 48]]
58263                      * 
58264                      * _.map(_.sortByAll(users, 'user', function(chr) { return
58265                      * Math.floor(chr.age / 10); }), _.values); // => [['barney', 36],
58266                      * ['barney', 34], ['fred', 48], ['fred', 42]]
58267                      */
58268                     var sortByAll = restParam(function(collection, iteratees) {
58269                         if (collection == null) {
58270                             return [];
58271                         }
58272                         var guard = iteratees[2];
58273                         if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
58274                             iteratees.length = 1;
58275                         }
58276                         return baseSortByOrder(collection, baseFlatten(iteratees), []);
58277                     });
58278
58279                     /**
58280                      * This method is like `_.sortByAll` except that it allows specifying the
58281                      * sort orders of the iteratees to sort by. If `orders` is unspecified, all
58282                      * values are sorted in ascending order. Otherwise, a value is sorted in
58283                      * ascending order if its corresponding order is "asc", and descending if
58284                      * "desc".
58285                      * 
58286                      * If a property name is provided for an iteratee the created `_.property`
58287                      * style callback returns the property value of the given element.
58288                      * 
58289                      * If an object is provided for an iteratee the created `_.matches` style
58290                      * callback returns `true` for elements that have the properties of the
58291                      * given object, else `false`.
58292                      * 
58293                      * @static
58294                      * @memberOf _
58295                      * @category Collection
58296                      * @param {Array|Object|string}
58297                      *            collection The collection to iterate over.
58298                      * @param {Function[]|Object[]|string[]}
58299                      *            iteratees The iteratees to sort by.
58300                      * @param {boolean[]}
58301                      *            [orders] The sort orders of `iteratees`.
58302                      * @param- {Object} [guard] Enables use as a callback for functions like
58303                      *         `_.reduce`.
58304                      * @returns {Array} Returns the new sorted array.
58305                      * @example
58306                      * 
58307                      * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58308                      * 34 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 36 } ];
58309                      *  // sort by `user` in ascending order and by `age` in descending order
58310                      * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); // =>
58311                      * [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
58312                      */
58313                     function sortByOrder(collection, iteratees, orders, guard) {
58314                         if (collection == null) {
58315                             return [];
58316                         }
58317                         if (guard && isIterateeCall(iteratees, orders, guard)) {
58318                             orders = undefined;
58319                         }
58320                         if (!isArray(iteratees)) {
58321                             iteratees = iteratees == null ? [] : [iteratees];
58322                         }
58323                         if (!isArray(orders)) {
58324                             orders = orders == null ? [] : [orders];
58325                         }
58326                         return baseSortByOrder(collection, iteratees, orders);
58327                     }
58328
58329                     /**
58330                      * Performs a deep comparison between each element in `collection` and the
58331                      * source object, returning an array of all elements that have equivalent
58332                      * property values.
58333                      * 
58334                      * **Note:** This method supports comparing arrays, booleans, `Date`
58335                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
58336                      * compared by their own, not inherited, enumerable properties. For
58337                      * comparing a single own or inherited property value see
58338                      * `_.matchesProperty`.
58339                      * 
58340                      * @static
58341                      * @memberOf _
58342                      * @category Collection
58343                      * @param {Array|Object|string}
58344                      *            collection The collection to search.
58345                      * @param {Object}
58346                      *            source The object of property values to match.
58347                      * @returns {Array} Returns the new filtered array.
58348                      * @example
58349                      * 
58350                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false, 'pets':
58351                      * ['hoppy'] }, { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby
58352                      * puss', 'dino'] } ];
58353                      * 
58354                      * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); // =>
58355                      * ['barney']
58356                      * 
58357                      * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); // => ['fred']
58358                      */
58359                     function where(collection, source) {
58360                         return filter(collection, baseMatches(source));
58361                     }
58362
58363                     /*------------------------------------------------------------------------*/
58364
58365                     /**
58366                      * Gets the number of milliseconds that have elapsed since the Unix epoch (1
58367                      * January 1970 00:00:00 UTC).
58368                      * 
58369                      * @static
58370                      * @memberOf _
58371                      * @category Date
58372                      * @example
58373                      * 
58374                      * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
58375                      * logs the number of milliseconds it took for the deferred function to be
58376                      * invoked
58377                      */
58378                     var now = nativeNow || function() {
58379                         return new Date().getTime();
58380                     };
58381
58382                     /*------------------------------------------------------------------------*/
58383
58384                     /**
58385                      * The opposite of `_.before`; this method creates a function that invokes
58386                      * `func` once it is called `n` or more times.
58387                      * 
58388                      * @static
58389                      * @memberOf _
58390                      * @category Function
58391                      * @param {number}
58392                      *            n The number of calls before `func` is invoked.
58393                      * @param {Function}
58394                      *            func The function to restrict.
58395                      * @returns {Function} Returns the new restricted function.
58396                      * @example
58397                      * 
58398                      * var saves = ['profile', 'settings'];
58399                      * 
58400                      * var done = _.after(saves.length, function() { console.log('done
58401                      * saving!'); });
58402                      * 
58403                      * _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete':
58404                      * done }); }); // => logs 'done saving!' after the two async saves have
58405                      * completed
58406                      */
58407                     function after(n, func) {
58408                         if (typeof func != 'function') {
58409                             if (typeof n == 'function') {
58410                                 var temp = n;
58411                                 n = func;
58412                                 func = temp;
58413                             } else {
58414                                 throw new TypeError(FUNC_ERROR_TEXT);
58415                             }
58416                         }
58417                         n = nativeIsFinite(n = +n) ? n : 0;
58418                         return function() {
58419                             if (--n < 1) {
58420                                 return func.apply(this, arguments);
58421                             }
58422                         };
58423                     }
58424
58425                     /**
58426                      * Creates a function that accepts up to `n` arguments ignoring any
58427                      * additional arguments.
58428                      * 
58429                      * @static
58430                      * @memberOf _
58431                      * @category Function
58432                      * @param {Function}
58433                      *            func The function to cap arguments for.
58434                      * @param {number}
58435                      *            [n=func.length] The arity cap.
58436                      * @param- {Object} [guard] Enables use as a callback for functions like
58437                      *         `_.map`.
58438                      * @returns {Function} Returns the new function.
58439                      * @example
58440                      * 
58441                      * _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10]
58442                      */
58443                     function ary(func, n, guard) {
58444                         if (guard && isIterateeCall(func, n, guard)) {
58445                             n = undefined;
58446                         }
58447                         n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
58448                         return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
58449                     }
58450
58451                     /**
58452                      * Creates a function that invokes `func`, with the `this` binding and
58453                      * arguments of the created function, while it is called less than `n`
58454                      * times. Subsequent calls to the created function return the result of the
58455                      * last `func` invocation.
58456                      * 
58457                      * @static
58458                      * @memberOf _
58459                      * @category Function
58460                      * @param {number}
58461                      *            n The number of calls at which `func` is no longer invoked.
58462                      * @param {Function}
58463                      *            func The function to restrict.
58464                      * @returns {Function} Returns the new restricted function.
58465                      * @example
58466                      * 
58467                      * jQuery('#add').on('click', _.before(5, addContactToList)); // => allows
58468                      * adding up to 4 contacts to the list
58469                      */
58470                     function before(n, func) {
58471                         var result;
58472                         if (typeof func != 'function') {
58473                             if (typeof n == 'function') {
58474                                 var temp = n;
58475                                 n = func;
58476                                 func = temp;
58477                             } else {
58478                                 throw new TypeError(FUNC_ERROR_TEXT);
58479                             }
58480                         }
58481                         return function() {
58482                             if (--n > 0) {
58483                                 result = func.apply(this, arguments);
58484                             }
58485                             if (n <= 1) {
58486                                 func = undefined;
58487                             }
58488                             return result;
58489                         };
58490                     }
58491
58492                     /**
58493                      * Creates a function that invokes `func` with the `this` binding of
58494                      * `thisArg` and prepends any additional `_.bind` arguments to those
58495                      * provided to the bound function.
58496                      * 
58497                      * The `_.bind.placeholder` value, which defaults to `_` in monolithic
58498                      * builds, may be used as a placeholder for partially applied arguments.
58499                      * 
58500                      * **Note:** Unlike native `Function#bind` this method does not set the
58501                      * "length" property of bound functions.
58502                      * 
58503                      * @static
58504                      * @memberOf _
58505                      * @category Function
58506                      * @param {Function}
58507                      *            func The function to bind.
58508                      * @param {*}
58509                      *            thisArg The `this` binding of `func`.
58510                      * @param {...*}
58511                      *            [partials] The arguments to be partially applied.
58512                      * @returns {Function} Returns the new bound function.
58513                      * @example
58514                      * 
58515                      * var greet = function(greeting, punctuation) { return greeting + ' ' +
58516                      * this.user + punctuation; };
58517                      * 
58518                      * var object = { 'user': 'fred' };
58519                      * 
58520                      * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
58521                      *  // using placeholders var bound = _.bind(greet, object, _, '!');
58522                      * bound('hi'); // => 'hi fred!'
58523                      */
58524                     var bind = restParam(function(func, thisArg, partials) {
58525                         var bitmask = BIND_FLAG;
58526                         if (partials.length) {
58527                             var holders = replaceHolders(partials, bind.placeholder);
58528                             bitmask |= PARTIAL_FLAG;
58529                         }
58530                         return createWrapper(func, bitmask, thisArg, partials, holders);
58531                     });
58532
58533                     /**
58534                      * Binds methods of an object to the object itself, overwriting the existing
58535                      * method. Method names may be specified as individual arguments or as
58536                      * arrays of method names. If no method names are provided all enumerable
58537                      * function properties, own and inherited, of `object` are bound.
58538                      * 
58539                      * **Note:** This method does not set the "length" property of bound
58540                      * functions.
58541                      * 
58542                      * @static
58543                      * @memberOf _
58544                      * @category Function
58545                      * @param {Object}
58546                      *            object The object to bind and assign the bound methods to.
58547                      * @param {...(string|string[])}
58548                      *            [methodNames] The object method names to bind, specified as
58549                      *            individual method names or arrays of method names.
58550                      * @returns {Object} Returns `object`.
58551                      * @example
58552                      * 
58553                      * var view = { 'label': 'docs', 'onClick': function() {
58554                      * console.log('clicked ' + this.label); } };
58555                      * 
58556                      * _.bindAll(view); jQuery('#docs').on('click', view.onClick); // => logs
58557                      * 'clicked docs' when the element is clicked
58558                      */
58559                     var bindAll = restParam(function(object, methodNames) {
58560                         methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
58561
58562                         var index = -1,
58563                             length = methodNames.length;
58564
58565                         while (++index < length) {
58566                             var key = methodNames[index];
58567                             object[key] = createWrapper(object[key], BIND_FLAG, object);
58568                         }
58569                         return object;
58570                     });
58571
58572                     /**
58573                      * Creates a function that invokes the method at `object[key]` and prepends
58574                      * any additional `_.bindKey` arguments to those provided to the bound
58575                      * function.
58576                      * 
58577                      * This method differs from `_.bind` by allowing bound functions to
58578                      * reference methods that may be redefined or don't yet exist. See [Peter
58579                      * Michaux's
58580                      * article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
58581                      * for more details.
58582                      * 
58583                      * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
58584                      * builds, may be used as a placeholder for partially applied arguments.
58585                      * 
58586                      * @static
58587                      * @memberOf _
58588                      * @category Function
58589                      * @param {Object}
58590                      *            object The object the method belongs to.
58591                      * @param {string}
58592                      *            key The key of the method.
58593                      * @param {...*}
58594                      *            [partials] The arguments to be partially applied.
58595                      * @returns {Function} Returns the new bound function.
58596                      * @example
58597                      * 
58598                      * var object = { 'user': 'fred', 'greet': function(greeting, punctuation) {
58599                      * return greeting + ' ' + this.user + punctuation; } };
58600                      * 
58601                      * var bound = _.bindKey(object, 'greet', 'hi'); bound('!'); // => 'hi
58602                      * fred!'
58603                      * 
58604                      * object.greet = function(greeting, punctuation) { return greeting + 'ya ' +
58605                      * this.user + punctuation; };
58606                      * 
58607                      * bound('!'); // => 'hiya fred!'
58608                      *  // using placeholders var bound = _.bindKey(object, 'greet', _, '!');
58609                      * bound('hi'); // => 'hiya fred!'
58610                      */
58611                     var bindKey = restParam(function(object, key, partials) {
58612                         var bitmask = BIND_FLAG | BIND_KEY_FLAG;
58613                         if (partials.length) {
58614                             var holders = replaceHolders(partials, bindKey.placeholder);
58615                             bitmask |= PARTIAL_FLAG;
58616                         }
58617                         return createWrapper(key, bitmask, object, partials, holders);
58618                     });
58619
58620                     /**
58621                      * Creates a function that accepts one or more arguments of `func` that when
58622                      * called either invokes `func` returning its result, if all `func`
58623                      * arguments have been provided, or returns a function that accepts one or
58624                      * more of the remaining `func` arguments, and so on. The arity of `func`
58625                      * may be specified if `func.length` is not sufficient.
58626                      * 
58627                      * The `_.curry.placeholder` value, which defaults to `_` in monolithic
58628                      * builds, may be used as a placeholder for provided arguments.
58629                      * 
58630                      * **Note:** This method does not set the "length" property of curried
58631                      * functions.
58632                      * 
58633                      * @static
58634                      * @memberOf _
58635                      * @category Function
58636                      * @param {Function}
58637                      *            func The function to curry.
58638                      * @param {number}
58639                      *            [arity=func.length] The arity of `func`.
58640                      * @param- {Object} [guard] Enables use as a callback for functions like
58641                      *         `_.map`.
58642                      * @returns {Function} Returns the new curried function.
58643                      * @example
58644                      * 
58645                      * var abc = function(a, b, c) { return [a, b, c]; };
58646                      * 
58647                      * var curried = _.curry(abc);
58648                      * 
58649                      * curried(1)(2)(3); // => [1, 2, 3]
58650                      * 
58651                      * curried(1, 2)(3); // => [1, 2, 3]
58652                      * 
58653                      * curried(1, 2, 3); // => [1, 2, 3]
58654                      *  // using placeholders curried(1)(_, 3)(2); // => [1, 2, 3]
58655                      */
58656                     var curry = createCurry(CURRY_FLAG);
58657
58658                     /**
58659                      * This method is like `_.curry` except that arguments are applied to `func`
58660                      * in the manner of `_.partialRight` instead of `_.partial`.
58661                      * 
58662                      * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
58663                      * builds, may be used as a placeholder for provided arguments.
58664                      * 
58665                      * **Note:** This method does not set the "length" property of curried
58666                      * functions.
58667                      * 
58668                      * @static
58669                      * @memberOf _
58670                      * @category Function
58671                      * @param {Function}
58672                      *            func The function to curry.
58673                      * @param {number}
58674                      *            [arity=func.length] The arity of `func`.
58675                      * @param- {Object} [guard] Enables use as a callback for functions like
58676                      *         `_.map`.
58677                      * @returns {Function} Returns the new curried function.
58678                      * @example
58679                      * 
58680                      * var abc = function(a, b, c) { return [a, b, c]; };
58681                      * 
58682                      * var curried = _.curryRight(abc);
58683                      * 
58684                      * curried(3)(2)(1); // => [1, 2, 3]
58685                      * 
58686                      * curried(2, 3)(1); // => [1, 2, 3]
58687                      * 
58688                      * curried(1, 2, 3); // => [1, 2, 3]
58689                      *  // using placeholders curried(3)(1, _)(2); // => [1, 2, 3]
58690                      */
58691                     var curryRight = createCurry(CURRY_RIGHT_FLAG);
58692
58693                     /**
58694                      * Creates a debounced function that delays invoking `func` until after
58695                      * `wait` milliseconds have elapsed since the last time the debounced
58696                      * function was invoked. The debounced function comes with a `cancel` method
58697                      * to cancel delayed invocations. Provide an options object to indicate that
58698                      * `func` should be invoked on the leading and/or trailing edge of the
58699                      * `wait` timeout. Subsequent calls to the debounced function return the
58700                      * result of the last `func` invocation.
58701                      * 
58702                      * **Note:** If `leading` and `trailing` options are `true`, `func` is
58703                      * invoked on the trailing edge of the timeout only if the the debounced
58704                      * function is invoked more than once during the `wait` timeout.
58705                      * 
58706                      * See [David Corbacho's
58707                      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
58708                      * for details over the differences between `_.debounce` and `_.throttle`.
58709                      * 
58710                      * @static
58711                      * @memberOf _
58712                      * @category Function
58713                      * @param {Function}
58714                      *            func The function to debounce.
58715                      * @param {number}
58716                      *            [wait=0] The number of milliseconds to delay.
58717                      * @param {Object}
58718                      *            [options] The options object.
58719                      * @param {boolean}
58720                      *            [options.leading=false] Specify invoking on the leading edge
58721                      *            of the timeout.
58722                      * @param {number}
58723                      *            [options.maxWait] The maximum time `func` is allowed to be
58724                      *            delayed before it is invoked.
58725                      * @param {boolean}
58726                      *            [options.trailing=true] Specify invoking on the trailing edge
58727                      *            of the timeout.
58728                      * @returns {Function} Returns the new debounced function.
58729                      * @example
58730                      *  // avoid costly calculations while the window size is in flux
58731                      * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
58732                      *  // invoke `sendMail` when the click event is fired, debouncing
58733                      * subsequent calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
58734                      * 'leading': true, 'trailing': false }));
58735                      *  // ensure `batchLog` is invoked once after 1 second of debounced calls
58736                      * var source = new EventSource('/stream'); jQuery(source).on('message',
58737                      * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
58738                      *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
58739                      * Object.observe(models.todo, todoChanges);
58740                      * 
58741                      * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
58742                      * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
58743                      *  // ...at some point `models.todo` is changed models.todo.completed =
58744                      * true;
58745                      *  // ...before 1 second has passed `models.todo` is deleted // which
58746                      * cancels the debounced `todoChanges` call delete models.todo;
58747                      */
58748                     function debounce(func, wait, options) {
58749                         var args,
58750                             maxTimeoutId,
58751                             result,
58752                             stamp,
58753                             thisArg,
58754                             timeoutId,
58755                             trailingCall,
58756                             lastCalled = 0,
58757                             maxWait = false,
58758                             trailing = true;
58759
58760                         if (typeof func != 'function') {
58761                             throw new TypeError(FUNC_ERROR_TEXT);
58762                         }
58763                         wait = wait < 0 ? 0 : (+wait || 0);
58764                         if (options === true) {
58765                             var leading = true;
58766                             trailing = false;
58767                         } else if (isObject(options)) {
58768                             leading = !!options.leading;
58769                             maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
58770                             trailing = 'trailing' in options ? !!options.trailing : trailing;
58771                         }
58772
58773                         function cancel() {
58774                             if (timeoutId) {
58775                                 clearTimeout(timeoutId);
58776                             }
58777                             if (maxTimeoutId) {
58778                                 clearTimeout(maxTimeoutId);
58779                             }
58780                             lastCalled = 0;
58781                             maxTimeoutId = timeoutId = trailingCall = undefined;
58782                         }
58783
58784                         function complete(isCalled, id) {
58785                             if (id) {
58786                                 clearTimeout(id);
58787                             }
58788                             maxTimeoutId = timeoutId = trailingCall = undefined;
58789                             if (isCalled) {
58790                                 lastCalled = now();
58791                                 result = func.apply(thisArg, args);
58792                                 if (!timeoutId && !maxTimeoutId) {
58793                                     args = thisArg = undefined;
58794                                 }
58795                             }
58796                         }
58797
58798                         function delayed() {
58799                             var remaining = wait - (now() - stamp);
58800                             if (remaining <= 0 || remaining > wait) {
58801                                 complete(trailingCall, maxTimeoutId);
58802                             } else {
58803                                 timeoutId = setTimeout(delayed, remaining);
58804                             }
58805                         }
58806
58807                         function maxDelayed() {
58808                             complete(trailing, timeoutId);
58809                         }
58810
58811                         function debounced() {
58812                             args = arguments;
58813                             stamp = now();
58814                             thisArg = this;
58815                             trailingCall = trailing && (timeoutId || !leading);
58816
58817                             if (maxWait === false) {
58818                                 var leadingCall = leading && !timeoutId;
58819                             } else {
58820                                 if (!maxTimeoutId && !leading) {
58821                                     lastCalled = stamp;
58822                                 }
58823                                 var remaining = maxWait - (stamp - lastCalled),
58824                                     isCalled = remaining <= 0 || remaining > maxWait;
58825
58826                                 if (isCalled) {
58827                                     if (maxTimeoutId) {
58828                                         maxTimeoutId = clearTimeout(maxTimeoutId);
58829                                     }
58830                                     lastCalled = stamp;
58831                                     result = func.apply(thisArg, args);
58832                                 } else if (!maxTimeoutId) {
58833                                     maxTimeoutId = setTimeout(maxDelayed, remaining);
58834                                 }
58835                             }
58836                             if (isCalled && timeoutId) {
58837                                 timeoutId = clearTimeout(timeoutId);
58838                             } else if (!timeoutId && wait !== maxWait) {
58839                                 timeoutId = setTimeout(delayed, wait);
58840                             }
58841                             if (leadingCall) {
58842                                 isCalled = true;
58843                                 result = func.apply(thisArg, args);
58844                             }
58845                             if (isCalled && !timeoutId && !maxTimeoutId) {
58846                                 args = thisArg = undefined;
58847                             }
58848                             return result;
58849                         }
58850                         debounced.cancel = cancel;
58851                         return debounced;
58852                     }
58853
58854                     /**
58855                      * Defers invoking the `func` until the current call stack has cleared. Any
58856                      * additional arguments are provided to `func` when it is invoked.
58857                      * 
58858                      * @static
58859                      * @memberOf _
58860                      * @category Function
58861                      * @param {Function}
58862                      *            func The function to defer.
58863                      * @param {...*}
58864                      *            [args] The arguments to invoke the function with.
58865                      * @returns {number} Returns the timer id.
58866                      * @example
58867                      * 
58868                      * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
58869                      * 'deferred' after one or more milliseconds
58870                      */
58871                     var defer = restParam(function(func, args) {
58872                         return baseDelay(func, 1, args);
58873                     });
58874
58875                     /**
58876                      * Invokes `func` after `wait` milliseconds. Any additional arguments are
58877                      * provided to `func` when it is invoked.
58878                      * 
58879                      * @static
58880                      * @memberOf _
58881                      * @category Function
58882                      * @param {Function}
58883                      *            func The function to delay.
58884                      * @param {number}
58885                      *            wait The number of milliseconds to delay invocation.
58886                      * @param {...*}
58887                      *            [args] The arguments to invoke the function with.
58888                      * @returns {number} Returns the timer id.
58889                      * @example
58890                      * 
58891                      * _.delay(function(text) { console.log(text); }, 1000, 'later'); // => logs
58892                      * 'later' after one second
58893                      */
58894                     var delay = restParam(function(func, wait, args) {
58895                         return baseDelay(func, wait, args);
58896                     });
58897
58898                     /**
58899                      * Creates a function that returns the result of invoking the provided
58900                      * functions with the `this` binding of the created function, where each
58901                      * successive invocation is supplied the return value of the previous.
58902                      * 
58903                      * @static
58904                      * @memberOf _
58905                      * @category Function
58906                      * @param {...Function}
58907                      *            [funcs] Functions to invoke.
58908                      * @returns {Function} Returns the new function.
58909                      * @example
58910                      * 
58911                      * function square(n) { return n * n; }
58912                      * 
58913                      * var addSquare = _.flow(_.add, square); addSquare(1, 2); // => 9
58914                      */
58915                     var flow = createFlow();
58916
58917                     /**
58918                      * This method is like `_.flow` except that it creates a function that
58919                      * invokes the provided functions from right to left.
58920                      * 
58921                      * @static
58922                      * @memberOf _
58923                      * @alias backflow, compose
58924                      * @category Function
58925                      * @param {...Function}
58926                      *            [funcs] Functions to invoke.
58927                      * @returns {Function} Returns the new function.
58928                      * @example
58929                      * 
58930                      * function square(n) { return n * n; }
58931                      * 
58932                      * var addSquare = _.flowRight(square, _.add); addSquare(1, 2); // => 9
58933                      */
58934                     var flowRight = createFlow(true);
58935
58936                     /**
58937                      * Creates a function that memoizes the result of `func`. If `resolver` is
58938                      * provided it determines the cache key for storing the result based on the
58939                      * arguments provided to the memoized function. By default, the first
58940                      * argument provided to the memoized function is coerced to a string and
58941                      * used as the cache key. The `func` is invoked with the `this` binding of
58942                      * the memoized function.
58943                      * 
58944                      * **Note:** The cache is exposed as the `cache` property on the memoized
58945                      * function. Its creation may be customized by replacing the
58946                      * `_.memoize.Cache` constructor with one whose instances implement the
58947                      * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
58948                      * method interface of `get`, `has`, and `set`.
58949                      * 
58950                      * @static
58951                      * @memberOf _
58952                      * @category Function
58953                      * @param {Function}
58954                      *            func The function to have its output memoized.
58955                      * @param {Function}
58956                      *            [resolver] The function to resolve the cache key.
58957                      * @returns {Function} Returns the new memoizing function.
58958                      * @example
58959                      * 
58960                      * var upperCase = _.memoize(function(string) { return string.toUpperCase();
58961                      * });
58962                      * 
58963                      * upperCase('fred'); // => 'FRED'
58964                      *  // modifying the result cache upperCase.cache.set('fred', 'BARNEY');
58965                      * upperCase('fred'); // => 'BARNEY'
58966                      *  // replacing `_.memoize.Cache` var object = { 'user': 'fred' }; var
58967                      * other = { 'user': 'barney' }; var identity = _.memoize(_.identity);
58968                      * 
58969                      * identity(object); // => { 'user': 'fred' } identity(other); // => {
58970                      * 'user': 'fred' }
58971                      * 
58972                      * _.memoize.Cache = WeakMap; var identity = _.memoize(_.identity);
58973                      * 
58974                      * identity(object); // => { 'user': 'fred' } identity(other); // => {
58975                      * 'user': 'barney' }
58976                      */
58977                     function memoize(func, resolver) {
58978                         if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
58979                             throw new TypeError(FUNC_ERROR_TEXT);
58980                         }
58981                         var memoized = function() {
58982                             var args = arguments,
58983                                 key = resolver ? resolver.apply(this, args) : args[0],
58984                                 cache = memoized.cache;
58985
58986                             if (cache.has(key)) {
58987                                 return cache.get(key);
58988                             }
58989                             var result = func.apply(this, args);
58990                             memoized.cache = cache.set(key, result);
58991                             return result;
58992                         };
58993                         memoized.cache = new memoize.Cache;
58994                         return memoized;
58995                     }
58996
58997                     /**
58998                      * Creates a function that runs each argument through a corresponding
58999                      * transform function.
59000                      * 
59001                      * @static
59002                      * @memberOf _
59003                      * @category Function
59004                      * @param {Function}
59005                      *            func The function to wrap.
59006                      * @param {...(Function|Function[])}
59007                      *            [transforms] The functions to transform arguments, specified
59008                      *            as individual functions or arrays of functions.
59009                      * @returns {Function} Returns the new function.
59010                      * @example
59011                      * 
59012                      * function doubled(n) { return n * 2; }
59013                      * 
59014                      * function square(n) { return n * n; }
59015                      * 
59016                      * var modded = _.modArgs(function(x, y) { return [x, y]; }, square,
59017                      * doubled);
59018                      * 
59019                      * modded(1, 2); // => [1, 4]
59020                      * 
59021                      * modded(5, 10); // => [25, 20]
59022                      */
59023                     var modArgs = restParam(function(func, transforms) {
59024                         transforms = baseFlatten(transforms);
59025                         if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
59026                             throw new TypeError(FUNC_ERROR_TEXT);
59027                         }
59028                         var length = transforms.length;
59029                         return restParam(function(args) {
59030                             var index = nativeMin(args.length, length);
59031                             while (index--) {
59032                                 args[index] = transforms[index](args[index]);
59033                             }
59034                             return func.apply(this, args);
59035                         });
59036                     });
59037
59038                     /**
59039                      * Creates a function that negates the result of the predicate `func`. The
59040                      * `func` predicate is invoked with the `this` binding and arguments of the
59041                      * created function.
59042                      * 
59043                      * @static
59044                      * @memberOf _
59045                      * @category Function
59046                      * @param {Function}
59047                      *            predicate The predicate to negate.
59048                      * @returns {Function} Returns the new function.
59049                      * @example
59050                      * 
59051                      * function isEven(n) { return n % 2 == 0; }
59052                      * 
59053                      * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5]
59054                      */
59055                     function negate(predicate) {
59056                         if (typeof predicate != 'function') {
59057                             throw new TypeError(FUNC_ERROR_TEXT);
59058                         }
59059                         return function() {
59060                             return !predicate.apply(this, arguments);
59061                         };
59062                     }
59063
59064                     /**
59065                      * Creates a function that is restricted to invoking `func` once. Repeat
59066                      * calls to the function return the value of the first call. The `func` is
59067                      * invoked with the `this` binding and arguments of the created function.
59068                      * 
59069                      * @static
59070                      * @memberOf _
59071                      * @category Function
59072                      * @param {Function}
59073                      *            func The function to restrict.
59074                      * @returns {Function} Returns the new restricted function.
59075                      * @example
59076                      * 
59077                      * var initialize = _.once(createApplication); initialize(); initialize(); //
59078                      * `initialize` invokes `createApplication` once
59079                      */
59080                     function once(func) {
59081                         return before(2, func);
59082                     }
59083
59084                     /**
59085                      * Creates a function that invokes `func` with `partial` arguments prepended
59086                      * to those provided to the new function. This method is like `_.bind`
59087                      * except it does **not** alter the `this` binding.
59088                      * 
59089                      * The `_.partial.placeholder` value, which defaults to `_` in monolithic
59090                      * builds, may be used as a placeholder for partially applied arguments.
59091                      * 
59092                      * **Note:** This method does not set the "length" property of partially
59093                      * applied functions.
59094                      * 
59095                      * @static
59096                      * @memberOf _
59097                      * @category Function
59098                      * @param {Function}
59099                      *            func The function to partially apply arguments to.
59100                      * @param {...*}
59101                      *            [partials] The arguments to be partially applied.
59102                      * @returns {Function} Returns the new partially applied function.
59103                      * @example
59104                      * 
59105                      * var greet = function(greeting, name) { return greeting + ' ' + name; };
59106                      * 
59107                      * var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); // =>
59108                      * 'hello fred'
59109                      *  // using placeholders var greetFred = _.partial(greet, _, 'fred');
59110                      * greetFred('hi'); // => 'hi fred'
59111                      */
59112                     var partial = createPartial(PARTIAL_FLAG);
59113
59114                     /**
59115                      * This method is like `_.partial` except that partially applied arguments
59116                      * are appended to those provided to the new function.
59117                      * 
59118                      * The `_.partialRight.placeholder` value, which defaults to `_` in
59119                      * monolithic builds, may be used as a placeholder for partially applied
59120                      * arguments.
59121                      * 
59122                      * **Note:** This method does not set the "length" property of partially
59123                      * applied functions.
59124                      * 
59125                      * @static
59126                      * @memberOf _
59127                      * @category Function
59128                      * @param {Function}
59129                      *            func The function to partially apply arguments to.
59130                      * @param {...*}
59131                      *            [partials] The arguments to be partially applied.
59132                      * @returns {Function} Returns the new partially applied function.
59133                      * @example
59134                      * 
59135                      * var greet = function(greeting, name) { return greeting + ' ' + name; };
59136                      * 
59137                      * var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); // => 'hi
59138                      * fred'
59139                      *  // using placeholders var sayHelloTo = _.partialRight(greet, 'hello',
59140                      * _); sayHelloTo('fred'); // => 'hello fred'
59141                      */
59142                     var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
59143
59144                     /**
59145                      * Creates a function that invokes `func` with arguments arranged according
59146                      * to the specified indexes where the argument value at the first index is
59147                      * provided as the first argument, the argument value at the second index is
59148                      * provided as the second argument, and so on.
59149                      * 
59150                      * @static
59151                      * @memberOf _
59152                      * @category Function
59153                      * @param {Function}
59154                      *            func The function to rearrange arguments for.
59155                      * @param {...(number|number[])}
59156                      *            indexes The arranged argument indexes, specified as individual
59157                      *            indexes or arrays of indexes.
59158                      * @returns {Function} Returns the new function.
59159                      * @example
59160                      * 
59161                      * var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, 2, 0, 1);
59162                      * 
59163                      * rearged('b', 'c', 'a') // => ['a', 'b', 'c']
59164                      * 
59165                      * var map = _.rearg(_.map, [1, 0]); map(function(n) { return n * 3; }, [1,
59166                      * 2, 3]); // => [3, 6, 9]
59167                      */
59168                     var rearg = restParam(function(func, indexes) {
59169                         return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
59170                     });
59171
59172                     /**
59173                      * Creates a function that invokes `func` with the `this` binding of the
59174                      * created function and arguments from `start` and beyond provided as an
59175                      * array.
59176                      * 
59177                      * **Note:** This method is based on the [rest
59178                      * parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
59179                      * 
59180                      * @static
59181                      * @memberOf _
59182                      * @category Function
59183                      * @param {Function}
59184                      *            func The function to apply a rest parameter to.
59185                      * @param {number}
59186                      *            [start=func.length-1] The start position of the rest
59187                      *            parameter.
59188                      * @returns {Function} Returns the new function.
59189                      * @example
59190                      * 
59191                      * var say = _.restParam(function(what, names) { return what + ' ' +
59192                      * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
59193                      * _.last(names); });
59194                      * 
59195                      * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
59196                      * pebbles'
59197                      */
59198                     function restParam(func, start) {
59199                         if (typeof func != 'function') {
59200                             throw new TypeError(FUNC_ERROR_TEXT);
59201                         }
59202                         start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
59203                         return function() {
59204                             var args = arguments,
59205                                 index = -1,
59206                                 length = nativeMax(args.length - start, 0),
59207                                 rest = Array(length);
59208
59209                             while (++index < length) {
59210                                 rest[index] = args[start + index];
59211                             }
59212                             switch (start) {
59213                                 case 0:
59214                                     return func.call(this, rest);
59215                                 case 1:
59216                                     return func.call(this, args[0], rest);
59217                                 case 2:
59218                                     return func.call(this, args[0], args[1], rest);
59219                             }
59220                             var otherArgs = Array(start + 1);
59221                             index = -1;
59222                             while (++index < start) {
59223                                 otherArgs[index] = args[index];
59224                             }
59225                             otherArgs[start] = rest;
59226                             return func.apply(this, otherArgs);
59227                         };
59228                     }
59229
59230                     /**
59231                      * Creates a function that invokes `func` with the `this` binding of the
59232                      * created function and an array of arguments much like
59233                      * [`Function#apply`](https://es5.github.io/#x15.3.4.3).
59234                      * 
59235                      * **Note:** This method is based on the [spread
59236                      * operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
59237                      * 
59238                      * @static
59239                      * @memberOf _
59240                      * @category Function
59241                      * @param {Function}
59242                      *            func The function to spread arguments over.
59243                      * @returns {Function} Returns the new function.
59244                      * @example
59245                      * 
59246                      * var say = _.spread(function(who, what) { return who + ' says ' + what;
59247                      * });
59248                      * 
59249                      * say(['fred', 'hello']); // => 'fred says hello'
59250                      *  // with a Promise var numbers = Promise.all([ Promise.resolve(40),
59251                      * Promise.resolve(36) ]);
59252                      * 
59253                      * numbers.then(_.spread(function(x, y) { return x + y; })); // => a Promise
59254                      * of 76
59255                      */
59256                     function spread(func) {
59257                         if (typeof func != 'function') {
59258                             throw new TypeError(FUNC_ERROR_TEXT);
59259                         }
59260                         return function(array) {
59261                             return func.apply(this, array);
59262                         };
59263                     }
59264
59265                     /**
59266                      * Creates a throttled function that only invokes `func` at most once per
59267                      * every `wait` milliseconds. The throttled function comes with a `cancel`
59268                      * method to cancel delayed invocations. Provide an options object to
59269                      * indicate that `func` should be invoked on the leading and/or trailing
59270                      * edge of the `wait` timeout. Subsequent calls to the throttled function
59271                      * return the result of the last `func` call.
59272                      * 
59273                      * **Note:** If `leading` and `trailing` options are `true`, `func` is
59274                      * invoked on the trailing edge of the timeout only if the the throttled
59275                      * function is invoked more than once during the `wait` timeout.
59276                      * 
59277                      * See [David Corbacho's
59278                      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
59279                      * for details over the differences between `_.throttle` and `_.debounce`.
59280                      * 
59281                      * @static
59282                      * @memberOf _
59283                      * @category Function
59284                      * @param {Function}
59285                      *            func The function to throttle.
59286                      * @param {number}
59287                      *            [wait=0] The number of milliseconds to throttle invocations
59288                      *            to.
59289                      * @param {Object}
59290                      *            [options] The options object.
59291                      * @param {boolean}
59292                      *            [options.leading=true] Specify invoking on the leading edge of
59293                      *            the timeout.
59294                      * @param {boolean}
59295                      *            [options.trailing=true] Specify invoking on the trailing edge
59296                      *            of the timeout.
59297                      * @returns {Function} Returns the new throttled function.
59298                      * @example
59299                      *  // avoid excessively updating the position while scrolling
59300                      * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
59301                      *  // invoke `renewToken` when the click event is fired, but not more than
59302                      * once every 5 minutes jQuery('.interactive').on('click',
59303                      * _.throttle(renewToken, 300000, { 'trailing': false }));
59304                      *  // cancel a trailing throttled call jQuery(window).on('popstate',
59305                      * throttled.cancel);
59306                      */
59307                     function throttle(func, wait, options) {
59308                         var leading = true,
59309                             trailing = true;
59310
59311                         if (typeof func != 'function') {
59312                             throw new TypeError(FUNC_ERROR_TEXT);
59313                         }
59314                         if (options === false) {
59315                             leading = false;
59316                         } else if (isObject(options)) {
59317                             leading = 'leading' in options ? !!options.leading : leading;
59318                             trailing = 'trailing' in options ? !!options.trailing : trailing;
59319                         }
59320                         return debounce(func, wait, {
59321                             'leading': leading,
59322                             'maxWait': +wait,
59323                             'trailing': trailing
59324                         });
59325                     }
59326
59327                     /**
59328                      * Creates a function that provides `value` to the wrapper function as its
59329                      * first argument. Any additional arguments provided to the function are
59330                      * appended to those provided to the wrapper function. The wrapper is
59331                      * invoked with the `this` binding of the created function.
59332                      * 
59333                      * @static
59334                      * @memberOf _
59335                      * @category Function
59336                      * @param {*}
59337                      *            value The value to wrap.
59338                      * @param {Function}
59339                      *            wrapper The wrapper function.
59340                      * @returns {Function} Returns the new function.
59341                      * @example
59342                      * 
59343                      * var p = _.wrap(_.escape, function(func, text) { return '
59344                      * <p>' + func(text) + '
59345                      * </p>'; });
59346                      * 
59347                      * p('fred, barney, & pebbles'); // => '
59348                      * <p>
59349                      * fred, barney, &amp; pebbles
59350                      * </p>'
59351                      */
59352                     function wrap(value, wrapper) {
59353                         wrapper = wrapper == null ? identity : wrapper;
59354                         return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
59355                     }
59356
59357                     /*------------------------------------------------------------------------*/
59358
59359                     /**
59360                      * Creates a clone of `value`. If `isDeep` is `true` nested objects are
59361                      * cloned, otherwise they are assigned by reference. If `customizer` is
59362                      * provided it is invoked to produce the cloned values. If `customizer`
59363                      * returns `undefined` cloning is handled by the method instead. The
59364                      * `customizer` is bound to `thisArg` and invoked with two argument; (value [,
59365                      * index|key, object]).
59366                      * 
59367                      * **Note:** This method is loosely based on the [structured clone
59368                      * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59369                      * The enumerable properties of `arguments` objects and objects created by
59370                      * constructors other than `Object` are cloned to plain `Object` objects. An
59371                      * empty object is returned for uncloneable values such as functions, DOM
59372                      * nodes, Maps, Sets, and WeakMaps.
59373                      * 
59374                      * @static
59375                      * @memberOf _
59376                      * @category Lang
59377                      * @param {*}
59378                      *            value The value to clone.
59379                      * @param {boolean}
59380                      *            [isDeep] Specify a deep clone.
59381                      * @param {Function}
59382                      *            [customizer] The function to customize cloning values.
59383                      * @param {*}
59384                      *            [thisArg] The `this` binding of `customizer`.
59385                      * @returns {*} Returns the cloned value.
59386                      * @example
59387                      * 
59388                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59389                      * 
59390                      * var shallow = _.clone(users); shallow[0] === users[0]; // => true
59391                      * 
59392                      * var deep = _.clone(users, true); deep[0] === users[0]; // => false
59393                      *  // using a customizer callback var el = _.clone(document.body,
59394                      * function(value) { if (_.isElement(value)) { return
59395                      * value.cloneNode(false); } });
59396                      * 
59397                      * el === document.body // => false el.nodeName // => BODY
59398                      * el.childNodes.length; // => 0
59399                      */
59400                     function clone(value, isDeep, customizer, thisArg) {
59401                         if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
59402                             isDeep = false;
59403                         } else if (typeof isDeep == 'function') {
59404                             thisArg = customizer;
59405                             customizer = isDeep;
59406                             isDeep = false;
59407                         }
59408                         return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) : baseClone(value, isDeep);
59409                     }
59410
59411                     /**
59412                      * Creates a deep clone of `value`. If `customizer` is provided it is
59413                      * invoked to produce the cloned values. If `customizer` returns `undefined`
59414                      * cloning is handled by the method instead. The `customizer` is bound to
59415                      * `thisArg` and invoked with two argument; (value [, index|key, object]).
59416                      * 
59417                      * **Note:** This method is loosely based on the [structured clone
59418                      * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59419                      * The enumerable properties of `arguments` objects and objects created by
59420                      * constructors other than `Object` are cloned to plain `Object` objects. An
59421                      * empty object is returned for uncloneable values such as functions, DOM
59422                      * nodes, Maps, Sets, and WeakMaps.
59423                      * 
59424                      * @static
59425                      * @memberOf _
59426                      * @category Lang
59427                      * @param {*}
59428                      *            value The value to deep clone.
59429                      * @param {Function}
59430                      *            [customizer] The function to customize cloning values.
59431                      * @param {*}
59432                      *            [thisArg] The `this` binding of `customizer`.
59433                      * @returns {*} Returns the deep cloned value.
59434                      * @example
59435                      * 
59436                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59437                      * 
59438                      * var deep = _.cloneDeep(users); deep[0] === users[0]; // => false
59439                      *  // using a customizer callback var el = _.cloneDeep(document.body,
59440                      * function(value) { if (_.isElement(value)) { return value.cloneNode(true); }
59441                      * });
59442                      * 
59443                      * el === document.body // => false el.nodeName // => BODY
59444                      * el.childNodes.length; // => 20
59445                      */
59446                     function cloneDeep(value, customizer, thisArg) {
59447                         return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) : baseClone(value, true);
59448                     }
59449
59450                     /**
59451                      * Checks if `value` is greater than `other`.
59452                      * 
59453                      * @static
59454                      * @memberOf _
59455                      * @category Lang
59456                      * @param {*}
59457                      *            value The value to compare.
59458                      * @param {*}
59459                      *            other The other value to compare.
59460                      * @returns {boolean} Returns `true` if `value` is greater than `other`,
59461                      *          else `false`.
59462                      * @example
59463                      * 
59464                      * _.gt(3, 1); // => true
59465                      * 
59466                      * _.gt(3, 3); // => false
59467                      * 
59468                      * _.gt(1, 3); // => false
59469                      */
59470                     function gt(value, other) {
59471                         return value > other;
59472                     }
59473
59474                     /**
59475                      * Checks if `value` is greater than or equal to `other`.
59476                      * 
59477                      * @static
59478                      * @memberOf _
59479                      * @category Lang
59480                      * @param {*}
59481                      *            value The value to compare.
59482                      * @param {*}
59483                      *            other The other value to compare.
59484                      * @returns {boolean} Returns `true` if `value` is greater than or equal to
59485                      *          `other`, else `false`.
59486                      * @example
59487                      * 
59488                      * _.gte(3, 1); // => true
59489                      * 
59490                      * _.gte(3, 3); // => true
59491                      * 
59492                      * _.gte(1, 3); // => false
59493                      */
59494                     function gte(value, other) {
59495                         return value >= other;
59496                     }
59497
59498                     /**
59499                      * Checks if `value` is classified as an `arguments` object.
59500                      * 
59501                      * @static
59502                      * @memberOf _
59503                      * @category Lang
59504                      * @param {*}
59505                      *            value The value to check.
59506                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59507                      *          else `false`.
59508                      * @example
59509                      * 
59510                      * _.isArguments(function() { return arguments; }()); // => true
59511                      * 
59512                      * _.isArguments([1, 2, 3]); // => false
59513                      */
59514                     function isArguments(value) {
59515                         return isObjectLike(value) && isArrayLike(value) &&
59516                             hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
59517                     }
59518
59519                     /**
59520                      * Checks if `value` is classified as an `Array` object.
59521                      * 
59522                      * @static
59523                      * @memberOf _
59524                      * @category Lang
59525                      * @param {*}
59526                      *            value The value to check.
59527                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59528                      *          else `false`.
59529                      * @example
59530                      * 
59531                      * _.isArray([1, 2, 3]); // => true
59532                      * 
59533                      * _.isArray(function() { return arguments; }()); // => false
59534                      */
59535                     var isArray = nativeIsArray || function(value) {
59536                         return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
59537                     };
59538
59539                     /**
59540                      * Checks if `value` is classified as a boolean primitive or object.
59541                      * 
59542                      * @static
59543                      * @memberOf _
59544                      * @category Lang
59545                      * @param {*}
59546                      *            value The value to check.
59547                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59548                      *          else `false`.
59549                      * @example
59550                      * 
59551                      * _.isBoolean(false); // => true
59552                      * 
59553                      * _.isBoolean(null); // => false
59554                      */
59555                     function isBoolean(value) {
59556                         return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
59557                     }
59558
59559                     /**
59560                      * Checks if `value` is classified as a `Date` object.
59561                      * 
59562                      * @static
59563                      * @memberOf _
59564                      * @category Lang
59565                      * @param {*}
59566                      *            value The value to check.
59567                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59568                      *          else `false`.
59569                      * @example
59570                      * 
59571                      * _.isDate(new Date); // => true
59572                      * 
59573                      * _.isDate('Mon April 23 2012'); // => false
59574                      */
59575                     function isDate(value) {
59576                         return isObjectLike(value) && objToString.call(value) == dateTag;
59577                     }
59578
59579                     /**
59580                      * Checks if `value` is a DOM element.
59581                      * 
59582                      * @static
59583                      * @memberOf _
59584                      * @category Lang
59585                      * @param {*}
59586                      *            value The value to check.
59587                      * @returns {boolean} Returns `true` if `value` is a DOM element, else
59588                      *          `false`.
59589                      * @example
59590                      * 
59591                      * _.isElement(document.body); // => true
59592                      * 
59593                      * _.isElement('<body>'); // => false
59594                      */
59595                     function isElement(value) {
59596                         return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
59597                     }
59598
59599                     /**
59600                      * Checks if `value` is empty. A value is considered empty unless it is an
59601                      * `arguments` object, array, string, or jQuery-like collection with a
59602                      * length greater than `0` or an object with own enumerable properties.
59603                      * 
59604                      * @static
59605                      * @memberOf _
59606                      * @category Lang
59607                      * @param {Array|Object|string}
59608                      *            value The value to inspect.
59609                      * @returns {boolean} Returns `true` if `value` is empty, else `false`.
59610                      * @example
59611                      * 
59612                      * _.isEmpty(null); // => true
59613                      * 
59614                      * _.isEmpty(true); // => true
59615                      * 
59616                      * _.isEmpty(1); // => true
59617                      * 
59618                      * _.isEmpty([1, 2, 3]); // => false
59619                      * 
59620                      * _.isEmpty({ 'a': 1 }); // => false
59621                      */
59622                     function isEmpty(value) {
59623                         if (value == null) {
59624                             return true;
59625                         }
59626                         if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
59627                                 (isObjectLike(value) && isFunction(value.splice)))) {
59628                             return !value.length;
59629                         }
59630                         return !keys(value).length;
59631                     }
59632
59633                     /**
59634                      * Performs a deep comparison between two values to determine if they are
59635                      * equivalent. If `customizer` is provided it is invoked to compare values.
59636                      * If `customizer` returns `undefined` comparisons are handled by the method
59637                      * instead. The `customizer` is bound to `thisArg` and invoked with three
59638                      * arguments: (value, other [, index|key]).
59639                      * 
59640                      * **Note:** This method supports comparing arrays, booleans, `Date`
59641                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
59642                      * compared by their own, not inherited, enumerable properties. Functions
59643                      * and DOM nodes are **not** supported. Provide a customizer function to
59644                      * extend support for comparing other values.
59645                      * 
59646                      * @static
59647                      * @memberOf _
59648                      * @alias eq
59649                      * @category Lang
59650                      * @param {*}
59651                      *            value The value to compare.
59652                      * @param {*}
59653                      *            other The other value to compare.
59654                      * @param {Function}
59655                      *            [customizer] The function to customize value comparisons.
59656                      * @param {*}
59657                      *            [thisArg] The `this` binding of `customizer`.
59658                      * @returns {boolean} Returns `true` if the values are equivalent, else
59659                      *          `false`.
59660                      * @example
59661                      * 
59662                      * var object = { 'user': 'fred' }; var other = { 'user': 'fred' };
59663                      * 
59664                      * object == other; // => false
59665                      * 
59666                      * _.isEqual(object, other); // => true
59667                      *  // using a customizer callback var array = ['hello', 'goodbye']; var
59668                      * other = ['hi', 'goodbye'];
59669                      * 
59670                      * _.isEqual(array, other, function(value, other) { if (_.every([value,
59671                      * other], RegExp.prototype.test, /^h(?:i|ello)$/)) { return true; } }); // =>
59672                      * true
59673                      */
59674                     function isEqual(value, other, customizer, thisArg) {
59675                         customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59676                         var result = customizer ? customizer(value, other) : undefined;
59677                         return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
59678                     }
59679
59680                     /**
59681                      * Checks if `value` is an `Error`, `EvalError`, `RangeError`,
59682                      * `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object.
59683                      * 
59684                      * @static
59685                      * @memberOf _
59686                      * @category Lang
59687                      * @param {*}
59688                      *            value The value to check.
59689                      * @returns {boolean} Returns `true` if `value` is an error object, else
59690                      *          `false`.
59691                      * @example
59692                      * 
59693                      * _.isError(new Error); // => true
59694                      * 
59695                      * _.isError(Error); // => false
59696                      */
59697                     function isError(value) {
59698                         return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
59699                     }
59700
59701                     /**
59702                      * Checks if `value` is a finite primitive number.
59703                      * 
59704                      * **Note:** This method is based on
59705                      * [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
59706                      * 
59707                      * @static
59708                      * @memberOf _
59709                      * @category Lang
59710                      * @param {*}
59711                      *            value The value to check.
59712                      * @returns {boolean} Returns `true` if `value` is a finite number, else
59713                      *          `false`.
59714                      * @example
59715                      * 
59716                      * _.isFinite(10); // => true
59717                      * 
59718                      * _.isFinite('10'); // => false
59719                      * 
59720                      * _.isFinite(true); // => false
59721                      * 
59722                      * _.isFinite(Object(10)); // => false
59723                      * 
59724                      * _.isFinite(Infinity); // => false
59725                      */
59726                     function isFinite(value) {
59727                         return typeof value == 'number' && nativeIsFinite(value);
59728                     }
59729
59730                     /**
59731                      * Checks if `value` is classified as a `Function` object.
59732                      * 
59733                      * @static
59734                      * @memberOf _
59735                      * @category Lang
59736                      * @param {*}
59737                      *            value The value to check.
59738                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59739                      *          else `false`.
59740                      * @example
59741                      * 
59742                      * _.isFunction(_); // => true
59743                      * 
59744                      * _.isFunction(/abc/); // => false
59745                      */
59746                     function isFunction(value) {
59747                         // The use of `Object#toString` avoids issues with the `typeof` operator
59748                         // in older versions of Chrome and Safari which return 'function' for
59749                         // regexes
59750                         // and Safari 8 equivalents which return 'object' for typed array
59751                         // constructors.
59752                         return isObject(value) && objToString.call(value) == funcTag;
59753                     }
59754
59755                     /**
59756                      * Checks if `value` is the [language type](https://es5.github.io/#x8) of
59757                      * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
59758                      * `new String('')`)
59759                      * 
59760                      * @static
59761                      * @memberOf _
59762                      * @category Lang
59763                      * @param {*}
59764                      *            value The value to check.
59765                      * @returns {boolean} Returns `true` if `value` is an object, else `false`.
59766                      * @example
59767                      * 
59768                      * _.isObject({}); // => true
59769                      * 
59770                      * _.isObject([1, 2, 3]); // => true
59771                      * 
59772                      * _.isObject(1); // => false
59773                      */
59774                     function isObject(value) {
59775                         // Avoid a V8 JIT bug in Chrome 19-20.
59776                         // See https://code.google.com/p/v8/issues/detail?id=2291 for more
59777                         // details.
59778                         var type = typeof value;
59779                         return !!value && (type == 'object' || type == 'function');
59780                     }
59781
59782                     /**
59783                      * Performs a deep comparison between `object` and `source` to determine if
59784                      * `object` contains equivalent property values. If `customizer` is provided
59785                      * it is invoked to compare values. If `customizer` returns `undefined`
59786                      * comparisons are handled by the method instead. The `customizer` is bound
59787                      * to `thisArg` and invoked with three arguments: (value, other, index|key).
59788                      * 
59789                      * **Note:** This method supports comparing properties of arrays, booleans,
59790                      * `Date` objects, numbers, `Object` objects, regexes, and strings.
59791                      * Functions and DOM nodes are **not** supported. Provide a customizer
59792                      * function to extend support for comparing other values.
59793                      * 
59794                      * @static
59795                      * @memberOf _
59796                      * @category Lang
59797                      * @param {Object}
59798                      *            object The object to inspect.
59799                      * @param {Object}
59800                      *            source The object of property values to match.
59801                      * @param {Function}
59802                      *            [customizer] The function to customize value comparisons.
59803                      * @param {*}
59804                      *            [thisArg] The `this` binding of `customizer`.
59805                      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
59806                      * @example
59807                      * 
59808                      * var object = { 'user': 'fred', 'age': 40 };
59809                      * 
59810                      * _.isMatch(object, { 'age': 40 }); // => true
59811                      * 
59812                      * _.isMatch(object, { 'age': 36 }); // => false
59813                      *  // using a customizer callback var object = { 'greeting': 'hello' }; var
59814                      * source = { 'greeting': 'hi' };
59815                      * 
59816                      * _.isMatch(object, source, function(value, other) { return _.every([value,
59817                      * other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; }); // =>
59818                      * true
59819                      */
59820                     function isMatch(object, source, customizer, thisArg) {
59821                         customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59822                         return baseIsMatch(object, getMatchData(source), customizer);
59823                     }
59824
59825                     /**
59826                      * Checks if `value` is `NaN`.
59827                      * 
59828                      * **Note:** This method is not the same as
59829                      * [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
59830                      * `undefined` and other non-numeric values.
59831                      * 
59832                      * @static
59833                      * @memberOf _
59834                      * @category Lang
59835                      * @param {*}
59836                      *            value The value to check.
59837                      * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
59838                      * @example
59839                      * 
59840                      * _.isNaN(NaN); // => true
59841                      * 
59842                      * _.isNaN(new Number(NaN)); // => true
59843                      * 
59844                      * isNaN(undefined); // => true
59845                      * 
59846                      * _.isNaN(undefined); // => false
59847                      */
59848                     function isNaN(value) {
59849                         // An `NaN` primitive is the only value that is not equal to itself.
59850                         // Perform the `toStringTag` check first to avoid errors with some host
59851                         // objects in IE.
59852                         return isNumber(value) && value != +value;
59853                     }
59854
59855                     /**
59856                      * Checks if `value` is a native function.
59857                      * 
59858                      * @static
59859                      * @memberOf _
59860                      * @category Lang
59861                      * @param {*}
59862                      *            value The value to check.
59863                      * @returns {boolean} Returns `true` if `value` is a native function, else
59864                      *          `false`.
59865                      * @example
59866                      * 
59867                      * _.isNative(Array.prototype.push); // => true
59868                      * 
59869                      * _.isNative(_); // => false
59870                      */
59871                     function isNative(value) {
59872                         if (value == null) {
59873                             return false;
59874                         }
59875                         if (isFunction(value)) {
59876                             return reIsNative.test(fnToString.call(value));
59877                         }
59878                         return isObjectLike(value) && reIsHostCtor.test(value);
59879                     }
59880
59881                     /**
59882                      * Checks if `value` is `null`.
59883                      * 
59884                      * @static
59885                      * @memberOf _
59886                      * @category Lang
59887                      * @param {*}
59888                      *            value The value to check.
59889                      * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
59890                      * @example
59891                      * 
59892                      * _.isNull(null); // => true
59893                      * 
59894                      * _.isNull(void 0); // => false
59895                      */
59896                     function isNull(value) {
59897                         return value === null;
59898                     }
59899
59900                     /**
59901                      * Checks if `value` is classified as a `Number` primitive or object.
59902                      * 
59903                      * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
59904                      * classified as numbers, use the `_.isFinite` method.
59905                      * 
59906                      * @static
59907                      * @memberOf _
59908                      * @category Lang
59909                      * @param {*}
59910                      *            value The value to check.
59911                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59912                      *          else `false`.
59913                      * @example
59914                      * 
59915                      * _.isNumber(8.4); // => true
59916                      * 
59917                      * _.isNumber(NaN); // => true
59918                      * 
59919                      * _.isNumber('8.4'); // => false
59920                      */
59921                     function isNumber(value) {
59922                         return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
59923                     }
59924
59925                     /**
59926                      * Checks if `value` is a plain object, that is, an object created by the
59927                      * `Object` constructor or one with a `[[Prototype]]` of `null`.
59928                      * 
59929                      * **Note:** This method assumes objects created by the `Object` constructor
59930                      * have no inherited enumerable properties.
59931                      * 
59932                      * @static
59933                      * @memberOf _
59934                      * @category Lang
59935                      * @param {*}
59936                      *            value The value to check.
59937                      * @returns {boolean} Returns `true` if `value` is a plain object, else
59938                      *          `false`.
59939                      * @example
59940                      * 
59941                      * function Foo() { this.a = 1; }
59942                      * 
59943                      * _.isPlainObject(new Foo); // => false
59944                      * 
59945                      * _.isPlainObject([1, 2, 3]); // => false
59946                      * 
59947                      * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
59948                      * 
59949                      * _.isPlainObject(Object.create(null)); // => true
59950                      */
59951                     function isPlainObject(value) {
59952                         var Ctor;
59953
59954                         // Exit early for non `Object` objects.
59955                         if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
59956                             (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
59957                             return false;
59958                         }
59959                         // IE < 9 iterates inherited properties before own properties. If the
59960                         // first
59961                         // iterated property is an object's own property then there are no
59962                         // inherited
59963                         // enumerable properties.
59964                         var result;
59965                         // In most environments an object's own properties are iterated before
59966                         // its inherited properties. If the last iterated property is an
59967                         // object's
59968                         // own property then there are no inherited enumerable properties.
59969                         baseForIn(value, function(subValue, key) {
59970                             result = key;
59971                         });
59972                         return result === undefined || hasOwnProperty.call(value, result);
59973                     }
59974
59975                     /**
59976                      * Checks if `value` is classified as a `RegExp` object.
59977                      * 
59978                      * @static
59979                      * @memberOf _
59980                      * @category Lang
59981                      * @param {*}
59982                      *            value The value to check.
59983                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59984                      *          else `false`.
59985                      * @example
59986                      * 
59987                      * _.isRegExp(/abc/); // => true
59988                      * 
59989                      * _.isRegExp('/abc/'); // => false
59990                      */
59991                     function isRegExp(value) {
59992                         return isObject(value) && objToString.call(value) == regexpTag;
59993                     }
59994
59995                     /**
59996                      * Checks if `value` is classified as a `String` primitive or object.
59997                      * 
59998                      * @static
59999                      * @memberOf _
60000                      * @category Lang
60001                      * @param {*}
60002                      *            value The value to check.
60003                      * @returns {boolean} Returns `true` if `value` is correctly classified,
60004                      *          else `false`.
60005                      * @example
60006                      * 
60007                      * _.isString('abc'); // => true
60008                      * 
60009                      * _.isString(1); // => false
60010                      */
60011                     function isString(value) {
60012                         return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
60013                     }
60014
60015                     /**
60016                      * Checks if `value` is classified as a typed array.
60017                      * 
60018                      * @static
60019                      * @memberOf _
60020                      * @category Lang
60021                      * @param {*}
60022                      *            value The value to check.
60023                      * @returns {boolean} Returns `true` if `value` is correctly classified,
60024                      *          else `false`.
60025                      * @example
60026                      * 
60027                      * _.isTypedArray(new Uint8Array); // => true
60028                      * 
60029                      * _.isTypedArray([]); // => false
60030                      */
60031                     function isTypedArray(value) {
60032                         return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
60033                     }
60034
60035                     /**
60036                      * Checks if `value` is `undefined`.
60037                      * 
60038                      * @static
60039                      * @memberOf _
60040                      * @category Lang
60041                      * @param {*}
60042                      *            value The value to check.
60043                      * @returns {boolean} Returns `true` if `value` is `undefined`, else
60044                      *          `false`.
60045                      * @example
60046                      * 
60047                      * _.isUndefined(void 0); // => true
60048                      * 
60049                      * _.isUndefined(null); // => false
60050                      */
60051                     function isUndefined(value) {
60052                         return value === undefined;
60053                     }
60054
60055                     /**
60056                      * Checks if `value` is less than `other`.
60057                      * 
60058                      * @static
60059                      * @memberOf _
60060                      * @category Lang
60061                      * @param {*}
60062                      *            value The value to compare.
60063                      * @param {*}
60064                      *            other The other value to compare.
60065                      * @returns {boolean} Returns `true` if `value` is less than `other`, else
60066                      *          `false`.
60067                      * @example
60068                      * 
60069                      * _.lt(1, 3); // => true
60070                      * 
60071                      * _.lt(3, 3); // => false
60072                      * 
60073                      * _.lt(3, 1); // => false
60074                      */
60075                     function lt(value, other) {
60076                         return value < other;
60077                     }
60078
60079                     /**
60080                      * Checks if `value` is less than or equal to `other`.
60081                      * 
60082                      * @static
60083                      * @memberOf _
60084                      * @category Lang
60085                      * @param {*}
60086                      *            value The value to compare.
60087                      * @param {*}
60088                      *            other The other value to compare.
60089                      * @returns {boolean} Returns `true` if `value` is less than or equal to
60090                      *          `other`, else `false`.
60091                      * @example
60092                      * 
60093                      * _.lte(1, 3); // => true
60094                      * 
60095                      * _.lte(3, 3); // => true
60096                      * 
60097                      * _.lte(3, 1); // => false
60098                      */
60099                     function lte(value, other) {
60100                         return value <= other;
60101                     }
60102
60103                     /**
60104                      * Converts `value` to an array.
60105                      * 
60106                      * @static
60107                      * @memberOf _
60108                      * @category Lang
60109                      * @param {*}
60110                      *            value The value to convert.
60111                      * @returns {Array} Returns the converted array.
60112                      * @example
60113                      * 
60114                      * (function() { return _.toArray(arguments).slice(1); }(1, 2, 3)); // =>
60115                      * [2, 3]
60116                      */
60117                     function toArray(value) {
60118                         var length = value ? getLength(value) : 0;
60119                         if (!isLength(length)) {
60120                             return values(value);
60121                         }
60122                         if (!length) {
60123                             return [];
60124                         }
60125                         return arrayCopy(value);
60126                     }
60127
60128                     /**
60129                      * Converts `value` to a plain object flattening inherited enumerable
60130                      * properties of `value` to own properties of the plain object.
60131                      * 
60132                      * @static
60133                      * @memberOf _
60134                      * @category Lang
60135                      * @param {*}
60136                      *            value The value to convert.
60137                      * @returns {Object} Returns the converted plain object.
60138                      * @example
60139                      * 
60140                      * function Foo() { this.b = 2; }
60141                      * 
60142                      * Foo.prototype.c = 3;
60143                      * 
60144                      * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
60145                      * 
60146                      * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2,
60147                      * 'c': 3 }
60148                      */
60149                     function toPlainObject(value) {
60150                         return baseCopy(value, keysIn(value));
60151                     }
60152
60153                     /*------------------------------------------------------------------------*/
60154
60155                     /**
60156                      * Recursively merges own enumerable properties of the source object(s),
60157                      * that don't resolve to `undefined` into the destination object. Subsequent
60158                      * sources overwrite property assignments of previous sources. If
60159                      * `customizer` is provided it is invoked to produce the merged values of
60160                      * the destination and source properties. If `customizer` returns
60161                      * `undefined` merging is handled by the method instead. The `customizer` is
60162                      * bound to `thisArg` and invoked with five arguments: (objectValue,
60163                      * sourceValue, key, object, source).
60164                      * 
60165                      * @static
60166                      * @memberOf _
60167                      * @category Object
60168                      * @param {Object}
60169                      *            object The destination object.
60170                      * @param {...Object}
60171                      *            [sources] The source objects.
60172                      * @param {Function}
60173                      *            [customizer] The function to customize assigned values.
60174                      * @param {*}
60175                      *            [thisArg] The `this` binding of `customizer`.
60176                      * @returns {Object} Returns `object`.
60177                      * @example
60178                      * 
60179                      * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
60180                      * 
60181                      * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
60182                      * 
60183                      * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
60184                      * 'user': 'fred', 'age': 40 }] }
60185                      *  // using a customizer callback var object = { 'fruits': ['apple'],
60186                      * 'vegetables': ['beet'] };
60187                      * 
60188                      * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
60189                      * 
60190                      * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
60191                      * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
60192                      * ['beet', 'carrot'] }
60193                      */
60194                     var merge = createAssigner(baseMerge);
60195
60196                     /**
60197                      * Assigns own enumerable properties of source object(s) to the destination
60198                      * object. Subsequent sources overwrite property assignments of previous
60199                      * sources. If `customizer` is provided it is invoked to produce the
60200                      * assigned values. The `customizer` is bound to `thisArg` and invoked with
60201                      * five arguments: (objectValue, sourceValue, key, object, source).
60202                      * 
60203                      * **Note:** This method mutates `object` and is based on
60204                      * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
60205                      * 
60206                      * @static
60207                      * @memberOf _
60208                      * @alias extend
60209                      * @category Object
60210                      * @param {Object}
60211                      *            object The destination object.
60212                      * @param {...Object}
60213                      *            [sources] The source objects.
60214                      * @param {Function}
60215                      *            [customizer] The function to customize assigned values.
60216                      * @param {*}
60217                      *            [thisArg] The `this` binding of `customizer`.
60218                      * @returns {Object} Returns `object`.
60219                      * @example
60220                      * 
60221                      * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
60222                      * 'user': 'fred', 'age': 40 }
60223                      *  // using a customizer callback var defaults = _.partialRight(_.assign,
60224                      * function(value, other) { return _.isUndefined(value) ? other : value; });
60225                      * 
60226                      * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60227                      * 'user': 'barney', 'age': 36 }
60228                      */
60229                     var assign = createAssigner(function(object, source, customizer) {
60230                         return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
60231                     });
60232
60233                     /**
60234                      * Creates an object that inherits from the given `prototype` object. If a
60235                      * `properties` object is provided its own enumerable properties are
60236                      * assigned to the created object.
60237                      * 
60238                      * @static
60239                      * @memberOf _
60240                      * @category Object
60241                      * @param {Object}
60242                      *            prototype The object to inherit from.
60243                      * @param {Object}
60244                      *            [properties] The properties to assign to the object.
60245                      * @param- {Object} [guard] Enables use as a callback for functions like
60246                      *         `_.map`.
60247                      * @returns {Object} Returns the new object.
60248                      * @example
60249                      * 
60250                      * function Shape() { this.x = 0; this.y = 0; }
60251                      * 
60252                      * function Circle() { Shape.call(this); }
60253                      * 
60254                      * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
60255                      * 
60256                      * var circle = new Circle; circle instanceof Circle; // => true
60257                      * 
60258                      * circle instanceof Shape; // => true
60259                      */
60260                     function create(prototype, properties, guard) {
60261                         var result = baseCreate(prototype);
60262                         if (guard && isIterateeCall(prototype, properties, guard)) {
60263                             properties = undefined;
60264                         }
60265                         return properties ? baseAssign(result, properties) : result;
60266                     }
60267
60268                     /**
60269                      * Assigns own enumerable properties of source object(s) to the destination
60270                      * object for all destination properties that resolve to `undefined`. Once a
60271                      * property is set, additional values of the same property are ignored.
60272                      * 
60273                      * **Note:** This method mutates `object`.
60274                      * 
60275                      * @static
60276                      * @memberOf _
60277                      * @category Object
60278                      * @param {Object}
60279                      *            object The destination object.
60280                      * @param {...Object}
60281                      *            [sources] The source objects.
60282                      * @returns {Object} Returns `object`.
60283                      * @example
60284                      * 
60285                      * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60286                      * 'user': 'barney', 'age': 36 }
60287                      */
60288                     var defaults = createDefaults(assign, assignDefaults);
60289
60290                     /**
60291                      * This method is like `_.defaults` except that it recursively assigns
60292                      * default properties.
60293                      * 
60294                      * **Note:** This method mutates `object`.
60295                      * 
60296                      * @static
60297                      * @memberOf _
60298                      * @category Object
60299                      * @param {Object}
60300                      *            object The destination object.
60301                      * @param {...Object}
60302                      *            [sources] The source objects.
60303                      * @returns {Object} Returns `object`.
60304                      * @example
60305                      * 
60306                      * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name':
60307                      * 'fred', 'age': 36 } }); // => { 'user': { 'name': 'barney', 'age': 36 } }
60308                      * 
60309                      */
60310                     var defaultsDeep = createDefaults(merge, mergeDefaults);
60311
60312                     /**
60313                      * This method is like `_.find` except that it returns the key of the first
60314                      * element `predicate` returns truthy for instead of the element itself.
60315                      * 
60316                      * If a property name is provided for `predicate` the created `_.property`
60317                      * style callback returns the property value of the given element.
60318                      * 
60319                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60320                      * style callback returns `true` for elements that have a matching property
60321                      * value, else `false`.
60322                      * 
60323                      * If an object is provided for `predicate` the created `_.matches` style
60324                      * callback returns `true` for elements that have the properties of the
60325                      * given object, else `false`.
60326                      * 
60327                      * @static
60328                      * @memberOf _
60329                      * @category Object
60330                      * @param {Object}
60331                      *            object The object to search.
60332                      * @param {Function|Object|string}
60333                      *            [predicate=_.identity] The function invoked per iteration.
60334                      * @param {*}
60335                      *            [thisArg] The `this` binding of `predicate`.
60336                      * @returns {string|undefined} Returns the key of the matched element, else
60337                      *          `undefined`.
60338                      * @example
60339                      * 
60340                      * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60341                      * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60342                      * 
60343                      * _.findKey(users, function(chr) { return chr.age < 40; }); // => 'barney'
60344                      * (iteration order is not guaranteed)
60345                      *  // using the `_.matches` callback shorthand _.findKey(users, { 'age': 1,
60346                      * 'active': true }); // => 'pebbles'
60347                      *  // using the `_.matchesProperty` callback shorthand _.findKey(users,
60348                      * 'active', false); // => 'fred'
60349                      *  // using the `_.property` callback shorthand _.findKey(users, 'active'); // =>
60350                      * 'barney'
60351                      */
60352                     var findKey = createFindKey(baseForOwn);
60353
60354                     /**
60355                      * This method is like `_.findKey` except that it iterates over elements of
60356                      * a collection in the opposite order.
60357                      * 
60358                      * If a property name is provided for `predicate` the created `_.property`
60359                      * style callback returns the property value of the given element.
60360                      * 
60361                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60362                      * style callback returns `true` for elements that have a matching property
60363                      * value, else `false`.
60364                      * 
60365                      * If an object is provided for `predicate` the created `_.matches` style
60366                      * callback returns `true` for elements that have the properties of the
60367                      * given object, else `false`.
60368                      * 
60369                      * @static
60370                      * @memberOf _
60371                      * @category Object
60372                      * @param {Object}
60373                      *            object The object to search.
60374                      * @param {Function|Object|string}
60375                      *            [predicate=_.identity] The function invoked per iteration.
60376                      * @param {*}
60377                      *            [thisArg] The `this` binding of `predicate`.
60378                      * @returns {string|undefined} Returns the key of the matched element, else
60379                      *          `undefined`.
60380                      * @example
60381                      * 
60382                      * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60383                      * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60384                      * 
60385                      * _.findLastKey(users, function(chr) { return chr.age < 40; }); // =>
60386                      * returns `pebbles` assuming `_.findKey` returns `barney`
60387                      *  // using the `_.matches` callback shorthand _.findLastKey(users, {
60388                      * 'age': 36, 'active': true }); // => 'barney'
60389                      *  // using the `_.matchesProperty` callback shorthand _.findLastKey(users,
60390                      * 'active', false); // => 'fred'
60391                      *  // using the `_.property` callback shorthand _.findLastKey(users,
60392                      * 'active'); // => 'pebbles'
60393                      */
60394                     var findLastKey = createFindKey(baseForOwnRight);
60395
60396                     /**
60397                      * Iterates over own and inherited enumerable properties of an object
60398                      * invoking `iteratee` for each property. The `iteratee` is bound to
60399                      * `thisArg` and invoked with three arguments: (value, key, object).
60400                      * Iteratee functions may exit iteration early by explicitly returning
60401                      * `false`.
60402                      * 
60403                      * @static
60404                      * @memberOf _
60405                      * @category Object
60406                      * @param {Object}
60407                      *            object The object to iterate over.
60408                      * @param {Function}
60409                      *            [iteratee=_.identity] The function invoked per iteration.
60410                      * @param {*}
60411                      *            [thisArg] The `this` binding of `iteratee`.
60412                      * @returns {Object} Returns `object`.
60413                      * @example
60414                      * 
60415                      * function Foo() { this.a = 1; this.b = 2; }
60416                      * 
60417                      * Foo.prototype.c = 3;
60418                      * 
60419                      * _.forIn(new Foo, function(value, key) { console.log(key); }); // => logs
60420                      * 'a', 'b', and 'c' (iteration order is not guaranteed)
60421                      */
60422                     var forIn = createForIn(baseFor);
60423
60424                     /**
60425                      * This method is like `_.forIn` except that it iterates over properties of
60426                      * `object` in the opposite order.
60427                      * 
60428                      * @static
60429                      * @memberOf _
60430                      * @category Object
60431                      * @param {Object}
60432                      *            object The object to iterate over.
60433                      * @param {Function}
60434                      *            [iteratee=_.identity] The function invoked per iteration.
60435                      * @param {*}
60436                      *            [thisArg] The `this` binding of `iteratee`.
60437                      * @returns {Object} Returns `object`.
60438                      * @example
60439                      * 
60440                      * function Foo() { this.a = 1; this.b = 2; }
60441                      * 
60442                      * Foo.prototype.c = 3;
60443                      * 
60444                      * _.forInRight(new Foo, function(value, key) { console.log(key); }); // =>
60445                      * logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
60446                      */
60447                     var forInRight = createForIn(baseForRight);
60448
60449                     /**
60450                      * Iterates over own enumerable properties of an object invoking `iteratee`
60451                      * for each property. The `iteratee` is bound to `thisArg` and invoked with
60452                      * three arguments: (value, key, object). Iteratee functions may exit
60453                      * iteration early by explicitly returning `false`.
60454                      * 
60455                      * @static
60456                      * @memberOf _
60457                      * @category Object
60458                      * @param {Object}
60459                      *            object The object to iterate over.
60460                      * @param {Function}
60461                      *            [iteratee=_.identity] The function invoked per iteration.
60462                      * @param {*}
60463                      *            [thisArg] The `this` binding of `iteratee`.
60464                      * @returns {Object} Returns `object`.
60465                      * @example
60466                      * 
60467                      * function Foo() { this.a = 1; this.b = 2; }
60468                      * 
60469                      * Foo.prototype.c = 3;
60470                      * 
60471                      * _.forOwn(new Foo, function(value, key) { console.log(key); }); // => logs
60472                      * 'a' and 'b' (iteration order is not guaranteed)
60473                      */
60474                     var forOwn = createForOwn(baseForOwn);
60475
60476                     /**
60477                      * This method is like `_.forOwn` except that it iterates over properties of
60478                      * `object` in the opposite order.
60479                      * 
60480                      * @static
60481                      * @memberOf _
60482                      * @category Object
60483                      * @param {Object}
60484                      *            object The object to iterate over.
60485                      * @param {Function}
60486                      *            [iteratee=_.identity] The function invoked per iteration.
60487                      * @param {*}
60488                      *            [thisArg] The `this` binding of `iteratee`.
60489                      * @returns {Object} Returns `object`.
60490                      * @example
60491                      * 
60492                      * function Foo() { this.a = 1; this.b = 2; }
60493                      * 
60494                      * Foo.prototype.c = 3;
60495                      * 
60496                      * _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // =>
60497                      * logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
60498                      */
60499                     var forOwnRight = createForOwn(baseForOwnRight);
60500
60501                     /**
60502                      * Creates an array of function property names from all enumerable
60503                      * properties, own and inherited, of `object`.
60504                      * 
60505                      * @static
60506                      * @memberOf _
60507                      * @alias methods
60508                      * @category Object
60509                      * @param {Object}
60510                      *            object The object to inspect.
60511                      * @returns {Array} Returns the new array of property names.
60512                      * @example
60513                      * 
60514                      * _.functions(_); // => ['after', 'ary', 'assign', ...]
60515                      */
60516                     function functions(object) {
60517                         return baseFunctions(object, keysIn(object));
60518                     }
60519
60520                     /**
60521                      * Gets the property value at `path` of `object`. If the resolved value is
60522                      * `undefined` the `defaultValue` is used in its place.
60523                      * 
60524                      * @static
60525                      * @memberOf _
60526                      * @category Object
60527                      * @param {Object}
60528                      *            object The object to query.
60529                      * @param {Array|string}
60530                      *            path The path of the property to get.
60531                      * @param {*}
60532                      *            [defaultValue] The value returned if the resolved value is
60533                      *            `undefined`.
60534                      * @returns {*} Returns the resolved value.
60535                      * @example
60536                      * 
60537                      * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60538                      * 
60539                      * _.get(object, 'a[0].b.c'); // => 3
60540                      * 
60541                      * _.get(object, ['a', '0', 'b', 'c']); // => 3
60542                      * 
60543                      * _.get(object, 'a.b.c', 'default'); // => 'default'
60544                      */
60545                     function get(object, path, defaultValue) {
60546                         var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
60547                         return result === undefined ? defaultValue : result;
60548                     }
60549
60550                     /**
60551                      * Checks if `path` is a direct property.
60552                      * 
60553                      * @static
60554                      * @memberOf _
60555                      * @category Object
60556                      * @param {Object}
60557                      *            object The object to query.
60558                      * @param {Array|string}
60559                      *            path The path to check.
60560                      * @returns {boolean} Returns `true` if `path` is a direct property, else
60561                      *          `false`.
60562                      * @example
60563                      * 
60564                      * var object = { 'a': { 'b': { 'c': 3 } } };
60565                      * 
60566                      * _.has(object, 'a'); // => true
60567                      * 
60568                      * _.has(object, 'a.b.c'); // => true
60569                      * 
60570                      * _.has(object, ['a', 'b', 'c']); // => true
60571                      */
60572                     function has(object, path) {
60573                         if (object == null) {
60574                             return false;
60575                         }
60576                         var result = hasOwnProperty.call(object, path);
60577                         if (!result && !isKey(path)) {
60578                             path = toPath(path);
60579                             object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60580                             if (object == null) {
60581                                 return false;
60582                             }
60583                             path = last(path);
60584                             result = hasOwnProperty.call(object, path);
60585                         }
60586                         return result || (isLength(object.length) && isIndex(path, object.length) &&
60587                             (isArray(object) || isArguments(object)));
60588                     }
60589
60590                     /**
60591                      * Creates an object composed of the inverted keys and values of `object`.
60592                      * If `object` contains duplicate values, subsequent values overwrite
60593                      * property assignments of previous values unless `multiValue` is `true`.
60594                      * 
60595                      * @static
60596                      * @memberOf _
60597                      * @category Object
60598                      * @param {Object}
60599                      *            object The object to invert.
60600                      * @param {boolean}
60601                      *            [multiValue] Allow multiple values per key.
60602                      * @param- {Object} [guard] Enables use as a callback for functions like
60603                      *         `_.map`.
60604                      * @returns {Object} Returns the new inverted object.
60605                      * @example
60606                      * 
60607                      * var object = { 'a': 1, 'b': 2, 'c': 1 };
60608                      * 
60609                      * _.invert(object); // => { '1': 'c', '2': 'b' }
60610                      *  // with `multiValue` _.invert(object, true); // => { '1': ['a', 'c'],
60611                      * '2': ['b'] }
60612                      */
60613                     function invert(object, multiValue, guard) {
60614                         if (guard && isIterateeCall(object, multiValue, guard)) {
60615                             multiValue = undefined;
60616                         }
60617                         var index = -1,
60618                             props = keys(object),
60619                             length = props.length,
60620                             result = {};
60621
60622                         while (++index < length) {
60623                             var key = props[index],
60624                                 value = object[key];
60625
60626                             if (multiValue) {
60627                                 if (hasOwnProperty.call(result, value)) {
60628                                     result[value].push(key);
60629                                 } else {
60630                                     result[value] = [key];
60631                                 }
60632                             } else {
60633                                 result[value] = key;
60634                             }
60635                         }
60636                         return result;
60637                     }
60638
60639                     /**
60640                      * Creates an array of the own enumerable property names of `object`.
60641                      * 
60642                      * **Note:** Non-object values are coerced to objects. See the [ES
60643                      * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for
60644                      * more details.
60645                      * 
60646                      * @static
60647                      * @memberOf _
60648                      * @category Object
60649                      * @param {Object}
60650                      *            object The object to query.
60651                      * @returns {Array} Returns the array of property names.
60652                      * @example
60653                      * 
60654                      * function Foo() { this.a = 1; this.b = 2; }
60655                      * 
60656                      * Foo.prototype.c = 3;
60657                      * 
60658                      * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
60659                      * 
60660                      * _.keys('hi'); // => ['0', '1']
60661                      */
60662                     var keys = !nativeKeys ? shimKeys : function(object) {
60663                         var Ctor = object == null ? undefined : object.constructor;
60664                         if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
60665                             (typeof object != 'function' && isArrayLike(object))) {
60666                             return shimKeys(object);
60667                         }
60668                         return isObject(object) ? nativeKeys(object) : [];
60669                     };
60670
60671                     /**
60672                      * Creates an array of the own and inherited enumerable property names of
60673                      * `object`.
60674                      * 
60675                      * **Note:** Non-object values are coerced to objects.
60676                      * 
60677                      * @static
60678                      * @memberOf _
60679                      * @category Object
60680                      * @param {Object}
60681                      *            object The object to query.
60682                      * @returns {Array} Returns the array of property names.
60683                      * @example
60684                      * 
60685                      * function Foo() { this.a = 1; this.b = 2; }
60686                      * 
60687                      * Foo.prototype.c = 3;
60688                      * 
60689                      * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not
60690                      * guaranteed)
60691                      */
60692                     function keysIn(object) {
60693                         if (object == null) {
60694                             return [];
60695                         }
60696                         if (!isObject(object)) {
60697                             object = Object(object);
60698                         }
60699                         var length = object.length;
60700                         length = (length && isLength(length) &&
60701                             (isArray(object) || isArguments(object)) && length) || 0;
60702
60703                         var Ctor = object.constructor,
60704                             index = -1,
60705                             isProto = typeof Ctor == 'function' && Ctor.prototype === object,
60706                             result = Array(length),
60707                             skipIndexes = length > 0;
60708
60709                         while (++index < length) {
60710                             result[index] = (index + '');
60711                         }
60712                         for (var key in object) {
60713                             if (!(skipIndexes && isIndex(key, length)) &&
60714                                 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
60715                                 result.push(key);
60716                             }
60717                         }
60718                         return result;
60719                     }
60720
60721                     /**
60722                      * The opposite of `_.mapValues`; this method creates an object with the
60723                      * same values as `object` and keys generated by running each own enumerable
60724                      * property of `object` through `iteratee`.
60725                      * 
60726                      * @static
60727                      * @memberOf _
60728                      * @category Object
60729                      * @param {Object}
60730                      *            object The object to iterate over.
60731                      * @param {Function|Object|string}
60732                      *            [iteratee=_.identity] The function invoked per iteration.
60733                      * @param {*}
60734                      *            [thisArg] The `this` binding of `iteratee`.
60735                      * @returns {Object} Returns the new mapped object.
60736                      * @example
60737                      * 
60738                      * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { return key + value;
60739                      * }); // => { 'a1': 1, 'b2': 2 }
60740                      */
60741                     var mapKeys = createObjectMapper(true);
60742
60743                     /**
60744                      * Creates an object with the same keys as `object` and values generated by
60745                      * running each own enumerable property of `object` through `iteratee`. The
60746                      * iteratee function is bound to `thisArg` and invoked with three arguments:
60747                      * (value, key, object).
60748                      * 
60749                      * If a property name is provided for `iteratee` the created `_.property`
60750                      * style callback returns the property value of the given element.
60751                      * 
60752                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60753                      * style callback returns `true` for elements that have a matching property
60754                      * value, else `false`.
60755                      * 
60756                      * If an object is provided for `iteratee` the created `_.matches` style
60757                      * callback returns `true` for elements that have the properties of the
60758                      * given object, else `false`.
60759                      * 
60760                      * @static
60761                      * @memberOf _
60762                      * @category Object
60763                      * @param {Object}
60764                      *            object The object to iterate over.
60765                      * @param {Function|Object|string}
60766                      *            [iteratee=_.identity] The function invoked per iteration.
60767                      * @param {*}
60768                      *            [thisArg] The `this` binding of `iteratee`.
60769                      * @returns {Object} Returns the new mapped object.
60770                      * @example
60771                      * 
60772                      * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { return n * 3; }); // => {
60773                      * 'a': 3, 'b': 6 }
60774                      * 
60775                      * var users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user':
60776                      * 'pebbles', 'age': 1 } };
60777                      *  // using the `_.property` callback shorthand _.mapValues(users, 'age'); // => {
60778                      * 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
60779                      */
60780                     var mapValues = createObjectMapper();
60781
60782                     /**
60783                      * The opposite of `_.pick`; this method creates an object composed of the
60784                      * own and inherited enumerable properties of `object` that are not omitted.
60785                      * 
60786                      * @static
60787                      * @memberOf _
60788                      * @category Object
60789                      * @param {Object}
60790                      *            object The source object.
60791                      * @param {Function|...(string|string[])}
60792                      *            [predicate] The function invoked per iteration or property
60793                      *            names to omit, specified as individual property names or
60794                      *            arrays of property names.
60795                      * @param {*}
60796                      *            [thisArg] The `this` binding of `predicate`.
60797                      * @returns {Object} Returns the new object.
60798                      * @example
60799                      * 
60800                      * var object = { 'user': 'fred', 'age': 40 };
60801                      * 
60802                      * _.omit(object, 'age'); // => { 'user': 'fred' }
60803                      * 
60804                      * _.omit(object, _.isNumber); // => { 'user': 'fred' }
60805                      */
60806                     var omit = restParam(function(object, props) {
60807                         if (object == null) {
60808                             return {};
60809                         }
60810                         if (typeof props[0] != 'function') {
60811                             var props = arrayMap(baseFlatten(props), String);
60812                             return pickByArray(object, baseDifference(keysIn(object), props));
60813                         }
60814                         var predicate = bindCallback(props[0], props[1], 3);
60815                         return pickByCallback(object, function(value, key, object) {
60816                             return !predicate(value, key, object);
60817                         });
60818                     });
60819
60820                     /**
60821                      * Creates a two dimensional array of the key-value pairs for `object`, e.g.
60822                      * `[[key1, value1], [key2, value2]]`.
60823                      * 
60824                      * @static
60825                      * @memberOf _
60826                      * @category Object
60827                      * @param {Object}
60828                      *            object The object to query.
60829                      * @returns {Array} Returns the new array of key-value pairs.
60830                      * @example
60831                      * 
60832                      * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred',
60833                      * 40]] (iteration order is not guaranteed)
60834                      */
60835                     function pairs(object) {
60836                         object = toObject(object);
60837
60838                         var index = -1,
60839                             props = keys(object),
60840                             length = props.length,
60841                             result = Array(length);
60842
60843                         while (++index < length) {
60844                             var key = props[index];
60845                             result[index] = [key, object[key]];
60846                         }
60847                         return result;
60848                     }
60849
60850                     /**
60851                      * Creates an object composed of the picked `object` properties. Property
60852                      * names may be specified as individual arguments or as arrays of property
60853                      * names. If `predicate` is provided it is invoked for each property of
60854                      * `object` picking the properties `predicate` returns truthy for. The
60855                      * predicate is bound to `thisArg` and invoked with three arguments: (value,
60856                      * key, object).
60857                      * 
60858                      * @static
60859                      * @memberOf _
60860                      * @category Object
60861                      * @param {Object}
60862                      *            object The source object.
60863                      * @param {Function|...(string|string[])}
60864                      *            [predicate] The function invoked per iteration or property
60865                      *            names to pick, specified as individual property names or
60866                      *            arrays of property names.
60867                      * @param {*}
60868                      *            [thisArg] The `this` binding of `predicate`.
60869                      * @returns {Object} Returns the new object.
60870                      * @example
60871                      * 
60872                      * var object = { 'user': 'fred', 'age': 40 };
60873                      * 
60874                      * _.pick(object, 'user'); // => { 'user': 'fred' }
60875                      * 
60876                      * _.pick(object, _.isString); // => { 'user': 'fred' }
60877                      */
60878                     var pick = restParam(function(object, props) {
60879                         if (object == null) {
60880                             return {};
60881                         }
60882                         return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
60883                     });
60884
60885                     /**
60886                      * This method is like `_.get` except that if the resolved value is a
60887                      * function it is invoked with the `this` binding of its parent object and
60888                      * its result is returned.
60889                      * 
60890                      * @static
60891                      * @memberOf _
60892                      * @category Object
60893                      * @param {Object}
60894                      *            object The object to query.
60895                      * @param {Array|string}
60896                      *            path The path of the property to resolve.
60897                      * @param {*}
60898                      *            [defaultValue] The value returned if the resolved value is
60899                      *            `undefined`.
60900                      * @returns {*} Returns the resolved value.
60901                      * @example
60902                      * 
60903                      * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
60904                      * 
60905                      * _.result(object, 'a[0].b.c1'); // => 3
60906                      * 
60907                      * _.result(object, 'a[0].b.c2'); // => 4
60908                      * 
60909                      * _.result(object, 'a.b.c', 'default'); // => 'default'
60910                      * 
60911                      * _.result(object, 'a.b.c', _.constant('default')); // => 'default'
60912                      */
60913                     function result(object, path, defaultValue) {
60914                         var result = object == null ? undefined : object[path];
60915                         if (result === undefined) {
60916                             if (object != null && !isKey(path, object)) {
60917                                 path = toPath(path);
60918                                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60919                                 result = object == null ? undefined : object[last(path)];
60920                             }
60921                             result = result === undefined ? defaultValue : result;
60922                         }
60923                         return isFunction(result) ? result.call(object) : result;
60924                     }
60925
60926                     /**
60927                      * Sets the property value of `path` on `object`. If a portion of `path`
60928                      * does not exist it is created.
60929                      * 
60930                      * @static
60931                      * @memberOf _
60932                      * @category Object
60933                      * @param {Object}
60934                      *            object The object to augment.
60935                      * @param {Array|string}
60936                      *            path The path of the property to set.
60937                      * @param {*}
60938                      *            value The value to set.
60939                      * @returns {Object} Returns `object`.
60940                      * @example
60941                      * 
60942                      * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60943                      * 
60944                      * _.set(object, 'a[0].b.c', 4); console.log(object.a[0].b.c); // => 4
60945                      * 
60946                      * _.set(object, 'x[0].y.z', 5); console.log(object.x[0].y.z); // => 5
60947                      */
60948                     function set(object, path, value) {
60949                         if (object == null) {
60950                             return object;
60951                         }
60952                         var pathKey = (path + '');
60953                         path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
60954
60955                         var index = -1,
60956                             length = path.length,
60957                             lastIndex = length - 1,
60958                             nested = object;
60959
60960                         while (nested != null && ++index < length) {
60961                             var key = path[index];
60962                             if (isObject(nested)) {
60963                                 if (index == lastIndex) {
60964                                     nested[key] = value;
60965                                 } else if (nested[key] == null) {
60966                                     nested[key] = isIndex(path[index + 1]) ? [] : {};
60967                                 }
60968                             }
60969                             nested = nested[key];
60970                         }
60971                         return object;
60972                     }
60973
60974                     /**
60975                      * An alternative to `_.reduce`; this method transforms `object` to a new
60976                      * `accumulator` object which is the result of running each of its own
60977                      * enumerable properties through `iteratee`, with each invocation
60978                      * potentially mutating the `accumulator` object. The `iteratee` is bound to
60979                      * `thisArg` and invoked with four arguments: (accumulator, value, key,
60980                      * object). Iteratee functions may exit iteration early by explicitly
60981                      * returning `false`.
60982                      * 
60983                      * @static
60984                      * @memberOf _
60985                      * @category Object
60986                      * @param {Array|Object}
60987                      *            object The object to iterate over.
60988                      * @param {Function}
60989                      *            [iteratee=_.identity] The function invoked per iteration.
60990                      * @param {*}
60991                      *            [accumulator] The custom accumulator value.
60992                      * @param {*}
60993                      *            [thisArg] The `this` binding of `iteratee`.
60994                      * @returns {*} Returns the accumulated value.
60995                      * @example
60996                      * 
60997                      * _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return
60998                      * n % 2 == 0; }); // => [4, 9]
60999                      * 
61000                      * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] =
61001                      * n * 3; }); // => { 'a': 3, 'b': 6 }
61002                      */
61003                     function transform(object, iteratee, accumulator, thisArg) {
61004                         var isArr = isArray(object) || isTypedArray(object);
61005                         iteratee = getCallback(iteratee, thisArg, 4);
61006
61007                         if (accumulator == null) {
61008                             if (isArr || isObject(object)) {
61009                                 var Ctor = object.constructor;
61010                                 if (isArr) {
61011                                     accumulator = isArray(object) ? new Ctor : [];
61012                                 } else {
61013                                     accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
61014                                 }
61015                             } else {
61016                                 accumulator = {};
61017                             }
61018                         }
61019                         (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
61020                             return iteratee(accumulator, value, index, object);
61021                         });
61022                         return accumulator;
61023                     }
61024
61025                     /**
61026                      * Creates an array of the own enumerable property values of `object`.
61027                      * 
61028                      * **Note:** Non-object values are coerced to objects.
61029                      * 
61030                      * @static
61031                      * @memberOf _
61032                      * @category Object
61033                      * @param {Object}
61034                      *            object The object to query.
61035                      * @returns {Array} Returns the array of property values.
61036                      * @example
61037                      * 
61038                      * function Foo() { this.a = 1; this.b = 2; }
61039                      * 
61040                      * Foo.prototype.c = 3;
61041                      * 
61042                      * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
61043                      * 
61044                      * _.values('hi'); // => ['h', 'i']
61045                      */
61046                     function values(object) {
61047                         return baseValues(object, keys(object));
61048                     }
61049
61050                     /**
61051                      * Creates an array of the own and inherited enumerable property values of
61052                      * `object`.
61053                      * 
61054                      * **Note:** Non-object values are coerced to objects.
61055                      * 
61056                      * @static
61057                      * @memberOf _
61058                      * @category Object
61059                      * @param {Object}
61060                      *            object The object to query.
61061                      * @returns {Array} Returns the array of property values.
61062                      * @example
61063                      * 
61064                      * function Foo() { this.a = 1; this.b = 2; }
61065                      * 
61066                      * Foo.prototype.c = 3;
61067                      * 
61068                      * _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed)
61069                      */
61070                     function valuesIn(object) {
61071                         return baseValues(object, keysIn(object));
61072                     }
61073
61074                     /*------------------------------------------------------------------------*/
61075
61076                     /**
61077                      * Checks if `n` is between `start` and up to but not including, `end`. If
61078                      * `end` is not specified it is set to `start` with `start` then set to `0`.
61079                      * 
61080                      * @static
61081                      * @memberOf _
61082                      * @category Number
61083                      * @param {number}
61084                      *            n The number to check.
61085                      * @param {number}
61086                      *            [start=0] The start of the range.
61087                      * @param {number}
61088                      *            end The end of the range.
61089                      * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
61090                      * @example
61091                      * 
61092                      * _.inRange(3, 2, 4); // => true
61093                      * 
61094                      * _.inRange(4, 8); // => true
61095                      * 
61096                      * _.inRange(4, 2); // => false
61097                      * 
61098                      * _.inRange(2, 2); // => false
61099                      * 
61100                      * _.inRange(1.2, 2); // => true
61101                      * 
61102                      * _.inRange(5.2, 4); // => false
61103                      */
61104                     function inRange(value, start, end) {
61105                         start = +start || 0;
61106                         if (end === undefined) {
61107                             end = start;
61108                             start = 0;
61109                         } else {
61110                             end = +end || 0;
61111                         }
61112                         return value >= nativeMin(start, end) && value < nativeMax(start, end);
61113                     }
61114
61115                     /**
61116                      * Produces a random number between `min` and `max` (inclusive). If only one
61117                      * argument is provided a number between `0` and the given number is
61118                      * returned. If `floating` is `true`, or either `min` or `max` are floats, a
61119                      * floating-point number is returned instead of an integer.
61120                      * 
61121                      * @static
61122                      * @memberOf _
61123                      * @category Number
61124                      * @param {number}
61125                      *            [min=0] The minimum possible value.
61126                      * @param {number}
61127                      *            [max=1] The maximum possible value.
61128                      * @param {boolean}
61129                      *            [floating] Specify returning a floating-point number.
61130                      * @returns {number} Returns the random number.
61131                      * @example
61132                      * 
61133                      * _.random(0, 5); // => an integer between 0 and 5
61134                      * 
61135                      * _.random(5); // => also an integer between 0 and 5
61136                      * 
61137                      * _.random(5, true); // => a floating-point number between 0 and 5
61138                      * 
61139                      * _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2
61140                      */
61141                     function random(min, max, floating) {
61142                         if (floating && isIterateeCall(min, max, floating)) {
61143                             max = floating = undefined;
61144                         }
61145                         var noMin = min == null,
61146                             noMax = max == null;
61147
61148                         if (floating == null) {
61149                             if (noMax && typeof min == 'boolean') {
61150                                 floating = min;
61151                                 min = 1;
61152                             } else if (typeof max == 'boolean') {
61153                                 floating = max;
61154                                 noMax = true;
61155                             }
61156                         }
61157                         if (noMin && noMax) {
61158                             max = 1;
61159                             noMax = false;
61160                         }
61161                         min = +min || 0;
61162                         if (noMax) {
61163                             max = min;
61164                             min = 0;
61165                         } else {
61166                             max = +max || 0;
61167                         }
61168                         if (floating || min % 1 || max % 1) {
61169                             var rand = nativeRandom();
61170                             return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
61171                         }
61172                         return baseRandom(min, max);
61173                     }
61174
61175                     /*------------------------------------------------------------------------*/
61176
61177                     /**
61178                      * Converts `string` to [camel
61179                      * case](https://en.wikipedia.org/wiki/CamelCase).
61180                      * 
61181                      * @static
61182                      * @memberOf _
61183                      * @category String
61184                      * @param {string}
61185                      *            [string=''] The string to convert.
61186                      * @returns {string} Returns the camel cased string.
61187                      * @example
61188                      * 
61189                      * _.camelCase('Foo Bar'); // => 'fooBar'
61190                      * 
61191                      * _.camelCase('--foo-bar'); // => 'fooBar'
61192                      * 
61193                      * _.camelCase('__foo_bar__'); // => 'fooBar'
61194                      */
61195                     var camelCase = createCompounder(function(result, word, index) {
61196                         word = word.toLowerCase();
61197                         return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
61198                     });
61199
61200                     /**
61201                      * Capitalizes the first character of `string`.
61202                      * 
61203                      * @static
61204                      * @memberOf _
61205                      * @category String
61206                      * @param {string}
61207                      *            [string=''] The string to capitalize.
61208                      * @returns {string} Returns the capitalized string.
61209                      * @example
61210                      * 
61211                      * _.capitalize('fred'); // => 'Fred'
61212                      */
61213                     function capitalize(string) {
61214                         string = baseToString(string);
61215                         return string && (string.charAt(0).toUpperCase() + string.slice(1));
61216                     }
61217
61218                     /**
61219                      * Deburrs `string` by converting [latin-1 supplementary
61220                      * letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
61221                      * to basic latin letters and removing [combining diacritical
61222                      * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
61223                      * 
61224                      * @static
61225                      * @memberOf _
61226                      * @category String
61227                      * @param {string}
61228                      *            [string=''] The string to deburr.
61229                      * @returns {string} Returns the deburred string.
61230                      * @example
61231                      * 
61232                      * _.deburr('déjà vu'); // => 'deja vu'
61233                      */
61234                     function deburr(string) {
61235                         string = baseToString(string);
61236                         return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
61237                     }
61238
61239                     /**
61240                      * Checks if `string` ends with the given target string.
61241                      * 
61242                      * @static
61243                      * @memberOf _
61244                      * @category String
61245                      * @param {string}
61246                      *            [string=''] The string to search.
61247                      * @param {string}
61248                      *            [target] The string to search for.
61249                      * @param {number}
61250                      *            [position=string.length] The position to search from.
61251                      * @returns {boolean} Returns `true` if `string` ends with `target`, else
61252                      *          `false`.
61253                      * @example
61254                      * 
61255                      * _.endsWith('abc', 'c'); // => true
61256                      * 
61257                      * _.endsWith('abc', 'b'); // => false
61258                      * 
61259                      * _.endsWith('abc', 'b', 2); // => true
61260                      */
61261                     function endsWith(string, target, position) {
61262                         string = baseToString(string);
61263                         target = (target + '');
61264
61265                         var length = string.length;
61266                         position = position === undefined ? length : nativeMin(position < 0 ? 0 : (+position || 0), length);
61267
61268                         position -= target.length;
61269                         return position >= 0 && string.indexOf(target, position) == position;
61270                     }
61271
61272                     /**
61273                      * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string`
61274                      * to their corresponding HTML entities.
61275                      * 
61276                      * **Note:** No other characters are escaped. To escape additional
61277                      * characters use a third-party library like [_he_](https://mths.be/he).
61278                      * 
61279                      * Though the ">" character is escaped for symmetry, characters like ">" and
61280                      * "/" don't need escaping in HTML and have no special meaning unless
61281                      * they're part of a tag or unquoted attribute value. See [Mathias Bynens's
61282                      * article](https://mathiasbynens.be/notes/ambiguous-ampersands) (under
61283                      * "semi-related fun fact") for more details.
61284                      * 
61285                      * Backticks are escaped because in Internet Explorer < 9, they can break
61286                      * out of attribute values or HTML comments. See
61287                      * [#59](https://html5sec.org/#59), [#102](https://html5sec.org/#102),
61288                      * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133)
61289                      * of the [HTML5 Security Cheatsheet](https://html5sec.org/) for more
61290                      * details.
61291                      * 
61292                      * When working with HTML you should always [quote attribute
61293                      * values](http://wonko.com/post/html-escaping) to reduce XSS vectors.
61294                      * 
61295                      * @static
61296                      * @memberOf _
61297                      * @category String
61298                      * @param {string}
61299                      *            [string=''] The string to escape.
61300                      * @returns {string} Returns the escaped string.
61301                      * @example
61302                      * 
61303                      * _.escape('fred, barney, & pebbles'); // => 'fred, barney, &amp; pebbles'
61304                      */
61305                     function escape(string) {
61306                         // Reset `lastIndex` because in IE < 9 `String#replace` does not.
61307                         string = baseToString(string);
61308                         return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
61309                     }
61310
61311                     /**
61312                      * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|",
61313                      * "?", "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
61314                      * 
61315                      * @static
61316                      * @memberOf _
61317                      * @category String
61318                      * @param {string}
61319                      *            [string=''] The string to escape.
61320                      * @returns {string} Returns the escaped string.
61321                      * @example
61322                      * 
61323                      * _.escapeRegExp('[lodash](https://lodash.com/)'); // =>
61324                      * '\[lodash\]\(https:\/\/lodash\.com\/\)'
61325                      */
61326                     function escapeRegExp(string) {
61327                         string = baseToString(string);
61328                         return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, escapeRegExpChar) : (string || '(?:)');
61329                     }
61330
61331                     /**
61332                      * Converts `string` to [kebab
61333                      * case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
61334                      * 
61335                      * @static
61336                      * @memberOf _
61337                      * @category String
61338                      * @param {string}
61339                      *            [string=''] The string to convert.
61340                      * @returns {string} Returns the kebab cased string.
61341                      * @example
61342                      * 
61343                      * _.kebabCase('Foo Bar'); // => 'foo-bar'
61344                      * 
61345                      * _.kebabCase('fooBar'); // => 'foo-bar'
61346                      * 
61347                      * _.kebabCase('__foo_bar__'); // => 'foo-bar'
61348                      */
61349                     var kebabCase = createCompounder(function(result, word, index) {
61350                         return result + (index ? '-' : '') + word.toLowerCase();
61351                     });
61352
61353                     /**
61354                      * Pads `string` on the left and right sides if it's shorter than `length`.
61355                      * Padding characters are truncated if they can't be evenly divided by
61356                      * `length`.
61357                      * 
61358                      * @static
61359                      * @memberOf _
61360                      * @category String
61361                      * @param {string}
61362                      *            [string=''] The string to pad.
61363                      * @param {number}
61364                      *            [length=0] The padding length.
61365                      * @param {string}
61366                      *            [chars=' '] The string used as padding.
61367                      * @returns {string} Returns the padded string.
61368                      * @example
61369                      * 
61370                      * _.pad('abc', 8); // => ' abc '
61371                      * 
61372                      * _.pad('abc', 8, '_-'); // => '_-abc_-_'
61373                      * 
61374                      * _.pad('abc', 3); // => 'abc'
61375                      */
61376                     function pad(string, length, chars) {
61377                         string = baseToString(string);
61378                         length = +length;
61379
61380                         var strLength = string.length;
61381                         if (strLength >= length || !nativeIsFinite(length)) {
61382                             return string;
61383                         }
61384                         var mid = (length - strLength) / 2,
61385                             leftLength = nativeFloor(mid),
61386                             rightLength = nativeCeil(mid);
61387
61388                         chars = createPadding('', rightLength, chars);
61389                         return chars.slice(0, leftLength) + string + chars;
61390                     }
61391
61392                     /**
61393                      * Pads `string` on the left side if it's shorter than `length`. Padding
61394                      * characters are truncated if they exceed `length`.
61395                      * 
61396                      * @static
61397                      * @memberOf _
61398                      * @category String
61399                      * @param {string}
61400                      *            [string=''] The string to pad.
61401                      * @param {number}
61402                      *            [length=0] The padding length.
61403                      * @param {string}
61404                      *            [chars=' '] The string used as padding.
61405                      * @returns {string} Returns the padded string.
61406                      * @example
61407                      * 
61408                      * _.padLeft('abc', 6); // => ' abc'
61409                      * 
61410                      * _.padLeft('abc', 6, '_-'); // => '_-_abc'
61411                      * 
61412                      * _.padLeft('abc', 3); // => 'abc'
61413                      */
61414                     var padLeft = createPadDir();
61415
61416                     /**
61417                      * Pads `string` on the right side if it's shorter than `length`. Padding
61418                      * characters are truncated if they exceed `length`.
61419                      * 
61420                      * @static
61421                      * @memberOf _
61422                      * @category String
61423                      * @param {string}
61424                      *            [string=''] The string to pad.
61425                      * @param {number}
61426                      *            [length=0] The padding length.
61427                      * @param {string}
61428                      *            [chars=' '] The string used as padding.
61429                      * @returns {string} Returns the padded string.
61430                      * @example
61431                      * 
61432                      * _.padRight('abc', 6); // => 'abc '
61433                      * 
61434                      * _.padRight('abc', 6, '_-'); // => 'abc_-_'
61435                      * 
61436                      * _.padRight('abc', 3); // => 'abc'
61437                      */
61438                     var padRight = createPadDir(true);
61439
61440                     /**
61441                      * Converts `string` to an integer of the specified radix. If `radix` is
61442                      * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
61443                      * hexadecimal, in which case a `radix` of `16` is used.
61444                      * 
61445                      * **Note:** This method aligns with the [ES5
61446                      * implementation](https://es5.github.io/#E) of `parseInt`.
61447                      * 
61448                      * @static
61449                      * @memberOf _
61450                      * @category String
61451                      * @param {string}
61452                      *            string The string to convert.
61453                      * @param {number}
61454                      *            [radix] The radix to interpret `value` by.
61455                      * @param- {Object} [guard] Enables use as a callback for functions like
61456                      *         `_.map`.
61457                      * @returns {number} Returns the converted integer.
61458                      * @example
61459                      * 
61460                      * _.parseInt('08'); // => 8
61461                      * 
61462                      * _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10]
61463                      */
61464                     function parseInt(string, radix, guard) {
61465                         // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
61466                         // Chrome fails to trim leading <BOM> whitespace characters.
61467                         // See https://code.google.com/p/v8/issues/detail?id=3109 for more
61468                         // details.
61469                         if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
61470                             radix = 0;
61471                         } else if (radix) {
61472                             radix = +radix;
61473                         }
61474                         string = trim(string);
61475                         return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
61476                     }
61477
61478                     /**
61479                      * Repeats the given string `n` times.
61480                      * 
61481                      * @static
61482                      * @memberOf _
61483                      * @category String
61484                      * @param {string}
61485                      *            [string=''] The string to repeat.
61486                      * @param {number}
61487                      *            [n=0] The number of times to repeat the string.
61488                      * @returns {string} Returns the repeated string.
61489                      * @example
61490                      * 
61491                      * _.repeat('*', 3); // => '***'
61492                      * 
61493                      * _.repeat('abc', 2); // => 'abcabc'
61494                      * 
61495                      * _.repeat('abc', 0); // => ''
61496                      */
61497                     function repeat(string, n) {
61498                         var result = '';
61499                         string = baseToString(string);
61500                         n = +n;
61501                         if (n < 1 || !string || !nativeIsFinite(n)) {
61502                             return result;
61503                         }
61504                         // Leverage the exponentiation by squaring algorithm for a faster
61505                         // repeat.
61506                         // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more
61507                         // details.
61508                         do {
61509                             if (n % 2) {
61510                                 result += string;
61511                             }
61512                             n = nativeFloor(n / 2);
61513                             string += string;
61514                         } while (n);
61515
61516                         return result;
61517                     }
61518
61519                     /**
61520                      * Converts `string` to [snake
61521                      * case](https://en.wikipedia.org/wiki/Snake_case).
61522                      * 
61523                      * @static
61524                      * @memberOf _
61525                      * @category String
61526                      * @param {string}
61527                      *            [string=''] The string to convert.
61528                      * @returns {string} Returns the snake cased string.
61529                      * @example
61530                      * 
61531                      * _.snakeCase('Foo Bar'); // => 'foo_bar'
61532                      * 
61533                      * _.snakeCase('fooBar'); // => 'foo_bar'
61534                      * 
61535                      * _.snakeCase('--foo-bar'); // => 'foo_bar'
61536                      */
61537                     var snakeCase = createCompounder(function(result, word, index) {
61538                         return result + (index ? '_' : '') + word.toLowerCase();
61539                     });
61540
61541                     /**
61542                      * Converts `string` to [start
61543                      * case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
61544                      * 
61545                      * @static
61546                      * @memberOf _
61547                      * @category String
61548                      * @param {string}
61549                      *            [string=''] The string to convert.
61550                      * @returns {string} Returns the start cased string.
61551                      * @example
61552                      * 
61553                      * _.startCase('--foo-bar'); // => 'Foo Bar'
61554                      * 
61555                      * _.startCase('fooBar'); // => 'Foo Bar'
61556                      * 
61557                      * _.startCase('__foo_bar__'); // => 'Foo Bar'
61558                      */
61559                     var startCase = createCompounder(function(result, word, index) {
61560                         return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
61561                     });
61562
61563                     /**
61564                      * Checks if `string` starts with the given target string.
61565                      * 
61566                      * @static
61567                      * @memberOf _
61568                      * @category String
61569                      * @param {string}
61570                      *            [string=''] The string to search.
61571                      * @param {string}
61572                      *            [target] The string to search for.
61573                      * @param {number}
61574                      *            [position=0] The position to search from.
61575                      * @returns {boolean} Returns `true` if `string` starts with `target`, else
61576                      *          `false`.
61577                      * @example
61578                      * 
61579                      * _.startsWith('abc', 'a'); // => true
61580                      * 
61581                      * _.startsWith('abc', 'b'); // => false
61582                      * 
61583                      * _.startsWith('abc', 'b', 1); // => true
61584                      */
61585                     function startsWith(string, target, position) {
61586                         string = baseToString(string);
61587                         position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
61588
61589                         return string.lastIndexOf(target, position) == position;
61590                     }
61591
61592                     /**
61593                      * Creates a compiled template function that can interpolate data properties
61594                      * in "interpolate" delimiters, HTML-escape interpolated data properties in
61595                      * "escape" delimiters, and execute JavaScript in "evaluate" delimiters.
61596                      * Data properties may be accessed as free variables in the template. If a
61597                      * setting object is provided it takes precedence over `_.templateSettings`
61598                      * values.
61599                      * 
61600                      * **Note:** In the development build `_.template` utilizes
61601                      * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
61602                      * for easier debugging.
61603                      * 
61604                      * For more information on precompiling templates see [lodash's custom
61605                      * builds documentation](https://lodash.com/custom-builds).
61606                      * 
61607                      * For more information on Chrome extension sandboxes see [Chrome's
61608                      * extensions
61609                      * documentation](https://developer.chrome.com/extensions/sandboxingEval).
61610                      * 
61611                      * @static
61612                      * @memberOf _
61613                      * @category String
61614                      * @param {string}
61615                      *            [string=''] The template string.
61616                      * @param {Object}
61617                      *            [options] The options object.
61618                      * @param {RegExp}
61619                      *            [options.escape] The HTML "escape" delimiter.
61620                      * @param {RegExp}
61621                      *            [options.evaluate] The "evaluate" delimiter.
61622                      * @param {Object}
61623                      *            [options.imports] An object to import into the template as
61624                      *            free variables.
61625                      * @param {RegExp}
61626                      *            [options.interpolate] The "interpolate" delimiter.
61627                      * @param {string}
61628                      *            [options.sourceURL] The sourceURL of the template's compiled
61629                      *            source.
61630                      * @param {string}
61631                      *            [options.variable] The data object variable name.
61632                      * @param- {Object} [otherOptions] Enables the legacy `options` param
61633                      *         signature.
61634                      * @returns {Function} Returns the compiled template function.
61635                      * @example
61636                      *  // using the "interpolate" delimiter to create a compiled
61637                      * template var compiled = _.template('hello <%= user %>!'); compiled({
61638                      * 'user': 'fred' }); // => 'hello fred!'
61639                      *  // using the HTML "escape" delimiter to escape data property values var
61640                      * compiled = _.template('<b><%- value %></b>'); compiled({ 'value': '<script>'
61641                      * }); // => '<b>&lt;script&gt;</b>'
61642                      *  // using the "evaluate" delimiter to execute JavaScript and generate
61643                      * HTML var compiled = _.template('<% _.forEach(users, function(user) { %>
61644                      * <li><%- user %></li><% }); %>'); compiled({ 'users': ['fred',
61645                      * 'barney'] }); // => '
61646                      * <li>fred</li>
61647                      * <li>barney</li>'
61648                      *  // using the internal `print` function in "evaluate" delimiters var
61649                      * compiled = _.template('<% print("hello " + user); %>!'); compiled({
61650                      * 'user': 'barney' }); // => 'hello barney!'
61651                      *  // using the ES delimiter as an alternative to the default "interpolate"
61652                      * delimiter var compiled = _.template('hello ${ user }!'); compiled({
61653                      * 'user': 'pebbles' }); // => 'hello pebbles!'
61654                      *  // using custom template delimiters _.templateSettings.interpolate =
61655                      * /{{([\s\S]+?)}}/g; var compiled = _.template('hello {{ user }}!');
61656                      * compiled({ 'user': 'mustache' }); // => 'hello mustache!'
61657                      *  // using backslashes to treat delimiters as plain text var compiled =
61658                      * _.template('<%= "\\<%- value %\\>" %>'); compiled({ 'value': 'ignored'
61659                      * }); // => '<%- value %>'
61660                      *  // using the `imports` option to import `jQuery` as `jq` var text = '<%
61661                      * jq.each(users, function(user) { %>
61662                      * <li><%- user %></li><% }); %>'; var compiled = _.template(text, {
61663                      * 'imports': { 'jq': jQuery } }); compiled({ 'users': ['fred', 'barney']
61664                      * }); // => '
61665                      * <li>fred</li>
61666                      * <li>barney</li>'
61667                      *  // using the `sourceURL` option to specify a custom sourceURL for the
61668                      * template var compiled = _.template('hello <%= user %>!', { 'sourceURL':
61669                      * '/basic/greeting.jst' }); compiled(data); // => find the source of
61670                      * "greeting.jst" under the Sources tab or Resources panel of the web
61671                      * inspector
61672                      *  // using the `variable` option to ensure a with-statement isn't used in
61673                      * the compiled template var compiled = _.template('hi <%= data.user %>!', {
61674                      * 'variable': 'data' }); compiled.source; // => function(data) { // var
61675                      * __t, __p = ''; // __p += 'hi ' + ((__t = ( data.user )) == null ? '' :
61676                      * __t) + '!'; // return __p; // }
61677                      *  // using the `source` property to inline compiled templates for
61678                      * meaningful // line numbers in error messages and a stack trace
61679                      * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ var JST = {\ "main": ' +
61680                      * _.template(mainText).source + '\ };\ ');
61681                      */
61682                     function template(string, options, otherOptions) {
61683                         // Based on John Resig's `tmpl` implementation
61684                         // (http://ejohn.org/blog/javascript-micro-templating/)
61685                         // and Laura Doktorova's doT.js (https://github.com/olado/doT).
61686                         var settings = lodash.templateSettings;
61687
61688                         if (otherOptions && isIterateeCall(string, options, otherOptions)) {
61689                             options = otherOptions = undefined;
61690                         }
61691                         string = baseToString(string);
61692                         options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
61693
61694                         var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
61695                             importsKeys = keys(imports),
61696                             importsValues = baseValues(imports, importsKeys);
61697
61698                         var isEscaping,
61699                             isEvaluating,
61700                             index = 0,
61701                             interpolate = options.interpolate || reNoMatch,
61702                             source = "__p += '";
61703
61704                         // Compile the regexp to match each delimiter.
61705                         var reDelimiters = RegExp(
61706                             (options.escape || reNoMatch).source + '|' +
61707                             interpolate.source + '|' +
61708                             (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
61709                             (options.evaluate || reNoMatch).source + '|$', 'g');
61710
61711                         // Use a sourceURL for easier debugging.
61712                         var sourceURL = '//# sourceURL=' +
61713                             ('sourceURL' in options ? options.sourceURL : ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n';
61714
61715                         string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
61716                             interpolateValue || (interpolateValue = esTemplateValue);
61717
61718                             // Escape characters that can't be included in string literals.
61719                             source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
61720
61721                             // Replace delimiters with snippets.
61722                             if (escapeValue) {
61723                                 isEscaping = true;
61724                                 source += "' +\n__e(" + escapeValue + ") +\n'";
61725                             }
61726                             if (evaluateValue) {
61727                                 isEvaluating = true;
61728                                 source += "';\n" + evaluateValue + ";\n__p += '";
61729                             }
61730                             if (interpolateValue) {
61731                                 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
61732                             }
61733                             index = offset + match.length;
61734
61735                             // The JS engine embedded in Adobe products requires returning the
61736                             // `match`
61737                             // string in order to produce the correct `offset` value.
61738                             return match;
61739                         });
61740
61741                         source += "';\n";
61742
61743                         // If `variable` is not specified wrap a with-statement around the
61744                         // generated
61745                         // code to add the data object to the top of the scope chain.
61746                         var variable = options.variable;
61747                         if (!variable) {
61748                             source = 'with (obj) {\n' + source + '\n}\n';
61749                         }
61750                         // Cleanup code by stripping empty strings.
61751                         source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
61752                             .replace(reEmptyStringMiddle, '$1')
61753                             .replace(reEmptyStringTrailing, '$1;');
61754
61755                         // Frame code as the function body.
61756                         source = 'function(' + (variable || 'obj') + ') {\n' +
61757                             (variable ? '' : 'obj || (obj = {});\n') +
61758                             "var __t, __p = ''" +
61759                             (isEscaping ? ', __e = _.escape' : '') +
61760                             (isEvaluating ? ', __j = Array.prototype.join;\n' +
61761                                 "function print() { __p += __j.call(arguments, '') }\n" : ';\n'
61762                             ) +
61763                             source +
61764                             'return __p\n}';
61765
61766                         var result = attempt(function() {
61767                             return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
61768                         });
61769
61770                         // Provide the compiled function's source by its `toString` method or
61771                         // the `source` property as a convenience for inlining compiled
61772                         // templates.
61773                         result.source = source;
61774                         if (isError(result)) {
61775                             throw result;
61776                         }
61777                         return result;
61778                     }
61779
61780                     /**
61781                      * Removes leading and trailing whitespace or specified characters from
61782                      * `string`.
61783                      * 
61784                      * @static
61785                      * @memberOf _
61786                      * @category String
61787                      * @param {string}
61788                      *            [string=''] The string to trim.
61789                      * @param {string}
61790                      *            [chars=whitespace] The characters to trim.
61791                      * @param- {Object} [guard] Enables use as a callback for functions like
61792                      *         `_.map`.
61793                      * @returns {string} Returns the trimmed string.
61794                      * @example
61795                      * 
61796                      * _.trim(' abc '); // => 'abc'
61797                      * 
61798                      * _.trim('-_-abc-_-', '_-'); // => 'abc'
61799                      * 
61800                      * _.map([' foo ', ' bar '], _.trim); // => ['foo', 'bar']
61801                      */
61802                     function trim(string, chars, guard) {
61803                         var value = string;
61804                         string = baseToString(string);
61805                         if (!string) {
61806                             return string;
61807                         }
61808                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61809                             return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
61810                         }
61811                         chars = (chars + '');
61812                         return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
61813                     }
61814
61815                     /**
61816                      * Removes leading whitespace or specified characters from `string`.
61817                      * 
61818                      * @static
61819                      * @memberOf _
61820                      * @category String
61821                      * @param {string}
61822                      *            [string=''] The string to trim.
61823                      * @param {string}
61824                      *            [chars=whitespace] The characters to trim.
61825                      * @param- {Object} [guard] Enables use as a callback for functions like
61826                      *         `_.map`.
61827                      * @returns {string} Returns the trimmed string.
61828                      * @example
61829                      * 
61830                      * _.trimLeft(' abc '); // => 'abc '
61831                      * 
61832                      * _.trimLeft('-_-abc-_-', '_-'); // => 'abc-_-'
61833                      */
61834                     function trimLeft(string, chars, guard) {
61835                         var value = string;
61836                         string = baseToString(string);
61837                         if (!string) {
61838                             return string;
61839                         }
61840                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61841                             return string.slice(trimmedLeftIndex(string));
61842                         }
61843                         return string.slice(charsLeftIndex(string, (chars + '')));
61844                     }
61845
61846                     /**
61847                      * Removes trailing whitespace or specified characters from `string`.
61848                      * 
61849                      * @static
61850                      * @memberOf _
61851                      * @category String
61852                      * @param {string}
61853                      *            [string=''] The string to trim.
61854                      * @param {string}
61855                      *            [chars=whitespace] The characters to trim.
61856                      * @param- {Object} [guard] Enables use as a callback for functions like
61857                      *         `_.map`.
61858                      * @returns {string} Returns the trimmed string.
61859                      * @example
61860                      * 
61861                      * _.trimRight(' abc '); // => ' abc'
61862                      * 
61863                      * _.trimRight('-_-abc-_-', '_-'); // => '-_-abc'
61864                      */
61865                     function trimRight(string, chars, guard) {
61866                         var value = string;
61867                         string = baseToString(string);
61868                         if (!string) {
61869                             return string;
61870                         }
61871                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61872                             return string.slice(0, trimmedRightIndex(string) + 1);
61873                         }
61874                         return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
61875                     }
61876
61877                     /**
61878                      * Truncates `string` if it's longer than the given maximum string length.
61879                      * The last characters of the truncated string are replaced with the
61880                      * omission string which defaults to "...".
61881                      * 
61882                      * @static
61883                      * @memberOf _
61884                      * @category String
61885                      * @param {string}
61886                      *            [string=''] The string to truncate.
61887                      * @param {Object|number}
61888                      *            [options] The options object or maximum string length.
61889                      * @param {number}
61890                      *            [options.length=30] The maximum string length.
61891                      * @param {string}
61892                      *            [options.omission='...'] The string to indicate text is
61893                      *            omitted.
61894                      * @param {RegExp|string}
61895                      *            [options.separator] The separator pattern to truncate to.
61896                      * @param- {Object} [guard] Enables use as a callback for functions like
61897                      *         `_.map`.
61898                      * @returns {string} Returns the truncated string.
61899                      * @example
61900                      * 
61901                      * _.trunc('hi-diddly-ho there, neighborino'); // => 'hi-diddly-ho there,
61902                      * neighbo...'
61903                      * 
61904                      * _.trunc('hi-diddly-ho there, neighborino', 24); // => 'hi-diddly-ho
61905                      * there, n...'
61906                      * 
61907                      * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' '
61908                      * }); // => 'hi-diddly-ho there,...'
61909                      * 
61910                      * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator':
61911                      * /,? +/ }); // => 'hi-diddly-ho there...'
61912                      * 
61913                      * _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); // =>
61914                      * 'hi-diddly-ho there, neig [...]'
61915                      */
61916                     function trunc(string, options, guard) {
61917                         if (guard && isIterateeCall(string, options, guard)) {
61918                             options = undefined;
61919                         }
61920                         var length = DEFAULT_TRUNC_LENGTH,
61921                             omission = DEFAULT_TRUNC_OMISSION;
61922
61923                         if (options != null) {
61924                             if (isObject(options)) {
61925                                 var separator = 'separator' in options ? options.separator : separator;
61926                                 length = 'length' in options ? (+options.length || 0) : length;
61927                                 omission = 'omission' in options ? baseToString(options.omission) : omission;
61928                             } else {
61929                                 length = +options || 0;
61930                             }
61931                         }
61932                         string = baseToString(string);
61933                         if (length >= string.length) {
61934                             return string;
61935                         }
61936                         var end = length - omission.length;
61937                         if (end < 1) {
61938                             return omission;
61939                         }
61940                         var result = string.slice(0, end);
61941                         if (separator == null) {
61942                             return result + omission;
61943                         }
61944                         if (isRegExp(separator)) {
61945                             if (string.slice(end).search(separator)) {
61946                                 var match,
61947                                     newEnd,
61948                                     substring = string.slice(0, end);
61949
61950                                 if (!separator.global) {
61951                                     separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
61952                                 }
61953                                 separator.lastIndex = 0;
61954                                 while ((match = separator.exec(substring))) {
61955                                     newEnd = match.index;
61956                                 }
61957                                 result = result.slice(0, newEnd == null ? end : newEnd);
61958                             }
61959                         } else if (string.indexOf(separator, end) != end) {
61960                             var index = result.lastIndexOf(separator);
61961                             if (index > -1) {
61962                                 result = result.slice(0, index);
61963                             }
61964                         }
61965                         return result + omission;
61966                     }
61967
61968                     /**
61969                      * The inverse of `_.escape`; this method converts the HTML entities
61970                      * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
61971                      * their corresponding characters.
61972                      * 
61973                      * **Note:** No other HTML entities are unescaped. To unescape additional
61974                      * HTML entities use a third-party library like [_he_](https://mths.be/he).
61975                      * 
61976                      * @static
61977                      * @memberOf _
61978                      * @category String
61979                      * @param {string}
61980                      *            [string=''] The string to unescape.
61981                      * @returns {string} Returns the unescaped string.
61982                      * @example
61983                      * 
61984                      * _.unescape('fred, barney, &amp; pebbles'); // => 'fred, barney, &
61985                      * pebbles'
61986                      */
61987                     function unescape(string) {
61988                         string = baseToString(string);
61989                         return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
61990                     }
61991
61992                     /**
61993                      * Splits `string` into an array of its words.
61994                      * 
61995                      * @static
61996                      * @memberOf _
61997                      * @category String
61998                      * @param {string}
61999                      *            [string=''] The string to inspect.
62000                      * @param {RegExp|string}
62001                      *            [pattern] The pattern to match words.
62002                      * @param- {Object} [guard] Enables use as a callback for functions like
62003                      *         `_.map`.
62004                      * @returns {Array} Returns the words of `string`.
62005                      * @example
62006                      * 
62007                      * _.words('fred, barney, & pebbles'); // => ['fred', 'barney', 'pebbles']
62008                      * 
62009                      * _.words('fred, barney, & pebbles', /[^, ]+/g); // => ['fred', 'barney',
62010                      * '&', 'pebbles']
62011                      */
62012                     function words(string, pattern, guard) {
62013                         if (guard && isIterateeCall(string, pattern, guard)) {
62014                             pattern = undefined;
62015                         }
62016                         string = baseToString(string);
62017                         return string.match(pattern || reWords) || [];
62018                     }
62019
62020                     /*------------------------------------------------------------------------*/
62021
62022                     /**
62023                      * Attempts to invoke `func`, returning either the result or the caught
62024                      * error object. Any additional arguments are provided to `func` when it is
62025                      * invoked.
62026                      * 
62027                      * @static
62028                      * @memberOf _
62029                      * @category Utility
62030                      * @param {Function}
62031                      *            func The function to attempt.
62032                      * @returns {*} Returns the `func` result or error object.
62033                      * @example
62034                      *  // avoid throwing errors for invalid selectors var elements =
62035                      * _.attempt(function(selector) { return
62036                      * document.querySelectorAll(selector); }, '>_>');
62037                      * 
62038                      * if (_.isError(elements)) { elements = []; }
62039                      */
62040                     var attempt = restParam(function(func, args) {
62041                         try {
62042                             return func.apply(undefined, args);
62043                         } catch (e) {
62044                             return isError(e) ? e : new Error(e);
62045                         }
62046                     });
62047
62048                     /**
62049                      * Creates a function that invokes `func` with the `this` binding of
62050                      * `thisArg` and arguments of the created function. If `func` is a property
62051                      * name the created callback returns the property value for a given element.
62052                      * If `func` is an object the created callback returns `true` for elements
62053                      * that contain the equivalent object properties, otherwise it returns
62054                      * `false`.
62055                      * 
62056                      * @static
62057                      * @memberOf _
62058                      * @alias iteratee
62059                      * @category Utility
62060                      * @param {*}
62061                      *            [func=_.identity] The value to convert to a callback.
62062                      * @param {*}
62063                      *            [thisArg] The `this` binding of `func`.
62064                      * @param- {Object} [guard] Enables use as a callback for functions like
62065                      *         `_.map`.
62066                      * @returns {Function} Returns the callback.
62067                      * @example
62068                      * 
62069                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62070                      * 40 } ];
62071                      *  // wrap to create custom callback shorthands _.callback =
62072                      * _.wrap(_.callback, function(callback, func, thisArg) { var match =
62073                      * /^(.+?)__([gl]t)(.+)$/.exec(func); if (!match) { return callback(func,
62074                      * thisArg); } return function(object) { return match[2] == 'gt' ?
62075                      * object[match[1]] > match[3] : object[match[1]] < match[3]; }; });
62076                      * 
62077                      * _.filter(users, 'age__gt36'); // => [{ 'user': 'fred', 'age': 40 }]
62078                      */
62079                     function callback(func, thisArg, guard) {
62080                         if (guard && isIterateeCall(func, thisArg, guard)) {
62081                             thisArg = undefined;
62082                         }
62083                         return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg);
62084                     }
62085
62086                     /**
62087                      * Creates a function that returns `value`.
62088                      * 
62089                      * @static
62090                      * @memberOf _
62091                      * @category Utility
62092                      * @param {*}
62093                      *            value The value to return from the new function.
62094                      * @returns {Function} Returns the new function.
62095                      * @example
62096                      * 
62097                      * var object = { 'user': 'fred' }; var getter = _.constant(object);
62098                      * 
62099                      * getter() === object; // => true
62100                      */
62101                     function constant(value) {
62102                         return function() {
62103                             return value;
62104                         };
62105                     }
62106
62107                     /**
62108                      * This method returns the first argument provided to it.
62109                      * 
62110                      * @static
62111                      * @memberOf _
62112                      * @category Utility
62113                      * @param {*}
62114                      *            value Any value.
62115                      * @returns {*} Returns `value`.
62116                      * @example
62117                      * 
62118                      * var object = { 'user': 'fred' };
62119                      * 
62120                      * _.identity(object) === object; // => true
62121                      */
62122                     function identity(value) {
62123                         return value;
62124                     }
62125
62126                     /**
62127                      * Creates a function that performs a deep comparison between a given object
62128                      * and `source`, returning `true` if the given object has equivalent
62129                      * property values, else `false`.
62130                      * 
62131                      * **Note:** This method supports comparing arrays, booleans, `Date`
62132                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
62133                      * compared by their own, not inherited, enumerable properties. For
62134                      * comparing a single own or inherited property value see
62135                      * `_.matchesProperty`.
62136                      * 
62137                      * @static
62138                      * @memberOf _
62139                      * @category Utility
62140                      * @param {Object}
62141                      *            source The object of property values to match.
62142                      * @returns {Function} Returns the new function.
62143                      * @example
62144                      * 
62145                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
62146                      * 'fred', 'age': 40, 'active': false } ];
62147                      * 
62148                      * _.filter(users, _.matches({ 'age': 40, 'active': false })); // => [{
62149                      * 'user': 'fred', 'age': 40, 'active': false }]
62150                      */
62151                     function matches(source) {
62152                         return baseMatches(baseClone(source, true));
62153                     }
62154
62155                     /**
62156                      * Creates a function that compares the property value of `path` on a given
62157                      * object to `value`.
62158                      * 
62159                      * **Note:** This method supports comparing arrays, booleans, `Date`
62160                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
62161                      * compared by their own, not inherited, enumerable properties.
62162                      * 
62163                      * @static
62164                      * @memberOf _
62165                      * @category Utility
62166                      * @param {Array|string}
62167                      *            path The path of the property to get.
62168                      * @param {*}
62169                      *            srcValue The value to match.
62170                      * @returns {Function} Returns the new function.
62171                      * @example
62172                      * 
62173                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
62174                      * 
62175                      * _.find(users, _.matchesProperty('user', 'fred')); // => { 'user': 'fred' }
62176                      */
62177                     function matchesProperty(path, srcValue) {
62178                         return baseMatchesProperty(path, baseClone(srcValue, true));
62179                     }
62180
62181                     /**
62182                      * Creates a function that invokes the method at `path` on a given object.
62183                      * Any additional arguments are provided to the invoked method.
62184                      * 
62185                      * @static
62186                      * @memberOf _
62187                      * @category Utility
62188                      * @param {Array|string}
62189                      *            path The path of the method to invoke.
62190                      * @param {...*}
62191                      *            [args] The arguments to invoke the method with.
62192                      * @returns {Function} Returns the new function.
62193                      * @example
62194                      * 
62195                      * var objects = [ { 'a': { 'b': { 'c': _.constant(2) } } }, { 'a': { 'b': {
62196                      * 'c': _.constant(1) } } } ];
62197                      * 
62198                      * _.map(objects, _.method('a.b.c')); // => [2, 1]
62199                      * 
62200                      * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); // =>
62201                      * [1, 2]
62202                      */
62203                     var method = restParam(function(path, args) {
62204                         return function(object) {
62205                             return invokePath(object, path, args);
62206                         };
62207                     });
62208
62209                     /**
62210                      * The opposite of `_.method`; this method creates a function that invokes
62211                      * the method at a given path on `object`. Any additional arguments are
62212                      * provided to the invoked method.
62213                      * 
62214                      * @static
62215                      * @memberOf _
62216                      * @category Utility
62217                      * @param {Object}
62218                      *            object The object to query.
62219                      * @param {...*}
62220                      *            [args] The arguments to invoke the method with.
62221                      * @returns {Function} Returns the new function.
62222                      * @example
62223                      * 
62224                      * var array = _.times(3, _.constant), object = { 'a': array, 'b': array,
62225                      * 'c': array };
62226                      * 
62227                      * _.map(['a[2]', 'c[0]'], _.methodOf(object)); // => [2, 0]
62228                      * 
62229                      * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); // => [2, 0]
62230                      */
62231                     var methodOf = restParam(function(object, args) {
62232                         return function(path) {
62233                             return invokePath(object, path, args);
62234                         };
62235                     });
62236
62237                     /**
62238                      * Adds all own enumerable function properties of a source object to the
62239                      * destination object. If `object` is a function then methods are added to
62240                      * its prototype as well.
62241                      * 
62242                      * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
62243                      * avoid conflicts caused by modifying the original.
62244                      * 
62245                      * @static
62246                      * @memberOf _
62247                      * @category Utility
62248                      * @param {Function|Object}
62249                      *            [object=lodash] The destination object.
62250                      * @param {Object}
62251                      *            source The object of functions to add.
62252                      * @param {Object}
62253                      *            [options] The options object.
62254                      * @param {boolean}
62255                      *            [options.chain=true] Specify whether the functions added are
62256                      *            chainable.
62257                      * @returns {Function|Object} Returns `object`.
62258                      * @example
62259                      * 
62260                      * function vowels(string) { return _.filter(string, function(v) { return
62261                      * /[aeiou]/i.test(v); }); }
62262                      * 
62263                      * _.mixin({ 'vowels': vowels }); _.vowels('fred'); // => ['e']
62264                      * 
62265                      * _('fred').vowels().value(); // => ['e']
62266                      * 
62267                      * _.mixin({ 'vowels': vowels }, { 'chain': false }); _('fred').vowels(); // =>
62268                      * ['e']
62269                      */
62270                     function mixin(object, source, options) {
62271                         if (options == null) {
62272                             var isObj = isObject(source),
62273                                 props = isObj ? keys(source) : undefined,
62274                                 methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
62275
62276                             if (!(methodNames ? methodNames.length : isObj)) {
62277                                 methodNames = false;
62278                                 options = source;
62279                                 source = object;
62280                                 object = this;
62281                             }
62282                         }
62283                         if (!methodNames) {
62284                             methodNames = baseFunctions(source, keys(source));
62285                         }
62286                         var chain = true,
62287                             index = -1,
62288                             isFunc = isFunction(object),
62289                             length = methodNames.length;
62290
62291                         if (options === false) {
62292                             chain = false;
62293                         } else if (isObject(options) && 'chain' in options) {
62294                             chain = options.chain;
62295                         }
62296                         while (++index < length) {
62297                             var methodName = methodNames[index],
62298                                 func = source[methodName];
62299
62300                             object[methodName] = func;
62301                             if (isFunc) {
62302                                 object.prototype[methodName] = (function(func) {
62303                                     return function() {
62304                                         var chainAll = this.__chain__;
62305                                         if (chain || chainAll) {
62306                                             var result = object(this.__wrapped__),
62307                                                 actions = result.__actions__ = arrayCopy(this.__actions__);
62308
62309                                             actions.push({
62310                                                 'func': func,
62311                                                 'args': arguments,
62312                                                 'thisArg': object
62313                                             });
62314                                             result.__chain__ = chainAll;
62315                                             return result;
62316                                         }
62317                                         return func.apply(object, arrayPush([this.value()], arguments));
62318                                     };
62319                                 }(func));
62320                             }
62321                         }
62322                         return object;
62323                     }
62324
62325                     /**
62326                      * Reverts the `_` variable to its previous value and returns a reference to
62327                      * the `lodash` function.
62328                      * 
62329                      * @static
62330                      * @memberOf _
62331                      * @category Utility
62332                      * @returns {Function} Returns the `lodash` function.
62333                      * @example
62334                      * 
62335                      * var lodash = _.noConflict();
62336                      */
62337                     function noConflict() {
62338                         root._ = oldDash;
62339                         return this;
62340                     }
62341
62342                     /**
62343                      * A no-operation function that returns `undefined` regardless of the
62344                      * arguments it receives.
62345                      * 
62346                      * @static
62347                      * @memberOf _
62348                      * @category Utility
62349                      * @example
62350                      * 
62351                      * var object = { 'user': 'fred' };
62352                      * 
62353                      * _.noop(object) === undefined; // => true
62354                      */
62355                     function noop() {
62356                         // No operation performed.
62357                     }
62358
62359                     /**
62360                      * Creates a function that returns the property value at `path` on a given
62361                      * object.
62362                      * 
62363                      * @static
62364                      * @memberOf _
62365                      * @category Utility
62366                      * @param {Array|string}
62367                      *            path The path of the property to get.
62368                      * @returns {Function} Returns the new function.
62369                      * @example
62370                      * 
62371                      * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
62372                      * 
62373                      * _.map(objects, _.property('a.b.c')); // => [2, 1]
62374                      * 
62375                      * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // =>
62376                      * [1, 2]
62377                      */
62378                     function property(path) {
62379                         return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
62380                     }
62381
62382                     /**
62383                      * The opposite of `_.property`; this method creates a function that returns
62384                      * the property value at a given path on `object`.
62385                      * 
62386                      * @static
62387                      * @memberOf _
62388                      * @category Utility
62389                      * @param {Object}
62390                      *            object The object to query.
62391                      * @returns {Function} Returns the new function.
62392                      * @example
62393                      * 
62394                      * var array = [0, 1, 2], object = { 'a': array, 'b': array, 'c': array };
62395                      * 
62396                      * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); // => [2, 0]
62397                      * 
62398                      * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); // => [2, 0]
62399                      */
62400                     function propertyOf(object) {
62401                         return function(path) {
62402                             return baseGet(object, toPath(path), path + '');
62403                         };
62404                     }
62405
62406                     /**
62407                      * Creates an array of numbers (positive and/or negative) progressing from
62408                      * `start` up to, but not including, `end`. If `end` is not specified it is
62409                      * set to `start` with `start` then set to `0`. If `end` is less than
62410                      * `start` a zero-length range is created unless a negative `step` is
62411                      * specified.
62412                      * 
62413                      * @static
62414                      * @memberOf _
62415                      * @category Utility
62416                      * @param {number}
62417                      *            [start=0] The start of the range.
62418                      * @param {number}
62419                      *            end The end of the range.
62420                      * @param {number}
62421                      *            [step=1] The value to increment or decrement by.
62422                      * @returns {Array} Returns the new array of numbers.
62423                      * @example
62424                      * 
62425                      * _.range(4); // => [0, 1, 2, 3]
62426                      * 
62427                      * _.range(1, 5); // => [1, 2, 3, 4]
62428                      * 
62429                      * _.range(0, 20, 5); // => [0, 5, 10, 15]
62430                      * 
62431                      * _.range(0, -4, -1); // => [0, -1, -2, -3]
62432                      * 
62433                      * _.range(1, 4, 0); // => [1, 1, 1]
62434                      * 
62435                      * _.range(0); // => []
62436                      */
62437                     function range(start, end, step) {
62438                         if (step && isIterateeCall(start, end, step)) {
62439                             end = step = undefined;
62440                         }
62441                         start = +start || 0;
62442                         step = step == null ? 1 : (+step || 0);
62443
62444                         if (end == null) {
62445                             end = start;
62446                             start = 0;
62447                         } else {
62448                             end = +end || 0;
62449                         }
62450                         // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
62451                         // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
62452                         var index = -1,
62453                             length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
62454                             result = Array(length);
62455
62456                         while (++index < length) {
62457                             result[index] = start;
62458                             start += step;
62459                         }
62460                         return result;
62461                     }
62462
62463                     /**
62464                      * Invokes the iteratee function `n` times, returning an array of the
62465                      * results of each invocation. The `iteratee` is bound to `thisArg` and
62466                      * invoked with one argument; (index).
62467                      * 
62468                      * @static
62469                      * @memberOf _
62470                      * @category Utility
62471                      * @param {number}
62472                      *            n The number of times to invoke `iteratee`.
62473                      * @param {Function}
62474                      *            [iteratee=_.identity] The function invoked per iteration.
62475                      * @param {*}
62476                      *            [thisArg] The `this` binding of `iteratee`.
62477                      * @returns {Array} Returns the array of results.
62478                      * @example
62479                      * 
62480                      * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false)); // => [3,
62481                      * 6, 4]
62482                      * 
62483                      * _.times(3, function(n) { mage.castSpell(n); }); // => invokes
62484                      * `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
62485                      * 
62486                      * _.times(3, function(n) { this.cast(n); }, mage); // => also invokes
62487                      * `mage.castSpell(n)` three times
62488                      */
62489                     function times(n, iteratee, thisArg) {
62490                         n = nativeFloor(n);
62491
62492                         // Exit early to avoid a JSC JIT bug in Safari 8
62493                         // where `Array(0)` is treated as `Array(1)`.
62494                         if (n < 1 || !nativeIsFinite(n)) {
62495                             return [];
62496                         }
62497                         var index = -1,
62498                             result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
62499
62500                         iteratee = bindCallback(iteratee, thisArg, 1);
62501                         while (++index < n) {
62502                             if (index < MAX_ARRAY_LENGTH) {
62503                                 result[index] = iteratee(index);
62504                             } else {
62505                                 iteratee(index);
62506                             }
62507                         }
62508                         return result;
62509                     }
62510
62511                     /**
62512                      * Generates a unique ID. If `prefix` is provided the ID is appended to it.
62513                      * 
62514                      * @static
62515                      * @memberOf _
62516                      * @category Utility
62517                      * @param {string}
62518                      *            [prefix] The value to prefix the ID with.
62519                      * @returns {string} Returns the unique ID.
62520                      * @example
62521                      * 
62522                      * _.uniqueId('contact_'); // => 'contact_104'
62523                      * 
62524                      * _.uniqueId(); // => '105'
62525                      */
62526                     function uniqueId(prefix) {
62527                         var id = ++idCounter;
62528                         return baseToString(prefix) + id;
62529                     }
62530
62531                     /*------------------------------------------------------------------------*/
62532
62533                     /**
62534                      * Adds two numbers.
62535                      * 
62536                      * @static
62537                      * @memberOf _
62538                      * @category Math
62539                      * @param {number}
62540                      *            augend The first number to add.
62541                      * @param {number}
62542                      *            addend The second number to add.
62543                      * @returns {number} Returns the sum.
62544                      * @example
62545                      * 
62546                      * _.add(6, 4); // => 10
62547                      */
62548                     function add(augend, addend) {
62549                         return (+augend || 0) + (+addend || 0);
62550                     }
62551
62552                     /**
62553                      * Calculates `n` rounded up to `precision`.
62554                      * 
62555                      * @static
62556                      * @memberOf _
62557                      * @category Math
62558                      * @param {number}
62559                      *            n The number to round up.
62560                      * @param {number}
62561                      *            [precision=0] The precision to round up to.
62562                      * @returns {number} Returns the rounded up number.
62563                      * @example
62564                      * 
62565                      * _.ceil(4.006); // => 5
62566                      * 
62567                      * _.ceil(6.004, 2); // => 6.01
62568                      * 
62569                      * _.ceil(6040, -2); // => 6100
62570                      */
62571                     var ceil = createRound('ceil');
62572
62573                     /**
62574                      * Calculates `n` rounded down to `precision`.
62575                      * 
62576                      * @static
62577                      * @memberOf _
62578                      * @category Math
62579                      * @param {number}
62580                      *            n The number to round down.
62581                      * @param {number}
62582                      *            [precision=0] The precision to round down to.
62583                      * @returns {number} Returns the rounded down number.
62584                      * @example
62585                      * 
62586                      * _.floor(4.006); // => 4
62587                      * 
62588                      * _.floor(0.046, 2); // => 0.04
62589                      * 
62590                      * _.floor(4060, -2); // => 4000
62591                      */
62592                     var floor = createRound('floor');
62593
62594                     /**
62595                      * Gets the maximum value of `collection`. If `collection` is empty or
62596                      * falsey `-Infinity` is returned. If an iteratee function is provided it is
62597                      * invoked for each value in `collection` to generate the criterion by which
62598                      * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62599                      * with three arguments: (value, index, collection).
62600                      * 
62601                      * If a property name is provided for `iteratee` the created `_.property`
62602                      * style callback returns the property value of the given element.
62603                      * 
62604                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
62605                      * style callback returns `true` for elements that have a matching property
62606                      * value, else `false`.
62607                      * 
62608                      * If an object is provided for `iteratee` the created `_.matches` style
62609                      * callback returns `true` for elements that have the properties of the
62610                      * given object, else `false`.
62611                      * 
62612                      * @static
62613                      * @memberOf _
62614                      * @category Math
62615                      * @param {Array|Object|string}
62616                      *            collection The collection to iterate over.
62617                      * @param {Function|Object|string}
62618                      *            [iteratee] The function invoked per iteration.
62619                      * @param {*}
62620                      *            [thisArg] The `this` binding of `iteratee`.
62621                      * @returns {*} Returns the maximum value.
62622                      * @example
62623                      * 
62624                      * _.max([4, 2, 8, 6]); // => 8
62625                      * 
62626                      * _.max([]); // => -Infinity
62627                      * 
62628                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62629                      * 40 } ];
62630                      * 
62631                      * _.max(users, function(chr) { return chr.age; }); // => { 'user': 'fred',
62632                      * 'age': 40 }
62633                      *  // using the `_.property` callback shorthand _.max(users, 'age'); // => {
62634                      * 'user': 'fred', 'age': 40 }
62635                      */
62636                     var max = createExtremum(gt, NEGATIVE_INFINITY);
62637
62638                     /**
62639                      * Gets the minimum value of `collection`. If `collection` is empty or
62640                      * falsey `Infinity` is returned. If an iteratee function is provided it is
62641                      * invoked for each value in `collection` to generate the criterion by which
62642                      * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62643                      * with three arguments: (value, index, collection).
62644                      * 
62645                      * If a property name is provided for `iteratee` the created `_.property`
62646                      * style callback returns the property value of the given element.
62647                      * 
62648                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
62649                      * style callback returns `true` for elements that have a matching property
62650                      * value, else `false`.
62651                      * 
62652                      * If an object is provided for `iteratee` the created `_.matches` style
62653                      * callback returns `true` for elements that have the properties of the
62654                      * given object, else `false`.
62655                      * 
62656                      * @static
62657                      * @memberOf _
62658                      * @category Math
62659                      * @param {Array|Object|string}
62660                      *            collection The collection to iterate over.
62661                      * @param {Function|Object|string}
62662                      *            [iteratee] The function invoked per iteration.
62663                      * @param {*}
62664                      *            [thisArg] The `this` binding of `iteratee`.
62665                      * @returns {*} Returns the minimum value.
62666                      * @example
62667                      * 
62668                      * _.min([4, 2, 8, 6]); // => 2
62669                      * 
62670                      * _.min([]); // => Infinity
62671                      * 
62672                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62673                      * 40 } ];
62674                      * 
62675                      * _.min(users, function(chr) { return chr.age; }); // => { 'user':
62676                      * 'barney', 'age': 36 }
62677                      *  // using the `_.property` callback shorthand _.min(users, 'age'); // => {
62678                      * 'user': 'barney', 'age': 36 }
62679                      */
62680                     var min = createExtremum(lt, POSITIVE_INFINITY);
62681
62682                     /**
62683                      * Calculates `n` rounded to `precision`.
62684                      * 
62685                      * @static
62686                      * @memberOf _
62687                      * @category Math
62688                      * @param {number}
62689                      *            n The number to round.
62690                      * @param {number}
62691                      *            [precision=0] The precision to round to.
62692                      * @returns {number} Returns the rounded number.
62693                      * @example
62694                      * 
62695                      * _.round(4.006); // => 4
62696                      * 
62697                      * _.round(4.006, 2); // => 4.01
62698                      * 
62699                      * _.round(4060, -2); // => 4100
62700                      */
62701                     var round = createRound('round');
62702
62703                     /**
62704                      * Gets the sum of the values in `collection`.
62705                      * 
62706                      * @static
62707                      * @memberOf _
62708                      * @category Math
62709                      * @param {Array|Object|string}
62710                      *            collection The collection to iterate over.
62711                      * @param {Function|Object|string}
62712                      *            [iteratee] The function invoked per iteration.
62713                      * @param {*}
62714                      *            [thisArg] The `this` binding of `iteratee`.
62715                      * @returns {number} Returns the sum.
62716                      * @example
62717                      * 
62718                      * _.sum([4, 6]); // => 10
62719                      * 
62720                      * _.sum({ 'a': 4, 'b': 6 }); // => 10
62721                      * 
62722                      * var objects = [ { 'n': 4 }, { 'n': 6 } ];
62723                      * 
62724                      * _.sum(objects, function(object) { return object.n; }); // => 10
62725                      *  // using the `_.property` callback shorthand _.sum(objects, 'n'); // =>
62726                      * 10
62727                      */
62728                     function sum(collection, iteratee, thisArg) {
62729                         if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
62730                             iteratee = undefined;
62731                         }
62732                         iteratee = getCallback(iteratee, thisArg, 3);
62733                         return iteratee.length == 1 ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee);
62734                     }
62735
62736                     /*------------------------------------------------------------------------*/
62737
62738                     // Ensure wrappers are instances of `baseLodash`.
62739                     lodash.prototype = baseLodash.prototype;
62740
62741                     LodashWrapper.prototype = baseCreate(baseLodash.prototype);
62742                     LodashWrapper.prototype.constructor = LodashWrapper;
62743
62744                     LazyWrapper.prototype = baseCreate(baseLodash.prototype);
62745                     LazyWrapper.prototype.constructor = LazyWrapper;
62746
62747                     // Add functions to the `Map` cache.
62748                     MapCache.prototype['delete'] = mapDelete;
62749                     MapCache.prototype.get = mapGet;
62750                     MapCache.prototype.has = mapHas;
62751                     MapCache.prototype.set = mapSet;
62752
62753                     // Add functions to the `Set` cache.
62754                     SetCache.prototype.push = cachePush;
62755
62756                     // Assign cache to `_.memoize`.
62757                     memoize.Cache = MapCache;
62758
62759                     // Add functions that return wrapped values when chaining.
62760                     lodash.after = after;
62761                     lodash.ary = ary;
62762                     lodash.assign = assign;
62763                     lodash.at = at;
62764                     lodash.before = before;
62765                     lodash.bind = bind;
62766                     lodash.bindAll = bindAll;
62767                     lodash.bindKey = bindKey;
62768                     lodash.callback = callback;
62769                     lodash.chain = chain;
62770                     lodash.chunk = chunk;
62771                     lodash.compact = compact;
62772                     lodash.constant = constant;
62773                     lodash.countBy = countBy;
62774                     lodash.create = create;
62775                     lodash.curry = curry;
62776                     lodash.curryRight = curryRight;
62777                     lodash.debounce = debounce;
62778                     lodash.defaults = defaults;
62779                     lodash.defaultsDeep = defaultsDeep;
62780                     lodash.defer = defer;
62781                     lodash.delay = delay;
62782                     lodash.difference = difference;
62783                     lodash.drop = drop;
62784                     lodash.dropRight = dropRight;
62785                     lodash.dropRightWhile = dropRightWhile;
62786                     lodash.dropWhile = dropWhile;
62787                     lodash.fill = fill;
62788                     lodash.filter = filter;
62789                     lodash.flatten = flatten;
62790                     lodash.flattenDeep = flattenDeep;
62791                     lodash.flow = flow;
62792                     lodash.flowRight = flowRight;
62793                     lodash.forEach = forEach;
62794                     lodash.forEachRight = forEachRight;
62795                     lodash.forIn = forIn;
62796                     lodash.forInRight = forInRight;
62797                     lodash.forOwn = forOwn;
62798                     lodash.forOwnRight = forOwnRight;
62799                     lodash.functions = functions;
62800                     lodash.groupBy = groupBy;
62801                     lodash.indexBy = indexBy;
62802                     lodash.initial = initial;
62803                     lodash.intersection = intersection;
62804                     lodash.invert = invert;
62805                     lodash.invoke = invoke;
62806                     lodash.keys = keys;
62807                     lodash.keysIn = keysIn;
62808                     lodash.map = map;
62809                     lodash.mapKeys = mapKeys;
62810                     lodash.mapValues = mapValues;
62811                     lodash.matches = matches;
62812                     lodash.matchesProperty = matchesProperty;
62813                     lodash.memoize = memoize;
62814                     lodash.merge = merge;
62815                     lodash.method = method;
62816                     lodash.methodOf = methodOf;
62817                     lodash.mixin = mixin;
62818                     lodash.modArgs = modArgs;
62819                     lodash.negate = negate;
62820                     lodash.omit = omit;
62821                     lodash.once = once;
62822                     lodash.pairs = pairs;
62823                     lodash.partial = partial;
62824                     lodash.partialRight = partialRight;
62825                     lodash.partition = partition;
62826                     lodash.pick = pick;
62827                     lodash.pluck = pluck;
62828                     lodash.property = property;
62829                     lodash.propertyOf = propertyOf;
62830                     lodash.pull = pull;
62831                     lodash.pullAt = pullAt;
62832                     lodash.range = range;
62833                     lodash.rearg = rearg;
62834                     lodash.reject = reject;
62835                     lodash.remove = remove;
62836                     lodash.rest = rest;
62837                     lodash.restParam = restParam;
62838                     lodash.set = set;
62839                     lodash.shuffle = shuffle;
62840                     lodash.slice = slice;
62841                     lodash.sortBy = sortBy;
62842                     lodash.sortByAll = sortByAll;
62843                     lodash.sortByOrder = sortByOrder;
62844                     lodash.spread = spread;
62845                     lodash.take = take;
62846                     lodash.takeRight = takeRight;
62847                     lodash.takeRightWhile = takeRightWhile;
62848                     lodash.takeWhile = takeWhile;
62849                     lodash.tap = tap;
62850                     lodash.throttle = throttle;
62851                     lodash.thru = thru;
62852                     lodash.times = times;
62853                     lodash.toArray = toArray;
62854                     lodash.toPlainObject = toPlainObject;
62855                     lodash.transform = transform;
62856                     lodash.union = union;
62857                     lodash.uniq = uniq;
62858                     lodash.unzip = unzip;
62859                     lodash.unzipWith = unzipWith;
62860                     lodash.values = values;
62861                     lodash.valuesIn = valuesIn;
62862                     lodash.where = where;
62863                     lodash.without = without;
62864                     lodash.wrap = wrap;
62865                     lodash.xor = xor;
62866                     lodash.zip = zip;
62867                     lodash.zipObject = zipObject;
62868                     lodash.zipWith = zipWith;
62869
62870                     // Add aliases.
62871                     lodash.backflow = flowRight;
62872                     lodash.collect = map;
62873                     lodash.compose = flowRight;
62874                     lodash.each = forEach;
62875                     lodash.eachRight = forEachRight;
62876                     lodash.extend = assign;
62877                     lodash.iteratee = callback;
62878                     lodash.methods = functions;
62879                     lodash.object = zipObject;
62880                     lodash.select = filter;
62881                     lodash.tail = rest;
62882                     lodash.unique = uniq;
62883
62884                     // Add functions to `lodash.prototype`.
62885                     mixin(lodash, lodash);
62886
62887                     /*------------------------------------------------------------------------*/
62888
62889                     // Add functions that return unwrapped values when chaining.
62890                     lodash.add = add;
62891                     lodash.attempt = attempt;
62892                     lodash.camelCase = camelCase;
62893                     lodash.capitalize = capitalize;
62894                     lodash.ceil = ceil;
62895                     lodash.clone = clone;
62896                     lodash.cloneDeep = cloneDeep;
62897                     lodash.deburr = deburr;
62898                     lodash.endsWith = endsWith;
62899                     lodash.escape = escape;
62900                     lodash.escapeRegExp = escapeRegExp;
62901                     lodash.every = every;
62902                     lodash.find = find;
62903                     lodash.findIndex = findIndex;
62904                     lodash.findKey = findKey;
62905                     lodash.findLast = findLast;
62906                     lodash.findLastIndex = findLastIndex;
62907                     lodash.findLastKey = findLastKey;
62908                     lodash.findWhere = findWhere;
62909                     lodash.first = first;
62910                     lodash.floor = floor;
62911                     lodash.get = get;
62912                     lodash.gt = gt;
62913                     lodash.gte = gte;
62914                     lodash.has = has;
62915                     lodash.identity = identity;
62916                     lodash.includes = includes;
62917                     lodash.indexOf = indexOf;
62918                     lodash.inRange = inRange;
62919                     lodash.isArguments = isArguments;
62920                     lodash.isArray = isArray;
62921                     lodash.isBoolean = isBoolean;
62922                     lodash.isDate = isDate;
62923                     lodash.isElement = isElement;
62924                     lodash.isEmpty = isEmpty;
62925                     lodash.isEqual = isEqual;
62926                     lodash.isError = isError;
62927                     lodash.isFinite = isFinite;
62928                     lodash.isFunction = isFunction;
62929                     lodash.isMatch = isMatch;
62930                     lodash.isNaN = isNaN;
62931                     lodash.isNative = isNative;
62932                     lodash.isNull = isNull;
62933                     lodash.isNumber = isNumber;
62934                     lodash.isObject = isObject;
62935                     lodash.isPlainObject = isPlainObject;
62936                     lodash.isRegExp = isRegExp;
62937                     lodash.isString = isString;
62938                     lodash.isTypedArray = isTypedArray;
62939                     lodash.isUndefined = isUndefined;
62940                     lodash.kebabCase = kebabCase;
62941                     lodash.last = last;
62942                     lodash.lastIndexOf = lastIndexOf;
62943                     lodash.lt = lt;
62944                     lodash.lte = lte;
62945                     lodash.max = max;
62946                     lodash.min = min;
62947                     lodash.noConflict = noConflict;
62948                     lodash.noop = noop;
62949                     lodash.now = now;
62950                     lodash.pad = pad;
62951                     lodash.padLeft = padLeft;
62952                     lodash.padRight = padRight;
62953                     lodash.parseInt = parseInt;
62954                     lodash.random = random;
62955                     lodash.reduce = reduce;
62956                     lodash.reduceRight = reduceRight;
62957                     lodash.repeat = repeat;
62958                     lodash.result = result;
62959                     lodash.round = round;
62960                     lodash.runInContext = runInContext;
62961                     lodash.size = size;
62962                     lodash.snakeCase = snakeCase;
62963                     lodash.some = some;
62964                     lodash.sortedIndex = sortedIndex;
62965                     lodash.sortedLastIndex = sortedLastIndex;
62966                     lodash.startCase = startCase;
62967                     lodash.startsWith = startsWith;
62968                     lodash.sum = sum;
62969                     lodash.template = template;
62970                     lodash.trim = trim;
62971                     lodash.trimLeft = trimLeft;
62972                     lodash.trimRight = trimRight;
62973                     lodash.trunc = trunc;
62974                     lodash.unescape = unescape;
62975                     lodash.uniqueId = uniqueId;
62976                     lodash.words = words;
62977
62978                     // Add aliases.
62979                     lodash.all = every;
62980                     lodash.any = some;
62981                     lodash.contains = includes;
62982                     lodash.eq = isEqual;
62983                     lodash.detect = find;
62984                     lodash.foldl = reduce;
62985                     lodash.foldr = reduceRight;
62986                     lodash.head = first;
62987                     lodash.include = includes;
62988                     lodash.inject = reduce;
62989
62990                     mixin(lodash, (function() {
62991                         var source = {};
62992                         baseForOwn(lodash, function(func, methodName) {
62993                             if (!lodash.prototype[methodName]) {
62994                                 source[methodName] = func;
62995                             }
62996                         });
62997                         return source;
62998                     }()), false);
62999
63000                     /*------------------------------------------------------------------------*/
63001
63002                     // Add functions capable of returning wrapped and unwrapped values when
63003                     // chaining.
63004                     lodash.sample = sample;
63005
63006                     lodash.prototype.sample = function(n) {
63007                         if (!this.__chain__ && n == null) {
63008                             return sample(this.value());
63009                         }
63010                         return this.thru(function(value) {
63011                             return sample(value, n);
63012                         });
63013                     };
63014
63015                     /*------------------------------------------------------------------------*/
63016
63017                     /**
63018                      * The semantic version number.
63019                      * 
63020                      * @static
63021                      * @memberOf _
63022                      * @type string
63023                      */
63024                     lodash.VERSION = VERSION;
63025
63026                     // Assign default placeholders.
63027                     arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
63028                         lodash[methodName].placeholder = lodash;
63029                     });
63030
63031                     // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
63032                     arrayEach(['drop', 'take'], function(methodName, index) {
63033                         LazyWrapper.prototype[methodName] = function(n) {
63034                             var filtered = this.__filtered__;
63035                             if (filtered && !index) {
63036                                 return new LazyWrapper(this);
63037                             }
63038                             n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
63039
63040                             var result = this.clone();
63041                             if (filtered) {
63042                                 result.__takeCount__ = nativeMin(result.__takeCount__, n);
63043                             } else {
63044                                 result.__views__.push({
63045                                     'size': n,
63046                                     'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
63047                                 });
63048                             }
63049                             return result;
63050                         };
63051
63052                         LazyWrapper.prototype[methodName + 'Right'] = function(n) {
63053                             return this.reverse()[methodName](n).reverse();
63054                         };
63055                     });
63056
63057                     // Add `LazyWrapper` methods that accept an `iteratee` value.
63058                     arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
63059                         var type = index + 1,
63060                             isFilter = type != LAZY_MAP_FLAG;
63061
63062                         LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
63063                             var result = this.clone();
63064                             result.__iteratees__.push({
63065                                 'iteratee': getCallback(iteratee, thisArg, 1),
63066                                 'type': type
63067                             });
63068                             result.__filtered__ = result.__filtered__ || isFilter;
63069                             return result;
63070                         };
63071                     });
63072
63073                     // Add `LazyWrapper` methods for `_.first` and `_.last`.
63074                     arrayEach(['first', 'last'], function(methodName, index) {
63075                         var takeName = 'take' + (index ? 'Right' : '');
63076
63077                         LazyWrapper.prototype[methodName] = function() {
63078                             return this[takeName](1).value()[0];
63079                         };
63080                     });
63081
63082                     // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
63083                     arrayEach(['initial', 'rest'], function(methodName, index) {
63084                         var dropName = 'drop' + (index ? '' : 'Right');
63085
63086                         LazyWrapper.prototype[methodName] = function() {
63087                             return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
63088                         };
63089                     });
63090
63091                     // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
63092                     arrayEach(['pluck', 'where'], function(methodName, index) {
63093                         var operationName = index ? 'filter' : 'map',
63094                             createCallback = index ? baseMatches : property;
63095
63096                         LazyWrapper.prototype[methodName] = function(value) {
63097                             return this[operationName](createCallback(value));
63098                         };
63099                     });
63100
63101                     LazyWrapper.prototype.compact = function() {
63102                         return this.filter(identity);
63103                     };
63104
63105                     LazyWrapper.prototype.reject = function(predicate, thisArg) {
63106                         predicate = getCallback(predicate, thisArg, 1);
63107                         return this.filter(function(value) {
63108                             return !predicate(value);
63109                         });
63110                     };
63111
63112                     LazyWrapper.prototype.slice = function(start, end) {
63113                         start = start == null ? 0 : (+start || 0);
63114
63115                         var result = this;
63116                         if (result.__filtered__ && (start > 0 || end < 0)) {
63117                             return new LazyWrapper(result);
63118                         }
63119                         if (start < 0) {
63120                             result = result.takeRight(-start);
63121                         } else if (start) {
63122                             result = result.drop(start);
63123                         }
63124                         if (end !== undefined) {
63125                             end = (+end || 0);
63126                             result = end < 0 ? result.dropRight(-end) : result.take(end - start);
63127                         }
63128                         return result;
63129                     };
63130
63131                     LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
63132                         return this.reverse().takeWhile(predicate, thisArg).reverse();
63133                     };
63134
63135                     LazyWrapper.prototype.toArray = function() {
63136                         return this.take(POSITIVE_INFINITY);
63137                     };
63138
63139                     // Add `LazyWrapper` methods to `lodash.prototype`.
63140                     baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63141                         var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
63142                             retUnwrapped = /^(?:first|last)$/.test(methodName),
63143                             lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
63144
63145                         if (!lodashFunc) {
63146                             return;
63147                         }
63148                         lodash.prototype[methodName] = function() {
63149                             var args = retUnwrapped ? [1] : arguments,
63150                                 chainAll = this.__chain__,
63151                                 value = this.__wrapped__,
63152                                 isHybrid = !!this.__actions__.length,
63153                                 isLazy = value instanceof LazyWrapper,
63154                                 iteratee = args[0],
63155                                 useLazy = isLazy || isArray(value);
63156
63157                             if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
63158                                 // Avoid lazy use if the iteratee has a "length" value other than
63159                                 // `1`.
63160                                 isLazy = useLazy = false;
63161                             }
63162                             var interceptor = function(value) {
63163                                 return (retUnwrapped && chainAll) ? lodashFunc(value, 1)[0] : lodashFunc.apply(undefined, arrayPush([value], args));
63164                             };
63165
63166                             var action = {
63167                                     'func': thru,
63168                                     'args': [interceptor],
63169                                     'thisArg': undefined
63170                                 },
63171                                 onlyLazy = isLazy && !isHybrid;
63172
63173                             if (retUnwrapped && !chainAll) {
63174                                 if (onlyLazy) {
63175                                     value = value.clone();
63176                                     value.__actions__.push(action);
63177                                     return func.call(value);
63178                                 }
63179                                 return lodashFunc.call(undefined, this.value())[0];
63180                             }
63181                             if (!retUnwrapped && useLazy) {
63182                                 value = onlyLazy ? value : new LazyWrapper(this);
63183                                 var result = func.apply(value, args);
63184                                 result.__actions__.push(action);
63185                                 return new LodashWrapper(result, chainAll);
63186                             }
63187                             return this.thru(interceptor);
63188                         };
63189                     });
63190
63191                     // Add `Array` and `String` methods to `lodash.prototype`.
63192                     arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
63193                         var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
63194                             chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
63195                             retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
63196
63197                         lodash.prototype[methodName] = function() {
63198                             var args = arguments;
63199                             if (retUnwrapped && !this.__chain__) {
63200                                 return func.apply(this.value(), args);
63201                             }
63202                             return this[chainName](function(value) {
63203                                 return func.apply(value, args);
63204                             });
63205                         };
63206                     });
63207
63208                     // Map minified function names to their real names.
63209                     baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63210                         var lodashFunc = lodash[methodName];
63211                         if (lodashFunc) {
63212                             var key = lodashFunc.name,
63213                                 names = realNames[key] || (realNames[key] = []);
63214
63215                             names.push({
63216                                 'name': methodName,
63217                                 'func': lodashFunc
63218                             });
63219                         }
63220                     });
63221
63222                     realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
63223                         'name': 'wrapper',
63224                         'func': undefined
63225                     }];
63226
63227                     // Add functions to the lazy wrapper.
63228                     LazyWrapper.prototype.clone = lazyClone;
63229                     LazyWrapper.prototype.reverse = lazyReverse;
63230                     LazyWrapper.prototype.value = lazyValue;
63231
63232                     // Add chaining functions to the `lodash` wrapper.
63233                     lodash.prototype.chain = wrapperChain;
63234                     lodash.prototype.commit = wrapperCommit;
63235                     lodash.prototype.concat = wrapperConcat;
63236                     lodash.prototype.plant = wrapperPlant;
63237                     lodash.prototype.reverse = wrapperReverse;
63238                     lodash.prototype.toString = wrapperToString;
63239                     lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
63240
63241                     // Add function aliases to the `lodash` wrapper.
63242                     lodash.prototype.collect = lodash.prototype.map;
63243                     lodash.prototype.head = lodash.prototype.first;
63244                     lodash.prototype.select = lodash.prototype.filter;
63245                     lodash.prototype.tail = lodash.prototype.rest;
63246
63247                     return lodash;
63248                 }
63249
63250                 /*--------------------------------------------------------------------------*/
63251
63252                 // Export lodash.
63253                 var _ = runInContext();
63254
63255                 // Some AMD build optimizers like r.js check for condition patterns like the
63256                 // following:
63257                 if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
63258                     // Expose lodash to the global object when an AMD loader is present to avoid
63259                     // errors in cases where lodash is loaded by a script tag and not intended
63260                     // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
63261                     // more details.
63262                     root._ = _;
63263
63264                     // Define as an anonymous module so, through path mapping, it can be
63265                     // referenced as the "underscore" module.
63266                     define(function() {
63267                         return _;
63268                     });
63269                 }
63270                 // Check for `exports` after `define` in case a build optimizer adds an
63271                 // `exports` object.
63272                 else if (freeExports && freeModule) {
63273                     // Export for Node.js or RingoJS.
63274                     if (moduleExports) {
63275                         (freeModule.exports = _)._ = _;
63276                     }
63277                     // Export for Rhino with CommonJS support.
63278                     else {
63279                         freeExports._ = _;
63280                     }
63281                 } else {
63282                     // Export for a browser or Rhino.
63283                     root._ = _;
63284                 }
63285             }.call(this));
63286
63287         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63288     }, {}],
63289     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js": [function(require, module, exports) {
63290         var baseCreate = require('./baseCreate'),
63291             baseLodash = require('./baseLodash');
63292
63293         /** Used as references for `-Infinity` and `Infinity`. */
63294         var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
63295
63296         /**
63297          * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
63298          * 
63299          * @private
63300          * @param {*}
63301          *            value The value to wrap.
63302          */
63303         function LazyWrapper(value) {
63304             this.__wrapped__ = value;
63305             this.__actions__ = [];
63306             this.__dir__ = 1;
63307             this.__filtered__ = false;
63308             this.__iteratees__ = [];
63309             this.__takeCount__ = POSITIVE_INFINITY;
63310             this.__views__ = [];
63311         }
63312
63313         LazyWrapper.prototype = baseCreate(baseLodash.prototype);
63314         LazyWrapper.prototype.constructor = LazyWrapper;
63315
63316         module.exports = LazyWrapper;
63317
63318     }, {
63319         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63320         "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63321     }],
63322     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js": [function(require, module, exports) {
63323         var baseCreate = require('./baseCreate'),
63324             baseLodash = require('./baseLodash');
63325
63326         /**
63327          * The base constructor for creating `lodash` wrapper objects.
63328          * 
63329          * @private
63330          * @param {*}
63331          *            value The value to wrap.
63332          * @param {boolean}
63333          *            [chainAll] Enable chaining for all wrapper methods.
63334          * @param {Array}
63335          *            [actions=[]] Actions to peform to resolve the unwrapped value.
63336          */
63337         function LodashWrapper(value, chainAll, actions) {
63338             this.__wrapped__ = value;
63339             this.__actions__ = actions || [];
63340             this.__chain__ = !!chainAll;
63341         }
63342
63343         LodashWrapper.prototype = baseCreate(baseLodash.prototype);
63344         LodashWrapper.prototype.constructor = LodashWrapper;
63345
63346         module.exports = LodashWrapper;
63347
63348     }, {
63349         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63350         "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63351     }],
63352     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js": [function(require, module, exports) {
63353         (function(global) {
63354             var cachePush = require('./cachePush'),
63355                 getNative = require('./getNative');
63356
63357             /** Native method references. */
63358             var Set = getNative(global, 'Set');
63359
63360             /*
63361              * Native method references for those with the same name as other `lodash`
63362              * methods.
63363              */
63364             var nativeCreate = getNative(Object, 'create');
63365
63366             /**
63367              * 
63368              * Creates a cache object to store unique values.
63369              * 
63370              * @private
63371              * @param {Array}
63372              *            [values] The values to cache.
63373              */
63374             function SetCache(values) {
63375                 var length = values ? values.length : 0;
63376
63377                 this.data = {
63378                     'hash': nativeCreate(null),
63379                     'set': new Set
63380                 };
63381                 while (length--) {
63382                     this.push(values[length]);
63383                 }
63384             }
63385
63386             // Add functions to the `Set` cache.
63387             SetCache.prototype.push = cachePush;
63388
63389             module.exports = SetCache;
63390
63391         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63392     }, {
63393         "./cachePush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js",
63394         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
63395     }],
63396     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js": [function(require, module, exports) {
63397         /**
63398          * Copies the values of `source` to `array`.
63399          * 
63400          * @private
63401          * @param {Array}
63402          *            source The array to copy values from.
63403          * @param {Array}
63404          *            [array=[]] The array to copy values to.
63405          * @returns {Array} Returns `array`.
63406          */
63407         function arrayCopy(source, array) {
63408             var index = -1,
63409                 length = source.length;
63410
63411             array || (array = Array(length));
63412             while (++index < length) {
63413                 array[index] = source[index];
63414             }
63415             return array;
63416         }
63417
63418         module.exports = arrayCopy;
63419
63420     }, {}],
63421     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js": [function(require, module, exports) {
63422         /**
63423          * A specialized version of `_.forEach` for arrays without support for callback
63424          * shorthands and `this` binding.
63425          * 
63426          * @private
63427          * @param {Array}
63428          *            array The array to iterate over.
63429          * @param {Function}
63430          *            iteratee The function invoked per iteration.
63431          * @returns {Array} Returns `array`.
63432          */
63433         function arrayEach(array, iteratee) {
63434             var index = -1,
63435                 length = array.length;
63436
63437             while (++index < length) {
63438                 if (iteratee(array[index], index, array) === false) {
63439                     break;
63440                 }
63441             }
63442             return array;
63443         }
63444
63445         module.exports = arrayEach;
63446
63447     }, {}],
63448     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js": [function(require, module, exports) {
63449         /**
63450          * A specialized version of `_.every` for arrays without support for callback
63451          * shorthands and `this` binding.
63452          * 
63453          * @private
63454          * @param {Array}
63455          *            array The array to iterate over.
63456          * @param {Function}
63457          *            predicate The function invoked per iteration.
63458          * @returns {boolean} Returns `true` if all elements pass the predicate check,
63459          *          else `false`.
63460          */
63461         function arrayEvery(array, predicate) {
63462             var index = -1,
63463                 length = array.length;
63464
63465             while (++index < length) {
63466                 if (!predicate(array[index], index, array)) {
63467                     return false;
63468                 }
63469             }
63470             return true;
63471         }
63472
63473         module.exports = arrayEvery;
63474
63475     }, {}],
63476     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js": [function(require, module, exports) {
63477         /**
63478          * A specialized version of `_.filter` for arrays without support for callback
63479          * shorthands and `this` binding.
63480          * 
63481          * @private
63482          * @param {Array}
63483          *            array The array to iterate over.
63484          * @param {Function}
63485          *            predicate The function invoked per iteration.
63486          * @returns {Array} Returns the new filtered array.
63487          */
63488         function arrayFilter(array, predicate) {
63489             var index = -1,
63490                 length = array.length,
63491                 resIndex = -1,
63492                 result = [];
63493
63494             while (++index < length) {
63495                 var value = array[index];
63496                 if (predicate(value, index, array)) {
63497                     result[++resIndex] = value;
63498                 }
63499             }
63500             return result;
63501         }
63502
63503         module.exports = arrayFilter;
63504
63505     }, {}],
63506     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js": [function(require, module, exports) {
63507         /**
63508          * A specialized version of `_.map` for arrays without support for callback
63509          * shorthands and `this` binding.
63510          * 
63511          * @private
63512          * @param {Array}
63513          *            array The array to iterate over.
63514          * @param {Function}
63515          *            iteratee The function invoked per iteration.
63516          * @returns {Array} Returns the new mapped array.
63517          */
63518         function arrayMap(array, iteratee) {
63519             var index = -1,
63520                 length = array.length,
63521                 result = Array(length);
63522
63523             while (++index < length) {
63524                 result[index] = iteratee(array[index], index, array);
63525             }
63526             return result;
63527         }
63528
63529         module.exports = arrayMap;
63530
63531     }, {}],
63532     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js": [function(require, module, exports) {
63533         /**
63534          * Appends the elements of `values` to `array`.
63535          * 
63536          * @private
63537          * @param {Array}
63538          *            array The array to modify.
63539          * @param {Array}
63540          *            values The values to append.
63541          * @returns {Array} Returns `array`.
63542          */
63543         function arrayPush(array, values) {
63544             var index = -1,
63545                 length = values.length,
63546                 offset = array.length;
63547
63548             while (++index < length) {
63549                 array[offset + index] = values[index];
63550             }
63551             return array;
63552         }
63553
63554         module.exports = arrayPush;
63555
63556     }, {}],
63557     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js": [function(require, module, exports) {
63558         /**
63559          * A specialized version of `_.reduce` for arrays without support for callback
63560          * shorthands and `this` binding.
63561          * 
63562          * @private
63563          * @param {Array}
63564          *            array The array to iterate over.
63565          * @param {Function}
63566          *            iteratee The function invoked per iteration.
63567          * @param {*}
63568          *            [accumulator] The initial value.
63569          * @param {boolean}
63570          *            [initFromArray] Specify using the first element of `array` as the
63571          *            initial value.
63572          * @returns {*} Returns the accumulated value.
63573          */
63574         function arrayReduce(array, iteratee, accumulator, initFromArray) {
63575             var index = -1,
63576                 length = array.length;
63577
63578             if (initFromArray && length) {
63579                 accumulator = array[++index];
63580             }
63581             while (++index < length) {
63582                 accumulator = iteratee(accumulator, array[index], index, array);
63583             }
63584             return accumulator;
63585         }
63586
63587         module.exports = arrayReduce;
63588
63589     }, {}],
63590     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js": [function(require, module, exports) {
63591         /**
63592          * A specialized version of `_.some` for arrays without support for callback
63593          * shorthands and `this` binding.
63594          * 
63595          * @private
63596          * @param {Array}
63597          *            array The array to iterate over.
63598          * @param {Function}
63599          *            predicate The function invoked per iteration.
63600          * @returns {boolean} Returns `true` if any element passes the predicate check,
63601          *          else `false`.
63602          */
63603         function arraySome(array, predicate) {
63604             var index = -1,
63605                 length = array.length;
63606
63607             while (++index < length) {
63608                 if (predicate(array[index], index, array)) {
63609                     return true;
63610                 }
63611             }
63612             return false;
63613         }
63614
63615         module.exports = arraySome;
63616
63617     }, {}],
63618     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js": [function(require, module, exports) {
63619         var keys = require('../object/keys');
63620
63621         /**
63622          * A specialized version of `_.assign` for customizing assigned values without
63623          * support for argument juggling, multiple sources, and `this` binding
63624          * `customizer` functions.
63625          * 
63626          * @private
63627          * @param {Object}
63628          *            object The destination object.
63629          * @param {Object}
63630          *            source The source object.
63631          * @param {Function}
63632          *            customizer The function to customize assigned values.
63633          * @returns {Object} Returns `object`.
63634          */
63635         function assignWith(object, source, customizer) {
63636             var index = -1,
63637                 props = keys(source),
63638                 length = props.length;
63639
63640             while (++index < length) {
63641                 var key = props[index],
63642                     value = object[key],
63643                     result = customizer(value, source[key], key, object, source);
63644
63645                 if ((result === result ? (result !== value) : (value === value)) ||
63646                     (value === undefined && !(key in object))) {
63647                     object[key] = result;
63648                 }
63649             }
63650             return object;
63651         }
63652
63653         module.exports = assignWith;
63654
63655     }, {
63656         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
63657     }],
63658     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js": [function(require, module, exports) {
63659         var baseCopy = require('./baseCopy'),
63660             keys = require('../object/keys');
63661
63662         /**
63663          * The base implementation of `_.assign` without support for argument juggling,
63664          * multiple sources, and `customizer` functions.
63665          * 
63666          * @private
63667          * @param {Object}
63668          *            object The destination object.
63669          * @param {Object}
63670          *            source The source object.
63671          * @returns {Object} Returns `object`.
63672          */
63673         function baseAssign(object, source) {
63674             return source == null ? object : baseCopy(source, keys(source), object);
63675         }
63676
63677         module.exports = baseAssign;
63678
63679     }, {
63680         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
63681         "./baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js"
63682     }],
63683     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js": [function(require, module, exports) {
63684         var baseMatches = require('./baseMatches'),
63685             baseMatchesProperty = require('./baseMatchesProperty'),
63686             bindCallback = require('./bindCallback'),
63687             identity = require('../utility/identity'),
63688             property = require('../utility/property');
63689
63690         /**
63691          * The base implementation of `_.callback` which supports specifying the number
63692          * of arguments to provide to `func`.
63693          * 
63694          * @private
63695          * @param {*}
63696          *            [func=_.identity] The value to convert to a callback.
63697          * @param {*}
63698          *            [thisArg] The `this` binding of `func`.
63699          * @param {number}
63700          *            [argCount] The number of arguments to provide to `func`.
63701          * @returns {Function} Returns the callback.
63702          */
63703         function baseCallback(func, thisArg, argCount) {
63704             var type = typeof func;
63705             if (type == 'function') {
63706                 return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
63707             }
63708             if (func == null) {
63709                 return identity;
63710             }
63711             if (type == 'object') {
63712                 return baseMatches(func);
63713             }
63714             return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
63715         }
63716
63717         module.exports = baseCallback;
63718
63719     }, {
63720         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
63721         "../utility/property": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js",
63722         "./baseMatches": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js",
63723         "./baseMatchesProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js",
63724         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
63725     }],
63726     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js": [function(require, module, exports) {
63727         /**
63728          * The base implementation of `compareAscending` which compares values and sorts
63729          * them in ascending order without guaranteeing a stable sort.
63730          * 
63731          * @private
63732          * @param {*}
63733          *            value The value to compare.
63734          * @param {*}
63735          *            other The other value to compare.
63736          * @returns {number} Returns the sort order indicator for `value`.
63737          */
63738         function baseCompareAscending(value, other) {
63739             if (value !== other) {
63740                 var valIsNull = value === null,
63741                     valIsUndef = value === undefined,
63742                     valIsReflexive = value === value;
63743
63744                 var othIsNull = other === null,
63745                     othIsUndef = other === undefined,
63746                     othIsReflexive = other === other;
63747
63748                 if ((value > other && !othIsNull) || !valIsReflexive ||
63749                     (valIsNull && !othIsUndef && othIsReflexive) ||
63750                     (valIsUndef && othIsReflexive)) {
63751                     return 1;
63752                 }
63753                 if ((value < other && !valIsNull) || !othIsReflexive ||
63754                     (othIsNull && !valIsUndef && valIsReflexive) ||
63755                     (othIsUndef && valIsReflexive)) {
63756                     return -1;
63757                 }
63758             }
63759             return 0;
63760         }
63761
63762         module.exports = baseCompareAscending;
63763
63764     }, {}],
63765     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js": [function(require, module, exports) {
63766         /**
63767          * Copies properties of `source` to `object`.
63768          * 
63769          * @private
63770          * @param {Object}
63771          *            source The object to copy properties from.
63772          * @param {Array}
63773          *            props The property names to copy.
63774          * @param {Object}
63775          *            [object={}] The object to copy properties to.
63776          * @returns {Object} Returns `object`.
63777          */
63778         function baseCopy(source, props, object) {
63779             object || (object = {});
63780
63781             var index = -1,
63782                 length = props.length;
63783
63784             while (++index < length) {
63785                 var key = props[index];
63786                 object[key] = source[key];
63787             }
63788             return object;
63789         }
63790
63791         module.exports = baseCopy;
63792
63793     }, {}],
63794     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js": [function(require, module, exports) {
63795         var isObject = require('../lang/isObject');
63796
63797         /**
63798          * The base implementation of `_.create` without support for assigning
63799          * properties to the created object.
63800          * 
63801          * @private
63802          * @param {Object}
63803          *            prototype The object to inherit from.
63804          * @returns {Object} Returns the new object.
63805          */
63806         var baseCreate = (function() {
63807             function object() {}
63808             return function(prototype) {
63809                 if (isObject(prototype)) {
63810                     object.prototype = prototype;
63811                     var result = new object;
63812                     object.prototype = undefined;
63813                 }
63814                 return result || {};
63815             };
63816         }());
63817
63818         module.exports = baseCreate;
63819
63820     }, {
63821         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
63822     }],
63823     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js": [function(require, module, exports) {
63824         /** Used as the `TypeError` message for "Functions" methods. */
63825         var FUNC_ERROR_TEXT = 'Expected a function';
63826
63827         /**
63828          * The base implementation of `_.delay` and `_.defer` which accepts an index of
63829          * where to slice the arguments to provide to `func`.
63830          * 
63831          * @private
63832          * @param {Function}
63833          *            func The function to delay.
63834          * @param {number}
63835          *            wait The number of milliseconds to delay invocation.
63836          * @param {Object}
63837          *            args The arguments provide to `func`.
63838          * @returns {number} Returns the timer id.
63839          */
63840         function baseDelay(func, wait, args) {
63841             if (typeof func != 'function') {
63842                 throw new TypeError(FUNC_ERROR_TEXT);
63843             }
63844             return setTimeout(function() {
63845                 func.apply(undefined, args);
63846             }, wait);
63847         }
63848
63849         module.exports = baseDelay;
63850
63851     }, {}],
63852     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js": [function(require, module, exports) {
63853         var baseIndexOf = require('./baseIndexOf'),
63854             cacheIndexOf = require('./cacheIndexOf'),
63855             createCache = require('./createCache');
63856
63857         /** Used as the size to enable large array optimizations. */
63858         var LARGE_ARRAY_SIZE = 200;
63859
63860         /**
63861          * The base implementation of `_.difference` which accepts a single array of
63862          * values to exclude.
63863          * 
63864          * @private
63865          * @param {Array}
63866          *            array The array to inspect.
63867          * @param {Array}
63868          *            values The values to exclude.
63869          * @returns {Array} Returns the new array of filtered values.
63870          */
63871         function baseDifference(array, values) {
63872             var length = array ? array.length : 0,
63873                 result = [];
63874
63875             if (!length) {
63876                 return result;
63877             }
63878             var index = -1,
63879                 indexOf = baseIndexOf,
63880                 isCommon = true,
63881                 cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
63882                 valuesLength = values.length;
63883
63884             if (cache) {
63885                 indexOf = cacheIndexOf;
63886                 isCommon = false;
63887                 values = cache;
63888             }
63889             outer:
63890                 while (++index < length) {
63891                     var value = array[index];
63892
63893                     if (isCommon && value === value) {
63894                         var valuesIndex = valuesLength;
63895                         while (valuesIndex--) {
63896                             if (values[valuesIndex] === value) {
63897                                 continue outer;
63898                             }
63899                         }
63900                         result.push(value);
63901                     } else if (indexOf(values, value, 0) < 0) {
63902                         result.push(value);
63903                     }
63904                 }
63905             return result;
63906         }
63907
63908         module.exports = baseDifference;
63909
63910     }, {
63911         "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
63912         "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
63913         "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
63914     }],
63915     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js": [function(require, module, exports) {
63916         var baseForOwn = require('./baseForOwn'),
63917             createBaseEach = require('./createBaseEach');
63918
63919         /**
63920          * The base implementation of `_.forEach` without support for callback
63921          * shorthands and `this` binding.
63922          * 
63923          * @private
63924          * @param {Array|Object|string}
63925          *            collection The collection to iterate over.
63926          * @param {Function}
63927          *            iteratee The function invoked per iteration.
63928          * @returns {Array|Object|string} Returns `collection`.
63929          */
63930         var baseEach = createBaseEach(baseForOwn);
63931
63932         module.exports = baseEach;
63933
63934     }, {
63935         "./baseForOwn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js",
63936         "./createBaseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js"
63937     }],
63938     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js": [function(require, module, exports) {
63939         var baseEach = require('./baseEach');
63940
63941         /**
63942          * The base implementation of `_.every` without support for callback shorthands
63943          * and `this` binding.
63944          * 
63945          * @private
63946          * @param {Array|Object|string}
63947          *            collection The collection to iterate over.
63948          * @param {Function}
63949          *            predicate The function invoked per iteration.
63950          * @returns {boolean} Returns `true` if all elements pass the predicate check,
63951          *          else `false`
63952          */
63953         function baseEvery(collection, predicate) {
63954             var result = true;
63955             baseEach(collection, function(value, index, collection) {
63956                 result = !!predicate(value, index, collection);
63957                 return result;
63958             });
63959             return result;
63960         }
63961
63962         module.exports = baseEvery;
63963
63964     }, {
63965         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
63966     }],
63967     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js": [function(require, module, exports) {
63968         var baseEach = require('./baseEach');
63969
63970         /**
63971          * The base implementation of `_.filter` without support for callback shorthands
63972          * and `this` binding.
63973          * 
63974          * @private
63975          * @param {Array|Object|string}
63976          *            collection The collection to iterate over.
63977          * @param {Function}
63978          *            predicate The function invoked per iteration.
63979          * @returns {Array} Returns the new filtered array.
63980          */
63981         function baseFilter(collection, predicate) {
63982             var result = [];
63983             baseEach(collection, function(value, index, collection) {
63984                 if (predicate(value, index, collection)) {
63985                     result.push(value);
63986                 }
63987             });
63988             return result;
63989         }
63990
63991         module.exports = baseFilter;
63992
63993     }, {
63994         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
63995     }],
63996     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js": [function(require, module, exports) {
63997         /**
63998          * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
63999          * `_.findLastKey`, without support for callback shorthands and `this` binding,
64000          * which iterates over `collection` using the provided `eachFunc`.
64001          * 
64002          * @private
64003          * @param {Array|Object|string}
64004          *            collection The collection to search.
64005          * @param {Function}
64006          *            predicate The function invoked per iteration.
64007          * @param {Function}
64008          *            eachFunc The function to iterate over `collection`.
64009          * @param {boolean}
64010          *            [retKey] Specify returning the key of the found element instead of
64011          *            the element itself.
64012          * @returns {*} Returns the found element or its key, else `undefined`.
64013          */
64014         function baseFind(collection, predicate, eachFunc, retKey) {
64015             var result;
64016             eachFunc(collection, function(value, key, collection) {
64017                 if (predicate(value, key, collection)) {
64018                     result = retKey ? key : value;
64019                     return false;
64020                 }
64021             });
64022             return result;
64023         }
64024
64025         module.exports = baseFind;
64026
64027     }, {}],
64028     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js": [function(require, module, exports) {
64029         /**
64030          * The base implementation of `_.findIndex` and `_.findLastIndex` without
64031          * support for callback shorthands and `this` binding.
64032          * 
64033          * @private
64034          * @param {Array}
64035          *            array The array to search.
64036          * @param {Function}
64037          *            predicate The function invoked per iteration.
64038          * @param {boolean}
64039          *            [fromRight] Specify iterating from right to left.
64040          * @returns {number} Returns the index of the matched value, else `-1`.
64041          */
64042         function baseFindIndex(array, predicate, fromRight) {
64043             var length = array.length,
64044                 index = fromRight ? length : -1;
64045
64046             while ((fromRight ? index-- : ++index < length)) {
64047                 if (predicate(array[index], index, array)) {
64048                     return index;
64049                 }
64050             }
64051             return -1;
64052         }
64053
64054         module.exports = baseFindIndex;
64055
64056     }, {}],
64057     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js": [function(require, module, exports) {
64058         var arrayPush = require('./arrayPush'),
64059             isArguments = require('../lang/isArguments'),
64060             isArray = require('../lang/isArray'),
64061             isArrayLike = require('./isArrayLike'),
64062             isObjectLike = require('./isObjectLike');
64063
64064         /**
64065          * The base implementation of `_.flatten` with added support for restricting
64066          * flattening and specifying the start index.
64067          * 
64068          * @private
64069          * @param {Array}
64070          *            array The array to flatten.
64071          * @param {boolean}
64072          *            [isDeep] Specify a deep flatten.
64073          * @param {boolean}
64074          *            [isStrict] Restrict flattening to arrays-like objects.
64075          * @param {Array}
64076          *            [result=[]] The initial result value.
64077          * @returns {Array} Returns the new flattened array.
64078          */
64079         function baseFlatten(array, isDeep, isStrict, result) {
64080             result || (result = []);
64081
64082             var index = -1,
64083                 length = array.length;
64084
64085             while (++index < length) {
64086                 var value = array[index];
64087                 if (isObjectLike(value) && isArrayLike(value) &&
64088                     (isStrict || isArray(value) || isArguments(value))) {
64089                     if (isDeep) {
64090                         // Recursively flatten arrays (susceptible to call stack limits).
64091                         baseFlatten(value, isDeep, isStrict, result);
64092                     } else {
64093                         arrayPush(result, value);
64094                     }
64095                 } else if (!isStrict) {
64096                     result[result.length] = value;
64097                 }
64098             }
64099             return result;
64100         }
64101
64102         module.exports = baseFlatten;
64103
64104     }, {
64105         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64106         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64107         "./arrayPush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js",
64108         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64109         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64110     }],
64111     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js": [function(require, module, exports) {
64112         var createBaseFor = require('./createBaseFor');
64113
64114         /**
64115          * The base implementation of `baseForIn` and `baseForOwn` which iterates over
64116          * `object` properties returned by `keysFunc` invoking `iteratee` for each
64117          * property. Iteratee functions may exit iteration early by explicitly returning
64118          * `false`.
64119          * 
64120          * @private
64121          * @param {Object}
64122          *            object The object to iterate over.
64123          * @param {Function}
64124          *            iteratee The function invoked per iteration.
64125          * @param {Function}
64126          *            keysFunc The function to get the keys of `object`.
64127          * @returns {Object} Returns `object`.
64128          */
64129         var baseFor = createBaseFor();
64130
64131         module.exports = baseFor;
64132
64133     }, {
64134         "./createBaseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js"
64135     }],
64136     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js": [function(require, module, exports) {
64137         var baseFor = require('./baseFor'),
64138             keysIn = require('../object/keysIn');
64139
64140         /**
64141          * The base implementation of `_.forIn` without support for callback shorthands
64142          * and `this` binding.
64143          * 
64144          * @private
64145          * @param {Object}
64146          *            object The object to iterate over.
64147          * @param {Function}
64148          *            iteratee The function invoked per iteration.
64149          * @returns {Object} Returns `object`.
64150          */
64151         function baseForIn(object, iteratee) {
64152             return baseFor(object, iteratee, keysIn);
64153         }
64154
64155         module.exports = baseForIn;
64156
64157     }, {
64158         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
64159         "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64160     }],
64161     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js": [function(require, module, exports) {
64162         var baseFor = require('./baseFor'),
64163             keys = require('../object/keys');
64164
64165         /**
64166          * The base implementation of `_.forOwn` without support for callback shorthands
64167          * and `this` binding.
64168          * 
64169          * @private
64170          * @param {Object}
64171          *            object The object to iterate over.
64172          * @param {Function}
64173          *            iteratee The function invoked per iteration.
64174          * @returns {Object} Returns `object`.
64175          */
64176         function baseForOwn(object, iteratee) {
64177             return baseFor(object, iteratee, keys);
64178         }
64179
64180         module.exports = baseForOwn;
64181
64182     }, {
64183         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64184         "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64185     }],
64186     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js": [function(require, module, exports) {
64187         var toObject = require('./toObject');
64188
64189         /**
64190          * The base implementation of `get` without support for string paths and default
64191          * values.
64192          * 
64193          * @private
64194          * @param {Object}
64195          *            object The object to query.
64196          * @param {Array}
64197          *            path The path of the property to get.
64198          * @param {string}
64199          *            [pathKey] The key representation of path.
64200          * @returns {*} Returns the resolved value.
64201          */
64202         function baseGet(object, path, pathKey) {
64203             if (object == null) {
64204                 return;
64205             }
64206             if (pathKey !== undefined && pathKey in toObject(object)) {
64207                 path = [pathKey];
64208             }
64209             var index = 0,
64210                 length = path.length;
64211
64212             while (object != null && index < length) {
64213                 object = object[path[index++]];
64214             }
64215             return (index && index == length) ? object : undefined;
64216         }
64217
64218         module.exports = baseGet;
64219
64220     }, {
64221         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64222     }],
64223     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js": [function(require, module, exports) {
64224         var indexOfNaN = require('./indexOfNaN');
64225
64226         /**
64227          * The base implementation of `_.indexOf` without support for binary searches.
64228          * 
64229          * @private
64230          * @param {Array}
64231          *            array The array to search.
64232          * @param {*}
64233          *            value The value to search for.
64234          * @param {number}
64235          *            fromIndex The index to search from.
64236          * @returns {number} Returns the index of the matched value, else `-1`.
64237          */
64238         function baseIndexOf(array, value, fromIndex) {
64239             if (value !== value) {
64240                 return indexOfNaN(array, fromIndex);
64241             }
64242             var index = fromIndex - 1,
64243                 length = array.length;
64244
64245             while (++index < length) {
64246                 if (array[index] === value) {
64247                     return index;
64248                 }
64249             }
64250             return -1;
64251         }
64252
64253         module.exports = baseIndexOf;
64254
64255     }, {
64256         "./indexOfNaN": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js"
64257     }],
64258     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js": [function(require, module, exports) {
64259         var baseIsEqualDeep = require('./baseIsEqualDeep'),
64260             isObject = require('../lang/isObject'),
64261             isObjectLike = require('./isObjectLike');
64262
64263         /**
64264          * The base implementation of `_.isEqual` without support for `this` binding
64265          * `customizer` functions.
64266          * 
64267          * @private
64268          * @param {*}
64269          *            value The value to compare.
64270          * @param {*}
64271          *            other The other value to compare.
64272          * @param {Function}
64273          *            [customizer] The function to customize comparing values.
64274          * @param {boolean}
64275          *            [isLoose] Specify performing partial comparisons.
64276          * @param {Array}
64277          *            [stackA] Tracks traversed `value` objects.
64278          * @param {Array}
64279          *            [stackB] Tracks traversed `other` objects.
64280          * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
64281          */
64282         function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
64283             if (value === other) {
64284                 return true;
64285             }
64286             if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
64287                 return value !== value && other !== other;
64288             }
64289             return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
64290         }
64291
64292         module.exports = baseIsEqual;
64293
64294     }, {
64295         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64296         "./baseIsEqualDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js",
64297         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64298     }],
64299     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js": [function(require, module, exports) {
64300         var equalArrays = require('./equalArrays'),
64301             equalByTag = require('./equalByTag'),
64302             equalObjects = require('./equalObjects'),
64303             isArray = require('../lang/isArray'),
64304             isTypedArray = require('../lang/isTypedArray');
64305
64306         /** `Object#toString` result references. */
64307         var argsTag = '[object Arguments]',
64308             arrayTag = '[object Array]',
64309             objectTag = '[object Object]';
64310
64311         /** Used for native method references. */
64312         var objectProto = Object.prototype;
64313
64314         /** Used to check objects for own properties. */
64315         var hasOwnProperty = objectProto.hasOwnProperty;
64316
64317         /**
64318          * Used to resolve the
64319          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
64320          * of values.
64321          */
64322         var objToString = objectProto.toString;
64323
64324         /**
64325          * A specialized version of `baseIsEqual` for arrays and objects which performs
64326          * deep comparisons and tracks traversed objects enabling objects with circular
64327          * references to be compared.
64328          * 
64329          * @private
64330          * @param {Object}
64331          *            object The object to compare.
64332          * @param {Object}
64333          *            other The other object to compare.
64334          * @param {Function}
64335          *            equalFunc The function to determine equivalents of values.
64336          * @param {Function}
64337          *            [customizer] The function to customize comparing objects.
64338          * @param {boolean}
64339          *            [isLoose] Specify performing partial comparisons.
64340          * @param {Array}
64341          *            [stackA=[]] Tracks traversed `value` objects.
64342          * @param {Array}
64343          *            [stackB=[]] Tracks traversed `other` objects.
64344          * @returns {boolean} Returns `true` if the objects are equivalent, else
64345          *          `false`.
64346          */
64347         function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
64348             var objIsArr = isArray(object),
64349                 othIsArr = isArray(other),
64350                 objTag = arrayTag,
64351                 othTag = arrayTag;
64352
64353             if (!objIsArr) {
64354                 objTag = objToString.call(object);
64355                 if (objTag == argsTag) {
64356                     objTag = objectTag;
64357                 } else if (objTag != objectTag) {
64358                     objIsArr = isTypedArray(object);
64359                 }
64360             }
64361             if (!othIsArr) {
64362                 othTag = objToString.call(other);
64363                 if (othTag == argsTag) {
64364                     othTag = objectTag;
64365                 } else if (othTag != objectTag) {
64366                     othIsArr = isTypedArray(other);
64367                 }
64368             }
64369             var objIsObj = objTag == objectTag,
64370                 othIsObj = othTag == objectTag,
64371                 isSameTag = objTag == othTag;
64372
64373             if (isSameTag && !(objIsArr || objIsObj)) {
64374                 return equalByTag(object, other, objTag);
64375             }
64376             if (!isLoose) {
64377                 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
64378                     othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
64379
64380                 if (objIsWrapped || othIsWrapped) {
64381                     return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
64382                 }
64383             }
64384             if (!isSameTag) {
64385                 return false;
64386             }
64387             // Assume cyclic values are equal.
64388             // For more information on detecting circular references see
64389             // https://es5.github.io/#JO.
64390             stackA || (stackA = []);
64391             stackB || (stackB = []);
64392
64393             var length = stackA.length;
64394             while (length--) {
64395                 if (stackA[length] == object) {
64396                     return stackB[length] == other;
64397                 }
64398             }
64399             // Add `object` and `other` to the stack of traversed objects.
64400             stackA.push(object);
64401             stackB.push(other);
64402
64403             var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
64404
64405             stackA.pop();
64406             stackB.pop();
64407
64408             return result;
64409         }
64410
64411         module.exports = baseIsEqualDeep;
64412
64413     }, {
64414         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64415         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64416         "./equalArrays": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js",
64417         "./equalByTag": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js",
64418         "./equalObjects": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js"
64419     }],
64420     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js": [function(require, module, exports) {
64421         var baseIsEqual = require('./baseIsEqual'),
64422             toObject = require('./toObject');
64423
64424         /**
64425          * The base implementation of `_.isMatch` without support for callback
64426          * shorthands and `this` binding.
64427          * 
64428          * @private
64429          * @param {Object}
64430          *            object The object to inspect.
64431          * @param {Array}
64432          *            matchData The propery names, values, and compare flags to match.
64433          * @param {Function}
64434          *            [customizer] The function to customize comparing objects.
64435          * @returns {boolean} Returns `true` if `object` is a match, else `false`.
64436          */
64437         function baseIsMatch(object, matchData, customizer) {
64438             var index = matchData.length,
64439                 length = index,
64440                 noCustomizer = !customizer;
64441
64442             if (object == null) {
64443                 return !length;
64444             }
64445             object = toObject(object);
64446             while (index--) {
64447                 var data = matchData[index];
64448                 if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
64449                     return false;
64450                 }
64451             }
64452             while (++index < length) {
64453                 data = matchData[index];
64454                 var key = data[0],
64455                     objValue = object[key],
64456                     srcValue = data[1];
64457
64458                 if (noCustomizer && data[2]) {
64459                     if (objValue === undefined && !(key in object)) {
64460                         return false;
64461                     }
64462                 } else {
64463                     var result = customizer ? customizer(objValue, srcValue, key) : undefined;
64464                     if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
64465                         return false;
64466                     }
64467                 }
64468             }
64469             return true;
64470         }
64471
64472         module.exports = baseIsMatch;
64473
64474     }, {
64475         "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64476         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64477     }],
64478     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js": [function(require, module, exports) {
64479         /**
64480          * The function whose prototype all chaining wrappers inherit from.
64481          * 
64482          * @private
64483          */
64484         function baseLodash() {
64485             // No operation performed.
64486         }
64487
64488         module.exports = baseLodash;
64489
64490     }, {}],
64491     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js": [function(require, module, exports) {
64492         var baseEach = require('./baseEach'),
64493             isArrayLike = require('./isArrayLike');
64494
64495         /**
64496          * The base implementation of `_.map` without support for callback shorthands
64497          * and `this` binding.
64498          * 
64499          * @private
64500          * @param {Array|Object|string}
64501          *            collection The collection to iterate over.
64502          * @param {Function}
64503          *            iteratee The function invoked per iteration.
64504          * @returns {Array} Returns the new mapped array.
64505          */
64506         function baseMap(collection, iteratee) {
64507             var index = -1,
64508                 result = isArrayLike(collection) ? Array(collection.length) : [];
64509
64510             baseEach(collection, function(value, key, collection) {
64511                 result[++index] = iteratee(value, key, collection);
64512             });
64513             return result;
64514         }
64515
64516         module.exports = baseMap;
64517
64518     }, {
64519         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
64520         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64521     }],
64522     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js": [function(require, module, exports) {
64523         var baseIsMatch = require('./baseIsMatch'),
64524             getMatchData = require('./getMatchData'),
64525             toObject = require('./toObject');
64526
64527         /**
64528          * The base implementation of `_.matches` which does not clone `source`.
64529          * 
64530          * @private
64531          * @param {Object}
64532          *            source The object of property values to match.
64533          * @returns {Function} Returns the new function.
64534          */
64535         function baseMatches(source) {
64536             var matchData = getMatchData(source);
64537             if (matchData.length == 1 && matchData[0][2]) {
64538                 var key = matchData[0][0],
64539                     value = matchData[0][1];
64540
64541                 return function(object) {
64542                     if (object == null) {
64543                         return false;
64544                     }
64545                     return object[key] === value && (value !== undefined || (key in toObject(object)));
64546                 };
64547             }
64548             return function(object) {
64549                 return baseIsMatch(object, matchData);
64550             };
64551         }
64552
64553         module.exports = baseMatches;
64554
64555     }, {
64556         "./baseIsMatch": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js",
64557         "./getMatchData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js",
64558         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64559     }],
64560     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js": [function(require, module, exports) {
64561         var baseGet = require('./baseGet'),
64562             baseIsEqual = require('./baseIsEqual'),
64563             baseSlice = require('./baseSlice'),
64564             isArray = require('../lang/isArray'),
64565             isKey = require('./isKey'),
64566             isStrictComparable = require('./isStrictComparable'),
64567             last = require('../array/last'),
64568             toObject = require('./toObject'),
64569             toPath = require('./toPath');
64570
64571         /**
64572          * The base implementation of `_.matchesProperty` which does not clone
64573          * `srcValue`.
64574          * 
64575          * @private
64576          * @param {string}
64577          *            path The path of the property to get.
64578          * @param {*}
64579          *            srcValue The value to compare.
64580          * @returns {Function} Returns the new function.
64581          */
64582         function baseMatchesProperty(path, srcValue) {
64583             var isArr = isArray(path),
64584                 isCommon = isKey(path) && isStrictComparable(srcValue),
64585                 pathKey = (path + '');
64586
64587             path = toPath(path);
64588             return function(object) {
64589                 if (object == null) {
64590                     return false;
64591                 }
64592                 var key = pathKey;
64593                 object = toObject(object);
64594                 if ((isArr || !isCommon) && !(key in object)) {
64595                     object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
64596                     if (object == null) {
64597                         return false;
64598                     }
64599                     key = last(path);
64600                     object = toObject(object);
64601                 }
64602                 return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
64603             };
64604         }
64605
64606         module.exports = baseMatchesProperty;
64607
64608     }, {
64609         "../array/last": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js",
64610         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64611         "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64612         "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64613         "./baseSlice": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js",
64614         "./isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js",
64615         "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js",
64616         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
64617         "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64618     }],
64619     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js": [function(require, module, exports) {
64620         var arrayEach = require('./arrayEach'),
64621             baseMergeDeep = require('./baseMergeDeep'),
64622             isArray = require('../lang/isArray'),
64623             isArrayLike = require('./isArrayLike'),
64624             isObject = require('../lang/isObject'),
64625             isObjectLike = require('./isObjectLike'),
64626             isTypedArray = require('../lang/isTypedArray'),
64627             keys = require('../object/keys');
64628
64629         /**
64630          * The base implementation of `_.merge` without support for argument juggling,
64631          * multiple sources, and `this` binding `customizer` functions.
64632          * 
64633          * @private
64634          * @param {Object}
64635          *            object The destination object.
64636          * @param {Object}
64637          *            source The source object.
64638          * @param {Function}
64639          *            [customizer] The function to customize merged values.
64640          * @param {Array}
64641          *            [stackA=[]] Tracks traversed source objects.
64642          * @param {Array}
64643          *            [stackB=[]] Associates values with source counterparts.
64644          * @returns {Object} Returns `object`.
64645          */
64646         function baseMerge(object, source, customizer, stackA, stackB) {
64647             if (!isObject(object)) {
64648                 return object;
64649             }
64650             var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
64651                 props = isSrcArr ? undefined : keys(source);
64652
64653             arrayEach(props || source, function(srcValue, key) {
64654                 if (props) {
64655                     key = srcValue;
64656                     srcValue = source[key];
64657                 }
64658                 if (isObjectLike(srcValue)) {
64659                     stackA || (stackA = []);
64660                     stackB || (stackB = []);
64661                     baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
64662                 } else {
64663                     var value = object[key],
64664                         result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64665                         isCommon = result === undefined;
64666
64667                     if (isCommon) {
64668                         result = srcValue;
64669                     }
64670                     if ((result !== undefined || (isSrcArr && !(key in object))) &&
64671                         (isCommon || (result === result ? (result !== value) : (value === value)))) {
64672                         object[key] = result;
64673                     }
64674                 }
64675             });
64676             return object;
64677         }
64678
64679         module.exports = baseMerge;
64680
64681     }, {
64682         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64683         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64684         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64685         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64686         "./arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
64687         "./baseMergeDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js",
64688         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64689         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64690     }],
64691     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js": [function(require, module, exports) {
64692         var arrayCopy = require('./arrayCopy'),
64693             isArguments = require('../lang/isArguments'),
64694             isArray = require('../lang/isArray'),
64695             isArrayLike = require('./isArrayLike'),
64696             isPlainObject = require('../lang/isPlainObject'),
64697             isTypedArray = require('../lang/isTypedArray'),
64698             toPlainObject = require('../lang/toPlainObject');
64699
64700         /**
64701          * A specialized version of `baseMerge` for arrays and objects which performs
64702          * deep merges and tracks traversed objects enabling objects with circular
64703          * references to be merged.
64704          * 
64705          * @private
64706          * @param {Object}
64707          *            object The destination object.
64708          * @param {Object}
64709          *            source The source object.
64710          * @param {string}
64711          *            key The key of the value to merge.
64712          * @param {Function}
64713          *            mergeFunc The function to merge values.
64714          * @param {Function}
64715          *            [customizer] The function to customize merged values.
64716          * @param {Array}
64717          *            [stackA=[]] Tracks traversed source objects.
64718          * @param {Array}
64719          *            [stackB=[]] Associates values with source counterparts.
64720          * @returns {boolean} Returns `true` if the objects are equivalent, else
64721          *          `false`.
64722          */
64723         function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
64724             var length = stackA.length,
64725                 srcValue = source[key];
64726
64727             while (length--) {
64728                 if (stackA[length] == srcValue) {
64729                     object[key] = stackB[length];
64730                     return;
64731                 }
64732             }
64733             var value = object[key],
64734                 result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64735                 isCommon = result === undefined;
64736
64737             if (isCommon) {
64738                 result = srcValue;
64739                 if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
64740                     result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
64741                 } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
64742                     result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
64743                 } else {
64744                     isCommon = false;
64745                 }
64746             }
64747             // Add the source value to the stack of traversed objects and associate
64748             // it with its merged value.
64749             stackA.push(srcValue);
64750             stackB.push(result);
64751
64752             if (isCommon) {
64753                 // Recursively merge objects and arrays (susceptible to call stack limits).
64754                 object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
64755             } else if (result === result ? (result !== value) : (value === value)) {
64756                 object[key] = result;
64757             }
64758         }
64759
64760         module.exports = baseMergeDeep;
64761
64762     }, {
64763         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64764         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64765         "../lang/isPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js",
64766         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64767         "../lang/toPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js",
64768         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
64769         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64770     }],
64771     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js": [function(require, module, exports) {
64772         /**
64773          * The base implementation of `_.property` without support for deep paths.
64774          * 
64775          * @private
64776          * @param {string}
64777          *            key The key of the property to get.
64778          * @returns {Function} Returns the new function.
64779          */
64780         function baseProperty(key) {
64781             return function(object) {
64782                 return object == null ? undefined : object[key];
64783             };
64784         }
64785
64786         module.exports = baseProperty;
64787
64788     }, {}],
64789     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js": [function(require, module, exports) {
64790         var baseGet = require('./baseGet'),
64791             toPath = require('./toPath');
64792
64793         /**
64794          * A specialized version of `baseProperty` which supports deep paths.
64795          * 
64796          * @private
64797          * @param {Array|string}
64798          *            path The path of the property to get.
64799          * @returns {Function} Returns the new function.
64800          */
64801         function basePropertyDeep(path) {
64802             var pathKey = (path + '');
64803             path = toPath(path);
64804             return function(object) {
64805                 return baseGet(object, path, pathKey);
64806             };
64807         }
64808
64809         module.exports = basePropertyDeep;
64810
64811     }, {
64812         "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64813         "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64814     }],
64815     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js": [function(require, module, exports) {
64816         /**
64817          * The base implementation of `_.reduce` and `_.reduceRight` without support for
64818          * callback shorthands and `this` binding, which iterates over `collection`
64819          * using the provided `eachFunc`.
64820          * 
64821          * @private
64822          * @param {Array|Object|string}
64823          *            collection The collection to iterate over.
64824          * @param {Function}
64825          *            iteratee The function invoked per iteration.
64826          * @param {*}
64827          *            accumulator The initial value.
64828          * @param {boolean}
64829          *            initFromCollection Specify using the first or last element of
64830          *            `collection` as the initial value.
64831          * @param {Function}
64832          *            eachFunc The function to iterate over `collection`.
64833          * @returns {*} Returns the accumulated value.
64834          */
64835         function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
64836             eachFunc(collection, function(value, index, collection) {
64837                 accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
64838             });
64839             return accumulator;
64840         }
64841
64842         module.exports = baseReduce;
64843
64844     }, {}],
64845     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js": [function(require, module, exports) {
64846         var identity = require('../utility/identity'),
64847             metaMap = require('./metaMap');
64848
64849         /**
64850          * The base implementation of `setData` without support for hot loop detection.
64851          * 
64852          * @private
64853          * @param {Function}
64854          *            func The function to associate metadata with.
64855          * @param {*}
64856          *            data The metadata.
64857          * @returns {Function} Returns `func`.
64858          */
64859         var baseSetData = !metaMap ? identity : function(func, data) {
64860             metaMap.set(func, data);
64861             return func;
64862         };
64863
64864         module.exports = baseSetData;
64865
64866     }, {
64867         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
64868         "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
64869     }],
64870     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js": [function(require, module, exports) {
64871         /**
64872          * The base implementation of `_.slice` without an iteratee call guard.
64873          * 
64874          * @private
64875          * @param {Array}
64876          *            array The array to slice.
64877          * @param {number}
64878          *            [start=0] The start position.
64879          * @param {number}
64880          *            [end=array.length] The end position.
64881          * @returns {Array} Returns the slice of `array`.
64882          */
64883         function baseSlice(array, start, end) {
64884             var index = -1,
64885                 length = array.length;
64886
64887             start = start == null ? 0 : (+start || 0);
64888             if (start < 0) {
64889                 start = -start > length ? 0 : (length + start);
64890             }
64891             end = (end === undefined || end > length) ? length : (+end || 0);
64892             if (end < 0) {
64893                 end += length;
64894             }
64895             length = start > end ? 0 : ((end - start) >>> 0);
64896             start >>>= 0;
64897
64898             var result = Array(length);
64899             while (++index < length) {
64900                 result[index] = array[index + start];
64901             }
64902             return result;
64903         }
64904
64905         module.exports = baseSlice;
64906
64907     }, {}],
64908     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js": [function(require, module, exports) {
64909         var baseEach = require('./baseEach');
64910
64911         /**
64912          * The base implementation of `_.some` without support for callback shorthands
64913          * and `this` binding.
64914          * 
64915          * @private
64916          * @param {Array|Object|string}
64917          *            collection The collection to iterate over.
64918          * @param {Function}
64919          *            predicate The function invoked per iteration.
64920          * @returns {boolean} Returns `true` if any element passes the predicate check,
64921          *          else `false`.
64922          */
64923         function baseSome(collection, predicate) {
64924             var result;
64925
64926             baseEach(collection, function(value, index, collection) {
64927                 result = predicate(value, index, collection);
64928                 return !result;
64929             });
64930             return !!result;
64931         }
64932
64933         module.exports = baseSome;
64934
64935     }, {
64936         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64937     }],
64938     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js": [function(require, module, exports) {
64939         /**
64940          * The base implementation of `_.sortBy` which uses `comparer` to define the
64941          * sort order of `array` and replaces criteria objects with their corresponding
64942          * values.
64943          * 
64944          * @private
64945          * @param {Array}
64946          *            array The array to sort.
64947          * @param {Function}
64948          *            comparer The function to define sort order.
64949          * @returns {Array} Returns `array`.
64950          */
64951         function baseSortBy(array, comparer) {
64952             var length = array.length;
64953
64954             array.sort(comparer);
64955             while (length--) {
64956                 array[length] = array[length].value;
64957             }
64958             return array;
64959         }
64960
64961         module.exports = baseSortBy;
64962
64963     }, {}],
64964     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js": [function(require, module, exports) {
64965         /**
64966          * Converts `value` to a string if it's not one. An empty string is returned for
64967          * `null` or `undefined` values.
64968          * 
64969          * @private
64970          * @param {*}
64971          *            value The value to process.
64972          * @returns {string} Returns the string.
64973          */
64974         function baseToString(value) {
64975             return value == null ? '' : (value + '');
64976         }
64977
64978         module.exports = baseToString;
64979
64980     }, {}],
64981     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js": [function(require, module, exports) {
64982         var baseIndexOf = require('./baseIndexOf'),
64983             cacheIndexOf = require('./cacheIndexOf'),
64984             createCache = require('./createCache');
64985
64986         /** Used as the size to enable large array optimizations. */
64987         var LARGE_ARRAY_SIZE = 200;
64988
64989         /**
64990          * The base implementation of `_.uniq` without support for callback shorthands
64991          * and `this` binding.
64992          * 
64993          * @private
64994          * @param {Array}
64995          *            array The array to inspect.
64996          * @param {Function}
64997          *            [iteratee] The function invoked per iteration.
64998          * @returns {Array} Returns the new duplicate free array.
64999          */
65000         function baseUniq(array, iteratee) {
65001             var index = -1,
65002                 indexOf = baseIndexOf,
65003                 length = array.length,
65004                 isCommon = true,
65005                 isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
65006                 seen = isLarge ? createCache() : null,
65007                 result = [];
65008
65009             if (seen) {
65010                 indexOf = cacheIndexOf;
65011                 isCommon = false;
65012             } else {
65013                 isLarge = false;
65014                 seen = iteratee ? [] : result;
65015             }
65016             outer:
65017                 while (++index < length) {
65018                     var value = array[index],
65019                         computed = iteratee ? iteratee(value, index, array) : value;
65020
65021                     if (isCommon && value === value) {
65022                         var seenIndex = seen.length;
65023                         while (seenIndex--) {
65024                             if (seen[seenIndex] === computed) {
65025                                 continue outer;
65026                             }
65027                         }
65028                         if (iteratee) {
65029                             seen.push(computed);
65030                         }
65031                         result.push(value);
65032                     } else if (indexOf(seen, computed, 0) < 0) {
65033                         if (iteratee || isLarge) {
65034                             seen.push(computed);
65035                         }
65036                         result.push(value);
65037                     }
65038                 }
65039             return result;
65040         }
65041
65042         module.exports = baseUniq;
65043
65044     }, {
65045         "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
65046         "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
65047         "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
65048     }],
65049     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js": [function(require, module, exports) {
65050         /**
65051          * The base implementation of `_.values` and `_.valuesIn` which creates an array
65052          * of `object` property values corresponding to the property names of `props`.
65053          * 
65054          * @private
65055          * @param {Object}
65056          *            object The object to query.
65057          * @param {Array}
65058          *            props The property names to get values for.
65059          * @returns {Object} Returns the array of property values.
65060          */
65061         function baseValues(object, props) {
65062             var index = -1,
65063                 length = props.length,
65064                 result = Array(length);
65065
65066             while (++index < length) {
65067                 result[index] = object[props[index]];
65068             }
65069             return result;
65070         }
65071
65072         module.exports = baseValues;
65073
65074     }, {}],
65075     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js": [function(require, module, exports) {
65076         var identity = require('../utility/identity');
65077
65078         /**
65079          * A specialized version of `baseCallback` which only supports `this` binding
65080          * and specifying the number of arguments to provide to `func`.
65081          * 
65082          * @private
65083          * @param {Function}
65084          *            func The function to bind.
65085          * @param {*}
65086          *            thisArg The `this` binding of `func`.
65087          * @param {number}
65088          *            [argCount] The number of arguments to provide to `func`.
65089          * @returns {Function} Returns the callback.
65090          */
65091         function bindCallback(func, thisArg, argCount) {
65092             if (typeof func != 'function') {
65093                 return identity;
65094             }
65095             if (thisArg === undefined) {
65096                 return func;
65097             }
65098             switch (argCount) {
65099                 case 1:
65100                     return function(value) {
65101                         return func.call(thisArg, value);
65102                     };
65103                 case 3:
65104                     return function(value, index, collection) {
65105                         return func.call(thisArg, value, index, collection);
65106                     };
65107                 case 4:
65108                     return function(accumulator, value, index, collection) {
65109                         return func.call(thisArg, accumulator, value, index, collection);
65110                     };
65111                 case 5:
65112                     return function(value, other, key, object, source) {
65113                         return func.call(thisArg, value, other, key, object, source);
65114                     };
65115             }
65116             return function() {
65117                 return func.apply(thisArg, arguments);
65118             };
65119         }
65120
65121         module.exports = bindCallback;
65122
65123     }, {
65124         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js"
65125     }],
65126     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js": [function(require, module, exports) {
65127         var isObject = require('../lang/isObject');
65128
65129         /**
65130          * Checks if `value` is in `cache` mimicking the return signature of `_.indexOf`
65131          * by returning `0` if the value is found, else `-1`.
65132          * 
65133          * @private
65134          * @param {Object}
65135          *            cache The cache to search.
65136          * @param {*}
65137          *            value The value to search for.
65138          * @returns {number} Returns `0` if `value` is found, else `-1`.
65139          */
65140         function cacheIndexOf(cache, value) {
65141             var data = cache.data,
65142                 result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
65143
65144             return result ? 0 : -1;
65145         }
65146
65147         module.exports = cacheIndexOf;
65148
65149     }, {
65150         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65151     }],
65152     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js": [function(require, module, exports) {
65153         var isObject = require('../lang/isObject');
65154
65155         /**
65156          * Adds `value` to the cache.
65157          * 
65158          * @private
65159          * @name push
65160          * @memberOf SetCache
65161          * @param {*}
65162          *            value The value to cache.
65163          */
65164         function cachePush(value) {
65165             var data = this.data;
65166             if (typeof value == 'string' || isObject(value)) {
65167                 data.set.add(value);
65168             } else {
65169                 data.hash[value] = true;
65170             }
65171         }
65172
65173         module.exports = cachePush;
65174
65175     }, {
65176         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65177     }],
65178     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js": [function(require, module, exports) {
65179         var baseCompareAscending = require('./baseCompareAscending');
65180
65181         /**
65182          * Used by `_.sortBy` to compare transformed elements of a collection and stable
65183          * sort them in ascending order.
65184          * 
65185          * @private
65186          * @param {Object}
65187          *            object The object to compare.
65188          * @param {Object}
65189          *            other The other object to compare.
65190          * @returns {number} Returns the sort order indicator for `object`.
65191          */
65192         function compareAscending(object, other) {
65193             return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
65194         }
65195
65196         module.exports = compareAscending;
65197
65198     }, {
65199         "./baseCompareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js"
65200     }],
65201     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js": [function(require, module, exports) {
65202         /*
65203          * Native method references for those with the same name as other `lodash`
65204          * methods.
65205          */
65206         var nativeMax = Math.max;
65207
65208         /**
65209          * Creates an array that is the composition of partially applied arguments,
65210          * placeholders, and provided arguments into a single array of arguments.
65211          * 
65212          * @private
65213          * @param {Array|Object}
65214          *            args The provided arguments.
65215          * @param {Array}
65216          *            partials The arguments to prepend to those provided.
65217          * @param {Array}
65218          *            holders The `partials` placeholder indexes.
65219          * @returns {Array} Returns the new array of composed arguments.
65220          */
65221         function composeArgs(args, partials, holders) {
65222             var holdersLength = holders.length,
65223                 argsIndex = -1,
65224                 argsLength = nativeMax(args.length - holdersLength, 0),
65225                 leftIndex = -1,
65226                 leftLength = partials.length,
65227                 result = Array(leftLength + argsLength);
65228
65229             while (++leftIndex < leftLength) {
65230                 result[leftIndex] = partials[leftIndex];
65231             }
65232             while (++argsIndex < holdersLength) {
65233                 result[holders[argsIndex]] = args[argsIndex];
65234             }
65235             while (argsLength--) {
65236                 result[leftIndex++] = args[argsIndex++];
65237             }
65238             return result;
65239         }
65240
65241         module.exports = composeArgs;
65242
65243     }, {}],
65244     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js": [function(require, module, exports) {
65245         /*
65246          * Native method references for those with the same name as other `lodash`
65247          * methods.
65248          */
65249         var nativeMax = Math.max;
65250
65251         /**
65252          * This function is like `composeArgs` except that the arguments composition is
65253          * tailored for `_.partialRight`.
65254          * 
65255          * @private
65256          * @param {Array|Object}
65257          *            args The provided arguments.
65258          * @param {Array}
65259          *            partials The arguments to append to those provided.
65260          * @param {Array}
65261          *            holders The `partials` placeholder indexes.
65262          * @returns {Array} Returns the new array of composed arguments.
65263          */
65264         function composeArgsRight(args, partials, holders) {
65265             var holdersIndex = -1,
65266                 holdersLength = holders.length,
65267                 argsIndex = -1,
65268                 argsLength = nativeMax(args.length - holdersLength, 0),
65269                 rightIndex = -1,
65270                 rightLength = partials.length,
65271                 result = Array(argsLength + rightLength);
65272
65273             while (++argsIndex < argsLength) {
65274                 result[argsIndex] = args[argsIndex];
65275             }
65276             var offset = argsIndex;
65277             while (++rightIndex < rightLength) {
65278                 result[offset + rightIndex] = partials[rightIndex];
65279             }
65280             while (++holdersIndex < holdersLength) {
65281                 result[offset + holders[holdersIndex]] = args[argsIndex++];
65282             }
65283             return result;
65284         }
65285
65286         module.exports = composeArgsRight;
65287
65288     }, {}],
65289     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js": [function(require, module, exports) {
65290         var baseCallback = require('./baseCallback'),
65291             baseEach = require('./baseEach'),
65292             isArray = require('../lang/isArray');
65293
65294         /**
65295          * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
65296          * 
65297          * @private
65298          * @param {Function}
65299          *            setter The function to set keys and values of the accumulator
65300          *            object.
65301          * @param {Function}
65302          *            [initializer] The function to initialize the accumulator object.
65303          * @returns {Function} Returns the new aggregator function.
65304          */
65305         function createAggregator(setter, initializer) {
65306             return function(collection, iteratee, thisArg) {
65307                 var result = initializer ? initializer() : {};
65308                 iteratee = baseCallback(iteratee, thisArg, 3);
65309
65310                 if (isArray(collection)) {
65311                     var index = -1,
65312                         length = collection.length;
65313
65314                     while (++index < length) {
65315                         var value = collection[index];
65316                         setter(result, value, iteratee(value, index, collection), collection);
65317                     }
65318                 } else {
65319                     baseEach(collection, function(value, key, collection) {
65320                         setter(result, value, iteratee(value, key, collection), collection);
65321                     });
65322                 }
65323                 return result;
65324             };
65325         }
65326
65327         module.exports = createAggregator;
65328
65329     }, {
65330         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65331         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65332         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65333     }],
65334     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js": [function(require, module, exports) {
65335         var bindCallback = require('./bindCallback'),
65336             isIterateeCall = require('./isIterateeCall'),
65337             restParam = require('../function/restParam');
65338
65339         /**
65340          * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
65341          * 
65342          * @private
65343          * @param {Function}
65344          *            assigner The function to assign values.
65345          * @returns {Function} Returns the new assigner function.
65346          */
65347         function createAssigner(assigner) {
65348             return restParam(function(object, sources) {
65349                 var index = -1,
65350                     length = object == null ? 0 : sources.length,
65351                     customizer = length > 2 ? sources[length - 2] : undefined,
65352                     guard = length > 2 ? sources[2] : undefined,
65353                     thisArg = length > 1 ? sources[length - 1] : undefined;
65354
65355                 if (typeof customizer == 'function') {
65356                     customizer = bindCallback(customizer, thisArg, 5);
65357                     length -= 2;
65358                 } else {
65359                     customizer = typeof thisArg == 'function' ? thisArg : undefined;
65360                     length -= (customizer ? 1 : 0);
65361                 }
65362                 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
65363                     customizer = length < 3 ? undefined : customizer;
65364                     length = 1;
65365                 }
65366                 while (++index < length) {
65367                     var source = sources[index];
65368                     if (source) {
65369                         assigner(object, source, customizer);
65370                     }
65371                 }
65372                 return object;
65373             });
65374         }
65375
65376         module.exports = createAssigner;
65377
65378     }, {
65379         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
65380         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
65381         "./isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
65382     }],
65383     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js": [function(require, module, exports) {
65384         var getLength = require('./getLength'),
65385             isLength = require('./isLength'),
65386             toObject = require('./toObject');
65387
65388         /**
65389          * Creates a `baseEach` or `baseEachRight` function.
65390          * 
65391          * @private
65392          * @param {Function}
65393          *            eachFunc The function to iterate over a collection.
65394          * @param {boolean}
65395          *            [fromRight] Specify iterating from right to left.
65396          * @returns {Function} Returns the new base function.
65397          */
65398         function createBaseEach(eachFunc, fromRight) {
65399             return function(collection, iteratee) {
65400                 var length = collection ? getLength(collection) : 0;
65401                 if (!isLength(length)) {
65402                     return eachFunc(collection, iteratee);
65403                 }
65404                 var index = fromRight ? length : -1,
65405                     iterable = toObject(collection);
65406
65407                 while ((fromRight ? index-- : ++index < length)) {
65408                     if (iteratee(iterable[index], index, iterable) === false) {
65409                         break;
65410                     }
65411                 }
65412                 return collection;
65413             };
65414         }
65415
65416         module.exports = createBaseEach;
65417
65418     }, {
65419         "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
65420         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
65421         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65422     }],
65423     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js": [function(require, module, exports) {
65424         var toObject = require('./toObject');
65425
65426         /**
65427          * Creates a base function for `_.forIn` or `_.forInRight`.
65428          * 
65429          * @private
65430          * @param {boolean}
65431          *            [fromRight] Specify iterating from right to left.
65432          * @returns {Function} Returns the new base function.
65433          */
65434         function createBaseFor(fromRight) {
65435             return function(object, iteratee, keysFunc) {
65436                 var iterable = toObject(object),
65437                     props = keysFunc(object),
65438                     length = props.length,
65439                     index = fromRight ? length : -1;
65440
65441                 while ((fromRight ? index-- : ++index < length)) {
65442                     var key = props[index];
65443                     if (iteratee(iterable[key], key, iterable) === false) {
65444                         break;
65445                     }
65446                 }
65447                 return object;
65448             };
65449         }
65450
65451         module.exports = createBaseFor;
65452
65453     }, {
65454         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65455     }],
65456     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js": [function(require, module, exports) {
65457         (function(global) {
65458             var createCtorWrapper = require('./createCtorWrapper');
65459
65460             /**
65461              * Creates a function that wraps `func` and invokes it with the `this` binding
65462              * of `thisArg`.
65463              * 
65464              * @private
65465              * @param {Function}
65466              *            func The function to bind.
65467              * @param {*}
65468              *            [thisArg] The `this` binding of `func`.
65469              * @returns {Function} Returns the new bound function.
65470              */
65471             function createBindWrapper(func, thisArg) {
65472                 var Ctor = createCtorWrapper(func);
65473
65474                 function wrapper() {
65475                     var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65476                     return fn.apply(thisArg, arguments);
65477                 }
65478                 return wrapper;
65479             }
65480
65481             module.exports = createBindWrapper;
65482
65483         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65484     }, {
65485         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65486     }],
65487     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js": [function(require, module, exports) {
65488         (function(global) {
65489             var SetCache = require('./SetCache'),
65490                 getNative = require('./getNative');
65491
65492             /** Native method references. */
65493             var Set = getNative(global, 'Set');
65494
65495             /*
65496              * Native method references for those with the same name as other `lodash`
65497              * methods.
65498              */
65499             var nativeCreate = getNative(Object, 'create');
65500
65501             /**
65502              * Creates a `Set` cache object to optimize linear searches of large arrays.
65503              * 
65504              * @private
65505              * @param {Array}
65506              *            [values] The values to cache.
65507              * @returns {null|Object} Returns the new cache object if `Set` is supported,
65508              *          else `null`.
65509              */
65510             function createCache(values) {
65511                 return (nativeCreate && Set) ? new SetCache(values) : null;
65512             }
65513
65514             module.exports = createCache;
65515
65516         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65517     }, {
65518         "./SetCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js",
65519         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
65520     }],
65521     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js": [function(require, module, exports) {
65522         var baseCreate = require('./baseCreate'),
65523             isObject = require('../lang/isObject');
65524
65525         /**
65526          * Creates a function that produces an instance of `Ctor` regardless of whether
65527          * it was invoked as part of a `new` expression or by `call` or `apply`.
65528          * 
65529          * @private
65530          * @param {Function}
65531          *            Ctor The constructor to wrap.
65532          * @returns {Function} Returns the new wrapped function.
65533          */
65534         function createCtorWrapper(Ctor) {
65535             return function() {
65536                 // Use a `switch` statement to work with class constructors.
65537                 // See
65538                 // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
65539                 // for more details.
65540                 var args = arguments;
65541                 switch (args.length) {
65542                     case 0:
65543                         return new Ctor;
65544                     case 1:
65545                         return new Ctor(args[0]);
65546                     case 2:
65547                         return new Ctor(args[0], args[1]);
65548                     case 3:
65549                         return new Ctor(args[0], args[1], args[2]);
65550                     case 4:
65551                         return new Ctor(args[0], args[1], args[2], args[3]);
65552                     case 5:
65553                         return new Ctor(args[0], args[1], args[2], args[3], args[4]);
65554                     case 6:
65555                         return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
65556                     case 7:
65557                         return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
65558                 }
65559                 var thisBinding = baseCreate(Ctor.prototype),
65560                     result = Ctor.apply(thisBinding, args);
65561
65562                 // Mimic the constructor's `return` behavior.
65563                 // See https://es5.github.io/#x13.2.2 for more details.
65564                 return isObject(result) ? result : thisBinding;
65565             };
65566         }
65567
65568         module.exports = createCtorWrapper;
65569
65570     }, {
65571         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
65572         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js"
65573     }],
65574     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js": [function(require, module, exports) {
65575         var baseCallback = require('./baseCallback'),
65576             baseFind = require('./baseFind'),
65577             baseFindIndex = require('./baseFindIndex'),
65578             isArray = require('../lang/isArray');
65579
65580         /**
65581          * Creates a `_.find` or `_.findLast` function.
65582          * 
65583          * @private
65584          * @param {Function}
65585          *            eachFunc The function to iterate over a collection.
65586          * @param {boolean}
65587          *            [fromRight] Specify iterating from right to left.
65588          * @returns {Function} Returns the new find function.
65589          */
65590         function createFind(eachFunc, fromRight) {
65591             return function(collection, predicate, thisArg) {
65592                 predicate = baseCallback(predicate, thisArg, 3);
65593                 if (isArray(collection)) {
65594                     var index = baseFindIndex(collection, predicate, fromRight);
65595                     return index > -1 ? collection[index] : undefined;
65596                 }
65597                 return baseFind(collection, predicate, eachFunc);
65598             };
65599         }
65600
65601         module.exports = createFind;
65602
65603     }, {
65604         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65605         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65606         "./baseFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js",
65607         "./baseFindIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js"
65608     }],
65609     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js": [function(require, module, exports) {
65610         var bindCallback = require('./bindCallback'),
65611             isArray = require('../lang/isArray');
65612
65613         /**
65614          * Creates a function for `_.forEach` or `_.forEachRight`.
65615          * 
65616          * @private
65617          * @param {Function}
65618          *            arrayFunc The function to iterate over an array.
65619          * @param {Function}
65620          *            eachFunc The function to iterate over a collection.
65621          * @returns {Function} Returns the new each function.
65622          */
65623         function createForEach(arrayFunc, eachFunc) {
65624             return function(collection, iteratee, thisArg) {
65625                 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
65626             };
65627         }
65628
65629         module.exports = createForEach;
65630
65631     }, {
65632         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65633         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
65634     }],
65635     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js": [function(require, module, exports) {
65636         (function(global) {
65637             var arrayCopy = require('./arrayCopy'),
65638                 composeArgs = require('./composeArgs'),
65639                 composeArgsRight = require('./composeArgsRight'),
65640                 createCtorWrapper = require('./createCtorWrapper'),
65641                 isLaziable = require('./isLaziable'),
65642                 reorder = require('./reorder'),
65643                 replaceHolders = require('./replaceHolders'),
65644                 setData = require('./setData');
65645
65646             /** Used to compose bitmasks for wrapper metadata. */
65647             var BIND_FLAG = 1,
65648                 BIND_KEY_FLAG = 2,
65649                 CURRY_BOUND_FLAG = 4,
65650                 CURRY_FLAG = 8,
65651                 CURRY_RIGHT_FLAG = 16,
65652                 PARTIAL_FLAG = 32,
65653                 PARTIAL_RIGHT_FLAG = 64,
65654                 ARY_FLAG = 128;
65655
65656             /*
65657              * Native method references for those with the same name as other `lodash`
65658              * methods.
65659              */
65660             var nativeMax = Math.max;
65661
65662             /**
65663              * Creates a function that wraps `func` and invokes it with optional `this`
65664              * binding of, partial application, and currying.
65665              * 
65666              * @private
65667              * @param {Function|string}
65668              *            func The function or method name to reference.
65669              * @param {number}
65670              *            bitmask The bitmask of flags. See `createWrapper` for more
65671              *            details.
65672              * @param {*}
65673              *            [thisArg] The `this` binding of `func`.
65674              * @param {Array}
65675              *            [partials] The arguments to prepend to those provided to the new
65676              *            function.
65677              * @param {Array}
65678              *            [holders] The `partials` placeholder indexes.
65679              * @param {Array}
65680              *            [partialsRight] The arguments to append to those provided to the
65681              *            new function.
65682              * @param {Array}
65683              *            [holdersRight] The `partialsRight` placeholder indexes.
65684              * @param {Array}
65685              *            [argPos] The argument positions of the new function.
65686              * @param {number}
65687              *            [ary] The arity cap of `func`.
65688              * @param {number}
65689              *            [arity] The arity of `func`.
65690              * @returns {Function} Returns the new wrapped function.
65691              */
65692             function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
65693                 var isAry = bitmask & ARY_FLAG,
65694                     isBind = bitmask & BIND_FLAG,
65695                     isBindKey = bitmask & BIND_KEY_FLAG,
65696                     isCurry = bitmask & CURRY_FLAG,
65697                     isCurryBound = bitmask & CURRY_BOUND_FLAG,
65698                     isCurryRight = bitmask & CURRY_RIGHT_FLAG,
65699                     Ctor = isBindKey ? undefined : createCtorWrapper(func);
65700
65701                 function wrapper() {
65702                     // Avoid `arguments` object use disqualifying optimizations by
65703                     // converting it to an array before providing it to other functions.
65704                     var length = arguments.length,
65705                         index = length,
65706                         args = Array(length);
65707
65708                     while (index--) {
65709                         args[index] = arguments[index];
65710                     }
65711                     if (partials) {
65712                         args = composeArgs(args, partials, holders);
65713                     }
65714                     if (partialsRight) {
65715                         args = composeArgsRight(args, partialsRight, holdersRight);
65716                     }
65717                     if (isCurry || isCurryRight) {
65718                         var placeholder = wrapper.placeholder,
65719                             argsHolders = replaceHolders(args, placeholder);
65720
65721                         length -= argsHolders.length;
65722                         if (length < arity) {
65723                             var newArgPos = argPos ? arrayCopy(argPos) : undefined,
65724                                 newArity = nativeMax(arity - length, 0),
65725                                 newsHolders = isCurry ? argsHolders : undefined,
65726                                 newHoldersRight = isCurry ? undefined : argsHolders,
65727                                 newPartials = isCurry ? args : undefined,
65728                                 newPartialsRight = isCurry ? undefined : args;
65729
65730                             bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
65731                             bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
65732
65733                             if (!isCurryBound) {
65734                                 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
65735                             }
65736                             var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
65737                                 result = createHybridWrapper.apply(undefined, newData);
65738
65739                             if (isLaziable(func)) {
65740                                 setData(result, newData);
65741                             }
65742                             result.placeholder = placeholder;
65743                             return result;
65744                         }
65745                     }
65746                     var thisBinding = isBind ? thisArg : this,
65747                         fn = isBindKey ? thisBinding[func] : func;
65748
65749                     if (argPos) {
65750                         args = reorder(args, argPos);
65751                     }
65752                     if (isAry && ary < args.length) {
65753                         args.length = ary;
65754                     }
65755                     if (this && this !== global && this instanceof wrapper) {
65756                         fn = Ctor || createCtorWrapper(func);
65757                     }
65758                     return fn.apply(thisBinding, args);
65759                 }
65760                 return wrapper;
65761             }
65762
65763             module.exports = createHybridWrapper;
65764
65765         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65766     }, {
65767         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
65768         "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
65769         "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
65770         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js",
65771         "./isLaziable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js",
65772         "./reorder": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js",
65773         "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
65774         "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65775     }],
65776     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js": [function(require, module, exports) {
65777         (function(global) {
65778             var createCtorWrapper = require('./createCtorWrapper');
65779
65780             /** Used to compose bitmasks for wrapper metadata. */
65781             var BIND_FLAG = 1;
65782
65783             /**
65784              * Creates a function that wraps `func` and invokes it with the optional `this`
65785              * binding of `thisArg` and the `partials` prepended to those provided to the
65786              * wrapper.
65787              * 
65788              * @private
65789              * @param {Function}
65790              *            func The function to partially apply arguments to.
65791              * @param {number}
65792              *            bitmask The bitmask of flags. See `createWrapper` for more
65793              *            details.
65794              * @param {*}
65795              *            thisArg The `this` binding of `func`.
65796              * @param {Array}
65797              *            partials The arguments to prepend to those provided to the new
65798              *            function.
65799              * @returns {Function} Returns the new bound function.
65800              */
65801             function createPartialWrapper(func, bitmask, thisArg, partials) {
65802                 var isBind = bitmask & BIND_FLAG,
65803                     Ctor = createCtorWrapper(func);
65804
65805                 function wrapper() {
65806                     // Avoid `arguments` object use disqualifying optimizations by
65807                     // converting it to an array before providing it `func`.
65808                     var argsIndex = -1,
65809                         argsLength = arguments.length,
65810                         leftIndex = -1,
65811                         leftLength = partials.length,
65812                         args = Array(leftLength + argsLength);
65813
65814                     while (++leftIndex < leftLength) {
65815                         args[leftIndex] = partials[leftIndex];
65816                     }
65817                     while (argsLength--) {
65818                         args[leftIndex++] = arguments[++argsIndex];
65819                     }
65820                     var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65821                     return fn.apply(isBind ? thisArg : this, args);
65822                 }
65823                 return wrapper;
65824             }
65825
65826             module.exports = createPartialWrapper;
65827
65828         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65829     }, {
65830         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65831     }],
65832     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js": [function(require, module, exports) {
65833         var baseCallback = require('./baseCallback'),
65834             baseReduce = require('./baseReduce'),
65835             isArray = require('../lang/isArray');
65836
65837         /**
65838          * Creates a function for `_.reduce` or `_.reduceRight`.
65839          * 
65840          * @private
65841          * @param {Function}
65842          *            arrayFunc The function to iterate over an array.
65843          * @param {Function}
65844          *            eachFunc The function to iterate over a collection.
65845          * @returns {Function} Returns the new each function.
65846          */
65847         function createReduce(arrayFunc, eachFunc) {
65848             return function(collection, iteratee, accumulator, thisArg) {
65849                 var initFromArray = arguments.length < 3;
65850                 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
65851             };
65852         }
65853
65854         module.exports = createReduce;
65855
65856     }, {
65857         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65858         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65859         "./baseReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js"
65860     }],
65861     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js": [function(require, module, exports) {
65862         var baseSetData = require('./baseSetData'),
65863             createBindWrapper = require('./createBindWrapper'),
65864             createHybridWrapper = require('./createHybridWrapper'),
65865             createPartialWrapper = require('./createPartialWrapper'),
65866             getData = require('./getData'),
65867             mergeData = require('./mergeData'),
65868             setData = require('./setData');
65869
65870         /** Used to compose bitmasks for wrapper metadata. */
65871         var BIND_FLAG = 1,
65872             BIND_KEY_FLAG = 2,
65873             PARTIAL_FLAG = 32,
65874             PARTIAL_RIGHT_FLAG = 64;
65875
65876         /** Used as the `TypeError` message for "Functions" methods. */
65877         var FUNC_ERROR_TEXT = 'Expected a function';
65878
65879         /*
65880          * Native method references for those with the same name as other `lodash`
65881          * methods.
65882          */
65883         var nativeMax = Math.max;
65884
65885         /**
65886          * Creates a function that either curries or invokes `func` with optional `this`
65887          * binding and partially applied arguments.
65888          * 
65889          * @private
65890          * @param {Function|string}
65891          *            func The function or method name to reference.
65892          * @param {number}
65893          *            bitmask The bitmask of flags. The bitmask may be composed of the
65894          *            following flags: 1 - `_.bind` 2 - `_.bindKey` 4 - `_.curry` or
65895          *            `_.curryRight` of a bound function 8 - `_.curry` 16 -
65896          *            `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
65897          *            `_.rearg` 256 - `_.ary`
65898          * @param {*}
65899          *            [thisArg] The `this` binding of `func`.
65900          * @param {Array}
65901          *            [partials] The arguments to be partially applied.
65902          * @param {Array}
65903          *            [holders] The `partials` placeholder indexes.
65904          * @param {Array}
65905          *            [argPos] The argument positions of the new function.
65906          * @param {number}
65907          *            [ary] The arity cap of `func`.
65908          * @param {number}
65909          *            [arity] The arity of `func`.
65910          * @returns {Function} Returns the new wrapped function.
65911          */
65912         function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
65913             var isBindKey = bitmask & BIND_KEY_FLAG;
65914             if (!isBindKey && typeof func != 'function') {
65915                 throw new TypeError(FUNC_ERROR_TEXT);
65916             }
65917             var length = partials ? partials.length : 0;
65918             if (!length) {
65919                 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
65920                 partials = holders = undefined;
65921             }
65922             length -= (holders ? holders.length : 0);
65923             if (bitmask & PARTIAL_RIGHT_FLAG) {
65924                 var partialsRight = partials,
65925                     holdersRight = holders;
65926
65927                 partials = holders = undefined;
65928             }
65929             var data = isBindKey ? undefined : getData(func),
65930                 newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
65931
65932             if (data) {
65933                 mergeData(newData, data);
65934                 bitmask = newData[1];
65935                 arity = newData[9];
65936             }
65937             newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
65938
65939             if (bitmask == BIND_FLAG) {
65940                 var result = createBindWrapper(newData[0], newData[2]);
65941             } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
65942                 result = createPartialWrapper.apply(undefined, newData);
65943             } else {
65944                 result = createHybridWrapper.apply(undefined, newData);
65945             }
65946             var setter = data ? baseSetData : setData;
65947             return setter(result, newData);
65948         }
65949
65950         module.exports = createWrapper;
65951
65952     }, {
65953         "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js",
65954         "./createBindWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js",
65955         "./createHybridWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js",
65956         "./createPartialWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js",
65957         "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
65958         "./mergeData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js",
65959         "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65960     }],
65961     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js": [function(require, module, exports) {
65962         var arraySome = require('./arraySome');
65963
65964         /**
65965          * A specialized version of `baseIsEqualDeep` for arrays with support for
65966          * partial deep comparisons.
65967          * 
65968          * @private
65969          * @param {Array}
65970          *            array The array to compare.
65971          * @param {Array}
65972          *            other The other array to compare.
65973          * @param {Function}
65974          *            equalFunc The function to determine equivalents of values.
65975          * @param {Function}
65976          *            [customizer] The function to customize comparing arrays.
65977          * @param {boolean}
65978          *            [isLoose] Specify performing partial comparisons.
65979          * @param {Array}
65980          *            [stackA] Tracks traversed `value` objects.
65981          * @param {Array}
65982          *            [stackB] Tracks traversed `other` objects.
65983          * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
65984          */
65985         function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
65986             var index = -1,
65987                 arrLength = array.length,
65988                 othLength = other.length;
65989
65990             if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
65991                 return false;
65992             }
65993             // Ignore non-index properties.
65994             while (++index < arrLength) {
65995                 var arrValue = array[index],
65996                     othValue = other[index],
65997                     result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
65998
65999                 if (result !== undefined) {
66000                     if (result) {
66001                         continue;
66002                     }
66003                     return false;
66004                 }
66005                 // Recursively compare arrays (susceptible to call stack limits).
66006                 if (isLoose) {
66007                     if (!arraySome(other, function(othValue) {
66008                             return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
66009                         })) {
66010                         return false;
66011                     }
66012                 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
66013                     return false;
66014                 }
66015             }
66016             return true;
66017         }
66018
66019         module.exports = equalArrays;
66020
66021     }, {
66022         "./arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js"
66023     }],
66024     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js": [function(require, module, exports) {
66025         /** `Object#toString` result references. */
66026         var boolTag = '[object Boolean]',
66027             dateTag = '[object Date]',
66028             errorTag = '[object Error]',
66029             numberTag = '[object Number]',
66030             regexpTag = '[object RegExp]',
66031             stringTag = '[object String]';
66032
66033         /**
66034          * A specialized version of `baseIsEqualDeep` for comparing objects of the same
66035          * `toStringTag`.
66036          * 
66037          * **Note:** This function only supports comparing values with tags of
66038          * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
66039          * 
66040          * @private
66041          * @param {Object}
66042          *            object The object to compare.
66043          * @param {Object}
66044          *            other The other object to compare.
66045          * @param {string}
66046          *            tag The `toStringTag` of the objects to compare.
66047          * @returns {boolean} Returns `true` if the objects are equivalent, else
66048          *          `false`.
66049          */
66050         function equalByTag(object, other, tag) {
66051             switch (tag) {
66052                 case boolTag:
66053                 case dateTag:
66054                     // Coerce dates and booleans to numbers, dates to milliseconds and
66055                     // booleans
66056                     // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
66057                     return +object == +other;
66058
66059                 case errorTag:
66060                     return object.name == other.name && object.message == other.message;
66061
66062                 case numberTag:
66063                     // Treat `NaN` vs. `NaN` as equal.
66064                     return (object != +object) ? other != +other : object == +other;
66065
66066                 case regexpTag:
66067                 case stringTag:
66068                     // Coerce regexes to strings and treat strings primitives and string
66069                     // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
66070                     // details.
66071                     return object == (other + '');
66072             }
66073             return false;
66074         }
66075
66076         module.exports = equalByTag;
66077
66078     }, {}],
66079     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js": [function(require, module, exports) {
66080         var keys = require('../object/keys');
66081
66082         /** Used for native method references. */
66083         var objectProto = Object.prototype;
66084
66085         /** Used to check objects for own properties. */
66086         var hasOwnProperty = objectProto.hasOwnProperty;
66087
66088         /**
66089          * A specialized version of `baseIsEqualDeep` for objects with support for
66090          * partial deep comparisons.
66091          * 
66092          * @private
66093          * @param {Object}
66094          *            object The object to compare.
66095          * @param {Object}
66096          *            other The other object to compare.
66097          * @param {Function}
66098          *            equalFunc The function to determine equivalents of values.
66099          * @param {Function}
66100          *            [customizer] The function to customize comparing values.
66101          * @param {boolean}
66102          *            [isLoose] Specify performing partial comparisons.
66103          * @param {Array}
66104          *            [stackA] Tracks traversed `value` objects.
66105          * @param {Array}
66106          *            [stackB] Tracks traversed `other` objects.
66107          * @returns {boolean} Returns `true` if the objects are equivalent, else
66108          *          `false`.
66109          */
66110         function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
66111             var objProps = keys(object),
66112                 objLength = objProps.length,
66113                 othProps = keys(other),
66114                 othLength = othProps.length;
66115
66116             if (objLength != othLength && !isLoose) {
66117                 return false;
66118             }
66119             var index = objLength;
66120             while (index--) {
66121                 var key = objProps[index];
66122                 if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
66123                     return false;
66124                 }
66125             }
66126             var skipCtor = isLoose;
66127             while (++index < objLength) {
66128                 key = objProps[index];
66129                 var objValue = object[key],
66130                     othValue = other[key],
66131                     result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
66132
66133                 // Recursively compare objects (susceptible to call stack limits).
66134                 if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
66135                     return false;
66136                 }
66137                 skipCtor || (skipCtor = key == 'constructor');
66138             }
66139             if (!skipCtor) {
66140                 var objCtor = object.constructor,
66141                     othCtor = other.constructor;
66142
66143                 // Non `Object` object instances with different constructors are not equal.
66144                 if (objCtor != othCtor &&
66145                     ('constructor' in object && 'constructor' in other) &&
66146                     !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
66147                         typeof othCtor == 'function' && othCtor instanceof othCtor)) {
66148                     return false;
66149                 }
66150             }
66151             return true;
66152         }
66153
66154         module.exports = equalObjects;
66155
66156     }, {
66157         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
66158     }],
66159     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js": [function(require, module, exports) {
66160         var metaMap = require('./metaMap'),
66161             noop = require('../utility/noop');
66162
66163         /**
66164          * Gets metadata for `func`.
66165          * 
66166          * @private
66167          * @param {Function}
66168          *            func The function to query.
66169          * @returns {*} Returns the metadata for `func`.
66170          */
66171         var getData = !metaMap ? noop : function(func) {
66172             return metaMap.get(func);
66173         };
66174
66175         module.exports = getData;
66176
66177     }, {
66178         "../utility/noop": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js",
66179         "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
66180     }],
66181     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js": [function(require, module, exports) {
66182         var realNames = require('./realNames');
66183
66184         /**
66185          * Gets the name of `func`.
66186          * 
66187          * @private
66188          * @param {Function}
66189          *            func The function to query.
66190          * @returns {string} Returns the function name.
66191          */
66192         function getFuncName(func) {
66193             var result = (func.name + ''),
66194                 array = realNames[result],
66195                 length = array ? array.length : 0;
66196
66197             while (length--) {
66198                 var data = array[length],
66199                     otherFunc = data.func;
66200                 if (otherFunc == null || otherFunc == func) {
66201                     return data.name;
66202                 }
66203             }
66204             return result;
66205         }
66206
66207         module.exports = getFuncName;
66208
66209     }, {
66210         "./realNames": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js"
66211     }],
66212     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js": [function(require, module, exports) {
66213         var baseProperty = require('./baseProperty');
66214
66215         /**
66216          * Gets the "length" property value of `object`.
66217          * 
66218          * **Note:** This function is used to avoid a [JIT
66219          * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari on
66220          * at least iOS 8.1-8.3 ARM64.
66221          * 
66222          * @private
66223          * @param {Object}
66224          *            object The object to query.
66225          * @returns {*} Returns the "length" value.
66226          */
66227         var getLength = baseProperty('length');
66228
66229         module.exports = getLength;
66230
66231     }, {
66232         "./baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js"
66233     }],
66234     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js": [function(require, module, exports) {
66235         var isStrictComparable = require('./isStrictComparable'),
66236             pairs = require('../object/pairs');
66237
66238         /**
66239          * Gets the propery names, values, and compare flags of `object`.
66240          * 
66241          * @private
66242          * @param {Object}
66243          *            object The object to query.
66244          * @returns {Array} Returns the match data of `object`.
66245          */
66246         function getMatchData(object) {
66247             var result = pairs(object),
66248                 length = result.length;
66249
66250             while (length--) {
66251                 result[length][2] = isStrictComparable(result[length][1]);
66252             }
66253             return result;
66254         }
66255
66256         module.exports = getMatchData;
66257
66258     }, {
66259         "../object/pairs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js",
66260         "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js"
66261     }],
66262     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js": [function(require, module, exports) {
66263         var isNative = require('../lang/isNative');
66264
66265         /**
66266          * Gets the native function at `key` of `object`.
66267          * 
66268          * @private
66269          * @param {Object}
66270          *            object The object to query.
66271          * @param {string}
66272          *            key The key of the method to get.
66273          * @returns {*} Returns the function if it's native, else `undefined`.
66274          */
66275         function getNative(object, key) {
66276             var value = object == null ? undefined : object[key];
66277             return isNative(value) ? value : undefined;
66278         }
66279
66280         module.exports = getNative;
66281
66282     }, {
66283         "../lang/isNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js"
66284     }],
66285     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js": [function(require, module, exports) {
66286         /**
66287          * Gets the index at which the first occurrence of `NaN` is found in `array`.
66288          * 
66289          * @private
66290          * @param {Array}
66291          *            array The array to search.
66292          * @param {number}
66293          *            fromIndex The index to search from.
66294          * @param {boolean}
66295          *            [fromRight] Specify iterating from right to left.
66296          * @returns {number} Returns the index of the matched `NaN`, else `-1`.
66297          */
66298         function indexOfNaN(array, fromIndex, fromRight) {
66299             var length = array.length,
66300                 index = fromIndex + (fromRight ? 0 : -1);
66301
66302             while ((fromRight ? index-- : ++index < length)) {
66303                 var other = array[index];
66304                 if (other !== other) {
66305                     return index;
66306                 }
66307             }
66308             return -1;
66309         }
66310
66311         module.exports = indexOfNaN;
66312
66313     }, {}],
66314     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js": [function(require, module, exports) {
66315         var getLength = require('./getLength'),
66316             isLength = require('./isLength');
66317
66318         /**
66319          * Checks if `value` is array-like.
66320          * 
66321          * @private
66322          * @param {*}
66323          *            value The value to check.
66324          * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
66325          */
66326         function isArrayLike(value) {
66327             return value != null && isLength(getLength(value));
66328         }
66329
66330         module.exports = isArrayLike;
66331
66332     }, {
66333         "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
66334         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66335     }],
66336     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js": [function(require, module, exports) {
66337         /** Used to detect unsigned integer values. */
66338         var reIsUint = /^\d+$/;
66339
66340         /**
66341          * Used as the [maximum
66342          * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66343          * of an array-like value.
66344          */
66345         var MAX_SAFE_INTEGER = 9007199254740991;
66346
66347         /**
66348          * Checks if `value` is a valid array-like index.
66349          * 
66350          * @private
66351          * @param {*}
66352          *            value The value to check.
66353          * @param {number}
66354          *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
66355          * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
66356          */
66357         function isIndex(value, length) {
66358             value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
66359             length = length == null ? MAX_SAFE_INTEGER : length;
66360             return value > -1 && value % 1 == 0 && value < length;
66361         }
66362
66363         module.exports = isIndex;
66364
66365     }, {}],
66366     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js": [function(require, module, exports) {
66367         var isArrayLike = require('./isArrayLike'),
66368             isIndex = require('./isIndex'),
66369             isObject = require('../lang/isObject');
66370
66371         /**
66372          * Checks if the provided arguments are from an iteratee call.
66373          * 
66374          * @private
66375          * @param {*}
66376          *            value The potential iteratee value argument.
66377          * @param {*}
66378          *            index The potential iteratee index or key argument.
66379          * @param {*}
66380          *            object The potential iteratee object argument.
66381          * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
66382          *          else `false`.
66383          */
66384         function isIterateeCall(value, index, object) {
66385             if (!isObject(object)) {
66386                 return false;
66387             }
66388             var type = typeof index;
66389             if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
66390                 var other = object[index];
66391                 return value === value ? (value === other) : (other !== other);
66392             }
66393             return false;
66394         }
66395
66396         module.exports = isIterateeCall;
66397
66398     }, {
66399         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
66400         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66401         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66402     }],
66403     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js": [function(require, module, exports) {
66404         var isArray = require('../lang/isArray'),
66405             toObject = require('./toObject');
66406
66407         /** Used to match property names within property paths. */
66408         var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
66409             reIsPlainProp = /^\w*$/;
66410
66411         /**
66412          * Checks if `value` is a property name and not a property path.
66413          * 
66414          * @private
66415          * @param {*}
66416          *            value The value to check.
66417          * @param {Object}
66418          *            [object] The object to query keys on.
66419          * @returns {boolean} Returns `true` if `value` is a property name, else
66420          *          `false`.
66421          */
66422         function isKey(value, object) {
66423             var type = typeof value;
66424             if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
66425                 return true;
66426             }
66427             if (isArray(value)) {
66428                 return false;
66429             }
66430             var result = !reIsDeepProp.test(value);
66431             return result || (object != null && value in toObject(object));
66432         }
66433
66434         module.exports = isKey;
66435
66436     }, {
66437         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66438         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66439     }],
66440     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js": [function(require, module, exports) {
66441         var LazyWrapper = require('./LazyWrapper'),
66442             getData = require('./getData'),
66443             getFuncName = require('./getFuncName'),
66444             lodash = require('../chain/lodash');
66445
66446         /**
66447          * Checks if `func` has a lazy counterpart.
66448          * 
66449          * @private
66450          * @param {Function}
66451          *            func The function to check.
66452          * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
66453          *          `false`.
66454          */
66455         function isLaziable(func) {
66456             var funcName = getFuncName(func),
66457                 other = lodash[funcName];
66458
66459             if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
66460                 return false;
66461             }
66462             if (func === other) {
66463                 return true;
66464             }
66465             var data = getData(other);
66466             return !!data && func === data[0];
66467         }
66468
66469         module.exports = isLaziable;
66470
66471     }, {
66472         "../chain/lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js",
66473         "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66474         "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66475         "./getFuncName": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js"
66476     }],
66477     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js": [function(require, module, exports) {
66478         /**
66479          * Used as the [maximum
66480          * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66481          * of an array-like value.
66482          */
66483         var MAX_SAFE_INTEGER = 9007199254740991;
66484
66485         /**
66486          * Checks if `value` is a valid array-like length.
66487          * 
66488          * **Note:** This function is based on
66489          * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
66490          * 
66491          * @private
66492          * @param {*}
66493          *            value The value to check.
66494          * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
66495          */
66496         function isLength(value) {
66497             return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
66498         }
66499
66500         module.exports = isLength;
66501
66502     }, {}],
66503     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js": [function(require, module, exports) {
66504         /**
66505          * Checks if `value` is object-like.
66506          * 
66507          * @private
66508          * @param {*}
66509          *            value The value to check.
66510          * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
66511          */
66512         function isObjectLike(value) {
66513             return !!value && typeof value == 'object';
66514         }
66515
66516         module.exports = isObjectLike;
66517
66518     }, {}],
66519     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js": [function(require, module, exports) {
66520         var isObject = require('../lang/isObject');
66521
66522         /**
66523          * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
66524          * 
66525          * @private
66526          * @param {*}
66527          *            value The value to check.
66528          * @returns {boolean} Returns `true` if `value` if suitable for strict equality
66529          *          comparisons, else `false`.
66530          */
66531         function isStrictComparable(value) {
66532             return value === value && !isObject(value);
66533         }
66534
66535         module.exports = isStrictComparable;
66536
66537     }, {
66538         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66539     }],
66540     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js": [function(require, module, exports) {
66541         var arrayCopy = require('./arrayCopy'),
66542             composeArgs = require('./composeArgs'),
66543             composeArgsRight = require('./composeArgsRight'),
66544             replaceHolders = require('./replaceHolders');
66545
66546         /** Used to compose bitmasks for wrapper metadata. */
66547         var BIND_FLAG = 1,
66548             CURRY_BOUND_FLAG = 4,
66549             CURRY_FLAG = 8,
66550             ARY_FLAG = 128,
66551             REARG_FLAG = 256;
66552
66553         /** Used as the internal argument placeholder. */
66554         var PLACEHOLDER = '__lodash_placeholder__';
66555
66556         /*
66557          * Native method references for those with the same name as other `lodash`
66558          * methods.
66559          */
66560         var nativeMin = Math.min;
66561
66562         /**
66563          * Merges the function metadata of `source` into `data`.
66564          * 
66565          * Merging metadata reduces the number of wrappers required to invoke a
66566          * function. This is possible because methods like `_.bind`, `_.curry`, and
66567          * `_.partial` may be applied regardless of execution order. Methods like
66568          * `_.ary` and `_.rearg` augment function arguments, making the order in which
66569          * they are executed important, preventing the merging of metadata. However, we
66570          * make an exception for a safe common case where curried functions have `_.ary`
66571          * and or `_.rearg` applied.
66572          * 
66573          * @private
66574          * @param {Array}
66575          *            data The destination metadata.
66576          * @param {Array}
66577          *            source The source metadata.
66578          * @returns {Array} Returns `data`.
66579          */
66580         function mergeData(data, source) {
66581             var bitmask = data[1],
66582                 srcBitmask = source[1],
66583                 newBitmask = bitmask | srcBitmask,
66584                 isCommon = newBitmask < ARY_FLAG;
66585
66586             var isCombo =
66587                 (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
66588                 (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
66589                 (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
66590
66591             // Exit early if metadata can't be merged.
66592             if (!(isCommon || isCombo)) {
66593                 return data;
66594             }
66595             // Use source `thisArg` if available.
66596             if (srcBitmask & BIND_FLAG) {
66597                 data[2] = source[2];
66598                 // Set when currying a bound function.
66599                 newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
66600             }
66601             // Compose partial arguments.
66602             var value = source[3];
66603             if (value) {
66604                 var partials = data[3];
66605                 data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
66606                 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
66607             }
66608             // Compose partial right arguments.
66609             value = source[5];
66610             if (value) {
66611                 partials = data[5];
66612                 data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
66613                 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
66614             }
66615             // Use source `argPos` if available.
66616             value = source[7];
66617             if (value) {
66618                 data[7] = arrayCopy(value);
66619             }
66620             // Use source `ary` if it's smaller.
66621             if (srcBitmask & ARY_FLAG) {
66622                 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
66623             }
66624             // Use source `arity` if one is not provided.
66625             if (data[9] == null) {
66626                 data[9] = source[9];
66627             }
66628             // Use source `func` and merge bitmasks.
66629             data[0] = source[0];
66630             data[1] = newBitmask;
66631
66632             return data;
66633         }
66634
66635         module.exports = mergeData;
66636
66637     }, {
66638         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66639         "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
66640         "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
66641         "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js"
66642     }],
66643     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js": [function(require, module, exports) {
66644         (function(global) {
66645             var getNative = require('./getNative');
66646
66647             /** Native method references. */
66648             var WeakMap = getNative(global, 'WeakMap');
66649
66650             /** Used to store function metadata. */
66651             var metaMap = WeakMap && new WeakMap;
66652
66653             module.exports = metaMap;
66654
66655         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
66656     }, {
66657         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
66658     }],
66659     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js": [function(require, module, exports) {
66660         var toObject = require('./toObject');
66661
66662         /**
66663          * A specialized version of `_.pick` which picks `object` properties specified
66664          * by `props`.
66665          * 
66666          * @private
66667          * @param {Object}
66668          *            object The source object.
66669          * @param {string[]}
66670          *            props The property names to pick.
66671          * @returns {Object} Returns the new object.
66672          */
66673         function pickByArray(object, props) {
66674             object = toObject(object);
66675
66676             var index = -1,
66677                 length = props.length,
66678                 result = {};
66679
66680             while (++index < length) {
66681                 var key = props[index];
66682                 if (key in object) {
66683                     result[key] = object[key];
66684                 }
66685             }
66686             return result;
66687         }
66688
66689         module.exports = pickByArray;
66690
66691     }, {
66692         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66693     }],
66694     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js": [function(require, module, exports) {
66695         var baseForIn = require('./baseForIn');
66696
66697         /**
66698          * A specialized version of `_.pick` which picks `object` properties `predicate`
66699          * returns truthy for.
66700          * 
66701          * @private
66702          * @param {Object}
66703          *            object The source object.
66704          * @param {Function}
66705          *            predicate The function invoked per iteration.
66706          * @returns {Object} Returns the new object.
66707          */
66708         function pickByCallback(object, predicate) {
66709             var result = {};
66710             baseForIn(object, function(value, key, object) {
66711                 if (predicate(value, key, object)) {
66712                     result[key] = value;
66713                 }
66714             });
66715             return result;
66716         }
66717
66718         module.exports = pickByCallback;
66719
66720     }, {
66721         "./baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js"
66722     }],
66723     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js": [function(require, module, exports) {
66724         /** Used to lookup unminified function names. */
66725         var realNames = {};
66726
66727         module.exports = realNames;
66728
66729     }, {}],
66730     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js": [function(require, module, exports) {
66731         var arrayCopy = require('./arrayCopy'),
66732             isIndex = require('./isIndex');
66733
66734         /*
66735          * Native method references for those with the same name as other `lodash`
66736          * methods.
66737          */
66738         var nativeMin = Math.min;
66739
66740         /**
66741          * Reorder `array` according to the specified indexes where the element at the
66742          * first index is assigned as the first element, the element at the second index
66743          * is assigned as the second element, and so on.
66744          * 
66745          * @private
66746          * @param {Array}
66747          *            array The array to reorder.
66748          * @param {Array}
66749          *            indexes The arranged array indexes.
66750          * @returns {Array} Returns `array`.
66751          */
66752         function reorder(array, indexes) {
66753             var arrLength = array.length,
66754                 length = nativeMin(indexes.length, arrLength),
66755                 oldArray = arrayCopy(array);
66756
66757             while (length--) {
66758                 var index = indexes[length];
66759                 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
66760             }
66761             return array;
66762         }
66763
66764         module.exports = reorder;
66765
66766     }, {
66767         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66768         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66769     }],
66770     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js": [function(require, module, exports) {
66771         /** Used as the internal argument placeholder. */
66772         var PLACEHOLDER = '__lodash_placeholder__';
66773
66774         /**
66775          * Replaces all `placeholder` elements in `array` with an internal placeholder
66776          * and returns an array of their indexes.
66777          * 
66778          * @private
66779          * @param {Array}
66780          *            array The array to modify.
66781          * @param {*}
66782          *            placeholder The placeholder to replace.
66783          * @returns {Array} Returns the new array of placeholder indexes.
66784          */
66785         function replaceHolders(array, placeholder) {
66786             var index = -1,
66787                 length = array.length,
66788                 resIndex = -1,
66789                 result = [];
66790
66791             while (++index < length) {
66792                 if (array[index] === placeholder) {
66793                     array[index] = PLACEHOLDER;
66794                     result[++resIndex] = index;
66795                 }
66796             }
66797             return result;
66798         }
66799
66800         module.exports = replaceHolders;
66801
66802     }, {}],
66803     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js": [function(require, module, exports) {
66804         var baseSetData = require('./baseSetData'),
66805             now = require('../date/now');
66806
66807         /** Used to detect when a function becomes hot. */
66808         var HOT_COUNT = 150,
66809             HOT_SPAN = 16;
66810
66811         /**
66812          * Sets metadata for `func`.
66813          * 
66814          * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
66815          * period of time, it will trip its breaker and transition to an identity
66816          * function to avoid garbage collection pauses in V8. See [V8 issue
66817          * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more details.
66818          * 
66819          * @private
66820          * @param {Function}
66821          *            func The function to associate metadata with.
66822          * @param {*}
66823          *            data The metadata.
66824          * @returns {Function} Returns `func`.
66825          */
66826         var setData = (function() {
66827             var count = 0,
66828                 lastCalled = 0;
66829
66830             return function(key, value) {
66831                 var stamp = now(),
66832                     remaining = HOT_SPAN - (stamp - lastCalled);
66833
66834                 lastCalled = stamp;
66835                 if (remaining > 0) {
66836                     if (++count >= HOT_COUNT) {
66837                         return key;
66838                     }
66839                 } else {
66840                     count = 0;
66841                 }
66842                 return baseSetData(key, value);
66843             };
66844         }());
66845
66846         module.exports = setData;
66847
66848     }, {
66849         "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
66850         "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js"
66851     }],
66852     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js": [function(require, module, exports) {
66853         var isArguments = require('../lang/isArguments'),
66854             isArray = require('../lang/isArray'),
66855             isIndex = require('./isIndex'),
66856             isLength = require('./isLength'),
66857             keysIn = require('../object/keysIn');
66858
66859         /** Used for native method references. */
66860         var objectProto = Object.prototype;
66861
66862         /** Used to check objects for own properties. */
66863         var hasOwnProperty = objectProto.hasOwnProperty;
66864
66865         /**
66866          * A fallback implementation of `Object.keys` which creates an array of the own
66867          * enumerable property names of `object`.
66868          * 
66869          * @private
66870          * @param {Object}
66871          *            object The object to query.
66872          * @returns {Array} Returns the array of property names.
66873          */
66874         function shimKeys(object) {
66875             var props = keysIn(object),
66876                 propsLength = props.length,
66877                 length = propsLength && object.length;
66878
66879             var allowIndexes = !!length && isLength(length) &&
66880                 (isArray(object) || isArguments(object));
66881
66882             var index = -1,
66883                 result = [];
66884
66885             while (++index < propsLength) {
66886                 var key = props[index];
66887                 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
66888                     result.push(key);
66889                 }
66890             }
66891             return result;
66892         }
66893
66894         module.exports = shimKeys;
66895
66896     }, {
66897         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
66898         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66899         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
66900         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
66901         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66902     }],
66903     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js": [function(require, module, exports) {
66904         /**
66905          * An implementation of `_.uniq` optimized for sorted arrays without support for
66906          * callback shorthands and `this` binding.
66907          * 
66908          * @private
66909          * @param {Array}
66910          *            array The array to inspect.
66911          * @param {Function}
66912          *            [iteratee] The function invoked per iteration.
66913          * @returns {Array} Returns the new duplicate free array.
66914          */
66915         function sortedUniq(array, iteratee) {
66916             var seen,
66917                 index = -1,
66918                 length = array.length,
66919                 resIndex = -1,
66920                 result = [];
66921
66922             while (++index < length) {
66923                 var value = array[index],
66924                     computed = iteratee ? iteratee(value, index, array) : value;
66925
66926                 if (!index || seen !== computed) {
66927                     seen = computed;
66928                     result[++resIndex] = value;
66929                 }
66930             }
66931             return result;
66932         }
66933
66934         module.exports = sortedUniq;
66935
66936     }, {}],
66937     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js": [function(require, module, exports) {
66938         var isObject = require('../lang/isObject');
66939
66940         /**
66941          * Converts `value` to an object if it's not one.
66942          * 
66943          * @private
66944          * @param {*}
66945          *            value The value to process.
66946          * @returns {Object} Returns the object.
66947          */
66948         function toObject(value) {
66949             return isObject(value) ? value : Object(value);
66950         }
66951
66952         module.exports = toObject;
66953
66954     }, {
66955         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66956     }],
66957     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js": [function(require, module, exports) {
66958         var baseToString = require('./baseToString'),
66959             isArray = require('../lang/isArray');
66960
66961         /** Used to match property names within property paths. */
66962         var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
66963
66964         /** Used to match backslashes in property paths. */
66965         var reEscapeChar = /\\(\\)?/g;
66966
66967         /**
66968          * Converts `value` to property path array if it's not one.
66969          * 
66970          * @private
66971          * @param {*}
66972          *            value The value to process.
66973          * @returns {Array} Returns the property path array.
66974          */
66975         function toPath(value) {
66976             if (isArray(value)) {
66977                 return value;
66978             }
66979             var result = [];
66980             baseToString(value).replace(rePropName, function(match, number, quote, string) {
66981                 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
66982             });
66983             return result;
66984         }
66985
66986         module.exports = toPath;
66987
66988     }, {
66989         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66990         "./baseToString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js"
66991     }],
66992     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js": [function(require, module, exports) {
66993         var LazyWrapper = require('./LazyWrapper'),
66994             LodashWrapper = require('./LodashWrapper'),
66995             arrayCopy = require('./arrayCopy');
66996
66997         /**
66998          * Creates a clone of `wrapper`.
66999          * 
67000          * @private
67001          * @param {Object}
67002          *            wrapper The wrapper to clone.
67003          * @returns {Object} Returns the cloned wrapper.
67004          */
67005         function wrapperClone(wrapper) {
67006             return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
67007         }
67008
67009         module.exports = wrapperClone;
67010
67011     }, {
67012         "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
67013         "./LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
67014         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js"
67015     }],
67016     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js": [function(require, module, exports) {
67017         var isArrayLike = require('../internal/isArrayLike'),
67018             isObjectLike = require('../internal/isObjectLike');
67019
67020         /** Used for native method references. */
67021         var objectProto = Object.prototype;
67022
67023         /** Used to check objects for own properties. */
67024         var hasOwnProperty = objectProto.hasOwnProperty;
67025
67026         /** Native method references. */
67027         var propertyIsEnumerable = objectProto.propertyIsEnumerable;
67028
67029         /**
67030          * Checks if `value` is classified as an `arguments` object.
67031          * 
67032          * @static
67033          * @memberOf _
67034          * @category Lang
67035          * @param {*}
67036          *            value The value to check.
67037          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67038          *          `false`.
67039          * @example
67040          * 
67041          * _.isArguments(function() { return arguments; }()); // => true
67042          * 
67043          * _.isArguments([1, 2, 3]); // => false
67044          */
67045         function isArguments(value) {
67046             return isObjectLike(value) && isArrayLike(value) &&
67047                 hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
67048         }
67049
67050         module.exports = isArguments;
67051
67052     }, {
67053         "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67054         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67055     }],
67056     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js": [function(require, module, exports) {
67057         var getNative = require('../internal/getNative'),
67058             isLength = require('../internal/isLength'),
67059             isObjectLike = require('../internal/isObjectLike');
67060
67061         /** `Object#toString` result references. */
67062         var arrayTag = '[object Array]';
67063
67064         /** Used for native method references. */
67065         var objectProto = Object.prototype;
67066
67067         /**
67068          * Used to resolve the
67069          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67070          * of values.
67071          */
67072         var objToString = objectProto.toString;
67073
67074         /*
67075          * Native method references for those with the same name as other `lodash`
67076          * methods.
67077          */
67078         var nativeIsArray = getNative(Array, 'isArray');
67079
67080         /**
67081          * Checks if `value` is classified as an `Array` object.
67082          * 
67083          * @static
67084          * @memberOf _
67085          * @category Lang
67086          * @param {*}
67087          *            value The value to check.
67088          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67089          *          `false`.
67090          * @example
67091          * 
67092          * _.isArray([1, 2, 3]); // => true
67093          * 
67094          * _.isArray(function() { return arguments; }()); // => false
67095          */
67096         var isArray = nativeIsArray || function(value) {
67097             return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
67098         };
67099
67100         module.exports = isArray;
67101
67102     }, {
67103         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67104         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67105         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67106     }],
67107     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js": [function(require, module, exports) {
67108         var isObject = require('./isObject');
67109
67110         /** `Object#toString` result references. */
67111         var funcTag = '[object Function]';
67112
67113         /** Used for native method references. */
67114         var objectProto = Object.prototype;
67115
67116         /**
67117          * Used to resolve the
67118          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67119          * of values.
67120          */
67121         var objToString = objectProto.toString;
67122
67123         /**
67124          * Checks if `value` is classified as a `Function` object.
67125          * 
67126          * @static
67127          * @memberOf _
67128          * @category Lang
67129          * @param {*}
67130          *            value The value to check.
67131          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67132          *          `false`.
67133          * @example
67134          * 
67135          * _.isFunction(_); // => true
67136          * 
67137          * _.isFunction(/abc/); // => false
67138          */
67139         function isFunction(value) {
67140             // The use of `Object#toString` avoids issues with the `typeof` operator
67141             // in older versions of Chrome and Safari which return 'function' for
67142             // regexes
67143             // and Safari 8 which returns 'object' for typed array constructors.
67144             return isObject(value) && objToString.call(value) == funcTag;
67145         }
67146
67147         module.exports = isFunction;
67148
67149     }, {
67150         "./isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67151     }],
67152     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js": [function(require, module, exports) {
67153         var isFunction = require('./isFunction'),
67154             isObjectLike = require('../internal/isObjectLike');
67155
67156         /** Used to detect host constructors (Safari > 5). */
67157         var reIsHostCtor = /^\[object .+?Constructor\]$/;
67158
67159         /** Used for native method references. */
67160         var objectProto = Object.prototype;
67161
67162         /** Used to resolve the decompiled source of functions. */
67163         var fnToString = Function.prototype.toString;
67164
67165         /** Used to check objects for own properties. */
67166         var hasOwnProperty = objectProto.hasOwnProperty;
67167
67168         /** Used to detect if a method is native. */
67169         var reIsNative = RegExp('^' +
67170             fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
67171             .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
67172         );
67173
67174         /**
67175          * Checks if `value` is a native function.
67176          * 
67177          * @static
67178          * @memberOf _
67179          * @category Lang
67180          * @param {*}
67181          *            value The value to check.
67182          * @returns {boolean} Returns `true` if `value` is a native function, else
67183          *          `false`.
67184          * @example
67185          * 
67186          * _.isNative(Array.prototype.push); // => true
67187          * 
67188          * _.isNative(_); // => false
67189          */
67190         function isNative(value) {
67191             if (value == null) {
67192                 return false;
67193             }
67194             if (isFunction(value)) {
67195                 return reIsNative.test(fnToString.call(value));
67196             }
67197             return isObjectLike(value) && reIsHostCtor.test(value);
67198         }
67199
67200         module.exports = isNative;
67201
67202     }, {
67203         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67204         "./isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
67205     }],
67206     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js": [function(require, module, exports) {
67207         var isObjectLike = require('../internal/isObjectLike');
67208
67209         /** `Object#toString` result references. */
67210         var numberTag = '[object Number]';
67211
67212         /** Used for native method references. */
67213         var objectProto = Object.prototype;
67214
67215         /**
67216          * Used to resolve the
67217          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67218          * of values.
67219          */
67220         var objToString = objectProto.toString;
67221
67222         /**
67223          * Checks if `value` is classified as a `Number` primitive or object.
67224          * 
67225          * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
67226          * as numbers, use the `_.isFinite` method.
67227          * 
67228          * @static
67229          * @memberOf _
67230          * @category Lang
67231          * @param {*}
67232          *            value The value to check.
67233          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67234          *          `false`.
67235          * @example
67236          * 
67237          * _.isNumber(8.4); // => true
67238          * 
67239          * _.isNumber(NaN); // => true
67240          * 
67241          * _.isNumber('8.4'); // => false
67242          */
67243         function isNumber(value) {
67244             return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
67245         }
67246
67247         module.exports = isNumber;
67248
67249     }, {
67250         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67251     }],
67252     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js": [function(require, module, exports) {
67253         /**
67254          * Checks if `value` is the [language type](https://es5.github.io/#x8) of
67255          * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
67256          * `new String('')`)
67257          * 
67258          * @static
67259          * @memberOf _
67260          * @category Lang
67261          * @param {*}
67262          *            value The value to check.
67263          * @returns {boolean} Returns `true` if `value` is an object, else `false`.
67264          * @example
67265          * 
67266          * _.isObject({}); // => true
67267          * 
67268          * _.isObject([1, 2, 3]); // => true
67269          * 
67270          * _.isObject(1); // => false
67271          */
67272         function isObject(value) {
67273             // Avoid a V8 JIT bug in Chrome 19-20.
67274             // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
67275             var type = typeof value;
67276             return !!value && (type == 'object' || type == 'function');
67277         }
67278
67279         module.exports = isObject;
67280
67281     }, {}],
67282     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js": [function(require, module, exports) {
67283         var baseForIn = require('../internal/baseForIn'),
67284             isArguments = require('./isArguments'),
67285             isObjectLike = require('../internal/isObjectLike');
67286
67287         /** `Object#toString` result references. */
67288         var objectTag = '[object Object]';
67289
67290         /** Used for native method references. */
67291         var objectProto = Object.prototype;
67292
67293         /** Used to check objects for own properties. */
67294         var hasOwnProperty = objectProto.hasOwnProperty;
67295
67296         /**
67297          * Used to resolve the
67298          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67299          * of values.
67300          */
67301         var objToString = objectProto.toString;
67302
67303         /**
67304          * Checks if `value` is a plain object, that is, an object created by the
67305          * `Object` constructor or one with a `[[Prototype]]` of `null`.
67306          * 
67307          * **Note:** This method assumes objects created by the `Object` constructor
67308          * have no inherited enumerable properties.
67309          * 
67310          * @static
67311          * @memberOf _
67312          * @category Lang
67313          * @param {*}
67314          *            value The value to check.
67315          * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
67316          * @example
67317          * 
67318          * function Foo() { this.a = 1; }
67319          * 
67320          * _.isPlainObject(new Foo); // => false
67321          * 
67322          * _.isPlainObject([1, 2, 3]); // => false
67323          * 
67324          * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
67325          * 
67326          * _.isPlainObject(Object.create(null)); // => true
67327          */
67328         function isPlainObject(value) {
67329             var Ctor;
67330
67331             // Exit early for non `Object` objects.
67332             if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
67333                 (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
67334                 return false;
67335             }
67336             // IE < 9 iterates inherited properties before own properties. If the first
67337             // iterated property is an object's own property then there are no inherited
67338             // enumerable properties.
67339             var result;
67340             // In most environments an object's own properties are iterated before
67341             // its inherited properties. If the last iterated property is an object's
67342             // own property then there are no inherited enumerable properties.
67343             baseForIn(value, function(subValue, key) {
67344                 result = key;
67345             });
67346             return result === undefined || hasOwnProperty.call(value, result);
67347         }
67348
67349         module.exports = isPlainObject;
67350
67351     }, {
67352         "../internal/baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js",
67353         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67354         "./isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js"
67355     }],
67356     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js": [function(require, module, exports) {
67357         var isObjectLike = require('../internal/isObjectLike');
67358
67359         /** `Object#toString` result references. */
67360         var stringTag = '[object String]';
67361
67362         /** Used for native method references. */
67363         var objectProto = Object.prototype;
67364
67365         /**
67366          * Used to resolve the
67367          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67368          * of values.
67369          */
67370         var objToString = objectProto.toString;
67371
67372         /**
67373          * Checks if `value` is classified as a `String` primitive or object.
67374          * 
67375          * @static
67376          * @memberOf _
67377          * @category Lang
67378          * @param {*}
67379          *            value The value to check.
67380          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67381          *          `false`.
67382          * @example
67383          * 
67384          * _.isString('abc'); // => true
67385          * 
67386          * _.isString(1); // => false
67387          */
67388         function isString(value) {
67389             return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
67390         }
67391
67392         module.exports = isString;
67393
67394     }, {
67395         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67396     }],
67397     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js": [function(require, module, exports) {
67398         var isLength = require('../internal/isLength'),
67399             isObjectLike = require('../internal/isObjectLike');
67400
67401         /** `Object#toString` result references. */
67402         var argsTag = '[object Arguments]',
67403             arrayTag = '[object Array]',
67404             boolTag = '[object Boolean]',
67405             dateTag = '[object Date]',
67406             errorTag = '[object Error]',
67407             funcTag = '[object Function]',
67408             mapTag = '[object Map]',
67409             numberTag = '[object Number]',
67410             objectTag = '[object Object]',
67411             regexpTag = '[object RegExp]',
67412             setTag = '[object Set]',
67413             stringTag = '[object String]',
67414             weakMapTag = '[object WeakMap]';
67415
67416         var arrayBufferTag = '[object ArrayBuffer]',
67417             float32Tag = '[object Float32Array]',
67418             float64Tag = '[object Float64Array]',
67419             int8Tag = '[object Int8Array]',
67420             int16Tag = '[object Int16Array]',
67421             int32Tag = '[object Int32Array]',
67422             uint8Tag = '[object Uint8Array]',
67423             uint8ClampedTag = '[object Uint8ClampedArray]',
67424             uint16Tag = '[object Uint16Array]',
67425             uint32Tag = '[object Uint32Array]';
67426
67427         /** Used to identify `toStringTag` values of typed arrays. */
67428         var typedArrayTags = {};
67429         typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
67430             typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
67431             typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
67432             typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
67433             typedArrayTags[uint32Tag] = true;
67434         typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
67435             typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
67436             typedArrayTags[dateTag] = typedArrayTags[errorTag] =
67437             typedArrayTags[funcTag] = typedArrayTags[mapTag] =
67438             typedArrayTags[numberTag] = typedArrayTags[objectTag] =
67439             typedArrayTags[regexpTag] = typedArrayTags[setTag] =
67440             typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
67441
67442         /** Used for native method references. */
67443         var objectProto = Object.prototype;
67444
67445         /**
67446          * Used to resolve the
67447          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67448          * of values.
67449          */
67450         var objToString = objectProto.toString;
67451
67452         /**
67453          * Checks if `value` is classified as a typed array.
67454          * 
67455          * @static
67456          * @memberOf _
67457          * @category Lang
67458          * @param {*}
67459          *            value The value to check.
67460          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67461          *          `false`.
67462          * @example
67463          * 
67464          * _.isTypedArray(new Uint8Array); // => true
67465          * 
67466          * _.isTypedArray([]); // => false
67467          */
67468         function isTypedArray(value) {
67469             return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
67470         }
67471
67472         module.exports = isTypedArray;
67473
67474     }, {
67475         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67476         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67477     }],
67478     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js": [function(require, module, exports) {
67479         var baseCopy = require('../internal/baseCopy'),
67480             keysIn = require('../object/keysIn');
67481
67482         /**
67483          * Converts `value` to a plain object flattening inherited enumerable properties
67484          * of `value` to own properties of the plain object.
67485          * 
67486          * @static
67487          * @memberOf _
67488          * @category Lang
67489          * @param {*}
67490          *            value The value to convert.
67491          * @returns {Object} Returns the converted plain object.
67492          * @example
67493          * 
67494          * function Foo() { this.b = 2; }
67495          * 
67496          * Foo.prototype.c = 3;
67497          * 
67498          * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
67499          * 
67500          * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c':
67501          * 3 }
67502          */
67503         function toPlainObject(value) {
67504             return baseCopy(value, keysIn(value));
67505         }
67506
67507         module.exports = toPlainObject;
67508
67509     }, {
67510         "../internal/baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js",
67511         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67512     }],
67513     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js": [function(require, module, exports) {
67514         var assignWith = require('../internal/assignWith'),
67515             baseAssign = require('../internal/baseAssign'),
67516             createAssigner = require('../internal/createAssigner');
67517
67518         /**
67519          * Assigns own enumerable properties of source object(s) to the destination
67520          * object. Subsequent sources overwrite property assignments of previous
67521          * sources. If `customizer` is provided it's invoked to produce the assigned
67522          * values. The `customizer` is bound to `thisArg` and invoked with five
67523          * arguments: (objectValue, sourceValue, key, object, source).
67524          * 
67525          * **Note:** This method mutates `object` and is based on
67526          * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
67527          * 
67528          * @static
67529          * @memberOf _
67530          * @alias extend
67531          * @category Object
67532          * @param {Object}
67533          *            object The destination object.
67534          * @param {...Object}
67535          *            [sources] The source objects.
67536          * @param {Function}
67537          *            [customizer] The function to customize assigned values.
67538          * @param {*}
67539          *            [thisArg] The `this` binding of `customizer`.
67540          * @returns {Object} Returns `object`.
67541          * @example
67542          * 
67543          * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
67544          * 'user': 'fred', 'age': 40 }
67545          *  // using a customizer callback var defaults = _.partialRight(_.assign,
67546          * function(value, other) { return _.isUndefined(value) ? other : value; });
67547          * 
67548          * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
67549          * 'user': 'barney', 'age': 36 }
67550          */
67551         var assign = createAssigner(function(object, source, customizer) {
67552             return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
67553         });
67554
67555         module.exports = assign;
67556
67557     }, {
67558         "../internal/assignWith": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js",
67559         "../internal/baseAssign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js",
67560         "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67561     }],
67562     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js": [function(require, module, exports) {
67563         var getNative = require('../internal/getNative'),
67564             isArrayLike = require('../internal/isArrayLike'),
67565             isObject = require('../lang/isObject'),
67566             shimKeys = require('../internal/shimKeys');
67567
67568         /*
67569          * Native method references for those with the same name as other `lodash`
67570          * methods.
67571          */
67572         var nativeKeys = getNative(Object, 'keys');
67573
67574         /**
67575          * Creates an array of the own enumerable property names of `object`.
67576          * 
67577          * **Note:** Non-object values are coerced to objects. See the [ES
67578          * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for more
67579          * details.
67580          * 
67581          * @static
67582          * @memberOf _
67583          * @category Object
67584          * @param {Object}
67585          *            object The object to query.
67586          * @returns {Array} Returns the array of property names.
67587          * @example
67588          * 
67589          * function Foo() { this.a = 1; this.b = 2; }
67590          * 
67591          * Foo.prototype.c = 3;
67592          * 
67593          * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
67594          * 
67595          * _.keys('hi'); // => ['0', '1']
67596          */
67597         var keys = !nativeKeys ? shimKeys : function(object) {
67598             var Ctor = object == null ? undefined : object.constructor;
67599             if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
67600                 (typeof object != 'function' && isArrayLike(object))) {
67601                 return shimKeys(object);
67602             }
67603             return isObject(object) ? nativeKeys(object) : [];
67604         };
67605
67606         module.exports = keys;
67607
67608     }, {
67609         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67610         "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67611         "../internal/shimKeys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js",
67612         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67613     }],
67614     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js": [function(require, module, exports) {
67615         var isArguments = require('../lang/isArguments'),
67616             isArray = require('../lang/isArray'),
67617             isIndex = require('../internal/isIndex'),
67618             isLength = require('../internal/isLength'),
67619             isObject = require('../lang/isObject');
67620
67621         /** Used for native method references. */
67622         var objectProto = Object.prototype;
67623
67624         /** Used to check objects for own properties. */
67625         var hasOwnProperty = objectProto.hasOwnProperty;
67626
67627         /**
67628          * Creates an array of the own and inherited enumerable property names of
67629          * `object`.
67630          * 
67631          * **Note:** Non-object values are coerced to objects.
67632          * 
67633          * @static
67634          * @memberOf _
67635          * @category Object
67636          * @param {Object}
67637          *            object The object to query.
67638          * @returns {Array} Returns the array of property names.
67639          * @example
67640          * 
67641          * function Foo() { this.a = 1; this.b = 2; }
67642          * 
67643          * Foo.prototype.c = 3;
67644          * 
67645          * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed)
67646          */
67647         function keysIn(object) {
67648             if (object == null) {
67649                 return [];
67650             }
67651             if (!isObject(object)) {
67652                 object = Object(object);
67653             }
67654             var length = object.length;
67655             length = (length && isLength(length) &&
67656                 (isArray(object) || isArguments(object)) && length) || 0;
67657
67658             var Ctor = object.constructor,
67659                 index = -1,
67660                 isProto = typeof Ctor == 'function' && Ctor.prototype === object,
67661                 result = Array(length),
67662                 skipIndexes = length > 0;
67663
67664             while (++index < length) {
67665                 result[index] = (index + '');
67666             }
67667             for (var key in object) {
67668                 if (!(skipIndexes && isIndex(key, length)) &&
67669                     !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
67670                     result.push(key);
67671                 }
67672             }
67673             return result;
67674         }
67675
67676         module.exports = keysIn;
67677
67678     }, {
67679         "../internal/isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
67680         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67681         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
67682         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67683         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67684     }],
67685     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js": [function(require, module, exports) {
67686         var baseMerge = require('../internal/baseMerge'),
67687             createAssigner = require('../internal/createAssigner');
67688
67689         /**
67690          * Recursively merges own enumerable properties of the source object(s), that
67691          * don't resolve to `undefined` into the destination object. Subsequent sources
67692          * overwrite property assignments of previous sources. If `customizer` is
67693          * provided it's invoked to produce the merged values of the destination and
67694          * source properties. If `customizer` returns `undefined` merging is handled by
67695          * the method instead. The `customizer` is bound to `thisArg` and invoked with
67696          * five arguments: (objectValue, sourceValue, key, object, source).
67697          * 
67698          * @static
67699          * @memberOf _
67700          * @category Object
67701          * @param {Object}
67702          *            object The destination object.
67703          * @param {...Object}
67704          *            [sources] The source objects.
67705          * @param {Function}
67706          *            [customizer] The function to customize assigned values.
67707          * @param {*}
67708          *            [thisArg] The `this` binding of `customizer`.
67709          * @returns {Object} Returns `object`.
67710          * @example
67711          * 
67712          * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
67713          * 
67714          * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
67715          * 
67716          * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
67717          * 'user': 'fred', 'age': 40 }] }
67718          *  // using a customizer callback var object = { 'fruits': ['apple'],
67719          * 'vegetables': ['beet'] };
67720          * 
67721          * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
67722          * 
67723          * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
67724          * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
67725          * ['beet', 'carrot'] }
67726          */
67727         var merge = createAssigner(baseMerge);
67728
67729         module.exports = merge;
67730
67731     }, {
67732         "../internal/baseMerge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js",
67733         "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67734     }],
67735     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js": [function(require, module, exports) {
67736         var arrayMap = require('../internal/arrayMap'),
67737             baseDifference = require('../internal/baseDifference'),
67738             baseFlatten = require('../internal/baseFlatten'),
67739             bindCallback = require('../internal/bindCallback'),
67740             keysIn = require('./keysIn'),
67741             pickByArray = require('../internal/pickByArray'),
67742             pickByCallback = require('../internal/pickByCallback'),
67743             restParam = require('../function/restParam');
67744
67745         /**
67746          * The opposite of `_.pick`; this method creates an object composed of the own
67747          * and inherited enumerable properties of `object` that are not omitted.
67748          * 
67749          * @static
67750          * @memberOf _
67751          * @category Object
67752          * @param {Object}
67753          *            object The source object.
67754          * @param {Function|...(string|string[])}
67755          *            [predicate] The function invoked per iteration or property names
67756          *            to omit, specified as individual property names or arrays of
67757          *            property names.
67758          * @param {*}
67759          *            [thisArg] The `this` binding of `predicate`.
67760          * @returns {Object} Returns the new object.
67761          * @example
67762          * 
67763          * var object = { 'user': 'fred', 'age': 40 };
67764          * 
67765          * _.omit(object, 'age'); // => { 'user': 'fred' }
67766          * 
67767          * _.omit(object, _.isNumber); // => { 'user': 'fred' }
67768          */
67769         var omit = restParam(function(object, props) {
67770             if (object == null) {
67771                 return {};
67772             }
67773             if (typeof props[0] != 'function') {
67774                 var props = arrayMap(baseFlatten(props), String);
67775                 return pickByArray(object, baseDifference(keysIn(object), props));
67776             }
67777             var predicate = bindCallback(props[0], props[1], 3);
67778             return pickByCallback(object, function(value, key, object) {
67779                 return !predicate(value, key, object);
67780             });
67781         });
67782
67783         module.exports = omit;
67784
67785     }, {
67786         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67787         "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
67788         "../internal/baseDifference": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js",
67789         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67790         "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67791         "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67792         "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js",
67793         "./keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67794     }],
67795     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js": [function(require, module, exports) {
67796         var keys = require('./keys'),
67797             toObject = require('../internal/toObject');
67798
67799         /**
67800          * Creates a two dimensional array of the key-value pairs for `object`, e.g.
67801          * `[[key1, value1], [key2, value2]]`.
67802          * 
67803          * @static
67804          * @memberOf _
67805          * @category Object
67806          * @param {Object}
67807          *            object The object to query.
67808          * @returns {Array} Returns the new array of key-value pairs.
67809          * @example
67810          * 
67811          * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred', 40]]
67812          * (iteration order is not guaranteed)
67813          */
67814         function pairs(object) {
67815             object = toObject(object);
67816
67817             var index = -1,
67818                 props = keys(object),
67819                 length = props.length,
67820                 result = Array(length);
67821
67822             while (++index < length) {
67823                 var key = props[index];
67824                 result[index] = [key, object[key]];
67825             }
67826             return result;
67827         }
67828
67829         module.exports = pairs;
67830
67831     }, {
67832         "../internal/toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
67833         "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67834     }],
67835     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js": [function(require, module, exports) {
67836         var baseFlatten = require('../internal/baseFlatten'),
67837             bindCallback = require('../internal/bindCallback'),
67838             pickByArray = require('../internal/pickByArray'),
67839             pickByCallback = require('../internal/pickByCallback'),
67840             restParam = require('../function/restParam');
67841
67842         /**
67843          * Creates an object composed of the picked `object` properties. Property names
67844          * may be specified as individual arguments or as arrays of property names. If
67845          * `predicate` is provided it's invoked for each property of `object` picking
67846          * the properties `predicate` returns truthy for. The predicate is bound to
67847          * `thisArg` and invoked with three arguments: (value, key, object).
67848          * 
67849          * @static
67850          * @memberOf _
67851          * @category Object
67852          * @param {Object}
67853          *            object The source object.
67854          * @param {Function|...(string|string[])}
67855          *            [predicate] The function invoked per iteration or property names
67856          *            to pick, specified as individual property names or arrays of
67857          *            property names.
67858          * @param {*}
67859          *            [thisArg] The `this` binding of `predicate`.
67860          * @returns {Object} Returns the new object.
67861          * @example
67862          * 
67863          * var object = { 'user': 'fred', 'age': 40 };
67864          * 
67865          * _.pick(object, 'user'); // => { 'user': 'fred' }
67866          * 
67867          * _.pick(object, _.isString); // => { 'user': 'fred' }
67868          */
67869         var pick = restParam(function(object, props) {
67870             if (object == null) {
67871                 return {};
67872             }
67873             return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
67874         });
67875
67876         module.exports = pick;
67877
67878     }, {
67879         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67880         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67881         "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67882         "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67883         "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js"
67884     }],
67885     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js": [function(require, module, exports) {
67886         var baseValues = require('../internal/baseValues'),
67887             keys = require('./keys');
67888
67889         /**
67890          * Creates an array of the own enumerable property values of `object`.
67891          * 
67892          * **Note:** Non-object values are coerced to objects.
67893          * 
67894          * @static
67895          * @memberOf _
67896          * @category Object
67897          * @param {Object}
67898          *            object The object to query.
67899          * @returns {Array} Returns the array of property values.
67900          * @example
67901          * 
67902          * function Foo() { this.a = 1; this.b = 2; }
67903          * 
67904          * Foo.prototype.c = 3;
67905          * 
67906          * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
67907          * 
67908          * _.values('hi'); // => ['h', 'i']
67909          */
67910         function values(object) {
67911             return baseValues(object, keys(object));
67912         }
67913
67914         module.exports = values;
67915
67916     }, {
67917         "../internal/baseValues": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js",
67918         "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67919     }],
67920     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js": [function(require, module, exports) {
67921         /**
67922          * This method returns the first argument provided to it.
67923          * 
67924          * @static
67925          * @memberOf _
67926          * @category Utility
67927          * @param {*}
67928          *            value Any value.
67929          * @returns {*} Returns `value`.
67930          * @example
67931          * 
67932          * var object = { 'user': 'fred' };
67933          * 
67934          * _.identity(object) === object; // => true
67935          */
67936         function identity(value) {
67937             return value;
67938         }
67939
67940         module.exports = identity;
67941
67942     }, {}],
67943     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js": [function(require, module, exports) {
67944         /**
67945          * A no-operation function that returns `undefined` regardless of the arguments
67946          * it receives.
67947          * 
67948          * @static
67949          * @memberOf _
67950          * @category Utility
67951          * @example
67952          * 
67953          * var object = { 'user': 'fred' };
67954          * 
67955          * _.noop(object) === undefined; // => true
67956          */
67957         function noop() {
67958             // No operation performed.
67959         }
67960
67961         module.exports = noop;
67962
67963     }, {}],
67964     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js": [function(require, module, exports) {
67965         var baseProperty = require('../internal/baseProperty'),
67966             basePropertyDeep = require('../internal/basePropertyDeep'),
67967             isKey = require('../internal/isKey');
67968
67969         /**
67970          * Creates a function that returns the property value at `path` on a given
67971          * object.
67972          * 
67973          * @static
67974          * @memberOf _
67975          * @category Utility
67976          * @param {Array|string}
67977          *            path The path of the property to get.
67978          * @returns {Function} Returns the new function.
67979          * @example
67980          * 
67981          * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
67982          * 
67983          * _.map(objects, _.property('a.b.c')); // => [2, 1]
67984          * 
67985          * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // => [1,
67986          * 2]
67987          */
67988         function property(path) {
67989             return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
67990         }
67991
67992         module.exports = property;
67993
67994     }, {
67995         "../internal/baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js",
67996         "../internal/basePropertyDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js",
67997         "../internal/isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js"
67998     }]
67999 }, {}, ["\\bpmn-js-examples-master\\modeler\\app\\index.js"]);